summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/X64
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseLib/X64')
-rw-r--r--MdePkg/Library/BaseLib/X64/DisablePaging64.asm10
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