Skip to content

doc: core: fix header regressions causing Zephyr build errors - #12

Open
lgirdwood wants to merge 6 commits into
topic/doxygen-c-api-architecturefrom
fix/doxygen-c-api-build-errors
Open

lgirdwood wants to merge 6 commits into
topic/doxygen-c-api-architecturefrom
fix/doxygen-c-api-build-errors

Conversation

@lgirdwood

Copy link
Copy Markdown
Owner

Summary

Fixes the Zephyr build failures on PR thesofproject#11294 across all platforms (PTL, LNL, TGL, MTL, i.MX8, etc.).

Commit d477607 ("doc: core: document RTOS, pipeline, drivers, and IPC4 interfaces") inadvertently reintroduced header conflicts and regressions from older revisions prior to recent upstream changes:

  1. zephyr/include/rtos/userspace_helper.h:

    • Restored missing #else before the user_access_to_mailbox() no-op stub when CONFIG_USERSPACE is disabled. This resolves the compiler error:
      error: static declaration of 'user_access_to_mailbox' follows non-static declaration
      
  2. src/include/sof/audio/audio_stream.h:

    • Removed duplicate cir_buf_bytes_without_wrap() which was already moved to module/audio/audio_stream.h returning size_t. This resolves:
      error: conflicting types for 'cir_buf_bytes_without_wrap'; have 'int(const void *, const void *)'
      
    • Restored uintptr_t and size_t types in pointer arithmetic and boundary checks.
  3. src/include/sof/audio/buffer.h:

    • Restored #if !CONFIG_ZEPHYR_LOG guards around struct tr_ctx tctx and kept trace_buf_get_tr_ctx in the non-Zephyr branch.
  4. src/include/sof/audio/component.h:

    • Restored SOF_DRV_UID_NAME macro, !CONFIG_ZEPHYR_LOG guards for tctx, and expect_eos in struct comp_dev.
  5. src/include/sof/audio/pipeline.h:

    • Restored struct mod_alloc_ctx *alloc and pipeline_set_eos(); removed expect_eos (which belongs in comp_dev).
  6. src/include/module/audio/sink_api.h & src/include/module/audio/source_api.h:

    • Restored get_state ops callbacks, sink_get_state(), and source_get_comp_state().
  7. src/include/ipc4/handler.h:

    • Restored ipc4_user_module_load() and removed invalid non-static declaration of ipc4_process_large_config_get().
  8. src/include/ipc4/notification.h:

    • Restored send_resource_notif() syscall declarations.
  9. src/probe/probe.c:

    • Restored dma_get_status() return code check.

Fixes thesofproject#11294

…an paths

Configure Doxygen build parameters to properly index modern SOF headers
and generate clean documentation:

- Set STRIP_FROM_PATH and STRIP_FROM_INC_PATH with @top_srcdir@ so that
  file names and include paths are stripped of host-absolute paths.
- Expand INPUT directories to include IPC4, LLEXT module interface,
  audio processing components, math routines, and debug probes.
- Expand common file-scope macros in PREDEFINED (LOG_MODULE_*,
  SOF_DEFINE_REG_UUID, DECLARE_TR_CTX, DECLARE_MODULE_ADAPTER,
  SOF_MODULE_INIT, EXPORT_SYMBOL, STATIC_ASSERT, BUILD_ASSERT,
  SYS_INIT) so Doxygen parses declarations cleanly without generating
  spurious macro-derived functions.
- Enable GENERATE_TREEVIEW and set DOT_GRAPH_MAX_NODES to 100 for clean
  navigation and call/include graph rendering.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…legacy uapi misnomer

Define the 9 unified architectural topic groups for Sound Open Firmware
in doc/groups.dox (IPC4 Host-DSP Protocol, IPC3 Host-DSP Protocol,
Loadable Module & LLEXT Interface, Pipeline & Buffer Infrastructure,
Audio Processing Components, RTOS Abstraction Layer, DSP Math & Filter
Libraries, Telemetry, Logging & Probes, and Platform & Hardware
Drivers).

Eliminate the historical "uAPI" misnomer in src/include/ipc/header.h
and src/include/ipc/control.h by migrating sof_uapi and sof_uapi_control
to ipc3_api. IPC is a host-to-DSP firmware protocol, not a userspace API.

Reassign legacy and driver groups (fw_regs_api, uuid_api, platform_api,
pm_runtime, sof_dma_drivers) directly into their respective parent
architectural topics, and replace the redundant sof_dma_copy_func group
with inline function documentation.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…system index

Add doc/mainpage.dox to define the primary landing page for the Doxygen
C API reference documentation. Document the core architecture, provide a
subsystem mapping table with direct links to groups and key headers,
and provide quick navigation links to the architectural topics and data
structure indices.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…dd missing docstrings

Add comprehensive Doxygen documentation (@file, @brief, @PARAM, @return,
@InGroup) for audio processing components and DSP mathematics libraries:

- Audio processing components (@InGroup audio_components_api): Document
  Aria gain algorithms (aria.h), DC blocking filters (dcblock.h),
  DRC passthrough (drc.h), up/down mixer channels (up_down_mixer.h),
  peak volume curves (peak_volume.h, volume.h), STFT processing routines
  (stft_process.h, stft_process_common.c), phase vocoder format maps
  (phase_vocoder.h, phase_vocoder_common.c), sound dose maps
  (sound_dose.h, sound_dose-generic.c), level multiplier
  (level_multiplier.h), and template component format maps
  (template.h, template-generic.c).
- DSP math libraries (@InGroup dsp_math_api): Document FFT plan creation
  and execution (fft.h), IIR Direct Form 1 & 2 Transposed filters
  (iir_df1.h, iir_df1_generic.h, iir_df2t.h, iir_df2t_generic.h),
  decibel/linear conversions (decibels.h), psychoacoustic mel filterbank
  (auditory.h, auditory.c), DCT plan generation (dct.h, dct.c),
  trigonometric lookup tables (lut_trig.h, trig.h, atan2.c), matrix
  operations (matrix.h), window functions (window.h), fixed-point
  numbers (numbers.h), and companding (mu_law.c).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add comprehensive Doxygen documentation (@file, @brief, @PARAM, @return,
@InGroup) for core SOF RTOS abstractions, audio pipeline infrastructure,
platform drivers, and IPC4 protocol interfaces:

- RTOS abstraction (@InGroup rtos_api): Document memory heaps and
  allocation (alloc.h), cache writeback and invalidation (cache.h),
  clocks (clk.h), mutexes (mutex.h), spinlocks (spinlock.h), timers
  (timer.h), userspace privilege helpers (kernel.h,
  userspace_helper.h), and core SOF runtime context (sof.h).
- Audio Pipeline & Buffers (@InGroup audio_pipeline_api, module_api):
  Document pipeline execution and graph links (pipeline.h), audio
  stream buffers (audio_buffer.h, buffer.h, audio_stream.h), format
  conversions (format_generic.h, pcm_converter.h, format.h), channel
  maps (channel_map.h), and schedulers (schedule.h, ll_schedule.h,
  dp_schedule.h, edf_schedule.h).
- Host-DSP IPC4 Protocol (@InGroup ipc4_api): Document base firmware
  initialization (base_fw.h), gateway descriptors (gateway.h, alh.h),
  error statuses (error_status.h), logging rings (logging.h), pipeline
  messages (pipeline.h), notifications (notification.h), and IPC
  dispatch handlers (handler.h).
- Platform Drivers & Telemetry (@InGroup platform_drivers_api, probe_api):
  Document DAI interfaces (dai-zephyr.h, dai-legacy.h), SSP driver
  registers (ssp.h), system agent scheduling (agent.h), performance
  counters (telemetry.h), trace ticks (trace.h), and probe buffers
  (probe.c).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Commit d477607 ("doc: core: document RTOS, pipeline, drivers, and
IPC4 interfaces") inadvertently reintroduced several header conflicts
and regressions from older revisions:

- zephyr/include/rtos/userspace_helper.h: Restore missing #else before
  the user_access_to_mailbox() stub when CONFIG_USERSPACE is disabled,
  resolving conflicting static vs non-static declaration build errors.
- src/include/sof/audio/audio_stream.h: Remove redundant
  cir_buf_bytes_without_wrap() which was relocated to
  module/audio/audio_stream.h returning size_t; restore uintptr_t and
  size_t types in pointer arithmetic and boundary checks.
- src/include/sof/audio/buffer.h: Keep tctx conditionally guarded by
  !CONFIG_ZEPHYR_LOG and keep trace_buf_get_tr_ctx definition in the
  non-Zephyr branch.
- src/include/sof/audio/component.h: Restore SOF_DRV_UID_NAME macro,
  CONFIG_ZEPHYR_LOG guards for tctx, expect_eos in comp_dev, and
  !CONFIG_ZEPHYR_LOG check in comp_init().
- src/include/sof/audio/pipeline.h: Restore mod_alloc_ctx *alloc,
  pipeline_set_eos(), and remove expect_eos (which lives in comp_dev).
- src/include/module/audio/sink_api.h: Restore get_state ops callback
  and sink_get_state() helper.
- src/include/module/audio/source_api.h: Restore get_state ops callback
  and source_get_comp_state() helper.
- src/include/ipc4/handler.h: Restore ipc4_user_module_load() and
  remove non-static declaration of static ipc4_process_large_config_get().
- src/include/ipc4/notification.h: Restore send_resource_notif()
  syscall declarations.
- src/probe/probe.c: Keep dma_get_status() return code check intact.

Fixes: thesofproject#11294
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@lgirdwood
lgirdwood force-pushed the topic/doxygen-c-api-architecture branch 3 times, most recently from f80e77e to 17cd1e1 Compare October 11, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants