Skip to content

Commit d18ea27

Browse files
committed
alloc: xtos: remove xtos memory zones.
Zones are no longer needed as Zephyr manages heaps. Remove enum and API usage. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 60e7a0a commit d18ea27

File tree

150 files changed

+309
-370
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+309
-370
lines changed

src/arch/xtensa/lib/cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static void alloc_shared_secondary_cores_objects(void)
4646
{
4747
uint8_t *dynamic_vectors;
4848

49-
dynamic_vectors = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, 0, SOF_DYNAMIC_VECTORS_SIZE);
49+
dynamic_vectors = rzalloc(0, 0, SOF_DYNAMIC_VECTORS_SIZE);
5050
if (dynamic_vectors == NULL)
5151
sof_panic(SOF_IPC_PANIC_MEM);
5252

src/arch/xtensa/schedule/task.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void task_context_set(void *task_ctx)
6565

6666
int task_context_alloc(void **task_ctx)
6767
{
68-
*task_ctx = rzalloc(SOF_MEM_ZONE_SYS_RUNTIME, 0, SOF_MEM_CAPS_RAM,
68+
*task_ctx = rzalloc(0, SOF_MEM_CAPS_RAM,
6969
sizeof(xtos_task_context));
7070
if (!*task_ctx)
7171
return -ENOMEM;

src/audio/aria/aria.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static int aria_init(struct processing_module *mod)
126126
list_init(&dev->bsource_list);
127127
list_init(&dev->bsink_list);
128128

129-
cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*cd));
129+
cd = rzalloc(0, SOF_MEM_CAPS_RAM, sizeof(*cd));
130130
if (!cd) {
131131
return -ENOMEM;
132132
}

src/audio/asrc/asrc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static int asrc_init(struct processing_module *mod)
217217
return -EINVAL;
218218
}
219219

220-
cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*cd));
220+
cd = rzalloc(0, SOF_MEM_CAPS_RAM, sizeof(*cd));
221221
if (!cd)
222222
return -ENOMEM;
223223

@@ -261,7 +261,7 @@ static int asrc_initialize_buffers(struct asrc_farrow *src_obj)
261261
buffer_size = src_obj->buffer_length * sizeof(int32_t);
262262

263263
for (ch = 0; ch < src_obj->num_channels; ch++) {
264-
buf_32 = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, buffer_size);
264+
buf_32 = rzalloc(0, SOF_MEM_CAPS_RAM, buffer_size);
265265

266266
if (!buf_32)
267267
return -ENOMEM;
@@ -272,7 +272,7 @@ static int asrc_initialize_buffers(struct asrc_farrow *src_obj)
272272
buffer_size = src_obj->buffer_length * sizeof(int16_t);
273273

274274
for (ch = 0; ch < src_obj->num_channels; ch++) {
275-
buf_16 = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, buffer_size);
275+
buf_16 = rzalloc(0, SOF_MEM_CAPS_RAM, buffer_size);
276276

277277
if (!buf_16)
278278
return -ENOMEM;
@@ -614,7 +614,7 @@ static int asrc_prepare(struct processing_module *mod,
614614
cd->buf_size = (cd->source_frames_max + cd->sink_frames_max) *
615615
frame_bytes;
616616

617-
cd->buf = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM,
617+
cd->buf = rzalloc(0, SOF_MEM_CAPS_RAM,
618618
cd->buf_size);
619619
if (!cd->buf) {
620620
cd->buf_size = 0;
@@ -640,7 +640,7 @@ static int asrc_prepare(struct processing_module *mod,
640640
goto err_free_buf;
641641
}
642642

643-
cd->asrc_obj = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM,
643+
cd->asrc_obj = rzalloc(0, SOF_MEM_CAPS_RAM,
644644
cd->asrc_size);
645645
if (!cd->asrc_obj) {
646646
comp_err(dev, "asrc_prepare(), allocation fail for size %d",

src/audio/buffers/comp_buffer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ static struct comp_buffer *buffer_alloc_struct(void *stream_addr, size_t size, u
188188

189189
tr_dbg(&buffer_tr, "buffer_alloc_struct()");
190190

191-
/* allocate new buffer */
192-
enum mem_zone zone = is_shared ? SOF_MEM_ZONE_RUNTIME_SHARED : SOF_MEM_ZONE_RUNTIME;
191+
/* allocate new buffer - use coherent flag is shared */
192+
flags |= is_shared ? SOF_MEM_FLAG_COHERENT : 0;
193193

194-
buffer = rzalloc(zone, 0, SOF_MEM_CAPS_RAM, sizeof(*buffer));
194+
buffer = rzalloc(flags, SOF_MEM_CAPS_RAM, sizeof(*buffer));
195195

196196
if (!buffer) {
197197
tr_err(&buffer_tr, "buffer_alloc_struct(): could not alloc structure");

src/audio/buffers/ring_buffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ struct ring_buffer *ring_buffer_create(size_t min_available, size_t min_free_spa
280280

281281
/* allocate ring_buffer structure */
282282
if (is_shared)
283-
ring_buffer = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM,
283+
ring_buffer = rzalloc(0, SOF_MEM_CAPS_RAM,
284284
sizeof(*ring_buffer));
285285
else
286-
ring_buffer = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM,
286+
ring_buffer = rzalloc(0, SOF_MEM_CAPS_RAM,
287287
sizeof(*ring_buffer));
288288
if (!ring_buffer)
289289
return NULL;

src/audio/chain_dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ __cold static struct comp_dev *chain_task_create(const struct comp_driver *drv,
668668
if (!dev)
669669
return NULL;
670670

671-
cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*cd));
671+
cd = rzalloc(0, SOF_MEM_CAPS_RAM, sizeof(*cd));
672672
if (!cd)
673673
goto error;
674674

src/audio/copier/copier.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static int mic_privacy_configure(struct comp_dev *dev, struct copier_data *cd)
8787
struct mic_privacy_data *mic_priv_data;
8888
int ret;
8989

90-
mic_priv_data = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM,
90+
mic_priv_data = rzalloc(0, SOF_MEM_CAPS_RAM,
9191
sizeof(struct mic_privacy_data));
9292
if (!mic_priv_data)
9393
return -ENOMEM;
@@ -144,7 +144,7 @@ __cold static int copier_init(struct processing_module *mod)
144144

145145
assert_can_be_cold();
146146

147-
cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*cd));
147+
cd = rzalloc(0, SOF_MEM_CAPS_RAM, sizeof(*cd));
148148
if (!cd)
149149
return -ENOMEM;
150150

@@ -166,7 +166,7 @@ __cold static int copier_init(struct processing_module *mod)
166166
*/
167167
if (copier->gtw_cfg.config_length) {
168168
gtw_cfg_size = copier->gtw_cfg.config_length << 2;
169-
gtw_cfg = rmalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM,
169+
gtw_cfg = rmalloc(0, SOF_MEM_CAPS_RAM,
170170
gtw_cfg_size);
171171
if (!gtw_cfg) {
172172
ret = -ENOMEM;

src/audio/copier/copier_dai.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ __cold static int copier_dai_init(struct comp_dev *dev,
204204
return ret;
205205
}
206206

207-
dd = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*dd));
207+
dd = rzalloc(0, SOF_MEM_CAPS_RAM, sizeof(*dd));
208208
if (!dd)
209209
return -ENOMEM;
210210

@@ -223,8 +223,8 @@ __cold static int copier_dai_init(struct comp_dev *dev,
223223

224224
/* Allocate gain data if selected for this dai type and set basic params */
225225
if (dai->apply_gain) {
226-
struct copier_gain_params *gain_data = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED,
227-
0, SOF_MEM_CAPS_RAM,
226+
struct copier_gain_params *gain_data = rzalloc(SOF_MEM_FLAG_COHERENT,
227+
SOF_MEM_CAPS_RAM,
228228
sizeof(*gain_data));
229229
if (!gain_data) {
230230
ret = -ENOMEM;

src/audio/copier/copier_host.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ __cold static int add_to_fpi_sync_group(struct comp_dev *parent_dev,
6262

6363
group->ref_count++;
6464
} else {
65-
group = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*group));
65+
group = rzalloc(0, SOF_MEM_CAPS_RAM, sizeof(*group));
6666
if (!group) {
6767
comp_err(parent_dev, "Failed to alloc memory for new group");
6868
return -ENOMEM;
@@ -177,7 +177,7 @@ __cold int copier_host_create(struct comp_dev *dev, struct copier_data *cd,
177177
ipc_host.dma_buffer_size = copier_cfg->gtw_cfg.dma_buffer_size;
178178
ipc_host.feature_mask = copier_cfg->copier_feature_mask;
179179

180-
hd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*hd));
180+
hd = rzalloc(0, SOF_MEM_CAPS_RAM, sizeof(*hd));
181181
if (!hd)
182182
return -ENOMEM;
183183

0 commit comments

Comments
 (0)