19IA32_IDT_GATE_DESCRIPTOR
21 IN UINT64 IdtEntryTemplate
25 IA32_IDT_GATE_DESCRIPTOR ExceptionHandler;
26 IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor;
29 ZeroMem ((VOID *)&ExceptionHandler,
sizeof (IA32_IDT_GATE_DESCRIPTOR));
31 *(UINT64 *) &ExceptionHandler = IdtEntryTemplate;
32 IdtGateDescriptor = &ExceptionHandler;
33 Entry = (IdtGateDescriptor->Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow;
35 IdtGateDescriptor->Bits.OffsetHigh = (UINT16)(Entry >> 16);
36 IdtGateDescriptor->Bits.OffsetLow = (UINT16)Entry;
38 return ExceptionHandler;
57 UINT32 TemporaryRamSize;
59 FspPlatformData = &FspData->PlatformData;
66 FspPlatformData->DataPtr =
NULL;
67 FspPlatformData->MicrocodeRegionBase = 0;
68 FspPlatformData->MicrocodeRegionSize = 0;
69 FspPlatformData->CodeRegionBase = 0;
70 FspPlatformData->CodeRegionSize = 0;
77 StackPtr = (UINT32 *)(TopOfCar -
sizeof (UINT32));
78 if ((*(StackPtr - 1) != FSP_MCUD_SIGNATURE) && (FspData->FspInfoHeader->ImageAttribute & BIT4)) {
80 if (TemporaryRamSize) {
81 TopOfCar =
PcdGet32 (PcdTemporaryRamBase) + TemporaryRamSize;
82 StackPtr = (UINT32 *)(TopOfCar -
sizeof (UINT32));
86 if (*(StackPtr - 1) == FSP_MCUD_SIGNATURE) {
87 while (*StackPtr != 0) {
88 if (*(StackPtr - 1) == FSP_MCUD_SIGNATURE) {
92 DataSize = *(StackPtr);
93 DataSize = DataSize /
sizeof (DataSize);
95 CopyMem (&(FspPlatformData->MicrocodeRegionBase), StackPtr + 1, 4 * sizeof (
UINTN));
96 }
else if (*(StackPtr - 1) == FSP_PER0_SIGNATURE) {
100 DataSize = *(StackPtr);
101 DataSize = DataSize /
sizeof (DataSize);
102 StackPtr -= DataSize;
103 CopyMem (FspData->PerfData, StackPtr + 1, 2 * sizeof (UINT64));
105 ((UINT8 *)(&FspData->PerfData[0]))[7] = FSP_PERF_ID_API_TEMP_RAM_INIT_ENTRY;
106 ((UINT8 *)(&FspData->PerfData[1]))[7] = FSP_PERF_ID_API_TEMP_RAM_INIT_EXIT;
108 StackPtr -= (*StackPtr);
131 VOID *FspmUpdDataPtr;
141 PeiFspData->Signature = FSP_GLOBAL_DATA_SIGNATURE;
142 PeiFspData->Version = FSP_GLOBAL_DATA_VERSION;
143 PeiFspData->CoreStack = BootLoaderStack;
144 PeiFspData->PerfIdx = 2;
145 PeiFspData->PerfSig = FSP_PERFORMANCE_DATA_SIGNATURE;
169 if (FspmUpdDataPtr ==
NULL) {
170 FspmUpdDataPtr = (VOID *)(
UINTN)(PeiFspData->FspInfoHeader->ImageBase + PeiFspData->FspInfoHeader->CfgRegionOffset);
180 if (
PcdGet8 (PcdFspHeapSizePercentage) != 0) {
200 for (Idx = 0; Idx < 8; Idx++) {
201 ImageId[Idx] = PeiFspData->FspInfoHeader->ImageId[Idx];
207 DEBUG_INFO | DEBUG_INIT,
208 "\n============= FSP Spec v%d.%d Header Revision v%x (%a v%x.%x.%x.%x) =============\n", \
209 (PeiFspData->FspInfoHeader->SpecVersion >> 4) & 0xF, \
210 PeiFspData->FspInfoHeader->SpecVersion & 0xF, \
211 PeiFspData->FspInfoHeader->HeaderRevision, \
213 (PeiFspData->FspInfoHeader->ImageRevision >> 24) & 0xFF, \
214 (PeiFspData->FspInfoHeader->ImageRevision >> 16) & 0xFF, \
215 (PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \
216 (((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF) | (PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF00)) : \
217 ((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF), \
218 (PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \
219 ((PeiFspData->FspInfoHeader->ImageRevision & 0xFF) | ((PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF) << 8)) : \
220 (PeiFspData->FspInfoHeader->ImageRevision & 0xFF)
RETURN_STATUS EFIAPI SerialPortInitialize(VOID)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
FSP_GLOBAL_DATA *EFIAPI GetFspGlobalDataPointer(VOID)
VOID EFIAPI SetFspMemoryInitUpdDataPointer(IN VOID *MemoryInitUpdPtr)
UINTN EFIAPI GetFspApiParameter2(VOID)
VOID EFIAPI SetFspUpdDataPointer(IN VOID *UpdDataPtr)
UINTN EFIAPI GetFspApiParameter(VOID)
VOID EFIAPI SetFspGlobalDataPointer(IN FSP_GLOBAL_DATA *FspData)
UINT64 EFIAPI SetFspMeasurePoint(IN UINT8 Id)
VOID EFIAPI SetFspApiCallingIndex(UINT8 Index)
VOID EFIAPI SetFspSiliconInitUpdDataPointer(IN VOID *SiliconInitUpdPtr)
#define DEBUG(Expression)
#define PcdGet8(TokenName)
#define PcdGet32(TokenName)
IA32_IDT_GATE_DESCRIPTOR FspGetExceptionHandler(IN UINT64 IdtEntryTemplate)
VOID FspDataPointerFixUp(IN UINTN OffsetGap)
VOID EFIAPI SecGetPlatformData(IN OUT FSP_GLOBAL_DATA *FspData)
VOID FspGlobalDataInit(IN OUT FSP_GLOBAL_DATA *PeiFspData, IN UINTN BootLoaderStack, IN UINT8 ApiIdx)
UINTN EFIAPI AsmGetFspInfoHeader(VOID)