x86_64 isr: don't rely on the value of rbp

This commit is contained in:
Matheus
2022-09-11 14:41:02 -03:00
parent 1000482a7e
commit f423acaedd
+7 -5
View File
@@ -59,11 +59,6 @@ section .text
add rsp, 24 ; cr2 gs fs add rsp, 24 ; cr2 gs fs
cmp rbp,0x3b
jne .noswapgspop
swapgs
.noswapgspop:
pop rax pop rax
mov es,rax mov es,rax
pop rax pop rax
@@ -85,6 +80,13 @@ section .text
pop rbp pop rbp
add rsp,8 ; remove error code add rsp,8 ; remove error code
cmp qword [rsp+8], 0x3b ; user cs
jne .noswap
swapgs
.noswap:
%endmacro %endmacro
%macro isr 2 %macro isr 2