Skip to content

sof _ctx_alloc() followup: Remove the ctx_alloc.h header and move the implementation into rtos/alloc.h.#10831

Open
jsarha wants to merge 1 commit into
thesofproject:mainfrom
jsarha:sof_ctx_alloc_followup
Open

sof _ctx_alloc() followup: Remove the ctx_alloc.h header and move the implementation into rtos/alloc.h.#10831
jsarha wants to merge 1 commit into
thesofproject:mainfrom
jsarha:sof_ctx_alloc_followup

Conversation

@jsarha
Copy link
Copy Markdown
Contributor

@jsarha jsarha commented Jun 1, 2026

Remove the ctx_alloc.h header and move the implementation into rtos/alloc.h.

Added based on this discussion:
#10802 (comment)

My revised version was just a little bit late and the old version was merged before I pushed the new one.

Remove the ctx_alloc.h header and move the implementation into
rtos/alloc.h.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the dedicated sof/ctx_alloc.h header and relocates the mod_alloc_ctx + sof_ctx_{alloc,zalloc,free}() inline allocation helpers into rtos/alloc.h, updating various SOF headers/sources to stop including the removed header.

Changes:

  • Deleted src/include/sof/ctx_alloc.h and moved its contents into zephyr/include/rtos/alloc.h.
  • Removed now-obsolete #include <sof/ctx_alloc.h> from several headers and sources.
  • Centralized ctx-based allocation helpers behind the RTOS allocation header (for Zephyr).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
zephyr/include/rtos/alloc.h Adds struct mod_alloc_ctx and sof_ctx_{alloc,zalloc,free}() inline helpers (moved from sof/ctx_alloc.h).
src/include/sof/lib/dai-zephyr.h Drops sof/ctx_alloc.h include.
src/include/sof/audio/component.h Drops sof/ctx_alloc.h include.
src/audio/module_adapter/module/generic.c Drops sof/ctx_alloc.h include.
src/audio/buffers/ring_buffer.c Drops sof/ctx_alloc.h include.
src/audio/buffers/comp_buffer.c Drops sof/ctx_alloc.h include.
src/include/sof/ctx_alloc.h Deleted (content moved to rtos/alloc.h).

Comment on lines +156 to +160
struct mod_alloc_ctx {
struct k_heap *heap;
struct vregion *vreg;
};

Comment on lines +153 to +154
#include <sof/lib/vregion.h>
#include <string.h>
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