#\r
#------------------------------------------------------------------------------\r
\r
-.globl ASM_PFX(InternalX86EnablePaging64)\r
+ASM_GLOBAL ASM_PFX(InternalX86EnablePaging64)\r
\r
#------------------------------------------------------------------------------\r
# VOID\r
#------------------------------------------------------------------------------\r
ASM_PFX(InternalX86EnablePaging64):\r
cli\r
- movl $LongStart, (%esp)\r
+ movl $LongStart, (%esp) # offset for far retf, seg is the 1st arg\r
movl %cr4, %eax\r
orb $0x20, %al\r
movl %eax, %cr4 # enable PAE\r
orb $1, %ah # set LME\r
wrmsr\r
movl %cr0, %eax\r
- btsl $31, %eax\r
+ btsl $31, %eax # set PG\r
movl %eax, %cr0 # enable paging\r
- lret\r
+ lret # topmost 2 dwords hold the address\r
LongStart: # long mode starts here\r
- .byte 0x67, 0x48\r
+ .byte 0x67, 0x48 # 32-bit address size, 64-bit operand size\r
movl (%esp), %ebx # mov rbx, [esp]\r
.byte 0x67, 0x48\r
movl 8(%esp), %ecx # mov rcx, [esp + 8]\r
.byte 0x67, 0x48\r
movl 0x18(%esp), %esp # mov rsp, [esp + 18h]\r
.byte 0x48\r
- addl $0x-0x20, %esp # add rsp, -20h\r
+ addl $0x-0x20, %esp # add rsp, -20h\r
call *%ebx # call rbx\r
- jmp .\r
+ jmp . # no one should get here\r