/** @file\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
#include <PiPei.h>\r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/PcdLib.h>\r
#include <Library/HobLib.h>\r
VOID\r
)\r
{\r
- FSP_INIT_RT_COMMON_BUFFER *FspInitRtBuffer;\r
- UINT32 BootLoaderTempRamStart;\r
- UINT32 BootLoaderTempRamEnd;\r
- UINT32 BootLoaderTempRamSize;\r
- UINT32 OffsetGap;\r
- UINT32 FspParamPtr;\r
- FSP_INIT_PARAMS *FspInitParams;\r
- UINT32 *NewStackTop;\r
- VOID *BootLoaderTempRamHob;\r
- VOID *UpdDataRgnPtr;\r
- VOID *PlatformDataPtr;\r
+ FSP_INIT_RT_COMMON_BUFFER *FspInitRtBuffer;\r
+ UINT32 BootLoaderTempRamStart;\r
+ UINT32 BootLoaderTempRamEnd;\r
+ UINT32 BootLoaderTempRamSize;\r
+ UINT32 OffsetGap;\r
+ UINT32 FspParamPtr;\r
+ FSP_INIT_PARAMS *FspInitParams;\r
+ UINT32 *NewStackTop;\r
+ VOID *BootLoaderTempRamHob;\r
+ VOID *UpdDataRgnPtr;\r
+ VOID *PlatformDataPtr;\r
+ UINT8 ApiMode;\r
+ \r
+ ApiMode = GetFspApiCallingMode ();\r
\r
//\r
// Get the temporary memory range used by the bootloader\r
//\r
// Build a Boot Loader Temporary Memory GUID HOB\r
//\r
- BootLoaderTempRamHob = BuildGuidHob (&gFspBootLoaderTemporaryMemoryGuid, BootLoaderTempRamSize);\r
+ if (ApiMode == 0) {\r
+ BootLoaderTempRamHob = BuildGuidHob (&gFspBootLoaderTemporaryMemoryGuid, BootLoaderTempRamSize);\r
+ } else {\r
+ BootLoaderTempRamHob = (VOID *)AllocatePool (BootLoaderTempRamSize);\r
+ }\r
+ ASSERT(BootLoaderTempRamHob != NULL);\r
+\r
CopyMem (BootLoaderTempRamHob, (VOID *)BootLoaderTempRamStart, BootLoaderTempRamSize);\r
OffsetGap = (UINT32)BootLoaderTempRamHob - BootLoaderTempRamStart;\r
\r
//\r
// Set a new stack frame for the continuation function\r
//\r
- FspInitParams = (FSP_INIT_PARAMS *)GetFspApiParameter ();\r
- FspInitRtBuffer = (FSP_INIT_RT_COMMON_BUFFER *)FspInitParams->RtBufferPtr;\r
- NewStackTop = (UINT32 *)FspInitRtBuffer->StackTop - 1;\r
- SetFspCoreStackPointer (NewStackTop);\r
+ if (ApiMode == 0) {\r
+ FspInitParams = (FSP_INIT_PARAMS *)GetFspApiParameter ();\r
+ FspInitRtBuffer = (FSP_INIT_RT_COMMON_BUFFER *)FspInitParams->RtBufferPtr;\r
+ NewStackTop = (UINT32 *)FspInitRtBuffer->StackTop - 1;\r
+ SetFspCoreStackPointer (NewStackTop);\r
+ }\r
\r
//\r
// Fix the FspInit Parameter Pointers to the new location.\r
((UINT32)PlatformDataPtr < BootLoaderTempRamEnd)) {\r
SetFspPlatformDataPointer ((UINT8 *)PlatformDataPtr + OffsetGap);\r
}\r
-\r
}\r