1 Star 0 Fork 17

大鱼/OpenAMP

forked from src-openEuler/OpenAMP 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-apps-Fix-atomic_flag-error-for-clang-compilation.patch 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
liyunfei 提交于 2023-03-24 14:38 . openamp: add fix patch for clang compile
From 124b01e83f31a404ccb4e796a840f9ff8c92e589 Mon Sep 17 00:00:00 2001
From: Yunfei Li <liyunfei33@huawei.com>
Date: Mon, 6 Mar 2023 15:28:33 +0800
Subject: [PATCH 1/2] apps:Fix atomic_flag error for clang compilation
Change atomic_int to atomic_flag to solve the error
reported when compiling with clang.
Signed-off-by: Yunfei Li <liyunfei33@huawei.com>
---
apps/examples/linux_rpc_demo/linux_rpc_demo.c | 5 +++--
apps/system/linux/machine/generic/platform_info.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/apps/examples/linux_rpc_demo/linux_rpc_demo.c b/apps/examples/linux_rpc_demo/linux_rpc_demo.c
index 16d39d4..35b4f28 100644
--- a/apps/examples/linux_rpc_demo/linux_rpc_demo.c
+++ b/apps/examples/linux_rpc_demo/linux_rpc_demo.c
@@ -37,7 +37,7 @@
static struct rpmsg_rpc_clt *rpmsg_default_rpc;
static int fd, bytes_written, bytes_read;
static struct polling poll;
-static atomic_int wait_resp;
+static atomic_flag wait_resp;
static void rpmsg_rpc_shutdown(struct rpmsg_rpc_clt *rpc)
{
@@ -465,7 +465,8 @@ int app(struct rpmsg_device *rdev, void *priv)
/* redirect I/Os */
LPRINTF("Initializating I/Os redirection...\r\n");
table_len = (int)sizeof(rpc_table) / sizeof(struct rpmsg_rpc_services);
- atomic_init(&wait_resp, 1);
+ wait_resp = (atomic_flag)ATOMIC_FLAG_INIT;
+ atomic_flag_test_and_set(&wait_resp);
ret = rpmsg_rpc_client_init(&rpc, rdev,
rpmsg_rpc_shutdown, rpc_table, table_len);
diff --git a/apps/system/linux/machine/generic/platform_info.c b/apps/system/linux/machine/generic/platform_info.c
index 9afd65e..f0980c8 100644
--- a/apps/system/linux/machine/generic/platform_info.c
+++ b/apps/system/linux/machine/generic/platform_info.c
@@ -51,7 +51,7 @@ struct vring_ipi_info {
/* Socket file path */
const char *path;
int fd;
- atomic_int sync;
+ atomic_flag sync;
};
struct remoteproc_priv {
--
2.28.0.windows.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hourenyu/OpenAMP.git
git@gitee.com:hourenyu/OpenAMP.git
hourenyu
OpenAMP
OpenAMP
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385