Update IntelFspPkg according to FSP1.1.
[mirror_edk2.git] / IntelFspWrapperPkg / FspInitPei / SecFspInitDone.c
1 /** @file
2 Install FspInitDone PPI and GetFspHobList API.
3
4 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15
16 #include "SecMain.h"
17
18 FSP_INIT_DONE_PPI gFspInitDonePpi = {
19 FspInitDoneGetFspHobList
20 };
21
22 /**
23 Return Hob list produced by FSP.
24
25 @param[in] PeiServices The pointer to the PEI Services Table.
26 @param[in] This The pointer to this instance of this PPI.
27 @param[out] FspHobList The pointer to Hob list produced by FSP.
28
29 @return EFI_SUCCESS FReturn Hob list produced by FSP successfully.
30 **/
31 EFI_STATUS
32 EFIAPI
33 FspInitDoneGetFspHobList (
34 IN CONST EFI_PEI_SERVICES **PeiServices,
35 IN FSP_INIT_DONE_PPI *This,
36 OUT VOID **FspHobList
37 )
38 {
39 VOID *TopOfTemporaryRamPpi;
40 EFI_STATUS Status;
41
42 Status = (*PeiServices)->LocatePpi (
43 PeiServices,
44 &gTopOfTemporaryRamPpiGuid,
45 0,
46 NULL,
47 (VOID **) &TopOfTemporaryRamPpi
48 );
49 if (EFI_ERROR (Status)) {
50 return EFI_NOT_FOUND;
51 }
52
53 *FspHobList = (VOID *)(UINTN)(*(UINT32 *)((UINTN)TopOfTemporaryRamPpi - sizeof(UINT32)));
54
55 return EFI_SUCCESS;
56 }
57