]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Fixed hang/reset in thunk code when building with GCC X64
authorgeekboy15a <geekboy15a@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 2 Aug 2011 22:29:50 +0000 (22:29 +0000)
committergeekboy15a <geekboy15a@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 2 Aug 2011 22:29:50 +0000 (22:29 +0000)
Reverted changes of data areas from .long back to .space 4.  This was done
because the size of .long is based off of .int and may vary.  Using a fixed size
is required because these values are for patching code.  Also note that .space
will automatically initialize the data to zero.  Not initializing all values to
zero was causing the hang/reset.

Signed-off-by: geekboy15a
Reviewed-by: darylm503
Reviewed-by: jljusten
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12079 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BaseLib/X64/Thunk16.S

index dabf2d09e1b699eef2f911a05440d59fca4fc48b..54753168c885f90fee33bfa60fc304793a08c808 100644 (file)
@@ -125,7 +125,7 @@ L_2:
     .byte 0x66,0x2e,0x89,0x87           # mov cs:[bx + (L_64Eip - L_Base)], eax\r
     .word   L_64Eip - L_Base\r
     .byte 0x66,0xb8                     # mov eax, imm32\r
-L_SavedCr4:   .long  0\r
+L_SavedCr4: .space      4\r
     movq    %rax, %cr4\r
     #\r
     # rdi in the instruction below is indeed bx in 16-bit code\r
@@ -138,15 +138,15 @@ L_SavedCr4:   .long  0
     orb     $1,%ah\r
     wrmsr\r
     .byte 0x66,0xb8                     # mov eax, imm32\r
-L_SavedCr0:    .long      \r
+L_SavedCr0: .space      4\r
     movq    %rax, %cr0\r
     .byte 0x66,0xea                     # jmp far cs:L_64Bit\r
-L_64Eip:     .long       0\r
-L_SavedCs:     .space      2\r
-L_64BitCode: \r
+L_64Eip:    .space      4\r
+L_SavedCs:  .space      2\r
+L_64BitCode:\r
     .byte   0x90\r
     .byte   0x67,0xbc                  # mov esp, imm32\r
-L_SavedSp:    .long                      # restore stack\r
+L_SavedSp:  .space      4              # restore stack\r
     nop\r
     ret\r
 \r