]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.nasm
UefiCpuPkg/CpuMpPei: Remove un-used variables and functions
[mirror_edk2.git] / UefiCpuPkg / CpuMpPei / Ia32 / MpFuncs.nasm
index 5d2da82d148c6a6fd957e766f9204fae6839243f..fc9db873fc1210caa9fdcdb36a04425387c0c4c3 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
@@ -132,12 +138,6 @@ CProcedureInvoke:
     jmp        $                 ; never reach here\r
 RendezvousFunnelProcEnd:\r
 \r
-global ASM_PFX(AsmCliHltLoop)\r
-ASM_PFX(AsmCliHltLoop):\r
-    cli\r
-    hlt\r
-    jmp        $-2\r
-\r
 ;-------------------------------------------------------------------------------------\r
 ;  AsmGetAddressMap (&AddressMap);\r
 ;-------------------------------------------------------------------------------------\r
@@ -228,28 +228,3 @@ OtherLoaded:
 \r
     popad\r
     ret\r
-\r
-global ASM_PFX(AsmInitializeGdt)\r
-ASM_PFX(AsmInitializeGdt):\r
-  push         ebp\r
-  mov          ebp, esp\r
-  pushad\r
-  mov          edi, [ebp + 8]      ; Load GDT register\r
-\r
-  lgdt         [edi]      ; and update the GDTR\r
-\r
-  push         PROTECT_MODE_CS\r
-  mov          eax, ASM_PFX(SetCodeSelectorFarJump)\r
-  push         eax\r
-  retf\r
-ASM_PFX(SetCodeSelectorFarJump):\r
-  mov          ax, PROTECT_MODE_DS ; Update the Base for the new selectors, too\r
-  mov          ds, ax\r
-  mov          es, ax\r
-  mov          fs, ax\r
-  mov          gs, ax\r
-  mov          ss, ax\r
-\r
-  popad\r
-  pop          ebp\r
-  ret\r