Skip to content

Commit 4892444

Browse files
committed
debug syscalls
1 parent 8cc1eb9 commit 4892444

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
@@ -415,38 +415,47 @@ EXPORT_SYMBOL(z_impl_mod_free);
415415
#include <zephyr/internal/syscall_handler.h>
416416

417417
#if CONFIG_FAST_GET
418+
__attribute__((optimize("-O0")))
418419
const void *z_vrfy_mod_fast_get(struct processing_module *mod, const void * const dram_ptr,
419420
size_t size)
420421
{
422+
volatile int i = 1;
423+
while (i);
421424
struct module_resources *res = &mod->priv.resources;
422425

423426
K_OOPS(K_SYSCALL_MEMORY_WRITE(mod, sizeof(*mod)));
424-
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap, sizeof(*res->heap)));
427+
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap->heap.heap, 4096));
425428
K_OOPS(K_SYSCALL_MEMORY_READ(dram_ptr, size));
426429

427430
return z_impl_mod_fast_get(mod, dram_ptr, size);
428431
}
429432
#include <zephyr/syscalls/mod_fast_get_mrsh.c>
430433
#endif
431434

435+
__attribute__((optimize("-O0")))
432436
void *z_vrfy_mod_alloc_ext(struct processing_module *mod, uint32_t flags, size_t size,
433437
size_t alignment)
434438
{
439+
volatile int i = 1;
440+
while (i);
435441
struct module_resources *res = &mod->priv.resources;
436442

437443
K_OOPS(K_SYSCALL_MEMORY_WRITE(mod, sizeof(*mod)));
438-
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap, sizeof(*res->heap)));
444+
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap->heap.heap, 4096));
439445

440446
return z_impl_mod_alloc_ext(mod, flags, size, alignment);
441447
}
442448
#include <zephyr/syscalls/mod_alloc_ext_mrsh.c>
443449

450+
__attribute__((optimize("-O0")))
444451
int z_vrfy_mod_free(struct processing_module *mod, const void *ptr)
445452
{
453+
volatile int i = 1;
454+
while (i);
446455
struct module_resources *res = &mod->priv.resources;
447456

448457
K_OOPS(K_SYSCALL_MEMORY_WRITE(mod, sizeof(*mod)));
449-
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap, sizeof(*res->heap)));
458+
K_OOPS(K_SYSCALL_MEMORY_WRITE(res->heap->heap.heap, 4096));
450459

451460
return z_impl_mod_free(mod, ptr);
452461
}

0 commit comments

Comments
 (0)