2 This PEIM will parse the hoblist from fsp and report them into pei core.
3 This file contains the main entrypoint of the PEIM.
5 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include <Library/DebugLib.h>
20 #include <Ppi/TopOfTemporaryRam.h>
21 #include <Ppi/SecPlatformInformation.h>
24 Save BIST value before call FspInit.
26 @param Bist BIST value.
34 Save Ticker value before call FspInit.
36 @param Ticker Ticker value.
44 Save SEC context before call FspInit.
46 @param PeiServices Pointer to PEI Services Table.
51 IN CONST EFI_PEI_SERVICES
**PeiServices
58 UINT32 TopOfTemporaryRam
;
59 VOID
*TopOfTemporaryRamPpi
;
62 DEBUG ((DEBUG_INFO
, "SaveSecContext - 0x%x\n", PeiServices
));
64 Status
= (*PeiServices
)->LocatePpi (
66 &gTopOfTemporaryRamPpiGuid
,
69 (VOID
**) &TopOfTemporaryRamPpi
71 if (EFI_ERROR (Status
)) {
75 DEBUG ((DEBUG_INFO
, "TopOfTemporaryRamPpi - 0x%x\n", TopOfTemporaryRamPpi
));
78 // The entries of BIST information, together with the number of them,
79 // reside in the bottom of stack, left untouched by normal stack operation.
80 // This routine copies the BIST information to the buffer pointed by
81 // PlatformInformationRecord for output.
83 // |--------------| <- TopOfTemporaryRam
96 TopOfTemporaryRam
= (UINT32
)(UINTN
)TopOfTemporaryRamPpi
- sizeof(UINT32
);
97 TopOfTemporaryRam
-= sizeof(UINT32
) * 2;
98 DEBUG ((DEBUG_INFO
, "TopOfTemporaryRam - 0x%x\n", TopOfTemporaryRam
));
99 Count
= *(UINT32
*)(UINTN
)(TopOfTemporaryRam
- sizeof(UINT32
));
100 DEBUG ((DEBUG_INFO
, "Count - 0x%x\n", Count
));
101 Size
= Count
* sizeof (IA32_HANDOFF_STATUS
);
102 DEBUG ((DEBUG_INFO
, "Size - 0x%x\n", Size
));
104 Bist
= (UINT32
*)(UINTN
)(TopOfTemporaryRam
- sizeof(UINT32
) - Size
);
105 DEBUG ((DEBUG_INFO
, "Bist - 0x%x\n", *Bist
));
106 Ticker
= (UINT64
*)(UINTN
)(TopOfTemporaryRam
- sizeof(UINT32
) - Size
- sizeof(UINT64
));
107 DEBUG ((DEBUG_INFO
, "Ticker - 0x%lx\n", *Ticker
));
110 // Just need record BSP
112 AsmSaveBistValue (*Bist
);
113 AsmSaveTickerValue (*Ticker
);