; Following functions will be provided in PlatformSecLib\r
;\r
EXTERN GetFspBaseAddress:PROC\r
+EXTERN GetFspInfoHdr:PROC\r
EXTERN GetBootFirmwareVolumeOffset:PROC\r
-EXTERN Pei2LoaderSwitchStack:PROC\r
+EXTERN Loader2PeiSwitchStack:PROC\r
EXTERN LoadMicrocode(LoadMicrocodeDefault):PROC\r
EXTERN SecPlatformInit(SecPlatformInitDefault):PROC\r
EXTERN SecCarInit:PROC\r
jz NemInitExit\r
\r
;\r
- ; CPUID/DeviceID check\r
- ; and Sec Platform Init\r
+ ; Sec Platform Init\r
;\r
CALL_MMX SecPlatformInit\r
cmp eax, 0\r
jz @F\r
cmp eax, 3 ; FspMemoryInit API\r
jz @F\r
- jmp Pei2LoaderSwitchStack\r
+\r
+ call GetFspInfoHdr\r
+ jmp Loader2PeiSwitchStack\r
\r
@@:\r
;\r
;\r
\r
;\r
- ; Store the address in FSP which will return control to the BL\r
+ ; Place holder to store the FspInfoHeader pointer\r
;\r
- push offset exit\r
+ push eax\r
+\r
+ ;\r
+ ; Update the FspInfoHeader pointer\r
+ ;\r
+ push eax\r
+ call GetFspInfoHdr\r
+ mov [esp + 4], eax\r
+ pop eax\r
\r
;\r
; Create a Task Frame in the stack for the Boot Loader\r
; Pass Control into the PEI Core\r
;\r
call SecStartup\r
-\r
+ add esp, 4\r
exit:\r
ret\r
\r
#\r
# Following functions will be provided in PlatformSecLib\r
#\r
+ASM_GLOBAL ASM_PFX(GetFspBaseAddress)\r
+ASM_GLOBAL ASM_PFX(GetFspInfoHdr)\r
ASM_GLOBAL ASM_PFX(GetBootFirmwareVolumeOffset)\r
-ASM_GLOBAL ASM_PFX(Pei2LoaderSwitchStack)\r
+ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)\r
\r
\r
#\r
jz NemInitExit\r
\r
#\r
- # CPUID/DeviceID check\r
- # and Sec Platform Init\r
+ # Sec Platform Init\r
#\r
movl $TempRamInitApiL1, %esi #CALL_MMX SecPlatformInit\r
movd %esi, %mm7\r
jz FspApiCommonL2\r
cmpl $0x03, %eax # FspMemoryInit API\r
jz FspApiCommonL2\r
- jmp Pei2LoaderSwitchStack\r
+ call ASM_PFX(GetFspInfoHdr)\r
+ jmp Loader2PeiSwitchStack\r
\r
FspApiCommonL2:\r
#\r
# \r
\r
#\r
- # Store the address in FSP which will return control to the BL\r
+ # Place holder to store the FspInfoHeader pointer\r
#\r
- pushl $FspApiCommonExit\r
+ pushl %eax\r
+\r
+ #\r
+ # Update the FspInfoHeader pointer\r
+ #\r
+ pushl %eax\r
+ call ASM_PFX(GetFspInfoHdr)\r
+ movl %eax, 4(%esp)\r
+ popl %eax\r
\r
#\r
# Create a Task Frame in the stack for the Boot Loader\r
# Pass Control into the PEI Core\r
#\r
call ASM_PFX(SecStartup)\r
-\r
+ addl $4, %esp\r
FspApiCommonExit:\r
ret\r
\r
.model flat,C\r
.code\r
\r
-FspInfoHeaderRelativeOff PROC NEAR PRIVATE\r
+FspInfoHeaderRelativeOff PROC NEAR PUBLIC\r
;\r
; This value will be pached by the build script\r
;\r
ret\r
GetFspBaseAddress ENDP\r
\r
+GetFspInfoHdr PROC NEAR PUBLIC\r
+ mov eax, GetFspBaseAddress\r
+ sub eax, dword ptr [FspInfoHeaderRelativeOff]\r
+ ret\r
+GetFspInfoHdr ENDP\r
+\r
END
\ No newline at end of file
mov (%eax), %eax\r
ret\r
\r
+ASM_GLOBAL ASM_PFX(GetFspInfoHdr)\r
+ASM_PFX(GetFspInfoHdr):\r
+ mov $GetFspBaseAddress, %eax\r
+ sub $FspInfoHeaderRelativeOff, %eax\r
+ ret\r
/** @file\r
Intel FSP API definition from Intel Firmware Support Package External\r
- Architecture Specification, April 2014, revision 001.\r
+ Architecture Specification v1.1, April 2015, revision 001.\r
\r
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
/** @file\r
Intel FSP Info Header definition from Intel Firmware Support Package External\r
- Architecture Specification, April 2014, revision 001.\r
+ Architecture Specification v1.1, April 2015, revision 001.\r
\r
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
/** @file\r
Intel FSP Header File Guid definition from Intel Firmware Support Package External\r
- Architecture Specification, April 2014, revision 001.\r
+ Architecture Specification v1.1, April 2015, revision 001.\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
/** @file\r
Intel FSP Hob Guid definition from Intel Firmware Support Package External\r
- Architecture Specification, April 2014, revision 001.\r
+ Architecture Specification v1.1, April 2015, revision 001.\r
\r
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
VOID\r
);\r
\r
+/**\r
+ This function gets the FSP info header pointer from the API context.\r
+\r
+ @retval FspInfoHeader FSP info header pointer\r
+**/\r
+FSP_INFO_HEADER *\r
+EFIAPI\r
+GetFspInfoHeaderFromApiContext (\r
+ VOID\r
+ );\r
+\r
/**\r
This function gets the VPD data pointer.\r
\r
// API Parameter +0x34\r
// API return address +0x30\r
//\r
-// push offset exit +0x2C\r
+// push FspInfoHeader +0x2C\r
// pushfd +0x28\r
// cli\r
// pushad +0x24\r
UINT32 Ecx;\r
UINT32 Eax;\r
UINT16 Flags[2];\r
- UINT32 ExitOff;\r
+ UINT32 FspInfoHeader;\r
UINT32 ApiRet;\r
UINT32 ApiParam;\r
} CONTEXT_STACK;\r
return GetFspGlobalDataPointer()->FspInfoHeader;\r
}\r
\r
+/**\r
+ This function gets the FSP info header pointer using the API stack context.\r
+\r
+ @retval FspInfoHeader FSP info header pointer using the API stack context\r
+**/\r
+FSP_INFO_HEADER *\r
+EFIAPI\r
+GetFspInfoHeaderFromApiContext (\r
+ VOID\r
+ )\r
+{\r
+ FSP_GLOBAL_DATA *FspData;\r
+\r
+ FspData = GetFspGlobalDataPointer ();\r
+ return (FSP_INFO_HEADER *)(*(UINT32 *)(UINTN)(FspData->CoreStack + CONTEXT_STACK_OFFSET(FspInfoHeader)));\r
+}\r
+\r
/**\r
This function gets the VPD data pointer.\r
\r
;------------------------------------------------------------------------------\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
;------------------------------------------------------------------------------\r
EXTERNDEF C MeasurePoint:PROC\r
Pei2LoaderSwitchStack PROC C PUBLIC\r
- jmp Loader2PeiSwitchStack\r
+ xor eax, eax\r
+ jmp FspSwitchStack\r
Pei2LoaderSwitchStack ENDP\r
\r
;------------------------------------------------------------------------------\r
; VOID\r
; )\r
;------------------------------------------------------------------------------\r
-EXTERNDEF C SwapStack:PROC\r
Loader2PeiSwitchStack PROC C PUBLIC\r
+ jmp FspSwitchStack\r
+Loader2PeiSwitchStack ENDP\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT32\r
+; EFIAPI\r
+; FspSwitchStack (\r
+; VOID\r
+; )\r
+;------------------------------------------------------------------------------\r
+EXTERNDEF C SwapStack:PROC\r
+FspSwitchStack PROC C PUBLIC\r
; Save current contexts\r
- push offset exit\r
+ push eax\r
pushfd\r
cli\r
pushad\r
add esp, 8\r
popad\r
popfd\r
-exit:\r
+ add esp, 4\r
ret\r
-Loader2PeiSwitchStack ENDP\r
+FspSwitchStack ENDP\r
\r
END\r
#------------------------------------------------------------------------------\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
+ 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 $exit\r
+ push %eax\r
pushf\r
cli\r
pusha\r
add $0x08,%esp\r
popa\r
popf\r
-exit:\r
+ add $0x04,%esp\r
ret\r
\r
\r