-
Notifications
You must be signed in to change notification settings - Fork 349
WIP: header RTOS abstraction #6163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In preparation for further RTOS abstraction, move the xtos specific headers to the xtos-wraper include PATH. Next step is to make sure these headers are not used in the building of common RTOS/arch agnostic code. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Move more RTOS and C library specific headers to the xtos wrapper directory. In preparation for RTOS abstraction. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Use the native Zephyr include path for spinlock and wrap the xtos path. No functional change. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
| #include <sof/list.h> | ||
| #include <sof/spinlock.h> | ||
| #include <zephyr/spinlock.h> | ||
| #include <ipc/stream.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a little bit odd. Does the user of a spinlock needs to know that we are using Zephyr or XTOS?
My feeling here is that this needs to be agnostic.
The user will just include <sof/spinlock.h and will get the spinlock for the specific OS on which SOF is being compiled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbaluta I think what this is trying to achieve is to make "native Zephyr" and to increase separation between Zephyr and XTOS builds. That's why the XTOS-wrapper spinlock.h header is now also moved to the xtos-wrapper/include/zephyr/ directory and it now only contains an XTOS Zephyr wrapper. When building with Zephyr that header isn't needed any more and the Zephyr header is included directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still WIP, I'm trying to do this in a clean way AND to avoid contamination between headers. More updates later.
|
|
||
| # TODO: The xtos-wrapper include PATH will eventually become optional based on the | ||
| # RTOS selection. It's manadatory atm until the native Zephyr integration is ready. | ||
| target_include_directories(SOF INTERFACE ${SOF_SRC_PATH}/arch/xtos-wrapper/include) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not sure about this, I'd rather not do this but maybe move headers more gradually - only those that we don't need with Zephyr already now. Besides doesn't this create a confusion for headers like zephyr/spinlock.h? Now there's one in Zephyr itself and one in xtos-wrapper...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be moving header usage gradually, but we need to put all the RTOS/IP headers in a place today where this can be visualized as today they are scattered around (making it difficult to debug issues where contamination is suspected).
|
Merged this into #6161 so closing. |
Primary RTOS will be Zephyr and xtos will be supported via wrapping.