mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
isr: allow stack traces to cross interrupts
This commit is contained in:
@@ -57,8 +57,17 @@ isr_common:
|
|||||||
mov rdi, rbp ; vec
|
mov rdi, rbp ; vec
|
||||||
mov rsi, rsp ; ctx
|
mov rsi, rsp ; ctx
|
||||||
|
|
||||||
; set this as the end of the stack frame
|
; set this as the end of the stack frame or continue it
|
||||||
xor rbp, rbp
|
cmp qword [rsp + 184], 0x8
|
||||||
|
jne .zero_frame
|
||||||
|
push qword [rsp + 176]
|
||||||
|
push qword [rsp + 168]
|
||||||
|
jmp .keep_going
|
||||||
|
.zero_frame:
|
||||||
|
push qword 0
|
||||||
|
push qword 0
|
||||||
|
.keep_going:
|
||||||
|
mov rbp, rsp
|
||||||
|
|
||||||
cld
|
cld
|
||||||
extern interrupt_isr
|
extern interrupt_isr
|
||||||
@@ -66,7 +75,7 @@ isr_common:
|
|||||||
cli
|
cli
|
||||||
|
|
||||||
; pop context
|
; pop context
|
||||||
add rsp, 24 ; cr2 gs and fs are not popped.
|
add rsp, 40 ; cr2 gs and fs are not popped.
|
||||||
pop rax
|
pop rax
|
||||||
mov es,rax
|
mov es,rax
|
||||||
pop rax
|
pop rax
|
||||||
|
|||||||
Reference in New Issue
Block a user