diff options
author | Anton Kling <anton@kling.gg> | 2024-02-21 20:06:35 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-02-21 20:06:35 +0100 |
commit | 9b475d3db3275d4c34f02161ae70ced5595a0fdb (patch) | |
tree | 0c50e4af3ce52017f295c44f6f4319e4a43de085 /kernel/log.c | |
parent | 6c9cb0bd8ceb039ce387c850e25adc6f99cfcd6f (diff) |
Kernel: Remove all inline assembly.
Now the kernel does not rely upon inline assembly which is often very
error prone. This also means that the kernel could probably be compiled
with any c99 compiler which would help future bootstrapping.
Diffstat (limited to 'kernel/log.c')
-rw-r--r-- | kernel/log.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/log.c b/kernel/log.c index fddf3b5..8f72b3a 100644 --- a/kernel/log.c +++ b/kernel/log.c @@ -1,4 +1,5 @@ #include "log.h" +#include <cpu/arch_inst.h> #include <sched/scheduler.h> struct stackframe { @@ -7,8 +8,7 @@ struct stackframe { }; void dump_backtrace(u32 max_frames) { - struct stackframe *stk; - asm("mov %%ebp,%0" : "=r"(stk)::); + struct stackframe *stk = (void*)get_current_sbp(); kprintf("Stack trace:\n"); for (u32 frame = 0; stk && frame < max_frames; ++frame) { kprintf(" 0x%x\n", stk->eip); |