From: yshang1 Date: Thu, 23 Nov 2006 09:05:19 +0000 (+0000) Subject: To Fix PVCS 429. X-Git-Tag: edk2-stable201903~23870 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=733f4094eece02888d5bc8413a9367ea58137133;ds=sidebyside To Fix PVCS 429. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2007 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdePkg/Library/BaseLib/X64/Thunk16.asm b/MdePkg/Library/BaseLib/X64/Thunk16.asm index b77ba68042..642310869b 100644 --- a/MdePkg/Library/BaseLib/X64/Thunk16.asm +++ b/MdePkg/Library/BaseLib/X64/Thunk16.asm @@ -96,18 +96,25 @@ _ThunkAttr DD ? @2: mov eax, ss 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 + DB 66h mov ebx, (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._EIP shl ax, 4 ; shl eax, 4 add bp, ax ; add ebp, eax mov ax, cs shl ax, 4 lea ax, [eax + ebx + (@64BitCode - @Base)] - DB 2eh ; cs: - mov [rdi + (@64Eip - @Base)], ax + DB 66h, 2eh, 89h, 87h ; mov cs:[bx + (@64Eip - @Base)], eax + DW @64Eip - @Base DB 66h, 0b8h ; mov eax, imm32 SavedCr4 DD ? mov cr4, rax + ; + ; rdi in the instruction below is indeed bx in 16-bit code + ; DB 66h, 2eh lgdt fword ptr [rdi + (SavedGdt - @Base)] DB 66h