Skip to content

Commit 2b65cde

Browse files
committed
audio: component: move mod_alloc_ctx definition to new sof/ctx_alloc.h
mod_alloc_ctx is needed by many components and also soon by audio components, so defining it in component.h will create circular dependencies. To clean this up, move definition of struct mod_alloc_ctx into the recently added ctx_alloc.h header. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent e418357 commit 2b65cde

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/include/sof/audio/component.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <rtos/idc.h>
2424
#include <rtos/mutex.h>
2525
#include <rtos/userspace_helper.h>
26+
#include <sof/ctx_alloc.h>
2627
#include <sof/lib/dai.h>
2728
#include <sof/schedule/schedule.h>
2829
#include <ipc/control.h>
@@ -579,13 +580,6 @@ struct comp_ops {
579580
uint64_t (*get_total_data_processed)(struct comp_dev *dev, uint32_t stream_no, bool input);
580581
};
581582

582-
struct k_heap;
583-
struct vregion;
584-
struct mod_alloc_ctx {
585-
struct k_heap *heap;
586-
struct vregion *vreg;
587-
};
588-
589583
/**
590584
* Audio component base driver "class"
591585
* - used by all other component types.

src/include/sof/ctx_alloc.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
#ifndef __SOF_CTX_ALLOC_H__
77
#define __SOF_CTX_ALLOC_H__
88

9-
#include <sof/audio/component.h>
109
#include <sof/lib/vregion.h>
1110
#include <rtos/alloc.h>
1211
#include <stddef.h>
1312
#include <stdint.h>
1413
#include <string.h>
1514

15+
struct mod_alloc_ctx {
16+
struct k_heap *heap;
17+
struct vregion *vreg;
18+
};
19+
1620
/**
1721
* Allocate memory from a mod_alloc_ctx context.
1822
*

src/include/sof/lib/dai-zephyr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <rtos/spinlock.h>
2727
#include <sof/trace/trace.h>
2828
#include <sof/ipc/topology.h>
29+
#include <sof/ctx_alloc.h>
2930
#include <sof/audio/pcm_converter.h>
3031
#include <sof/audio/ipc-config.h>
3132
#include <ipc/dai.h>

0 commit comments

Comments
 (0)