Skip to content

Commit fdb650c

Browse files
committed
debug syscalls
1 parent 7f80efa commit fdb650c

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/audio/module_adapter/module/generic.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,38 +419,47 @@ EXPORT_SYMBOL(z_impl_mod_free);
419419
#include <zephyr/internal/syscall_handler.h>
420420

421421
#if CONFIG_FAST_GET
422+
__attribute__((optimize("-O0")))
422423
const void *z_vrfy_mod_fast_get(struct processing_module *mod, const void * const dram_ptr,
423424
size_t size)
424425
{
426+
volatile int i = 1;
427+
while (i);
425428
struct module_resources *res = &mod->priv.resources;
426429

427430
K_OOPS(K_SYSCALL_MEMORY_WRITE(mod, sizeof(*mod)));
428-
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap, sizeof(*res->heap)));
431+
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap->heap.heap, 4096));
429432
K_OOPS(K_SYSCALL_MEMORY_READ(dram_ptr, size));
430433

431434
return z_impl_mod_fast_get(mod, dram_ptr, size);
432435
}
433436
#include <zephyr/syscalls/mod_fast_get_mrsh.c>
434437
#endif
435438

439+
__attribute__((optimize("-O0")))
436440
void *z_vrfy_mod_alloc_ext(struct processing_module *mod, uint32_t flags, size_t size,
437441
size_t alignment)
438442
{
443+
volatile int i = 1;
444+
while (i);
439445
struct module_resources *res = &mod->priv.resources;
440446

441447
K_OOPS(K_SYSCALL_MEMORY_WRITE(mod, sizeof(*mod)));
442-
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap, sizeof(*res->heap)));
448+
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap->heap.heap, 4096));
443449

444450
return z_impl_mod_alloc_ext(mod, flags, size, alignment);
445451
}
446452
#include <zephyr/syscalls/mod_alloc_ext_mrsh.c>
447453

454+
__attribute__((optimize("-O0")))
448455
int z_vrfy_mod_free(struct processing_module *mod, const void *ptr)
449456
{
457+
volatile int i = 1;
458+
while (i);
450459
struct module_resources *res = &mod->priv.resources;
451460

452461
K_OOPS(K_SYSCALL_MEMORY_WRITE(mod, sizeof(*mod)));
453-
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap, sizeof(*res->heap)));
462+
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap->heap.heap, 4096));
454463

455464
return z_impl_mod_free(mod, ptr);
456465
}

0 commit comments

Comments
 (0)