Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions smex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ target_compile_options(smex PRIVATE
-Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3
)

# 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(smex PRIVATE
"${SOF_ROOT_SOURCE_DIRECTORY}/src/include"
"${SOF_ROOT_SOURCE_DIRECTORY}/rimage/src/include"
"${SOF_ROOT_SOURCE_DIRECTORY}/src/arch/xtos-wrapper/include"
)
3 changes: 3 additions & 0 deletions src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ if(CONFIG_REMBRANDT)
endif()
# includes

# 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_options INTERFACE
${PROJECT_SOURCE_DIR}/src/arch/xtensa/include
${PROJECT_SOURCE_DIR}/src/arch/xtensa/xtos
${PROJECT_SOURCE_DIR}/src/arch/xtos-wrapper/include
)

target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/src/platform/${platform_folder}/include)
Expand Down
2 changes: 1 addition & 1 deletion src/arch/xtensa/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <sof/init.h>
#include <sof/lib/cpu.h>
#include <sof/sof.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>

#include <ipc/trace.h>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <platform/lib/clk.h>
#include <sof/sof.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <stdbool.h>
#include <stdint.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <sof/lib/io.h>
#include <sof/lib/memory.h>
#include <sof/sof.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <sof/lib/cache.h>
#include <sof/lib/memory.h>
#include <sof/sof.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>

#include <stddef.h>
#include <stdint.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <platform/lib/pm_runtime.h>
#include <sof/sof.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/trace/trace.h>
#include <user/trace.h>
#include <stdint.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <sof/schedule/ll_schedule.h>
#include <sof/schedule/schedule.h>
#include <sof/schedule/task.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/trace/trace.h>
#include <user/trace.h>

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
#ifndef __SOF_SPINLOCK_H__
#define __SOF_SPINLOCK_H__

#ifndef __ZEPHYR__
#include <arch/spinlock.h>
typedef uint32_t k_spinlock_key_t;
#endif
#include <sof/lib/memory.h>
#include <ipc/trace.h>

Expand Down Expand Up @@ -143,8 +141,6 @@ extern struct tr_ctx sl_tr;

#endif /* CONFIG_DEBUG_LOCKS */

#ifndef __ZEPHYR__

/* all SMP spinlocks need init, nothing todo on UP */
static inline void _spinlock_init(struct k_spinlock *lock, int line)
{
Expand All @@ -164,18 +160,4 @@ k_spinlock_key_t _k_spin_lock_irq(struct k_spinlock *lock);
void _k_spin_unlock_irq(struct k_spinlock *lock, k_spinlock_key_t key, int line);
#define k_spin_unlock(lock, key) _k_spin_unlock_irq(lock, key, __LINE__)

#else

#include <zephyr/kernel.h>

/* This has to be moved to Zephyr */
static inline void k_spinlock_init(struct k_spinlock *lock)
{
#ifdef CONFIG_SMP
atomic_set(&lock->locked, 0);
#endif
}

#endif /* __ZEPHYR__ */

#endif /* __SOF_SPINLOCK_H__ */
2 changes: 1 addition & 1 deletion src/audio/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <sof/list.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <ipc/topology.h>
#include <errno.h>
#include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/audio/pipeline/pipeline-graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <sof/lib/uuid.h>
#include <sof/compiler_attributes.h>
#include <sof/list.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/string.h>
#include <ipc/header.h>
#include <ipc/stream.h>
Expand Down
2 changes: 1 addition & 1 deletion src/audio/pipeline/pipeline-params.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <sof/lib/mm_heap.h>
#include <sof/compiler_attributes.h>
#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.

#include <ipc/topology.h>
#include <ipc4/error_status.h>
Expand Down
2 changes: 1 addition & 1 deletion src/audio/pipeline/pipeline-schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <sof/schedule/ll_schedule.h>
#include <sof/schedule/schedule.h>
#include <sof/schedule/task.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/string.h>
#include <ipc/header.h>
#include <ipc/stream.h>
Expand Down
2 changes: 1 addition & 1 deletion src/audio/pipeline/pipeline-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <sof/lib/dai.h>
#include <sof/lib/wait.h>
#include <sof/list.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/string.h>
#include <ipc/stream.h>
#include <ipc/topology.h>
Expand Down
2 changes: 1 addition & 1 deletion src/audio/pipeline/pipeline-xrun.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <sof/audio/pipeline.h>
#include <sof/ipc/msg.h>
#include <sof/list.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/string.h>
#include <ipc/header.h>
#include <ipc/stream.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/rembrandt/acp_bt_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <sof/lib/notifier.h>
#include <sof/platform.h>
#include <sof/schedule/schedule.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/math/numbers.h>
#include <sof/trace/trace.h>
#include <ipc/topology.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/rembrandt/acp_dmic_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <sof/lib/notifier.h>
#include <sof/platform.h>
#include <sof/schedule/schedule.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/math/numbers.h>
#include <sof/trace/trace.h>
#include <ipc/topology.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/rembrandt/acp_hs_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <sof/lib/notifier.h>
#include <sof/platform.h>
#include <sof/schedule/schedule.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/math/numbers.h>
#include <sof/trace/trace.h>
#include <ipc/topology.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/rembrandt/acp_sp_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <sof/lib/notifier.h>
#include <sof/platform.h>
#include <sof/schedule/schedule.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/math/numbers.h>
#include <sof/trace/trace.h>
#include <ipc/topology.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/rembrandt/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <sof/lib/memory.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <xtensa/hal.h>
#include <xtensa/config/core.h>
#include <xtensa/config/specreg.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/rembrandt/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <sof/schedule/edf_schedule.h>
#include <sof/schedule/schedule.h>
#include <sof/schedule/task.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <ipc/header.h>
#include <ipc/topology.h>
#include <errno.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/renoir/acp_bt_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <sof/lib/notifier.h>
#include <sof/platform.h>
#include <sof/schedule/schedule.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/math/numbers.h>
#include <sof/trace/trace.h>
#include <ipc/topology.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/renoir/acp_dmic_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <sof/lib/notifier.h>
#include <sof/platform.h>
#include <sof/schedule/schedule.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/math/numbers.h>
#include <sof/trace/trace.h>
#include <ipc/topology.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/renoir/acp_sp_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <sof/lib/notifier.h>
#include <sof/platform.h>
#include <sof/schedule/schedule.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/math/numbers.h>
#include <sof/trace/trace.h>
#include <ipc/topology.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/renoir/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <sof/lib/memory.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <xtensa/hal.h>
#include <xtensa/config/core.h>
#include <xtensa/config/specreg.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/amd/renoir/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <sof/schedule/edf_schedule.h>
#include <sof/schedule/schedule.h>
#include <sof/schedule/task.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <ipc/header.h>
#include <ipc/topology.h>
#include <errno.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/dw/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <sof/lib/wait.h>
#include <sof/lib/notifier.h>
#include <sof/platform.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <ipc/topology.h>

#include <errno.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/dw/ssi-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <sof/schedule/ll_schedule.h>
#include <sof/schedule/schedule.h>
#include <sof/schedule/task.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/string.h>
#include <ipc/header.h>
#include <ipc/topology.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/generic/dummy-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <sof/lib/notifier.h>
#include <sof/lib/uuid.h>
#include <sof/platform.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/string.h>
#include <sof/trace/trace.h>
#include <sys/types.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/imx/interrupt-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <sof/lib/memory.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/imx/interrupt-irqsteer.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <sof/lib/memory.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/imx/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <sof/schedule/edf_schedule.h>
#include <sof/schedule/schedule.h>
#include <sof/schedule/task.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <ipc/header.h>
#include <ipc/topology.h>
#include <ipc/trace.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/baytrail/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <sof/platform.h>
#include <sof/schedule/edf_schedule.h>
#include <sof/schedule/schedule.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <ipc/header.h>
#include <ipc/topology.h>
#include <stdbool.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/baytrail/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <sof/lib/alloc.h>
#include <sof/lib/dai.h>
#include <sof/lib/dma.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/trace/trace.h>
#include <ipc/dai.h>
#include <ipc/dai-intel.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/cavs/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <sof/lib/shim.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>

#include <stdbool.h>
#include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/cavs/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <sof/schedule/edf_schedule.h>
#include <sof/schedule/schedule.h>
#include <sof/schedule/task.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <ipc/header.h>

#include <stdbool.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/cavs/sue-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <sof/schedule/edf_schedule.h>
#include <sof/schedule/schedule.h>
#include <sof/schedule/task.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <ipc/header.h>
#include <stddef.h>
#include <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/dmic/dmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <sof/lib/uuid.h>
#include <sof/math/decibels.h>
#include <sof/math/numbers.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/string.h>
#include <ipc/dai.h>
#include <ipc/dai-intel.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/haswell/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <sof/schedule/edf_schedule.h>
#include <sof/schedule/schedule.h>
#include <sof/schedule/task.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <ipc/header.h>
#include <ipc/topology.h>
#include <stdbool.h>
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/haswell/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <sof/lib/dai.h>
#include <sof/lib/dma.h>
#include <sof/lib/shim.h>
#include <sof/spinlock.h>
#include <zephyr/spinlock.h>
#include <sof/trace/trace.h>
#include <ipc/dai.h>
#include <ipc/dai-intel.h>
Expand Down
Loading