Clear DF flag during trap handling to conform to x86-64 calling convention

This commit is contained in:
Ruize Tang
2024-11-24 22:46:52 +08:00
committed by Tate, Hongliang Tian
parent 5f35189a51
commit 9e5075dab7

View File

@ -57,6 +57,7 @@ trap_handler_table:
.section .text
.global trap_common
trap_common:
cld # clear DF before calling/returning to any C function to conform to x86-64 calling convention
push rax
mov ax, [rsp + 4*8] # load cs
and ax, 0x3 # test