fix zephyr conflicting types atomic - #4058
Conversation
|
Can one of the admins verify this patch?
|
|
Can one of the admins verify this patch? |
There was a problem hiding this comment.
Please use a prefix for your commit subject.
E.g include: Fix zephyr conflicting types
then please explain in the commit message WHY do we need this change. Do you get a compiler error?
Please give more information so that people can understand the intention of your change.
04733ff to
7cb5c2b
Compare
|
@zrombel good to merge ? CI pending.... |
|
PR was build and it looks taht it's good to merge. |
|
@lyakh I assume this is good for you ? Any idea why you have not seen this ? |
@lgirdwood @lyakh I'm also working on imx support for SOF with Zephyr and I didn't encounter this issue. |
This kind of issue won't occur when you just compile a simple sample. When you use src/include/sof/atomic.h (this header file may also be included by others) and zephyr at the same time. The issue will reappear。Please note that my modification is in host arch, and other platforms are not considered.Because my platform is not in the official support list |
@lgirdwood because SOF code includes sof/atomic.h whereas Zephyr code includes sys/atomic.h... So, I'm not sure this is a complete fix. A complete one should also remove the definition of |
There was a problem hiding this comment.
wouldn't it be better and more correct to move this #ifndef 3 lines up and to #include <sys/atomic.h> on the #else branch? Or better invert the condition to #ifdef to avoid a negation.
a4464c5 to
04e2655
Compare
|
I re-reveiw the sof code, the Cmakefile in the zephyr directory contains two header file paths. When we compile sof, #include <sof/atomic.h>, then the header files under sof/zephyr will be found first. So we don't see the issue of type conflicts. Therefore, there is another modification scheme that does not change the sof code, but it needs to introduce the header files in the sof/zephyr/include directory when the external app is compiled, overwriting the header file path of sof itself WORK: But I don’t think this is a good way |
|
@hongshui3000 the plan is to remove all the SOF ARCH header paths as we continue and use more and more native Zephyr APIs (today we still have some in wrapper.c) i.e. SOF include path would only be for audio APIs. |
The atomic code is implemented in zephyr. When sof is used as a zephyr module, there is no need to reimplement atomic. The modification here is to solve the problem of repeated definition of atomic related content. Signed-off-by: Yang XiaoHua <yangxiaohuamail@gmail.com>
04e2655 to
8d1ce85
Compare
|
I think using Zephyr is a great idea, thanks @hongshui3000. |
|
Jenkins shows unrelated DUT boot failure. |
fix #4049
Signed-off-by: yxh yangxiaohuamail@gmail.com