diff --git a/arch/x86/kernel/include/registers.h b/arch/x86/kernel/include/registers.h index 0e9dca07..2b3d7bb8 100644 --- a/arch/x86/kernel/include/registers.h +++ b/arch/x86/kernel/include/registers.h @@ -136,7 +136,7 @@ struct tss64 { } __attribute__((packed)); struct x86_regs { - unsigned long r15, r11, r10, r9, r8; + unsigned long r15, r14, r13, r12, r11, r10, r9, r8; unsigned long rdi, rsi, rdx, rcx, rbx, rax, rbp; unsigned long error, rip, cs, rflags, rsp, ss; }; diff --git a/arch/x86/kernel/interrupt.S b/arch/x86/kernel/interrupt.S index d0a0838b..04dbb85f 100644 --- a/arch/x86/kernel/interrupt.S +++ b/arch/x86/kernel/interrupt.S @@ -36,9 +36,15 @@ pushq %r9; \ pushq %r10; \ pushq %r11; \ + pushq %r12; \ + pushq %r13; \ + pushq %r14; \ pushq %r15; #define POP_ALL_REGS \ popq %r15; \ + popq %r14; \ + popq %r13; \ + popq %r12; \ popq %r11; \ popq %r10; \ popq %r9; \ @@ -69,7 +75,7 @@ vector=vector+1 common_interrupt: PUSH_ALL_REGS - movq 96(%rsp), %rdi + movq 120(%rsp), %rdi movq %rsp, %rsi call handle_interrupt /* Enter C code */ POP_ALL_REGS @@ -85,7 +91,7 @@ page_fault: cld PUSH_ALL_REGS movq %cr2, %rdi - movq 96(%rsp),%rsi + movq 120(%rsp),%rsi movq %rsp,%rdx movq __page_fault_handler_address(%rip), %rax andq %rax, %rax @@ -122,13 +128,13 @@ x86_syscall: movq %gs:24, %rcx movq %rcx, 32(%rsp) PUSH_ALL_REGS - movq 80(%rsp), %rdi + movq 104(%rsp), %rdi movw %ss, %ax movw %ax, %ds movq %rsp, %rsi callq *__x86_syscall_handler(%rip) 1: - movq %rax, 80(%rsp) + movq %rax, 104(%rsp) POP_ALL_REGS #ifdef USE_SYSRET movq 8(%rsp), %rcx