X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/b9f4a7b7475e62dbff22da6dd768222f03889c00..13a19dccebb7df5b78d984ce26f8f3225dd5130a:/lunaix-os/kernel/debug/trace.c diff --git a/lunaix-os/kernel/debug/trace.c b/lunaix-os/kernel/debug/trace.c index a3553f1..e43d873 100644 --- a/lunaix-os/kernel/debug/trace.c +++ b/lunaix-os/kernel/debug/trace.c @@ -1,5 +1,5 @@ -#include #include +#include #include #include #include @@ -23,13 +23,14 @@ trace_modksyms_init(struct boot_handoff* bhctx) for (size_t i = 0; i < bhctx->mods.mods_num; i++) { struct boot_modent* mod = &bhctx->mods.entries[i]; if (streq(mod->str, "modksyms")) { - // In case boot loader does not place our ksyms on page boundary - ptr_t start = PG_ALIGN(mod->start); + assert(PG_ALIGNED(mod->start)); + ptr_t end = ROUNDUP(mod->end, PG_SIZE); - ptr_t ksym_va = (ptr_t)ioremap(start, (end - start)); + ptr_t ksym_va = + (ptr_t)vmm_vmap(mod->start, (end - mod->start), PG_PREM_R); - trace_ctx.ksym_table = - (struct ksyms*)(ksym_va + (mod->start - start)); + assert(ksym_va); + trace_ctx.ksym_table = (struct ksyms*)ksym_va; } } } @@ -126,7 +127,7 @@ trace_printstack() trace_printstack_of(cpu_get_fp()); } -void +static void trace_printswctx(const isr_param* p, char* direction) {