]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/XenPlatformPei/Fv.c
OvmfPkg/XenPlatformPei: no hvmloader: get the E820 table via hypercall
[mirror_edk2.git] / OvmfPkg / XenPlatformPei / Fv.c
CommitLineData
3b96221f
AP
1/** @file\r
2 Build FV related hobs for platform.\r
3\r
4 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
5 Copyright (c) 2019, Citrix Systems, Inc.\r
6\r
7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
8\r
9**/\r
10\r
11#include "PiPei.h"\r
12#include "Platform.h"\r
13#include <Library/DebugLib.h>\r
14#include <Library/HobLib.h>\r
15#include <Library/PeiServicesLib.h>\r
16#include <Library/PcdLib.h>\r
17\r
18\r
19/**\r
20 Publish PEI & DXE (Decompressed) Memory based FVs to let PEI\r
21 and DXE know about them.\r
22\r
23 @retval EFI_SUCCESS Platform PEI FVs were initialized successfully.\r
24\r
25**/\r
26EFI_STATUS\r
27PeiFvInitialization (\r
28 VOID\r
29 )\r
30{\r
31 DEBUG ((DEBUG_INFO, "Platform PEI Firmware Volume Initialization\n"));\r
32\r
33 //\r
34 // Create a memory allocation HOB for the PEI FV.\r
35 //\r
36 // Allocate as ACPI NVS is S3 is supported\r
37 //\r
38 BuildMemoryAllocationHob (\r
39 PcdGet32 (PcdOvmfPeiMemFvBase),\r
40 PcdGet32 (PcdOvmfPeiMemFvSize),\r
41 EfiBootServicesData\r
42 );\r
43\r
44 //\r
45 // Let DXE know about the DXE FV\r
46 //\r
47 BuildFvHob (PcdGet32 (PcdOvmfDxeMemFvBase), PcdGet32 (PcdOvmfDxeMemFvSize));\r
48\r
49 //\r
50 // Create a memory allocation HOB for the DXE FV.\r
51 //\r
52 // If "secure" S3 is needed, then SEC will decompress both PEI and DXE\r
53 // firmware volumes at S3 resume too, hence we need to keep away the OS from\r
54 // DXEFV as well. Otherwise we only need to keep away DXE itself from the\r
55 // DXEFV area.\r
56 //\r
57 BuildMemoryAllocationHob (\r
58 PcdGet32 (PcdOvmfDxeMemFvBase),\r
59 PcdGet32 (PcdOvmfDxeMemFvSize),\r
60 EfiBootServicesData\r
61 );\r
62\r
63 //\r
64 // Let PEI know about the DXE FV so it can find the DXE Core\r
65 //\r
66 PeiServicesInstallFvInfoPpi (\r
67 NULL,\r
68 (VOID *)(UINTN) PcdGet32 (PcdOvmfDxeMemFvBase),\r
69 PcdGet32 (PcdOvmfDxeMemFvSize),\r
70 NULL,\r
71 NULL\r
72 );\r
73\r
74 return EFI_SUCCESS;\r
75}\r
76\r