]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Library/PeilessStartupLib/PeilessStartupInternal.h
OvmfPkg: Implement MeasureHobList/MeasureFvImage
[mirror_edk2.git] / OvmfPkg / Library / PeilessStartupLib / PeilessStartupInternal.h
CommitLineData
4fe26784
MX
1/** @file\r
2\r
3 Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r
4\r
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9#ifndef PEILESS_STARTUP_INTERNAL_LIB_H_\r
10#define PEILESS_STARTUP_INTERNAL_LIB_H_\r
11\r
12#include <PiPei.h>\r
13#include <Library/BaseLib.h>\r
14#include <Uefi/UefiSpec.h>\r
15#include <Uefi/UefiBaseType.h>\r
16#include <IndustryStandard/IntelTdx.h>\r
17\r
18EFI_STATUS\r
19EFIAPI\r
20DxeLoadCore (\r
21 IN INTN FvInstance\r
22 );\r
23\r
24VOID\r
25EFIAPI\r
26TransferHobList (\r
27 IN CONST VOID *HobStart\r
28 );\r
29\r
30/**\r
31 * This function is to find a memory region which is the largest one below 4GB.\r
32 * It will be used as the firmware hoblist.\r
33 *\r
34 * @param VmmHobList Vmm passed hoblist which constains the memory information.\r
35 * @return EFI_SUCCESS Successfully construct the firmware hoblist.\r
36 * @return EFI_NOT_FOUND Cannot find a memory region to be the fw hoblist.\r
37 */\r
38EFI_STATUS\r
39EFIAPI\r
40ConstructFwHobList (\r
41 IN CONST VOID *VmmHobList\r
42 );\r
43\r
44/**\r
45 * Construct the HobList in SEC phase.\r
46 *\r
47 * @return EFI_SUCCESS Successfully construct the firmware hoblist.\r
48 * @return EFI_NOT_FOUND Cannot find a memory region to be the fw hoblist.\r
49 */\r
50EFI_STATUS\r
51EFIAPI\r
52ConstructSecHobList (\r
53 );\r
54\r
4b0a6226
MX
55/**\r
56 Check the integrity of CFV data.\r
57\r
58 @param[in] TdxCfvBase - A pointer to CFV header\r
59 @param[in] TdxCfvSize - CFV data size\r
60\r
61 @retval TRUE - The CFV data is valid.\r
62 @retval FALSE - The CFV data is invalid.\r
63\r
64**/\r
65BOOLEAN\r
66EFIAPI\r
67TdxValidateCfv (\r
68 IN UINT8 *TdxCfvBase,\r
69 IN UINT32 TdxCfvSize\r
70 );\r
71\r
ff0ffe59
MX
72/**\r
73 Measure the Hoblist passed from the VMM.\r
74\r
75 @param[in] VmmHobList The Hoblist pass the firmware\r
76\r
77 @retval EFI_SUCCESS Fv image is measured successfully\r
78 or it has been already measured.\r
79 @retval Others Other errors as indicated\r
80**/\r
81EFI_STATUS\r
82EFIAPI\r
83MeasureHobList (\r
84 IN CONST VOID *VmmHobList\r
85 );\r
86\r
87/**\r
88 Measure FV image.\r
89\r
90 @param[in] FvBase Base address of FV image.\r
91 @param[in] FvLength Length of FV image.\r
92 @param[in] PcrIndex Index of PCR\r
93\r
94 @retval EFI_SUCCESS Fv image is measured successfully\r
95 or it has been already measured.\r
96 @retval EFI_OUT_OF_RESOURCES No enough memory to log the new event.\r
97 @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
98\r
99**/\r
100EFI_STATUS\r
101EFIAPI\r
102MeasureFvImage (\r
103 IN EFI_PHYSICAL_ADDRESS FvBase,\r
104 IN UINT64 FvLength,\r
105 IN UINT8 PcrIndex\r
106 );\r
107\r
4fe26784 108#endif\r