]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/Ia32/Thunk16.S
MdePkg: Fix GCC Thunk support for IA32
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / Thunk16.S
index 88657f8182ea0c6094ad82ff12a5131f51d0d952..df205e9a1929c7b970c888550616119e72bbb986 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -55,7 +55,7 @@ ASM_PFX(ThunkAttr): .space  4
     orb     $2, %al\r
     outb    %al, $0x92                  # deactivate A20M#\r
 2:\r
-    movl    %ss, %eax\r
+    movw    %ss, %ax\r
     .byte   0x67, 0x66, 0x8d, 0x6c, 0x24, 0x34, 0x66\r
     mov     %ebp, 0xffffffd8(%esi)\r
     mov     0xfffffff8(%esi), %ebx\r
@@ -134,8 +134,8 @@ _16DsDesc:
 GdtEnd:\r
 \r
 #\r
-#   @param  RegSet  Pointer to a IA32_DWORD_REGS structure\r
-#   @param  Transition  Pointer to the transition code\r
+#   @param  RegSet  The pointer to a IA32_DWORD_REGS structure\r
+#   @param  Transition  The pointer to the transition code\r
 #   @return The address of the 16-bit stack after returning from user code\r
 #\r
 ASM_PFX(InternalAsmThunk16):\r
@@ -160,14 +160,14 @@ ASM_PFX(InternalAsmThunk16):
     movsl                               # copy RegSet\r
     movl    40(%esp), %eax              # eax <- address of transition code\r
     movl    %edx, %esi                  # esi <- 16-bit stack segment\r
-    lea     0x5e(%eax), %edx\r
+    lea     0x5f(%eax), %edx\r
     movl    %eax, %ecx\r
     andl    $0xf, %ecx\r
     shll    $12, %eax\r
     lea     0x6(%ecx), %ecx\r
     movw    %cx, %ax\r
     stosl                               # [edi] <- return address of user code\r
-    sgdtl   0xffffffa2(%edx)\r
+    sgdtl   0xffffffa1(%edx)\r
     sidtl   0x24(%esp)\r
     movl    %cr0, %eax\r
     movl    %eax, (%edx)                # save CR0 in SavedCr0\r