]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspPkg/Library/BaseFspSwitchStackLib/Ia32/Stack.s
Add dual FSP binaries support.
[mirror_edk2.git] / IntelFspPkg / Library / BaseFspSwitchStackLib / Ia32 / Stack.s
index 6932cd8448cae645217b5297086a169d0ed1a919..a21a5b6c61f8928cf550c2973d77253569286d13 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #\r
-# Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2015, 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
@@ -15,8 +15,6 @@
 #\r
 #------------------------------------------------------------------------------\r
 \r
-ASM_GLOBAL ASM_PFX(Pei2LoaderSwitchStack)\r
-ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)\r
 \r
 #------------------------------------------------------------------------------\r
 # UINT32\r
@@ -27,38 +25,54 @@ ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)
 #------------------------------------------------------------------------------\r
 ASM_GLOBAL ASM_PFX(Pei2LoaderSwitchStack)\r
 ASM_PFX(Pei2LoaderSwitchStack):\r
-    jmp     ASM_PFX(Loader2PeiSwitchStack)\r
+    xorl    %eax, %eax\r
+    jmp     ASM_PFX(FspSwitchStack)\r
 \r
 #------------------------------------------------------------------------------\r
 # UINT32\r
 # EFIAPI\r
 # Loader2PeiSwitchStack (\r
+#   VOID\r
 #   )\r
 #------------------------------------------------------------------------------\r
 ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)\r
 ASM_PFX(Loader2PeiSwitchStack):\r
-#Save current contexts\r
-    push    $exit\r
-    pushf\r
+    jmp     ASM_PFX(FspSwitchStack)\r
+\r
+#------------------------------------------------------------------------------\r
+# UINT32\r
+# EFIAPI\r
+# FspSwitchStack (\r
+#   VOID\r
+#   )\r
+#------------------------------------------------------------------------------\r
+ASM_GLOBAL ASM_PFX(FspSwitchStack)\r
+ASM_PFX(FspSwitchStack):\r
+    #\r
+    #Save current contexts\r
+    #\r
+    push    %eax\r
     pushf\r
     cli\r
     pusha\r
-    push    $0x0\r
-    push    $0x0\r
+    sub     $0x08, %esp\r
     sidt    (%esp)\r
 \r
+    #\r
     # Load new stack\r
+    #\r
     push   %esp\r
     call   ASM_PFX(SwapStack)\r
-    mov    %eax,%esp\r
+    movl   %eax, %esp\r
 \r
+    #\r
     # Restore previous contexts\r
+    #\r
     lidt    (%esp)\r
-    add     $8,%esp\r
+    add     $0x08,%esp\r
     popa\r
     popf\r
-    popf\r
-exit:\r
+    add     $0x04,%esp\r
     ret\r
 \r
 \r