diff --git a/Kernel/Arch/i386/CPU.cpp b/Kernel/Arch/i386/CPU.cpp index ab98e63454e..738dcf35b3f 100644 --- a/Kernel/Arch/i386/CPU.cpp +++ b/Kernel/Arch/i386/CPU.cpp @@ -62,40 +62,38 @@ asm( " add $0x4, %esp\n" " iret\n"); -#define EH_ENTRY(ec) \ - extern "C" void exception_##ec##_handler(RegisterDump&); \ - extern "C" void exception_##ec##_entry(); \ - asm( \ - ".globl exception_" #ec "_entry\n" \ - "exception_" #ec "_entry: \n" \ - " pusha\n" \ - " pushw %ds\n" \ - " pushw %es\n" \ - " pushw %fs\n" \ - " pushw %gs\n" \ - " pushw %ss\n" \ - " pushw %ss\n" \ - " pushw %ss\n" \ - " pushw %ss\n" \ - " pushw %ss\n" \ - " popw %ds\n" \ - " popw %es\n" \ - " popw %fs\n" \ - " popw %gs\n" \ - " pushl %esp\n" \ - " call exception_" #ec "_handler\n" \ - " add $4, %esp\n" \ - " popw %gs\n" \ - " popw %gs\n" \ - " popw %fs\n" \ - " popw %es\n" \ - " popw %ds\n" \ - " popa\n" \ - " add $0x4, %esp\n" \ +#define EH_ENTRY(ec) \ + extern "C" void exception_##ec##_handler(RegisterDump); \ + extern "C" void exception_##ec##_entry(); \ + asm( \ + ".globl exception_" #ec "_entry\n" \ + "exception_" #ec "_entry: \n" \ + " pusha\n" \ + " pushw %ds\n" \ + " pushw %es\n" \ + " pushw %fs\n" \ + " pushw %gs\n" \ + " pushw %ss\n" \ + " pushw %ss\n" \ + " pushw %ss\n" \ + " pushw %ss\n" \ + " pushw %ss\n" \ + " popw %ds\n" \ + " popw %es\n" \ + " popw %fs\n" \ + " popw %gs\n" \ + " call exception_" #ec "_handler\n" \ + " popw %gs\n" \ + " popw %gs\n" \ + " popw %fs\n" \ + " popw %es\n" \ + " popw %ds\n" \ + " popa\n" \ + " add $0x4, %esp\n" \ " iret\n"); #define EH_ENTRY_NO_CODE(ec) \ - extern "C" void exception_##ec##_handler(RegisterDump&); \ + extern "C" void exception_##ec##_handler(RegisterDump); \ extern "C" void exception_##ec##_entry(); \ asm( \ ".globl exception_" #ec "_entry\n" \ @@ -115,9 +113,7 @@ asm( " popw %es\n" \ " popw %fs\n" \ " popw %gs\n" \ - " pushl %esp\n" \ " call exception_" #ec "_handler\n" \ - " add $4, %esp\n" \ " popw %gs\n" \ " popw %gs\n" \ " popw %fs\n" \ @@ -186,26 +182,26 @@ static void handle_crash(RegisterDump& regs, const char* description, int signal } EH_ENTRY_NO_CODE(6); -void exception_6_handler(RegisterDump& regs) +void exception_6_handler(RegisterDump regs) { handle_crash(regs, "Illegal instruction", SIGILL); } EH_ENTRY_NO_CODE(0); -void exception_0_handler(RegisterDump& regs) +void exception_0_handler(RegisterDump regs) { handle_crash(regs, "Division by zero", SIGFPE); } EH_ENTRY(13); -void exception_13_handler(RegisterDump& regs) +void exception_13_handler(RegisterDump regs) { handle_crash(regs, "General protection fault", SIGSEGV); } // 7: FPU not available exception EH_ENTRY_NO_CODE(7); -void exception_7_handler(RegisterDump& regs) +void exception_7_handler(RegisterDump regs) { (void)regs; @@ -237,7 +233,7 @@ void exception_7_handler(RegisterDump& regs) // 14: Page Fault EH_ENTRY(14); -void exception_14_handler(RegisterDump& regs) +void exception_14_handler(RegisterDump regs) { ASSERT(current); diff --git a/Kernel/Arch/i386/PIT.cpp b/Kernel/Arch/i386/PIT.cpp index 1890dac6174..b4861c30661 100644 --- a/Kernel/Arch/i386/PIT.cpp +++ b/Kernel/Arch/i386/PIT.cpp @@ -7,7 +7,7 @@ #define IRQ_TIMER 0 extern "C" void timer_interrupt_entry(); -extern "C" void timer_interrupt_handler(RegisterDump&); +extern "C" void timer_interrupt_handler(RegisterDump); asm( ".globl timer_interrupt_entry \n" @@ -27,9 +27,7 @@ asm( " popw %es\n" " popw %fs\n" " popw %gs\n" - " pushl %esp\n" " call timer_interrupt_handler\n" - " add $4, %esp\n" " popw %gs\n" " popw %gs\n" " popw %fs\n" @@ -42,7 +40,7 @@ asm( static u32 s_ticks_this_second; static u32 s_seconds_since_boot; -void timer_interrupt_handler(RegisterDump& regs) +void timer_interrupt_handler(RegisterDump regs) { IRQHandlerScope scope(IRQ_TIMER); if (++s_ticks_this_second >= TICKS_PER_SECOND) { diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp index aa581dc9fc6..a055e795109 100644 --- a/Kernel/Syscall.cpp +++ b/Kernel/Syscall.cpp @@ -6,7 +6,7 @@ #include #include -extern "C" void syscall_trap_entry(RegisterDump&); +extern "C" void syscall_trap_entry(RegisterDump); extern "C" void syscall_trap_handler(); extern volatile RegisterDump* syscallRegDump; @@ -28,9 +28,7 @@ asm( " popw %es\n" " popw %fs\n" " popw %gs\n" - " pushl %esp\n" " call syscall_trap_entry\n" - " add $4, %esp\n" " popw %gs\n" " popw %gs\n" " popw %fs\n" @@ -329,7 +327,7 @@ static u32 handle(RegisterDump& regs, u32 function, u32 arg1, u32 arg2, u32 arg3 } -void syscall_trap_entry(RegisterDump& regs) +void syscall_trap_entry(RegisterDump regs) { current->process().big_lock().lock(); u32 function = regs.eax;