]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix the issue to clear the high 16-bit of EAX before use it Thunk code.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Dec 2011 08:27:53 +0000 (08:27 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Dec 2011 08:27:53 +0000 (08:27 +0000)
This patch updates MdePkg BaseLib, EcpPkg EdkIIGlueLib BaseLib and ThunkLib.

Signed-off-by: lgao4
Reviewed-by: rsun3
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12877 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.S
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.asm
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.S
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.asm
EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S
EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.asm
EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.S
EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm

index 6055ca663ce0df43a050068345e4090322fa067a..b33d67c9ed124d47345b61dafc09fe09c9422164 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2011, 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,8 @@ ASM_PFX(ThunkAttr): .space  4
     orb     $2, %al\r
     outb    %al, $0x92                  # deactivate A20M#\r
 2:\r
-    movw    %ss, %ax\r
+    xorw    %ax, %ax                    # xor eax, eax \r
+    movl    %ss, %eax                   # mov ax, ss\r
     .byte   0x67, 0x66, 0x8d, 0x6c, 0x24, 0x34, 0x66\r
     mov     %ebp, 0xffffffd8(%esi)\r
     mov     0xfffffff8(%esi), %ebx\r
index 61508d73bca418d57f5f35d0f5f0592e8256337f..8b22e0f336c1f98ac647c295c7e4691d024898d0 100644 (file)
@@ -1,4 +1,4 @@
-; Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2004 - 2011, 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
@@ -108,7 +108,8 @@ _ThunkAttr  DD      ?
     or      al, 2\r
     out     92h, al                     ; deactivate A20M#\r
 @2:\r
-    mov     ax, ss\r
+    xor     ax, ax                      ; xor eax, eax\r
+    mov     eax, ss                     ; mov ax, ss\r
     DB      67h\r
     lea     bp, [esp + sizeof (IA32_REGS)]\r
     ;\r
index 1de788a1847ecaccdaf80ad1a2c086ccc4aadf40..038cc75a67bde8e2b639db808d21d032faf2ab2a 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2011, 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
@@ -109,7 +109,8 @@ L_1:
     orb     $2,%al\r
     outb    %al, $0x92                   # deactivate A20M#\r
 L_2: \r
-    movw    %ss,%ax\r
+    xorw    %ax,%ax                      # xor eax, eax\r
+    movl    %ss,%eax                     # mov ax, ss\r
     lea     IA32_REGS_SIZE(%esp), %bp\r
     #\r
     # rsi in the following 2 instructions is indeed bp in 16-bit code\r
index c7d9caefe74840689f4419e1359c0ba45a1c50ce..b181a4ccfd5c6803b25cfd0989308939ecb97741 100644 (file)
@@ -1,4 +1,4 @@
-; Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2004 - 2011, 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
@@ -103,7 +103,8 @@ _ThunkAttr  DD      ?
     or      al, 2\r
     out     92h, al                     ; deactivate A20M#\r
 @2:\r
-    mov     ax, ss\r
+    xor     ax, ax                      ; xor eax, eax\r
+    mov     eax, ss                     ; mov ax, ss\r
     lea     bp, [esp + sizeof (IA32_REGS)]\r
     ;\r
     ; rsi in the following 2 instructions is indeed bp in 16-bit code\r
index 55415d87035c9140ea98988fb92f2bc216c32eff..cf7776a6a3a207bf4190566b739bd4396c97167f 100644 (file)
@@ -1,6 +1,6 @@
 #*****************************************************************************\r
 #*\r
-#*   Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#*   Copyright (c) 2006 - 2011, 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
@@ -116,7 +116,8 @@ L_16Bit:
     .byte  0xfc\r
     \r
 L_Lable1:\r
-    movl   %ss,%eax\r
+    xor    %eax,%eax\r
+    movw   %ss,%ax\r
     shl    $0x4,%eax\r
     add    %esp,%eax\r
     lss    0x3c(%esp),%esp\r
index 76c1317469af9de0f1ce12291a2e3402cd11cce3..0a796ed236b8cdc724170e8374fe753415492836 100644 (file)
@@ -1,6 +1,6 @@
 ;*****************************************************************************\r
 ;*\r
-;*   Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+;*   Copyright (c) 2006 - 2011, 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
@@ -141,7 +141,8 @@ __Thunk16   PROC    USES    ebp ebx esi edi ds  es  fs  gs
     mov     cr4, eax                    ; disable PAE & PSE\r
     db      67h, 0FFh, 06Ch, 024h, 0FCh ; jmp     dword ptr [esp-4]\r
 @@:\r
-    mov     eax, ss\r
+    xor     eax, eax\r
+    mov     ax, ss\r
     shl     eax, 4\r
     add     eax, esp                    ; eax <- address of 16-bit stack\r
     lss     esp, fword ptr (_STK16 ptr [esp + sizeof (IA32_REGS)]).SavedEsp\r
index 7328ab764d99b53cde18bde4d2f8b4d1991fc407..f77388d81161301756845b83674267e148c50f1b 100644 (file)
@@ -148,7 +148,7 @@ Label_16Bit:
 \r
 Label:\r
       xor    %rax,%rax\r
-      movl   %ss,%eax\r
+      movw   %ss,%ax\r
       shl    $0x4,%eax\r
       add    %esp,%eax\r
       mov    %r15,%rsp\r
index 0638d5faa8de9a3a6067853c506387572faaad76..6b74bbe7cb9bcdab3d4b5ac692842cb0800ac576 100644 (file)
@@ -144,7 +144,7 @@ _Thunk16    PROC    USES    rbp rbx rsi rdi r12 r13 r14 r15
     retf\r
 @@:\r
     xor     rax, rax\r
-    mov     eax, ss\r
+    mov     ax, ss\r
     shl     eax, 4\r
     add     eax, esp                    ; rax <- address of 16-bit stack\r
     mov     rsp, r15\r