# );\r
#------------------------------------------------------------------------------\r
\r
-.global ASM_PFX(InternalX86DisablePaging64)\r
+ASM_GLOBAL ASM_PFX(InternalX86DisablePaging64)\r
ASM_PFX(InternalX86DisablePaging64):\r
cli \r
shl $0x20,%rcx # rcx[32..47] <- Cs\r
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
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