]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/Ia32/EnablePaging64.asm
Fixed GCC 4.4 build issue due to incorrect prefix. Now using ASM_PFX to correctly...
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / EnablePaging64.asm
index 6c9b0ea76bca8a44de6914f218b73ca1b13c4975..435bb391058fabcd55d4d28e5592987272469574 100644 (file)
     .model  flat,C\r
     .code\r
 \r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; InternalX86EnablePaging64 (\r
+;   IN      UINT16                    Cs,\r
+;   IN      UINT64                    EntryPoint,\r
+;   IN      UINT64                    Context1,  OPTIONAL\r
+;   IN      UINT64                    Context2,  OPTIONAL\r
+;   IN      UINT64                    NewStack\r
+;   );\r
+;------------------------------------------------------------------------------\r
 InternalX86EnablePaging64 PROC\r
     cli\r
-    mov     [esp], @F                   ; offset for far retf\r
+    mov     [esp], @F                   ; offset for far retf, seg is the 1st arg\r
     mov     eax, cr4\r
     or      al, (1 SHL 5)\r
     mov     cr4, eax                    ; enable PAE\r
@@ -36,11 +47,11 @@ InternalX86EnablePaging64 PROC
     or      ah, 1                       ; set LME\r
     wrmsr\r
     mov     eax, cr0\r
-    bts     eax, 31\r
+    bts     eax, 31                     ; set PG\r
     mov     cr0, eax                    ; enable paging\r
-    retf\r
+    retf                                ; topmost 2 dwords hold the address\r
 @@:                                     ; long mode starts here\r
-    DB      67h, 48h\r
+    DB      67h, 48h                    ; 32-bit address size, 64-bit operand size\r
     mov     ebx, [esp]                  ; mov rbx, [esp]\r
     DB      67h, 48h\r
     mov     ecx, [esp + 8]              ; mov rcx, [esp + 8]\r
@@ -51,7 +62,7 @@ InternalX86EnablePaging64 PROC
     DB      48h\r
     add     esp, -20h                   ; add rsp, -20h\r
     call    ebx                         ; call rbx\r
-    jmp     $\r
+    hlt                                 ; no one should get here\r
 InternalX86EnablePaging64 ENDP\r
 \r
     END\r