Skip to content

Commit

Permalink
zephyr: namespace the generated version.h
Browse files Browse the repository at this point in the history
Zephyr's build time generated `version.h` is now in the
`zephyr` to provide proper namespace, update the includes of
this module accordingly.

Signed-off-by: Yong Cong Sin <[email protected]>
  • Loading branch information
ycsin committed Nov 11, 2023
1 parent 49377e8 commit d687e96
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2023 Meta

menu "Compatibility"

config SOF_COMPAT_INCLUDES
bool "Use legacy include path"
default n
help
Use legacy Zephyr include paths.

endmenu

source "Kconfig"
3 changes: 3 additions & 0 deletions app/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ CONFIG_SCHED_CPU_MASK_PIN_ONLY=y
CONFIG_SYS_CLOCK_TICKS_PER_SEC=15000
CONFIG_DAI=y
CONFIG_HEAP_MEM_POOL_SIZE=2048

# 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 @@ -38,7 +38,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
4 changes: 4 additions & 0 deletions src/trace/dma-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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>
#include <zephyr/device.h>
#include <zephyr/drivers/mm/mm_drv_intel_adsp_mtl_tlb.h>
Expand Down
4 changes: 4 additions & 0 deletions zephyr/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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

0 comments on commit d687e96

Please sign in to comment.