]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/X64/DisablePaging64.S
Fix the bug that EntryPoint of DisablePaging64() is corrupted.
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / DisablePaging64.S
index a55059e3bec99bd7c4c7d9f80dde23f012a3f3a1..8c71d2d49e25425a19bb6873b92c8aaeea00186a 100644 (file)
@@ -51,6 +51,8 @@ L1:
     mov    %cr0,%rax\r
     btr    $0x1f,%eax\r
     mov    %rax,%cr0                      # disable paging\r
+\r
+    mov    %rdx,%rbx                      # save EntryPoint to rbx, for rdmsr will overwrite rdx\r
     mov    $0xc0000080,%ecx\r
     rdmsr  \r
     and    $0xfe,%ah                      # clear LME\r
@@ -60,6 +62,6 @@ L1:
     mov    %rax,%cr4\r
     push   %rdi                           # push Context2\r
     push   %rsi                           # push Context1\r
-    callq  *%rdx                          # transfer control to EntryPoint\r
+    callq  *%rbx                          # transfer control to EntryPoint\r
     jmp    .                              # no one should get here\r
 \r