#------------------------------------------------------------------------------\r
#\r
-# Copyright (c) 2006, Intel Corporation\r
+# Copyright (c) 2006 - 2008, Intel Corporation\r
# All rights reserved. This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
#\r
# Module Name:\r
#\r
-# EnablePaging64.Asm\r
+# EnablePaging64.S\r
#\r
# Abstract:\r
#\r
#\r
#------------------------------------------------------------------------------\r
\r
-.global _InternalX86EnablePaging64\r
+.globl ASM_PFX(InternalX86EnablePaging64)\r
\r
#------------------------------------------------------------------------------\r
# VOID\r
# IN UINT64 NewStack\r
# );\r
#------------------------------------------------------------------------------\r
-_InternalX86EnablePaging64:\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-20, %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