Less annoying paging exception handler output

This commit is contained in:
Sparchatus 2022-05-11 13:50:08 +00:00
parent b2c12e8c15
commit 807e804bb8

View File

@ -97,11 +97,11 @@ static void pt_exception_handler(enum exception_type type, int subtype,
errval_t err;
lvaddr_t ip = registers_get_ip(regs);
debug_printf("[pt_exception_handler] type=%s, addr=%p, ip=%p\n",
pt_exception_type_to_string(type, subtype),
addr,
ip
);
// debug_printf("[pt_exception_handler] type=%s, addr=%p, ip=%p\n",
// pt_exception_type_to_string(type, subtype),
// addr,
// ip
// );
// WARNING: these debug calls can overflow the stack
// debug_print_save_area(regs);
// debug_dump(regs);
@ -125,16 +125,17 @@ static void pt_exception_handler(enum exception_type type, int subtype,
}
}
if (vaddr_reg == NULL) {
debug_printf("[pt_exception_handler] page_addr = 0x%x\n", page_addr);
debug_printf("[pt_exception_handler] type=%s, addr=%p, ip=%p, page_addr=0x%x\n", pt_exception_type_to_string(type, subtype), addr, ip, page_addr);
thread_mutex_unlock(&st->lock);
USER_PANIC("[pt_exception_handler][ERROR] Page fault ouside valid virtual address space");
}
if (vaddr_reg->free) {
debug_printf("[pt_exception_handler] page_addr = 0x%x, base = 0x%x, size = 0x%x\n", page_addr, vaddr_reg->base, vaddr_reg->size);
debug_printf("[pt_exception_handler] type=%s, addr=%p, ip=%p, page_addr=0x%x, base=0x%x, size=0x%x\n", pt_exception_type_to_string(type, subtype), addr, ip, page_addr, vaddr_reg->base, vaddr_reg->size);
thread_mutex_unlock(&st->lock);
USER_PANIC("[pt_exception_handler][ERROR] Page fault ouside allocated address space");
}
if (!vaddr_reg->heap) {
debug_printf("[pt_exception_handler] type=%s, addr=%p, ip=%p\n", pt_exception_type_to_string(type, subtype), addr, ip);
thread_mutex_unlock(&st->lock);
USER_PANIC("[ERROR] Page fault in allocated address space but outside heap");
}