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@11047 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
li-elvin 2010-11-12 07:47:27 +00:00
parent be3b67bca5
commit 4d4c535a32
4 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # 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 orb $2, %al
outb %al, $0x92 # deactivate A20M# outb %al, $0x92 # deactivate A20M#
2: 2:
movl %ss, %eax movw %ss, %ax
.byte 0x67, 0x66, 0x8d, 0x6c, 0x24, 0x34, 0x66 .byte 0x67, 0x66, 0x8d, 0x6c, 0x24, 0x34, 0x66
mov %ebp, 0xffffffd8(%esi) mov %ebp, 0xffffffd8(%esi)
mov 0xfffffff8(%esi), %ebx mov 0xfffffff8(%esi), %ebx

View File

@ -3,7 +3,7 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; 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 ; which accompanies this distribution. The full text of the license may be found at
@ -109,7 +109,7 @@ _ThunkAttr DD ?
or al, 2 or al, 2
out 92h, al ; deactivate A20M# out 92h, al ; deactivate A20M#
@2: @2:
mov eax, ss mov ax, ss
DB 67h DB 67h
lea bp, [esp + sizeof (IA32_REGS)] lea bp, [esp + sizeof (IA32_REGS)]
; ;

View File

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
@ -104,7 +104,7 @@ L_1:
orb $2,%al orb $2,%al
outb %al, $0x92 # deactivate A20M# outb %al, $0x92 # deactivate A20M#
L_2: L_2:
movl %ss,%eax movw %ss,%ax
lea IA32_REGS_SIZE(%esp), %bp lea IA32_REGS_SIZE(%esp), %bp
# #
# rsi in the following 2 instructions is indeed bp in 16-bit code # rsi in the following 2 instructions is indeed bp in 16-bit code

View File

@ -3,7 +3,7 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; 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 ; which accompanies this distribution. The full text of the license may be found at
@ -105,7 +105,7 @@ _ThunkAttr DD ?
or al, 2 or al, 2
out 92h, al ; deactivate A20M# out 92h, al ; deactivate A20M#
@2: @2:
mov eax, ss mov ax, ss
lea bp, [esp + sizeof (IA32_REGS)] lea bp, [esp + sizeof (IA32_REGS)]
; ;
; rsi in the following 2 instructions is indeed bp in 16-bit code ; rsi in the following 2 instructions is indeed bp in 16-bit code