From d50a4db58bada0d06aa0eb3f6c979c4d6494c636 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 27 Nov 2026 13:42:00 +0000 Subject: [PATCH 1/4] ipc: probe_dma_frame: do not include rtos/bit.h probe_dma_frame.h is part of the probe ABI, which the sof-probes host tool also uses, but it got MASK() from the RTOS header rtos/bit.h. That made the tool build with the host RTOS headers (posix/include). Write the format field masks as constants. They have the values and the unsigned long long type of the MASK() expressions they replace. Include stdint.h for the uint32_t fields, which came through rtos/bit.h before. No functional change. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Liam Girdwood --- src/include/ipc/probe_dma_frame.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/include/ipc/probe_dma_frame.h b/src/include/ipc/probe_dma_frame.h index 4a9d562d59ab..77498e9af106 100644 --- a/src/include/ipc/probe_dma_frame.h +++ b/src/include/ipc/probe_dma_frame.h @@ -12,7 +12,7 @@ #ifndef __IPC_PROBE_DMA_FRAME_H__ #define __IPC_PROBE_DMA_FRAME_H__ -#include +#include /** * \brief Header for data packets sent via compressed PCM from extraction probes. @@ -46,16 +46,16 @@ struct probe_data_packet { #define PROBE_SHIFT_SAMPLE_END 8 /**< Endianness (0 = little-endian) */ #define PROBE_SHIFT_INTERLEAVING_ST 7 /**< Interleaving (1 = sample interleaved) */ -#define PROBE_MASK_FMT_TYPE MASK(31, 31) /**< Type encoding mask */ -#define PROBE_MASK_STANDARD_TYPE MASK(30, 27) /**< Standard type mask */ -#define PROBE_MASK_AUDIO_FMT MASK(26, 23) /**< Audio format mask */ -#define PROBE_MASK_SAMPLE_RATE MASK(22, 19) /**< Sample rate mask */ -#define PROBE_MASK_NB_CHANNELS MASK(18, 14) /**< Channel count mask */ -#define PROBE_MASK_SAMPLE_SIZE MASK(13, 12) /**< Sample size mask */ -#define PROBE_MASK_CONTAINER_SIZE MASK(11, 10) /**< Container size mask */ -#define PROBE_MASK_SAMPLE_FMT MASK(9, 9) /**< Sample format mask */ -#define PROBE_MASK_SAMPLE_END MASK(8, 8) /**< Endianness mask */ -#define PROBE_MASK_INTERLEAVING_ST MASK(7, 7) /**< Interleaving mask */ +#define PROBE_MASK_FMT_TYPE 0x80000000ULL /**< Type encoding mask */ +#define PROBE_MASK_STANDARD_TYPE 0x78000000ULL /**< Standard type mask */ +#define PROBE_MASK_AUDIO_FMT 0x07800000ULL /**< Audio format mask */ +#define PROBE_MASK_SAMPLE_RATE 0x00780000ULL /**< Sample rate mask */ +#define PROBE_MASK_NB_CHANNELS 0x0007c000ULL /**< Channel count mask */ +#define PROBE_MASK_SAMPLE_SIZE 0x00003000ULL /**< Sample size mask */ +#define PROBE_MASK_CONTAINER_SIZE 0x00000c00ULL /**< Container size mask */ +#define PROBE_MASK_SAMPLE_FMT 0x00000200ULL /**< Sample format mask */ +#define PROBE_MASK_SAMPLE_END 0x00000100ULL /**< Endianness mask */ +#define PROBE_MASK_INTERLEAVING_ST 0x00000080ULL /**< Interleaving mask */ /** @} */ #endif /* __IPC_PROBE_DMA_FRAME_H__ */ From b52130a1ed60964f492ddea729d64a7ee6cbe91b Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 27 Nov 2026 13:42:00 +0000 Subject: [PATCH 2/4] kernel: ext_manifest: do not include sof/compiler_attributes.h ext_manifest.h is shared with the smex host tool, and it only uses __packed from sof/compiler_attributes.h, an RTOS header, which made smex build with the host RTOS headers (posix/include). The header already defines __packed when it is not defined, so drop the include. No functional change. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Liam Girdwood --- src/include/kernel/ext_manifest.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/include/kernel/ext_manifest.h b/src/include/kernel/ext_manifest.h index c429cbe0340e..9993c9b0e584 100644 --- a/src/include/kernel/ext_manifest.h +++ b/src/include/kernel/ext_manifest.h @@ -34,7 +34,6 @@ #define __KERNEL_EXT_MANIFEST_H__ #include -#include #include /* Top-level headers shared with rimage */ From 8a2b42088854d5128f5eee1248f687f29aebf4c8 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 27 Nov 2026 13:42:00 +0000 Subject: [PATCH 3/4] smex, probes: build without the host RTOS headers smex and sof-probes added the host RTOS headers (posix/include) to their include path, with a TODO to fix it. They only use SOF ABI headers from src/include, which no longer include RTOS headers. Drop the include directory and the TODOs. The sof-logger still needs it: it includes sof/lib/uuid.h and sof/common.h, which use zephyr/sys/util.h. The topology parser is built with the host library for the testbench, so it keeps them too. No functional change. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Liam Girdwood --- smex/CMakeLists.txt | 5 ----- tools/probes/CMakeLists.txt | 5 ----- 2 files changed, 10 deletions(-) diff --git a/smex/CMakeLists.txt b/smex/CMakeLists.txt index 3b0fe567ee54..8ea7f29d4b28 100644 --- a/smex/CMakeLists.txt +++ b/smex/CMakeLists.txt @@ -30,8 +30,3 @@ target_include_directories(smex PRIVATE "${SOF_ROOT_SOURCE_DIRECTORY}/src/include" "${SOF_ROOT_SOURCE_DIRECTORY}/tools/rimage/src/include" ) - -# TODO: smex should not need RTOS headers: FIX. -target_include_directories(smex PRIVATE - "${SOF_ROOT_SOURCE_DIRECTORY}/posix/include" -) diff --git a/tools/probes/CMakeLists.txt b/tools/probes/CMakeLists.txt index b38cd965844d..a0bb98b246ea 100644 --- a/tools/probes/CMakeLists.txt +++ b/tools/probes/CMakeLists.txt @@ -15,9 +15,4 @@ target_include_directories(sof-probes PRIVATE "../../src/include" ) -# TODO: probes should not need to include RTOS headers. FIX. -target_include_directories(sof-probes PRIVATE - "../../posix/include" -) - install(TARGETS sof-probes DESTINATION bin) From c23f3f4649f212c8c0e0c95a6c4f9532c3b186ca Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 27 Nov 2026 13:42:52 +0000 Subject: [PATCH 4/4] audio: tensorflow: do not use the host RTOS headers The TensorFlow Micro library target (tflm_lib), built for the firmware and as an LLEXT module, has the host RTOS headers (posix/include) on its include path. Its sources are TensorFlow Micro, flatbuffers, gemmlowp, ruy, the HiFi NN library and the micro speech example, and none of them includes a header from posix/include (rtos/, sof/ or zephyr/). Drop the include directory. No functional change. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Liam Girdwood --- src/audio/tensorflow/CMakeLists.txt | 1 - src/audio/tensorflow/llext/CMakeLists.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/src/audio/tensorflow/CMakeLists.txt b/src/audio/tensorflow/CMakeLists.txt index 5cb3086f46b1..c9684438ce3d 100644 --- a/src/audio/tensorflow/CMakeLists.txt +++ b/src/audio/tensorflow/CMakeLists.txt @@ -415,7 +415,6 @@ target_include_directories(tflm_lib PRIVATE ${RUY_PATH} ${NN_HIFI_PATH} ${NN_HIFI_PATH}/include - ${sof_top_dir}/posix/include ) # TODO: Need to detect and add mul16/32 options. diff --git a/src/audio/tensorflow/llext/CMakeLists.txt b/src/audio/tensorflow/llext/CMakeLists.txt index 22bfc22da748..47eb0f6874ba 100644 --- a/src/audio/tensorflow/llext/CMakeLists.txt +++ b/src/audio/tensorflow/llext/CMakeLists.txt @@ -408,7 +408,6 @@ target_include_directories(tflm_lib PRIVATE ${RUY_PATH} ${NN_HIFI_PATH} ${NN_HIFI_PATH}/include - ${sof_top_dir}/posix/include ) # TODO: Need to detect and add mul16/32 options.