From: qhuang8 Date: Wed, 3 Jun 2009 08:15:18 +0000 (+0000) Subject: 1. Fix the bug that we should use rip relative addressing for x64 label to prevent... X-Git-Tag: edk2-stable201903~17823 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=2561f5654062a6b36f006400e20f508073f91f36 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 --- diff --git a/MdePkg/Library/BaseLib/X64/DisablePaging64.S b/MdePkg/Library/BaseLib/X64/DisablePaging64.S index f3ed29ed40..038af71d2f 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