]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Fix the bug that we should use rip relative addressing for x64 label to prevent...
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 3 Jun 2009 08:15:18 +0000 (08:15 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 3 Jun 2009 08:15:18 +0000 (08:15 +0000)
2. Sync the bug fix of MS assembly in r8455.
3. Correct the function prototype in comments.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8456 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BaseLib/X64/DisablePaging64.S

index f3ed29ed402d3bc5cb37f37572af6948d4e08f3d..038af71d2f8b52de5db7fc9e1480b19d17424f51 100644 (file)
 # EFIAPI\r
 # InternalX86DisablePaging64 (\r
 #   IN      UINT16                    Cs,\r
-#   IN      UINT64                    EntryPoint,\r
-#   IN      UINT64                    Context1,  OPTIONAL\r
+#   IN      UINT32                    EntryPoint,\r
+#   IN      UINT32                    Context1,  OPTIONAL\r
 #   IN      UINT32                    Context2,  OPTIONAL\r
-#   IN      UINT64                    NewStack\r
+#   IN      UINT32                    NewStack\r
 #   );\r
 #------------------------------------------------------------------------------\r
 \r
 ASM_GLOBAL ASM_PFX(InternalX86DisablePaging64)\r
 ASM_PFX(InternalX86DisablePaging64):\r
     cli    \r
-    shl    $0x20,%rcx                     # rcx[32..47] <- Cs\r
-    lea    L1, %eax\r
+    lea    L1(%rip), %r10\r
     mov    %r8d, %esi \r
-    or     %rax, %rcx                     # rcx[0..47] <- Cs:@F\r
     mov    %r9d, %edi \r
     mov    0x28(%rsp), %eax               # eax <- New Stack\r
-    push   %rcx\r
-    ret                                   # switch to compatibility mode\r
+    push   %rcx                           # push Cs to stack\r
+    push   %r10\r
+    .byte  0x48, 0xcb                     # retq: Use far return to load CS register from stack\r
+                                          # (Use raw byte code since some GNU assemblers generates incorrect code for "retq")  \r
 L1:\r
     mov    %eax,%esp                      # set up new stack\r
     mov    %cr0,%rax\r