diff --git a/scripts/kernel_user_partition.txt b/scripts/kernel_user_partition.txt index 35229aecb7e7..2bf6401a1be7 100644 --- a/scripts/kernel_user_partition.txt +++ b/scripts/kernel_user_partition.txt @@ -55,9 +55,12 @@ zephyr/include/sof/lib/vpage.h # Zephyr headers that only kernel code may include: kernel internals and # driver APIs that are not system calls. +# Not listed on purpose: zephyr/drivers/dma.h. Its types and constants are +# the arguments of the sof_dma_*() system calls in sof/lib/sof_dma.h, so +# user-space code needs them. User-space code must not call its dma_*() +# driver functions directly, which this include check cannot catch. [zephyr-kernel-headers] kernel/include/* -include/zephyr/drivers/dma.h include/zephyr/pm/device_runtime.h # User-space sources that still include kernel-only headers, removed one @@ -65,18 +68,13 @@ include/zephyr/pm/device_runtime.h # other user-space source is an error, so this list must only shrink. # It covers the CI build configurations and the user-space overlays. [leak-baseline] -src/audio/asrc/asrc.c -src/audio/chain_dma.c src/audio/component.c src/audio/copier/copier.c -src/audio/copier/copier_dai.c -src/audio/copier/copier_gain.c src/audio/copier/copier_host.c src/audio/copier/copier_ipcgtw.c src/audio/dai-zephyr.c src/audio/data_blob.c src/audio/host-zephyr.c -src/audio/intel_uaol.c src/audio/kpb.c src/audio/module_adapter/iadk/kpb_service.cpp src/audio/module_adapter/iadk/system_agent.cpp @@ -90,17 +88,12 @@ src/audio/pipeline/pipeline-xrun.c src/audio/volume/volume.c src/audio/volume/volume_ipc4.c src/debug/tester/tester_simple_dram_test.c -src/ipc/ipc-common.c src/ipc/ipc-helper.c src/ipc/ipc4/dai.c src/ipc/ipc4/handler-user.c src/ipc/ipc4/helper.c -src/lib/dai.c -src/lib/dma.c src/lib/notifier.c src/samples/audio/detect_test.c src/schedule/zephyr_domain.c src/schedule/zephyr_dp_schedule.c -src/schedule/zephyr_dp_schedule_application.c -src/schedule/zephyr_dp_schedule_thread.c src/schedule/zephyr_ll.c diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index 40d0a9f4902a..2cbdfe998a2c 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/src/include/sof/schedule/ll_schedule_domain.h b/src/include/sof/schedule/ll_schedule_domain.h index 1ef47c005589..c86e37e8b1a5 100644 --- a/src/include/sof/schedule/ll_schedule_domain.h +++ b/src/include/sof/schedule/ll_schedule_domain.h @@ -18,7 +18,10 @@ #include #include #include +#ifndef __ZEPHYR__ +/* for clock_ms_to_ticks() in domain_init() */ #include +#endif #include #include #include diff --git a/src/kernel/audio/base_fw_intel.c b/src/kernel/audio/base_fw_intel.c index 3d25f89dbd18..43ba7d0011dc 100644 --- a/src/kernel/audio/base_fw_intel.c +++ b/src/kernel/audio/base_fw_intel.c @@ -24,6 +24,7 @@ #include #include +#include #include #include diff --git a/src/kernel/ipc/ipc3/host-page-table.c b/src/kernel/ipc/ipc3/host-page-table.c index 4e42b21ac825..56b2335a3a76 100644 --- a/src/kernel/ipc/ipc3/host-page-table.c +++ b/src/kernel/ipc/ipc3/host-page-table.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/src/kernel/platform/posix/posix.c b/src/kernel/platform/posix/posix.c index cea923d91ef1..eb5a55274eb7 100644 --- a/src/kernel/platform/posix/posix.c +++ b/src/kernel/platform/posix/posix.c @@ -2,6 +2,7 @@ // Copyright(c) 2022 Google LLC. All rights reserved. // Author: Andy Ross #include +#include #include #include #include diff --git a/zephyr/include/rtos/timer.h b/zephyr/include/rtos/timer.h index fef53389faac..c430859823bb 100644 --- a/zephyr/include/rtos/timer.h +++ b/zephyr/include/rtos/timer.h @@ -16,7 +16,6 @@ #include #include #include -#include struct comp_dev; struct sof_ipc_stream_posn; diff --git a/zephyr/include/sof/lib/dma-legacy.h b/zephyr/include/sof/lib/dma-legacy.h index cb381ce03363..592ffc87b665 100644 --- a/zephyr/include/sof/lib/dma-legacy.h +++ b/zephyr/include/sof/lib/dma-legacy.h @@ -6,6 +6,8 @@ #ifndef __SOF_LIB_DMA_LEGACY_H__ #define __SOF_LIB_DMA_LEGACY_H__ +#include + /* DMA attributes */ #define DMA_ATTR_BUFFER_ALIGNMENT 0 #define DMA_ATTR_COPY_ALIGNMENT 1 diff --git a/zephyr/include/sof/lib/dma.h b/zephyr/include/sof/lib/dma.h index 261abe8cacea..145478db30f3 100644 --- a/zephyr/include/sof/lib/dma.h +++ b/zephyr/include/sof/lib/dma.h @@ -21,8 +21,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/zephyr/lib/alloc.c b/zephyr/lib/alloc.c index 87d0fa9d945d..f1148a0e6771 100644 --- a/zephyr/lib/alloc.c +++ b/zephyr/lib/alloc.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include /* for zephyr_ll_user_heap() */ diff --git a/zephyr/lib/cpu.c b/zephyr/lib/cpu.c index ea407a45a554..ec5217823f8a 100644 --- a/zephyr/lib/cpu.c +++ b/zephyr/lib/cpu.c @@ -19,7 +19,9 @@ static uint32_t mic_disable_status; #endif /* CONFIG_INTEL_ADSP_MIC_PRIVACY */ #include #include +#include #include +#include #include #include #include diff --git a/zephyr/wrapper.c b/zephyr/wrapper.c index afdc5b54a2e9..d866c7305824 100644 --- a/zephyr/wrapper.c +++ b/zephyr/wrapper.c @@ -13,7 +13,8 @@ #include #include #include -#include +#include +#include #include #include #include