To Fix PVCS 429.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2007 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
yshang1 2006-11-23 09:05:19 +00:00
parent 2d57c546e0
commit 733f4094ee
1 changed files with 9 additions and 2 deletions

View File

@ -96,18 +96,25 @@ _ThunkAttr DD ?
@2: @2:
mov eax, ss mov eax, 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
;
mov word ptr (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._ESP, bp mov word ptr (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._ESP, bp
DB 66h
mov ebx, (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._EIP mov ebx, (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._EIP
shl ax, 4 ; shl eax, 4 shl ax, 4 ; shl eax, 4
add bp, ax ; add ebp, eax add bp, ax ; add ebp, eax
mov ax, cs mov ax, cs
shl ax, 4 shl ax, 4
lea ax, [eax + ebx + (@64BitCode - @Base)] lea ax, [eax + ebx + (@64BitCode - @Base)]
DB 2eh ; cs: DB 66h, 2eh, 89h, 87h ; mov cs:[bx + (@64Eip - @Base)], eax
mov [rdi + (@64Eip - @Base)], ax DW @64Eip - @Base
DB 66h, 0b8h ; mov eax, imm32 DB 66h, 0b8h ; mov eax, imm32
SavedCr4 DD ? SavedCr4 DD ?
mov cr4, rax mov cr4, rax
;
; rdi in the instruction below is indeed bx in 16-bit code
;
DB 66h, 2eh DB 66h, 2eh
lgdt fword ptr [rdi + (SavedGdt - @Base)] lgdt fword ptr [rdi + (SavedGdt - @Base)]
DB 66h DB 66h