]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/XenPlatformPei/Fv.c
OvmfPkg: Apply uncrustify changes
[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
3b96221f
AP
18/**\r
19 Publish PEI & DXE (Decompressed) Memory based FVs to let PEI\r
20 and DXE know about them.\r
21\r
22 @retval EFI_SUCCESS Platform PEI FVs were initialized successfully.\r
23\r
24**/\r
25EFI_STATUS\r
26PeiFvInitialization (\r
27 VOID\r
28 )\r
29{\r
30 DEBUG ((DEBUG_INFO, "Platform PEI Firmware Volume Initialization\n"));\r
31\r
32 //\r
33 // Create a memory allocation HOB for the PEI FV.\r
34 //\r
35 // Allocate as ACPI NVS is S3 is supported\r
36 //\r
37 BuildMemoryAllocationHob (\r
38 PcdGet32 (PcdOvmfPeiMemFvBase),\r
39 PcdGet32 (PcdOvmfPeiMemFvSize),\r
40 EfiBootServicesData\r
41 );\r
42\r
43 //\r
44 // Let DXE know about the DXE FV\r
45 //\r
46 BuildFvHob (PcdGet32 (PcdOvmfDxeMemFvBase), PcdGet32 (PcdOvmfDxeMemFvSize));\r
47\r
48 //\r
49 // Create a memory allocation HOB for the DXE FV.\r
50 //\r
51 // If "secure" S3 is needed, then SEC will decompress both PEI and DXE\r
52 // firmware volumes at S3 resume too, hence we need to keep away the OS from\r
53 // DXEFV as well. Otherwise we only need to keep away DXE itself from the\r
54 // DXEFV area.\r
55 //\r
56 BuildMemoryAllocationHob (\r
57 PcdGet32 (PcdOvmfDxeMemFvBase),\r
58 PcdGet32 (PcdOvmfDxeMemFvSize),\r
59 EfiBootServicesData\r
60 );\r
61\r
62 //\r
63 // Let PEI know about the DXE FV so it can find the DXE Core\r
64 //\r
65 PeiServicesInstallFvInfoPpi (\r
66 NULL,\r
ac0a286f 67 (VOID *)(UINTN)PcdGet32 (PcdOvmfDxeMemFvBase),\r
3b96221f
AP
68 PcdGet32 (PcdOvmfDxeMemFvSize),\r
69 NULL,\r
70 NULL\r
71 );\r
72\r
73 return EFI_SUCCESS;\r
74}\r