diff options
author | bxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-05-24 05:33:03 +0000 |
---|---|---|
committer | bxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-05-24 05:33:03 +0000 |
commit | 18c319ae39f741101ccf0b076bb749e05344d443 (patch) | |
tree | 2ff98855267f75d38c3235c911c15db2ecd0dd4a /MdePkg/Library/BaseLib/X64/Thunk16.asm | |
parent | 4df60ea54fd2ee5bf97586f453165ab3533a1aec (diff) | |
download | edk2-platforms-18c319ae39f741101ccf0b076bb749e05344d443.tar.xz |
1. Updated CpuFlushTlb() according to IA-64 programmer's guide
2. Updated Thunk code to preserve EFLAGS/RFLAGS across real mode code invocation
3. Updated comments in x86Thunk.c
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@248 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseLib/X64/Thunk16.asm')
-rw-r--r-- | MdePkg/Library/BaseLib/X64/Thunk16.asm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/MdePkg/Library/BaseLib/X64/Thunk16.asm b/MdePkg/Library/BaseLib/X64/Thunk16.asm index 15aaa80090..3121867ebb 100644 --- a/MdePkg/Library/BaseLib/X64/Thunk16.asm +++ b/MdePkg/Library/BaseLib/X64/Thunk16.asm @@ -149,6 +149,11 @@ _ToUserCode PROC call @Base ; push eip
@Base:
pop bp ; ebp <- offset @Base
+ push [esp + sizeof (IA32_REGS) + 2]
+ lea eax, [rsi + (offset @RealMode - offset @Base)]
+ push rax
+ retf
+@RealMode:
DB 2eh ; cs:
mov [rsi + (offset SavedSs - offset @Base)], edi
DB 2eh ; cs:
@@ -222,7 +227,9 @@ InternalAsmThunk16 PROC USES rbp rbx rsi rdi push 10h
pop rdx ; rdx <- selector for data segments
lgdt fword ptr [rcx + (offset _16Gdtr - offset SavedCr4)]
+ pushfq
call fword ptr [rcx + (offset _EntryPoint - offset SavedCr4)]
+ popfq
lidt fword ptr [rsp + 38h] ; restore protected mode IDTR
lea eax, [rbp - sizeof (IA32_REGS)]
pop gs
|