X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFsp2Pkg%2FFspSecCore%2FSecFsp.c;h=216f7bb6c5eca797f888a3aa790d407d91b4d03f;hp=04b43c10d094ee1a0d8152b7e82f014cc7e50aae;hb=HEAD;hpb=630df8c86eac64f918aa74f52cbf042db033d3db diff --git a/IntelFsp2Pkg/FspSecCore/SecFsp.c b/IntelFsp2Pkg/FspSecCore/SecFsp.c index 04b43c10d0..11be1f97ca 100644 --- a/IntelFsp2Pkg/FspSecCore/SecFsp.c +++ b/IntelFsp2Pkg/FspSecCore/SecFsp.c @@ -16,19 +16,20 @@ @return FSP specific IDT gate descriptor. **/ -UINT64 +IA32_IDT_GATE_DESCRIPTOR FspGetExceptionHandler ( IN UINT64 IdtEntryTemplate ) { UINT32 Entry; - UINT64 ExceptionHandler; + IA32_IDT_GATE_DESCRIPTOR ExceptionHandler; IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor; FSP_INFO_HEADER *FspInfoHeader; + ZeroMem ((VOID *)&ExceptionHandler, sizeof (IA32_IDT_GATE_DESCRIPTOR)); FspInfoHeader = (FSP_INFO_HEADER *)(UINTN)AsmGetFspInfoHeader (); - ExceptionHandler = IdtEntryTemplate; - IdtGateDescriptor = (IA32_IDT_GATE_DESCRIPTOR *)&ExceptionHandler; + *(UINT64 *) &ExceptionHandler = IdtEntryTemplate; + IdtGateDescriptor = &ExceptionHandler; Entry = (IdtGateDescriptor->Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow; Entry = FspInfoHeader->ImageBase + FspInfoHeader->ImageSize - (~Entry + 1); IdtGateDescriptor->Bits.OffsetHigh = (UINT16)(Entry >> 16); @@ -130,10 +131,14 @@ FspGlobalDataInit ( ZeroMem ((VOID *)PeiFspData, sizeof (FSP_GLOBAL_DATA)); PeiFspData->Signature = FSP_GLOBAL_DATA_SIGNATURE; - PeiFspData->Version = 0; + PeiFspData->Version = FSP_GLOBAL_DATA_VERSION; PeiFspData->CoreStack = BootLoaderStack; PeiFspData->PerfIdx = 2; PeiFspData->PerfSig = FSP_PERFORMANCE_DATA_SIGNATURE; + // + // Cache FspHobList pointer passed by bootloader via ApiParameter2 + // + PeiFspData->FspHobListPtr = (VOID **)GetFspApiParameter2 (); SetFspMeasurePoint (FSP_PERF_ID_API_FSP_MEMORY_INIT_ENTRY); @@ -200,11 +205,11 @@ FspGlobalDataInit ( (PeiFspData->FspInfoHeader->ImageRevision >> 24) & 0xFF, \ (PeiFspData->FspInfoHeader->ImageRevision >> 16) & 0xFF, \ (PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \ - (((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF) | (PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF00)) :\ - ((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF), \ + (((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF) | (PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF00)) : \ + ((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF), \ (PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \ - ((PeiFspData->FspInfoHeader->ImageRevision & 0xFF) | ((PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF) << 8)): \ - (PeiFspData->FspInfoHeader->ImageRevision & 0xFF) + ((PeiFspData->FspInfoHeader->ImageRevision & 0xFF) | ((PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF) << 8)) : \ + (PeiFspData->FspInfoHeader->ImageRevision & 0xFF) )); }