diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-03 08:11:34 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-03 08:11:34 +0000 |
commit | 1a76fbef8415e2cf57210272c26d3102d835484e (patch) | |
tree | 1feac57265db69f59b450223bf8bf71681c8e2e5 | |
parent | 693c4e024fffeec9907583c0becaaa49cb277bf8 (diff) | |
download | edk2-platforms-1a76fbef8415e2cf57210272c26d3102d835484e.tar.xz |
Save label "@F" to 64-bit register (r10) instead of 32-bit register (eax) in case label @F is above 4G.
Use "far retq" to load CS and 64-bit rip instead.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8455 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdePkg/Library/BaseLib/X64/DisablePaging64.asm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/MdePkg/Library/BaseLib/X64/DisablePaging64.asm b/MdePkg/Library/BaseLib/X64/DisablePaging64.asm index 29bf558e6c..f11f6ff291 100644 --- a/MdePkg/Library/BaseLib/X64/DisablePaging64.asm +++ b/MdePkg/Library/BaseLib/X64/DisablePaging64.asm @@ -36,14 +36,14 @@ ;------------------------------------------------------------------------------
InternalX86DisablePaging64 PROC
cli
- shl rcx, 32 ; rcx[32..47] <- Cs
- lea eax, @F
+ lea r10, @F
mov esi, r8d
- or rcx, rax ; rcx[0..47] <- Cs:@F
mov edi, r9d
mov eax, [rsp + 28h] ; eax <- New Stack
- push rcx
- retf ; switch to compatibility mode
+ push rcx ; push Cs to stack
+ push r10
+ DB 48h ; prefix to composite "retq" with next "retf"
+ retf ; Use far return to load CS register from stack
@@:
mov esp, eax ; set up new stack
mov rax, cr0
|