diff --git a/arch/x86_64/src/context.rs b/arch/x86_64/src/context.rs index a11ff14..2a8242d 100644 --- a/arch/x86_64/src/context.rs +++ b/arch/x86_64/src/context.rs @@ -151,8 +151,7 @@ unsafe extern fn signal_handler_wrapper() { } // Push scratch registers - asm!("xchg bx, bx - push rax + asm!("push rax push rcx push rdx push rdi @@ -171,8 +170,7 @@ unsafe extern fn signal_handler_wrapper() { inner(&*(rsp as *const SignalHandlerStack)); // Pop scratch registers, error code, and return - asm!("xchg bx, bx - pop r11 + asm!("pop r11 pop r10 pop r9 pop r8 diff --git a/arch/x86_64/src/lib.rs b/arch/x86_64/src/lib.rs index e5dbd9d..21be1a1 100644 --- a/arch/x86_64/src/lib.rs +++ b/arch/x86_64/src/lib.rs @@ -241,8 +241,7 @@ macro_rules! interrupt_error { } // Push scratch registers - asm!("xchg bx, bx - push rax + asm!("push rax push rcx push rdx push rdi diff --git a/arch/x86_64/src/start.rs b/arch/x86_64/src/start.rs index 55a3087..c39edf4 100644 --- a/arch/x86_64/src/start.rs +++ b/arch/x86_64/src/start.rs @@ -160,8 +160,7 @@ pub unsafe extern fn kstart_ap(cpu_id: usize, bsp_table: usize, stack_start: usi pub unsafe fn usermode(ip: usize, sp: usize) -> ! { // Go to usermode - asm!("xchg bx, bx - mov ds, ax + asm!("mov ds, ax mov es, ax mov fs, bx mov gs, ax