mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-09 03:10:27 +00:00
[metal] CPU exception handler now dumps cr2 value
This commit is contained in:
parent
5aaadf1162
commit
b8cd8a07b4
1 changed files with 7 additions and 4 deletions
|
@ -70,9 +70,11 @@ __excep0_isr:
|
||||||
push %rcx # preserve registers which we will
|
push %rcx # preserve registers which we will
|
||||||
push %rdx # use to call kprintf
|
push %rdx # use to call kprintf
|
||||||
push %r8
|
push %r8
|
||||||
mov 40(%rsp),%rcx # edx:rcx = "caller" cs:rip
|
push %r9
|
||||||
mov 48(%rsp),%edx
|
mov 48(%rsp),%rcx # edx:rcx = "caller" cs:rip
|
||||||
mov 32(%rsp),%r8 # r8 = error code
|
mov 56(%rsp),%edx
|
||||||
|
mov 40(%rsp),%r8 # r8 = error code
|
||||||
|
mov %cr2,%r9 # r9 = cr2, in case it is useful
|
||||||
push %rax # preserve other call-used registers
|
push %rax # preserve other call-used registers
|
||||||
push %rdi
|
push %rdi
|
||||||
push %r9
|
push %r9
|
||||||
|
@ -141,7 +143,8 @@ isr_init:
|
||||||
// String constants.
|
// String constants.
|
||||||
.rodata.str1.1
|
.rodata.str1.1
|
||||||
.excep_msg:
|
.excep_msg:
|
||||||
.asciz "CPU exception %d @ %#llx:%#llx err code %#llx\n"
|
.ascii "\033[1;31mCPU exception %d @ %#llx:%#llx err code %#llx "
|
||||||
|
.asciz "cr2 %#llx\33[0m\n"
|
||||||
.previous
|
.previous
|
||||||
|
|
||||||
// IDTR value.
|
// IDTR value.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue