new 64b kernel memory map (not userspace yet)
[akaros.git] / kern / arch / i686 / trapentry.S
index 424876a..f282bee 100644 (file)
@@ -78,6 +78,9 @@
        pushl %fs;                                                                 \
        pushl %gs;                                                                 \
        pushal;                                                                    \
+       movw $0, %ax;                                                              \
+       movw %ax, %gs;                                                             \
+       movw %ax, %fs;                                                             \
        movw $GD_KD, %ax;                                                          \
        movw %ax, %ds;                                                             \
        movw %ax, %es;                                                             \
@@ -171,7 +174,7 @@ IRQ_HANDLER(IRQ219, 251)
 IRQ_HANDLER(IRQ220, 252)
 IRQ_HANDLER(IRQ221, 253)
 IRQ_HANDLER(IRQ222, 254)
-IRQ_HANDLER_SPEC(IRQ223, I_ACTIVE_MSG, __active_message)
+IRQ_HANDLER_SPEC(IRQ223, I_KERNEL_MSG, __kernel_message)
 
 /* Technically, these HANDLER entries do not need to be in numeric order */
 TRAPHANDLER_NOEC(ISR_syscall, T_SYSCALL)
@@ -193,6 +196,9 @@ _alltraps:
        pushl %fs
        pushl %gs
        pushal
+       movw $0, %ax;
+       movw %ax, %gs;
+       movw %ax, %fs;
        movw $GD_KD, %ax                # data segments aren't accessible by default
        movw %ax, %ds
        movw %ax, %es
@@ -218,6 +224,9 @@ _allirqs:
        pushl %fs
        pushl %gs
        pushal
+       movw $0, %ax;
+       movw %ax, %gs;
+       movw %ax, %fs;
        movw $GD_KD, %ax                # data segments aren't accessible by default
        movw %ax, %ds
        movw %ax, %es
@@ -235,21 +244,26 @@ _allirqs:
 
 .globl sysenter_handler;
 .type sysenter_handler, @function;
+# All of the pushl zeros are to keep the trap frame looking the same as when we
+# receive a trap or an interrupt
 sysenter_handler:
        sti                                             # enable interrupts (things are sane here)
        cld
-       pushl $0                                # esp
        pushl $0                                # ss
-       pushfl                                  # save the eflags
-       pushl $0                                # these zeros keep the trapframe looking the same
-       pushl $0                                # as when we receive a trap or interrupt
-       pushl $0                                # and CS == 0 lets the kernel know it was a sysenter
+       pushl $0                                # esp
+       pushfl                                  # eflags
+       pushl $0                                # CS == 0 lets the kernel know it was a sysenter        
+       pushl $0                                # eip
+       pushl $0                                # err 
        pushl $T_SYSCALL                # helps with print_trapframe
        pushl %ds
        pushl %es
        pushl %fs
        pushl %gs
        pushal
+       movw $0, %ax;
+       movw %ax, %gs;
+       movw %ax, %fs;
        movw $GD_KD, %ax
        movw %ax, %ds
        movw %ax, %es
@@ -265,6 +279,5 @@ sysenter_handler:
        addl $0x10, %esp                # pop T_SYSCALL and the three zeros
        popfl                                   # restore EFLAGS (and usually enables interrupts!)
        movl %ebp, %ecx
-       movl %esi, %edx
        sti                                             # interrupts are turned off when starting a core
        sysexit