]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/Ia32/EnablePaging64.S
sync comments.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / EnablePaging64.S
index 45ae2f306b6c9aa84d46d6c9e91a10dab1816609..ce9d3eb2d95aee001fb2e40e40df0962f19bf274 100644 (file)
@@ -36,7 +36,7 @@
 #------------------------------------------------------------------------------\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
@@ -45,11 +45,11 @@ ASM_PFX(InternalX86EnablePaging64):
     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
@@ -58,6 +58,6 @@ LongStart:                              # long mode starts here
     .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