summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-12-15 08:27:17 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-12-15 08:27:17 +0000
commitc577049aafd5d00f96fe6d136e442da8b7520242 (patch)
tree90aa447ee6129b3a136651c71c557b1824eea952 /MdePkg
parentcb40609c754e8ddd351b8f01a60f8097ed0b82dc (diff)
Fix the issue to clear the high 16-bit of EAX before use it Thunk code.
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@12876 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Thunk16.S5
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Thunk16.asm5
-rw-r--r--MdePkg/Library/BaseLib/X64/Thunk16.S5
-rw-r--r--MdePkg/Library/BaseLib/X64/Thunk16.asm5
4 files changed, 12 insertions, 8 deletions
diff --git a/MdePkg/Library/BaseLib/Ia32/Thunk16.S b/MdePkg/Library/BaseLib/Ia32/Thunk16.S
index df205e9a19..d45a0d40b1 100644
--- a/MdePkg/Library/BaseLib/Ia32/Thunk16.S
+++ b/MdePkg/Library/BaseLib/Ia32/Thunk16.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -55,7 +55,8 @@ ASM_PFX(ThunkAttr): .space 4
orb $2, %al
outb %al, $0x92 # deactivate A20M#
2:
- movw %ss, %ax
+ xorw %ax, %ax # xor eax, eax
+ movl %ss, %eax # mov ax, ss
.byte 0x67, 0x66, 0x8d, 0x6c, 0x24, 0x34, 0x66
mov %ebp, 0xffffffd8(%esi)
mov 0xfffffff8(%esi), %ebx
diff --git a/MdePkg/Library/BaseLib/Ia32/Thunk16.asm b/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
index 31f9254ad5..6df0a4a46a 100644
--- a/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
+++ b/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
@@ -3,7 +3,7 @@
;------------------------------------------------------------------------------
;
-; Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
@@ -109,7 +109,8 @@ _ThunkAttr DD ?
or al, 2
out 92h, al ; deactivate A20M#
@2:
- mov ax, ss
+ xor ax, ax ; xor eax, eax
+ mov eax, ss ; mov ax, ss
DB 67h
lea bp, [esp + sizeof (IA32_REGS)]
;
diff --git a/MdePkg/Library/BaseLib/X64/Thunk16.S b/MdePkg/Library/BaseLib/X64/Thunk16.S
index 4c3c5605fa..d037a71043 100644
--- a/MdePkg/Library/BaseLib/X64/Thunk16.S
+++ b/MdePkg/Library/BaseLib/X64/Thunk16.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -109,7 +109,8 @@ L_1:
orb $2,%al
outb %al, $0x92 # deactivate A20M#
L_2:
- movw %ss,%ax
+ xorw %ax, %ax # xor eax, eax
+ movl %ss, %eax # mov ax, ss
lea IA32_REGS_SIZE(%esp), %bp
#
# rsi in the following 2 instructions is indeed bp in 16-bit code
diff --git a/MdePkg/Library/BaseLib/X64/Thunk16.asm b/MdePkg/Library/BaseLib/X64/Thunk16.asm
index 829df1c2a0..8b208fdb58 100644
--- a/MdePkg/Library/BaseLib/X64/Thunk16.asm
+++ b/MdePkg/Library/BaseLib/X64/Thunk16.asm
@@ -3,7 +3,7 @@
;------------------------------------------------------------------------------
;
-; Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
@@ -105,7 +105,8 @@ _ThunkAttr DD ?
or al, 2
out 92h, al ; deactivate A20M#
@2:
- mov ax, ss
+ xor ax, ax ; xor eax, eax
+ mov eax, ss ; mov ax, ss
lea bp, [esp + sizeof (IA32_REGS)]
;
; rsi in the following 2 instructions is indeed bp in 16-bit code