From 1a76fbef8415e2cf57210272c26d3102d835484e Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Wed, 3 Jun 2009 08:11:34 +0000 Subject: 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 --- MdePkg/Library/BaseLib/X64/DisablePaging64.asm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'MdePkg') 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 -- cgit v1.2.3