]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/X64/DisablePaging64.asm
1. Added comments to ASM files
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / DisablePaging64.asm
index 2609c941aa0a0aa2d715ba14249342396e00320d..518137ddc9ee3f8777024bec5b18795f6aac3cf6 100644 (file)
 ;------------------------------------------------------------------------------\r
 InternalX86DisablePaging64    PROC\r
     cli\r
-    shl     rcx, 32\r
+    shl     rcx, 32                     ; rcx[32..47] <- Cs\r
     lea     eax, @F\r
-    mov     ecx, eax\r
-    push    rcx\r
-    mov     ebx, edx\r
     mov     esi, r8d\r
+    or      rcx, rax                    ; rcx[0..47] <- Cs:@F\r
     mov     edi, r9d\r
-    mov     eax, [rsp + 28h]\r
-    retf\r
+    mov     eax, [rsp + 28h]            ; eax <- New Stack\r
+    push    rcx\r
+    retf                                ; switch to compatibility mode\r
 @@:\r
     mov     esp, eax                    ; set up new stack\r
     mov     rax, cr0\r
@@ -57,10 +56,10 @@ InternalX86DisablePaging64    PROC
     mov     rax, cr4\r
     and     al, NOT (1 SHL 5)           ; clear PAE\r
     mov     cr4, rax\r
-    push    rdi\r
-    push    rsi\r
-    call    rbx\r
-    jmp     $\r
+    push    rdi                         ; push Context2\r
+    push    rsi                         ; push Context1\r
+    call    rdx                         ; transfer control to EntryPoint\r
+    hlt                                 ; no one should get here\r
 InternalX86DisablePaging64    ENDP\r
 \r
     END\r