Skip to content

Commit 163c3bf

Browse files
committed
debug
1 parent 2f45a88 commit 163c3bf

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

src/audio/module_adapter/module/generic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ __attribute__((optimize("-O0")))
419419
const void *z_vrfy_mod_fast_get(struct processing_module *mod, const void * const dram_ptr,
420420
size_t size)
421421
{
422-
volatile int i = 1;
422+
volatile int i = 0;
423423
while (i);
424424
struct module_resources *res = &mod->priv.resources;
425425

@@ -436,7 +436,7 @@ __attribute__((optimize("-O0")))
436436
void *z_vrfy_mod_alloc_ext(struct processing_module *mod, uint32_t flags, size_t size,
437437
size_t alignment)
438438
{
439-
volatile int i = 1;
439+
volatile int i = 0;
440440
while (i);
441441
struct module_resources *res = &mod->priv.resources;
442442

@@ -450,7 +450,7 @@ void *z_vrfy_mod_alloc_ext(struct processing_module *mod, uint32_t flags, size_t
450450
__attribute__((optimize("-O0")))
451451
int z_vrfy_mod_free(struct processing_module *mod, const void *ptr)
452452
{
453-
volatile int i = 1;
453+
volatile int i = 0;
454454
while (i);
455455
struct module_resources *res = &mod->priv.resources;
456456

zephyr/include/rtos/userspace_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <zephyr/cache.h>
2222
#include <zephyr/app_memory/app_memdomain.h>
2323

24-
#define USER_MOD_HEAP_SIZE ALIGN_UP(CONFIG_SOF_ZEPHYR_USERSPACE_MODULE_HEAP_SIZE, \
24+
#define USER_MOD_HEAP_SIZE ALIGN_UP(CONFIG_SOF_ZEPHYR_USERSPACE_MODULE_HEAP_SIZE + 2048, \
2525
CONFIG_MM_DRV_PAGE_SIZE)
2626
#define APP_TASK_BSS K_APP_BMEM(common_partition)
2727
#define APP_TASK_DATA K_APP_DMEM(common_partition)

zephyr/lib/fast-get.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
#ifdef __ZEPHYR__
2020
#include <zephyr/logging/log.h>
2121
#else
22-
#define LOG_DBG(...) do {} while (0)
23-
#define LOG_INF(...) do {} while (0)
24-
#define LOG_WRN(...) do {} while (0)
2522
#define LOG_ERR(...) do {} while (0)
2623
#endif
2724

@@ -125,7 +122,7 @@ static int fast_get_access_grant(k_tid_t thread, void *addr, size_t size)
125122
.attr = K_MEM_PARTITION_P_RO_U_RO | XTENSA_MMU_CACHED_WB,
126123
};
127124

128-
LOG_DBG("add %#zx @ %p", part.size, addr);
125+
LOG_ERR("add %#zx @ %p", part.size, addr);
129126
return k_mem_domain_add_partition(thread->mem_domain_info.mem_domain, &part);
130127
}
131128
#endif /* CONFIG_USERSPACE */
@@ -171,7 +168,7 @@ const void *fast_get(struct k_heap *heap, const void *dram_ptr, size_t size)
171168
} while (!entry);
172169

173170
#if CONFIG_USERSPACE
174-
LOG_DBG("userspace %u part %#zx bytes alloc %p entry %p DRAM %p",
171+
LOG_ERR("userspace %u part %#zx bytes alloc %p entry %p DRAM %p",
175172
k_current_get()->mem_domain_info.mem_domain->num_partitions, size,
176173
alloc_ptr, entry->sram_ptr, dram_ptr);
177174
#endif
@@ -193,7 +190,7 @@ const void *fast_get(struct k_heap *heap, const void *dram_ptr, size_t size)
193190
if (k_current_get() != entry->thread &&
194191
!fast_get_domain_exists(k_current_get(), ret,
195192
ALIGN_UP(size, CONFIG_MM_DRV_PAGE_SIZE))) {
196-
LOG_DBG("grant access to thread %p first was %p", k_current_get(),
193+
LOG_ERR("grant access to thread %p first was %p", k_current_get(),
197194
entry->thread);
198195
int err = fast_get_access_grant(k_current_get(), ret, size);
199196

@@ -209,7 +206,7 @@ const void *fast_get(struct k_heap *heap, const void *dram_ptr, size_t size)
209206
dcache_invalidate_region((__sparse_force void __sparse_cache *)ret,
210207
size);
211208
} else {
212-
LOG_WRN("Repeated access request by thread");
209+
LOG_ERR("Repeated access request by thread");
213210
}
214211
}
215212
#endif
@@ -250,7 +247,7 @@ const void *fast_get(struct k_heap *heap, const void *dram_ptr, size_t size)
250247
entry->refcount = 1;
251248
out:
252249
k_spin_unlock(&data->lock, key);
253-
LOG_DBG("get %p, %p, size %u, refcnt %u", dram_ptr, ret, size, entry ? entry->refcount : 0);
250+
LOG_ERR("get %p, %p, size %u, refcnt %u", dram_ptr, ret, size, entry ? entry->refcount : 0);
254251

255252
return ret;
256253
}
@@ -304,7 +301,7 @@ void fast_put(struct k_heap *heap, const void *sram_ptr)
304301
int err = k_mem_domain_remove_partition(domain, &part);
305302

306303
if (err < 0)
307-
LOG_WRN("partition removal failed err=%d", err);
304+
LOG_ERR("partition removal failed err=%d", err);
308305

309306
} else
310307
#endif /* CONFIG_USERSPACE */
@@ -316,7 +313,7 @@ void fast_put(struct k_heap *heap, const void *sram_ptr)
316313
memset(entry, 0, sizeof(*entry));
317314
}
318315
out:
319-
LOG_DBG("put %p, DRAM %p size %u refcnt %u", sram_ptr, entry ? entry->dram_ptr : 0,
316+
LOG_ERR("put %p, DRAM %p size %u refcnt %u", sram_ptr, entry ? entry->dram_ptr : 0,
320317
entry ? entry->size : 0, entry ? entry->refcount : 0);
321318
k_spin_unlock(&data->lock, key);
322319
}

0 commit comments

Comments
 (0)