Skip to content
Draft
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
19 changes: 19 additions & 0 deletions app/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright(c) 2023 Meta
#
# Author: Yong Cong Sin <[email protected]>

menu "Compatibility"

config SOF_COMPAT_INCLUDES
bool "Use legacy include path"
default n
help
Use legacy Zephyr generated include paths,
i.e. `#include <version.h> instead of:
`#include <zephyr/version.h>`

endmenu

source "Kconfig"
3 changes: 3 additions & 0 deletions app/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=2048
CONFIG_LLEXT=y
CONFIG_LLEXT_STORAGE_WRITABLE=y
CONFIG_MODULES=y

# To be able to use Zephyr legacy include paths
CONFIG_SOF_COMPAT_INCLUDES=y
4 changes: 4 additions & 0 deletions src/init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@
#include <zephyr/logging/log_ctrl.h>
#include <user/abi_dbg.h>
#include <sof_versions.h>
#ifdef CONFIG_SOF_COMPAT_INCLUDES
#include <version.h>
#else
#include <zephyr/version.h>
#endif
#endif
#include <sof/lib/ams.h>

Expand Down
2 changes: 1 addition & 1 deletion src/ipc/ipc-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Andrey Borisovich <[email protected]>
// Adrian Warecki <[email protected]>

#include <autoconf.h>
#include <zephyr/autoconf.h>

#include <intel_adsp_ipc.h>
#include <sof/ipc/common.h>
Expand Down
4 changes: 4 additions & 0 deletions src/trace/dma-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
#include <sof_versions.h>

#ifdef __ZEPHYR__
#ifdef CONFIG_SOF_COMPAT_INCLUDES
#include <version.h>
#else
#include <zephyr/version.h>
#endif
#endif

#include <errno.h>
Expand Down
4 changes: 4 additions & 0 deletions zephyr/lib/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
#include <zephyr/init.h>
#include <zephyr/kernel.h>
#include <zephyr/pm/policy.h>
#ifdef CONFIG_SOF_COMPAT_INCLUDES
#include <version.h>
#else
#include <zephyr/version.h>
#endif
#include <zephyr/sys/__assert.h>
#include <zephyr/cache.h>

Expand Down
4 changes: 4 additions & 0 deletions zephyr/lib/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
#include <rtos/alloc.h>

/* Zephyr includes */
#ifdef CONFIG_SOF_COMPAT_INCLUDES
#include <version.h>
#else
#include <zephyr/version.h>
#endif
#include <zephyr/kernel.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you removing kernel.h?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, copy paste error

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

#include <zephyr/kernel/smp.h>
#include <zephyr/device.h>
Expand Down
4 changes: 4 additions & 0 deletions zephyr/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
#include <zephyr/kernel_structs.h>
#include <zephyr/kernel.h>
#include <zephyr/pm/policy.h>
#ifdef CONFIG_SOF_COMPAT_INCLUDES
#include <version.h>
#else
#include <zephyr/version.h>
#endif
#include <zephyr/sys/__assert.h>
#include <zephyr/logging/log_ctrl.h>
#include <zephyr/logging/log.h>
Expand Down