]> xenbits.xensource.com Git - seabios.git/commitdiff
Don't clobber %ax on ENTRY_INTO32 macro
authorKevin O'Connor <kevin@koconnor.net>
Tue, 21 Oct 2014 07:19:55 +0000 (03:19 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 27 Oct 2014 14:56:54 +0000 (10:56 -0400)
There's no need to clobber %ax in ENTRY_INTO32.  Now that %eax isn't
clobbered, use ENTRY_INTO32 in entry_csm.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/entryfuncs.S
src/romlayout.S

index 679b1fc41a2c4b80487e7f69218585c00650b770..8438604d33e45e0d5f150c0a82abc409347d568b 100644 (file)
         .endm
 
         // Reset stack, transition to 32bit mode, and call a C function.
-        // Clobbers %ax
         .macro ENTRY_INTO32 cfunc
-        xorw %ax, %ax
-        movw %ax, %ss
+        xorw %dx, %dx
+        movw %dx, %ss
         movl $ BUILD_STACK_ADDR , %esp
         movl $ \cfunc , %edx
         jmp transition32
index cca4e439ce276d7b9479f9c9bf0db417c61c8850..4ebbdee334d945a580521ec43e674edc4225bde4 100644 (file)
@@ -431,14 +431,8 @@ entry_csm:
         shll $4, %eax
         addl %esp, %eax
 
-        // Change to BUILD_STACK_ADDR stack
-        xorl %ebx, %ebx
-        movw %bx, %ss
-        movl $BUILD_STACK_ADDR, %esp
-
-        // Jump to 32bit mode and call handle_csm(bregs)
-        movl $_cfunc32flat_handle_csm, %edx
-        jmp transition32
+        // Change to BUILD_STACK_ADDR stack and call handle_csm(bregs)
+        ENTRY_INTO32 _cfunc32flat_handle_csm
 
         DECLFUNC __csm_return
         .code32