From be3b67bca5dfd62cea1148470554f6628efb9b7b Mon Sep 17 00:00:00 2001 From: li-elvin Date: Fri, 12 Nov 2010 07:45:08 +0000 Subject: [PATCH] Fix the issue that the high 16-bit of EAX may contain invalid data, which cause bad stack pointer, the change will ensure the high 16-bit of EAX is cleared. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11046 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.S | 4 ++-- .../Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.asm | 4 ++-- .../Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.S | 4 ++-- .../Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.asm | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.S index 1ce29f1af6..6055ca663c 100644 --- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.S +++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.S @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ # -# Copyright (c) 2006, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
# 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,7 @@ ASM_PFX(ThunkAttr): .space 4 orb $2, %al outb %al, $0x92 # deactivate A20M# 2: - movl %ss, %eax + movw %ss, %ax .byte 0x67, 0x66, 0x8d, 0x6c, 0x24, 0x34, 0x66 mov %ebp, 0xffffffd8(%esi) mov 0xfffffff8(%esi), %ebx diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.asm index bc33ce9e1d..61508d73bc 100644 --- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.asm +++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.asm @@ -1,4 +1,4 @@ -; Copyright (c) 2004, Intel Corporation. All rights reserved.
+; Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.
; 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 @@ -108,7 +108,7 @@ _ThunkAttr DD ? or al, 2 out 92h, al ; deactivate A20M# @2: - mov eax, ss + mov ax, ss DB 67h lea bp, [esp + sizeof (IA32_REGS)] ; diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.S index d63f02923c..da626ad47c 100644 --- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.S +++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.S @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ # -# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
# 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 @@ -104,7 +104,7 @@ L_1: orb $2,%al outb %al, $0x92 # deactivate A20M# L_2: - movl %ss,%eax + movw %ss,%ax lea IA32_REGS_SIZE(%esp), %bp # # rsi in the following 2 instructions is indeed bp in 16-bit code diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.asm index 3276fafd90..c7d9caefe7 100644 --- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.asm +++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.asm @@ -1,4 +1,4 @@ -; Copyright (c) 2004, Intel Corporation. All rights reserved.
+; Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.
; 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 @@ -103,7 +103,7 @@ _ThunkAttr DD ? or al, 2 out 92h, al ; deactivate A20M# @2: - 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 -- 2.39.2