summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-03 08:15:18 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-03 08:15:18 +0000
commit2561f5654062a6b36f006400e20f508073f91f36 (patch)
tree025c9a4b4571366c0a7c9aeac146a2513ffcf9e9 /MdePkg
parent1a76fbef8415e2cf57210272c26d3102d835484e (diff)
downloadedk2-2561f5654062a6b36f006400e20f508073f91f36.zip
edk2-2561f5654062a6b36f006400e20f508073f91f36.tar.gz
edk2-2561f5654062a6b36f006400e20f508073f91f36.tar.bz2
1. Fix the bug that we should use rip relative addressing for x64 label to prevent GNU assembly generate incorrect code.
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
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/BaseLib/X64/DisablePaging64.S16
1 files changed, 8 insertions, 8 deletions
diff --git a/MdePkg/Library/BaseLib/X64/DisablePaging64.S b/MdePkg/Library/BaseLib/X64/DisablePaging64.S
index f3ed29e..038af71 100644
--- a/MdePkg/Library/BaseLib/X64/DisablePaging64.S
+++ b/MdePkg/Library/BaseLib/X64/DisablePaging64.S
@@ -28,24 +28,24 @@
# EFIAPI
# InternalX86DisablePaging64 (
# IN UINT16 Cs,
-# IN UINT64 EntryPoint,
-# IN UINT64 Context1, OPTIONAL
+# IN UINT32 EntryPoint,
+# IN UINT32 Context1, OPTIONAL
# IN UINT32 Context2, OPTIONAL
-# IN UINT64 NewStack
+# IN UINT32 NewStack
# );
#------------------------------------------------------------------------------
ASM_GLOBAL ASM_PFX(InternalX86DisablePaging64)
ASM_PFX(InternalX86DisablePaging64):
cli
- shl $0x20,%rcx # rcx[32..47] <- Cs
- lea L1, %eax
+ lea L1(%rip), %r10
mov %r8d, %esi
- or %rax, %rcx # rcx[0..47] <- Cs:@F
mov %r9d, %edi
mov 0x28(%rsp), %eax # eax <- New Stack
- push %rcx
- ret # switch to compatibility mode
+ push %rcx # push Cs to stack
+ push %r10
+ .byte 0x48, 0xcb # retq: Use far return to load CS register from stack
+ # (Use raw byte code since some GNU assemblers generates incorrect code for "retq")
L1:
mov %eax,%esp # set up new stack
mov %cr0,%rax