mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
panic: don't trace non-kernel addresses and disable interrupts on panic
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
static void tracestack(uint64_t** addr){
|
static void tracestack(uint64_t** addr){
|
||||||
for(size_t depth = 0; depth < TRACE_MAXDEPTH; ++depth){
|
for(size_t depth = 0; depth < TRACE_MAXDEPTH; ++depth){
|
||||||
|
if(addr < (uint64_t)0xFFFFFFFF80000000) return;
|
||||||
uint64_t *calleeaddr = *(addr + 1);
|
uint64_t *calleeaddr = *(addr + 1);
|
||||||
addr = (uint64_t**)*addr;
|
addr = (uint64_t**)*addr;
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ static void tracestack(uint64_t** addr){
|
|||||||
}
|
}
|
||||||
|
|
||||||
__attribute((noreturn)) void _panic(char* reason, arch_regs *reg){
|
__attribute((noreturn)) void _panic(char* reason, arch_regs *reg){
|
||||||
|
asm volatile("cli");
|
||||||
printf("PANIC: %s\n", reason);
|
printf("PANIC: %s\n", reason);
|
||||||
|
|
||||||
// XXX maybe this should be an NMI?
|
// XXX maybe this should be an NMI?
|
||||||
|
|||||||
Reference in New Issue
Block a user