]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/CpuMpPei/Ia32: Use CodeSegment and DataSegment fields
authorJeff Fan <jeff.fan@intel.com>
Mon, 11 Jul 2016 05:21:10 +0000 (13:21 +0800)
committerJeff Fan <jeff.fan@intel.com>
Thu, 14 Jul 2016 01:41:20 +0000 (09:41 +0800)
Using CodeSegment and DataSegment fields in ExchangeInfo instead of the hardcode
MACROs.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Giri Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm
UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.nasm

index ab78bcc07b5972209232165259a1d142f633e372..97fdd9ef97411d40c39b14cd02db2dbc22191847 100644 (file)
@@ -1,5 +1,5 @@
 ;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -39,25 +39,34 @@ RendezvousFunnelProcStart::
 ; Save BIST information to ebp firstly\r
     db 66h,  08bh, 0e8h                 ; mov        ebp, eax    ; save BIST information\r
 \r
-    db 8ch,0c8h                         ; mov        ax,cs\r
-    db 8eh,0d8h                         ; mov        ds,ax\r
-    db 8eh,0c0h                         ; mov        es,ax\r
-    db 8eh,0d0h                         ; mov        ss,ax\r
-    db 33h,0c0h                         ; xor        ax,ax\r
-    db 8eh,0e0h                         ; mov        fs,ax\r
-    db 8eh,0e8h                         ; mov        gs,ax\r
+    db 8ch,0c8h                         ; mov        ax, cs\r
+    db 8eh,0d8h                         ; mov        ds, ax\r
+    db 8eh,0c0h                         ; mov        es, ax\r
+    db 8eh,0d0h                         ; mov        ss, ax\r
+    db 33h,0c0h                         ; xor        ax, ax\r
+    db 8eh,0e0h                         ; mov        fs, ax\r
+    db 8eh,0e8h                         ; mov        gs, ax\r
 \r
     db 0BEh                             ; opcode of mov si, mem16\r
     dw BufferStartLocation              ; mov        si, BufferStartLocation\r
-    db 66h,  8Bh, 1Ch                   ; mov        ebx,dword ptr [si]\r
+    db 66h,  8Bh, 1Ch                   ; mov        ebx, dword ptr [si]\r
 \r
-    db 0BFh                             ; opcode of mov di, mem16\r
-    dw PmodeOffsetLocation              ; mov        di, PmodeOffsetLocation\r
-    db 66h,  8Bh, 05h                   ; mov        eax,dword ptr [di]\r
-    db 8Bh,  0F8h                       ; mov        di, ax\r
-    db 83h,  0EFh,06h                   ; sub        di, 06h\r
-    db 66h,  03h, 0C3h                  ; add        eax, ebx\r
-    db 66h,  89h, 05h                   ; mov        dword ptr [di],eax\r
+    db 0BEh                             ; opcode of mov si, mem16\r
+    dw PmodeOffsetLocation              ; mov        si,  PmodeOffsetLocation\r
+    db 66h,  8Bh,  04h                  ; mov        eax, [si]\r
+    db 0BEh                             ; opcode of mov si, mem16\r
+    dw CodeSegmentLocation              ; mov        si,  CodeSegmentLocation\r
+    db 66h,  8Bh,  14h                  ; mov        edx, [si]\r
+    db 89h, 0C7h                        ; mov        di,  ax\r
+    db 83h, 0EFh,  02h                  ; sub        di,  02h\r
+    db 89h,  15h                        ; mov        [di], dx\r
+    db 83h, 0EFh,  04h                  ; sub        di,  04h\r
+    db 66h,  01h, 0D8h                  ; add        eax, ebx\r
+    db 66h,  89h,  05h                  ; mov        [di], eax\r
+\r
+    db 0BEh                             ; opcode of mov si, mem16\r
+    dw DataSegmentLocation              ; mov        si,  DataSegmentLocation\r
+    db 66h,  8Bh,  14h                  ; mov        edx, [si]\r
 \r
     db 0BEh                             ; opcode of mov si, mem16\r
     dw GdtrLocation                     ; mov        si, GdtrLocation\r
@@ -78,15 +87,14 @@ RendezvousFunnelProcStart::
 \r
     db 66h,  67h, 0EAh                  ; far jump\r
     dd 0h                               ; 32-bit offset\r
-    dw PROTECT_MODE_CS                  ; 16-bit selector\r
+    dw 0h                               ; 16-bit selector\r
 \r
 Flat32Start::                           ; protected mode entry point\r
-    mov        ax, PROTECT_MODE_DS\r
-    mov        ds, ax\r
-    mov        es, ax\r
-    mov        fs, ax\r
-    mov        gs, ax\r
-    mov        ss, ax\r
+    mov        ds, dx\r
+    mov        es, dx\r
+    mov        fs, dx\r
+    mov        gs, dx\r
+    mov        ss, dx\r
 \r
     mov        esi, ebx\r
     mov        edi, esi\r
index 2ff16dc297bc189245bf3df171aadfcac7c265cd..577ca4e31c8f5794a3cb09a103eccab7acf240bf 100644 (file)
@@ -1,5 +1,5 @@
 ;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -48,13 +48,20 @@ BITS 16
     mov        si,  BufferStartLocation\r
     mov        ebx, [si]\r
 \r
-    mov        di,  PmodeOffsetLocation\r
-    mov        eax, [di]\r
+    mov        si,  PmodeOffsetLocation\r
+    mov        eax, [si]\r
+    mov        si,  CodeSegmentLocation\r
+    mov        edx, [si]\r
     mov        di,  ax\r
-    sub        di,  06h\r
+    sub        di,  02h\r
+    mov        [di], dx\r
+    sub        di,  04h\r
     add        eax, ebx\r
     mov        [di],eax\r
 \r
+    mov        si,  DataSegmentLocation\r
+    mov        edx, [si]\r
+\r
     mov        si, GdtrLocation\r
 o32 lgdt       [cs:si]\r
 \r
@@ -68,15 +75,14 @@ o32 lidt       [cs:si]
     or         eax, 000000003h                 ;Set PE bit (bit #0) & MP\r
     mov        cr0, eax\r
 \r
-    jmp        PROTECT_MODE_CS:strict dword 0  ; far jump to protected mode\r
+    jmp        0:strict dword 0                ; far jump to protected mode\r
 BITS 32\r
 Flat32Start:                                   ; protected mode entry point\r
-    mov        ax, PROTECT_MODE_DS\r
-    mov        ds, ax\r
-    mov        es, ax\r
-    mov        fs, ax\r
-    mov        gs, ax\r
-    mov        ss, ax\r
+    mov        ds, dx\r
+    mov        es, dx\r
+    mov        fs, dx\r
+    mov        gs, dx\r
+    mov        ss, dx\r
 \r
     mov        esi, ebx\r
     mov        edi, esi\r