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