From 13f06a56bfc60a6f106474b1a4db47650340a90e Mon Sep 17 00:00:00 2001 From: li-elvin Date: Fri, 12 Nov 2010 07:48:32 +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@11048 6f19259b-4bc3-4df7-8a09-765794883524 --- UnixPkg/Library/UnixBaseLib/X64/Thunk16.S | 4 ++-- UnixPkg/Library/UnixBaseLib/X64/Thunk16.asm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/UnixPkg/Library/UnixBaseLib/X64/Thunk16.S b/UnixPkg/Library/UnixBaseLib/X64/Thunk16.S index fa9b3d6035..049ec86355 100644 --- a/UnixPkg/Library/UnixBaseLib/X64/Thunk16.S +++ b/UnixPkg/Library/UnixBaseLib/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/UnixPkg/Library/UnixBaseLib/X64/Thunk16.asm b/UnixPkg/Library/UnixBaseLib/X64/Thunk16.asm index 459966a43f..829df1c2a0 100644 --- a/UnixPkg/Library/UnixBaseLib/X64/Thunk16.asm +++ b/UnixPkg/Library/UnixBaseLib/X64/Thunk16.asm @@ -3,7 +3,7 @@ ;------------------------------------------------------------------------------ ; -; Copyright (c) 2006 - 2008, 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 @@ -105,7 +105,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