Skip to content

Conversation

@lgirdwood
Copy link
Member

Primary RTOS will be Zephyr and xtos will be supported via wrapping.

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>
Copy link
Collaborator

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.

Copy link
Collaborator

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

Copy link
Member Author

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)
Copy link
Collaborator

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...

Copy link
Member Author

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).

@lgirdwood
Copy link
Member Author

Merged this into #6161 so closing.

@lgirdwood lgirdwood closed this Aug 19, 2022
@lgirdwood lgirdwood deleted the lrg/topic/headers2 branch August 19, 2022 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants