]> git.proxmox.com Git - mirror_edk2.git/blame - UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
UefiPayloadPkg: Create gUniversalPayloadSmbiosTableGuid Hob
[mirror_edk2.git] / UefiPayloadPkg / UefiPayloadEntry / UefiPayloadEntry.h
CommitLineData
7c4ab1c2
GD
1/** @file\r
2*\r
302a8f35 3* Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r
7c4ab1c2
GD
4*\r
5* SPDX-License-Identifier: BSD-2-Clause-Patent\r
6*\r
7**/\r
8\r
9#ifndef __UEFI_PAYLOAD_ENTRY_H__\r
10#define __UEFI_PAYLOAD_ENTRY_H__\r
11\r
12#include <PiPei.h>\r
13\r
14#include <Library/BaseLib.h>\r
15#include <Library/BaseMemoryLib.h>\r
16#include <Library/MemoryAllocationLib.h>\r
17#include <Library/DebugLib.h>\r
18#include <Library/PeCoffLib.h>\r
19#include <Library/HobLib.h>\r
20#include <Library/PcdLib.h>\r
21#include <Guid/MemoryAllocationHob.h>\r
22#include <Library/IoLib.h>\r
23#include <Library/PeCoffLib.h>\r
24#include <Library/BlParseLib.h>\r
25#include <Library/PlatformSupportLib.h>\r
26#include <Library/UefiCpuLib.h>\r
27#include <IndustryStandard/Acpi.h>\r
28#include <IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h>\r
29#include <Guid/SerialPortInfoGuid.h>\r
30#include <Guid/SystemTableInfoGuid.h>\r
31#include <Guid/MemoryMapInfoGuid.h>\r
32#include <Guid/AcpiBoardInfoGuid.h>\r
33#include <Guid/GraphicsInfoHob.h>\r
302a8f35 34#include <UniversalPayload/SmbiosTable.h>\r
7c4ab1c2
GD
35\r
36\r
37#define LEGACY_8259_MASK_REGISTER_MASTER 0x21\r
38#define LEGACY_8259_MASK_REGISTER_SLAVE 0xA1\r
39#define GET_OCCUPIED_SIZE(ActualSize, Alignment) \\r
40 ((ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) & ((Alignment) - 1)))\r
41\r
42/**\r
43 Auto-generated function that calls the library constructors for all of the module's\r
44 dependent libraries.\r
45**/\r
46VOID\r
47EFIAPI\r
48ProcessLibraryConstructorList (\r
49 VOID\r
50 );\r
51\r
52/**\r
53 Add a new HOB to the HOB List.\r
54\r
55 @param HobType Type of the new HOB.\r
56 @param HobLength Length of the new HOB to allocate.\r
57\r
58 @return NULL if there is no space to create a hob.\r
59 @return The address point to the new created hob.\r
60\r
61**/\r
62VOID *\r
63EFIAPI\r
64CreateHob (\r
65 IN UINT16 HobType,\r
66 IN UINT16 HobLength\r
67 );\r
68\r
69/**\r
70 Update the Stack Hob if the stack has been moved\r
71\r
72 @param BaseAddress The 64 bit physical address of the Stack.\r
73 @param Length The length of the stack in bytes.\r
74\r
75**/\r
76VOID\r
77EFIAPI\r
78UpdateStackHob (\r
79 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
80 IN UINT64 Length\r
81 );\r
82\r
83/**\r
84 Build a Handoff Information Table HOB\r
85\r
86 This function initialize a HOB region from EfiMemoryBegin with length\r
87 EfiMemoryLength. And EfiFreeMemoryBottom and EfiFreeMemoryTop should\r
88 be inside the HOB region.\r
89\r
90 @param[in] EfiMemoryBegin Total memory start address\r
91 @param[in] EfiMemoryLength Total memory length reported in handoff HOB.\r
92 @param[in] EfiFreeMemoryBottom Free memory start address\r
93 @param[in] EfiFreeMemoryTop Free memory end address.\r
94\r
95 @return The pointer to the handoff HOB table.\r
96\r
97**/\r
98EFI_HOB_HANDOFF_INFO_TABLE*\r
99EFIAPI\r
100HobConstructor (\r
101 IN VOID *EfiMemoryBegin,\r
102 IN UINTN EfiMemoryLength,\r
103 IN VOID *EfiFreeMemoryBottom,\r
104 IN VOID *EfiFreeMemoryTop\r
105 );\r
106\r
107/**\r
108 Find DXE core from FV and build DXE core HOBs.\r
109\r
110 @param[out] DxeCoreEntryPoint DXE core entry point\r
111\r
112 @retval EFI_SUCCESS If it completed successfully.\r
113 @retval EFI_NOT_FOUND If it failed to load DXE FV.\r
114**/\r
115EFI_STATUS\r
116LoadDxeCore (\r
117 OUT PHYSICAL_ADDRESS *DxeCoreEntryPoint\r
118 );\r
119\r
120/**\r
121 Transfers control to DxeCore.\r
122\r
123 This function performs a CPU architecture specific operations to execute\r
124 the entry point of DxeCore with the parameters of HobList.\r
125\r
126 @param DxeCoreEntryPoint The entry point of DxeCore.\r
127 @param HobList The start of HobList passed to DxeCore.\r
128**/\r
129VOID\r
130HandOffToDxeCore (\r
131 IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,\r
132 IN EFI_PEI_HOB_POINTERS HobList\r
133 );\r
134\r
135#endif\r