]> git.proxmox.com Git - mirror_edk2.git/commitdiff
To Fix PVCS 429.
authoryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 23 Nov 2006 09:05:19 +0000 (09:05 +0000)
committeryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 23 Nov 2006 09:05:19 +0000 (09:05 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2007 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BaseLib/X64/Thunk16.asm

index b77ba680429ce4db049a53d53954fc3620796720..642310869b6fe6ec6574f56ed387f054dd9cab03 100644 (file)
@@ -96,18 +96,25 @@ _ThunkAttr  DD      ?
 @2:\r
     mov     eax, ss\r
     lea     bp, [esp + sizeof (IA32_REGS)]\r
+    ;\r
+    ; rsi in the following 2 instructions is indeed bp in 16-bit code\r
+    ;\r
     mov     word ptr (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._ESP, bp\r
+    DB      66h\r
     mov     ebx, (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._EIP\r
     shl     ax, 4                       ; shl eax, 4\r
     add     bp, ax                      ; add ebp, eax\r
     mov     ax, cs\r
     shl     ax, 4\r
     lea     ax, [eax + ebx + (@64BitCode - @Base)]\r
-    DB      2eh                         ; cs:\r
-    mov     [rdi + (@64Eip - @Base)], ax\r
+    DB      66h, 2eh, 89h, 87h          ; mov cs:[bx + (@64Eip - @Base)], eax\r
+    DW      @64Eip - @Base\r
     DB      66h, 0b8h                   ; mov eax, imm32\r
 SavedCr4    DD      ?\r
     mov     cr4, rax\r
+    ;\r
+    ; rdi in the instruction below is indeed bx in 16-bit code\r
+    ;\r
     DB      66h, 2eh\r
     lgdt    fword ptr [rdi + (SavedGdt - @Base)]\r
     DB      66h\r