summaryrefslogtreecommitdiffstats
path: root/MdePkg
diff options
context:
space:
mode:
authoryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-23 09:05:19 +0000
committeryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-23 09:05:19 +0000
commit733f4094eece02888d5bc8413a9367ea58137133 (patch)
tree3e8af74c0eb69944151684a0a6d613efdda25a0a /MdePkg
parent2d57c546e05ca2385a81b2f4280eae2861263759 (diff)
downloadedk2-733f4094eece02888d5bc8413a9367ea58137133.tar.gz
edk2-733f4094eece02888d5bc8413a9367ea58137133.tar.bz2
edk2-733f4094eece02888d5bc8413a9367ea58137133.zip
To Fix PVCS 429.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2007 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/BaseLib/X64/Thunk16.asm11
1 files changed, 9 insertions, 2 deletions
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