mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
x86_64 isr: don't rely on the value of rbp
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user