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/Ia32/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/Ia32/Thunk16.asm')
-rw-r--r-- | MdePkg/Library/BaseLib/Ia32/Thunk16.asm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/MdePkg/Library/BaseLib/Ia32/Thunk16.asm b/MdePkg/Library/BaseLib/Ia32/Thunk16.asm index 89d4f679b6..454b8905bc 100644 --- a/MdePkg/Library/BaseLib/Ia32/Thunk16.asm +++ b/MdePkg/Library/BaseLib/Ia32/Thunk16.asm @@ -141,6 +141,12 @@ _ToUserCode PROC call @Base ; push eip
@Base:
pop bp ; ebp <- offset @Base
+ DB 67h ; address size override
+ push [esp + sizeof (IA32_REGS) + 2]
+ lea eax, [esi + (offset @RealMode - offset @Base)]
+ push eax
+ retf
+@RealMode:
mov cs:[esi + (offset SavedSs - offset @Base)], edx
mov cs:[esi + (offset SavedEsp - offset @Base)], bx
DB 66h
@@ -208,7 +214,9 @@ InternalAsmThunk16 PROC USES ebp ebx esi edi ds es fs gs push 10h
pop ecx ; ecx <- selector for data segments
lgdt fword ptr [edx + (offset _16Gdtr - offset SavedCr0)]
+ pushfd
call fword ptr [edx + (offset _EntryPoint - offset SavedCr0)]
+ popfd
lidt fword ptr [esp + 36] ; restore protected mode IDTR
lea eax, [ebp - sizeof (IA32_REGS)]
ret
|