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