X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseLib%2FX64%2FDisablePaging64.asm;h=518137ddc9ee3f8777024bec5b18795f6aac3cf6;hp=2609c941aa0a0aa2d715ba14249342396e00320d;hb=a9a812a0ed4ab3d83941fdc6da281aebdb9bb296;hpb=741fb364170375f89aa9c29488cc402db07a3776 diff --git a/MdePkg/Library/BaseLib/X64/DisablePaging64.asm b/MdePkg/Library/BaseLib/X64/DisablePaging64.asm index 2609c941aa..518137ddc9 100644 --- a/MdePkg/Library/BaseLib/X64/DisablePaging64.asm +++ b/MdePkg/Library/BaseLib/X64/DisablePaging64.asm @@ -36,15 +36,14 @@ ;------------------------------------------------------------------------------ InternalX86DisablePaging64 PROC cli - shl rcx, 32 + shl rcx, 32 ; rcx[32..47] <- Cs lea eax, @F - mov ecx, eax - push rcx - mov ebx, edx mov esi, r8d + or rcx, rax ; rcx[0..47] <- Cs:@F mov edi, r9d - mov eax, [rsp + 28h] - retf + mov eax, [rsp + 28h] ; eax <- New Stack + push rcx + retf ; switch to compatibility mode @@: mov esp, eax ; set up new stack mov rax, cr0 @@ -57,10 +56,10 @@ InternalX86DisablePaging64 PROC mov rax, cr4 and al, NOT (1 SHL 5) ; clear PAE mov cr4, rax - push rdi - push rsi - call rbx - jmp $ + push rdi ; push Context2 + push rsi ; push Context1 + call rdx ; transfer control to EntryPoint + hlt ; no one should get here InternalX86DisablePaging64 ENDP END