1 | /** @file
|
---|
2 | *
|
---|
3 | * Copyright (c) 2020, 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 |
|
---|
35 |
|
---|
36 | #define LEGACY_8259_MASK_REGISTER_MASTER 0x21
|
---|
37 | #define LEGACY_8259_MASK_REGISTER_SLAVE 0xA1
|
---|
38 | #define GET_OCCUPIED_SIZE(ActualSize, Alignment) \
|
---|
39 | ((ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) & ((Alignment) - 1)))
|
---|
40 |
|
---|
41 | /**
|
---|
42 | Auto-generated function that calls the library constructors for all of the module's
|
---|
43 | dependent libraries.
|
---|
44 | **/
|
---|
45 | VOID
|
---|
46 | EFIAPI
|
---|
47 | ProcessLibraryConstructorList (
|
---|
48 | VOID
|
---|
49 | );
|
---|
50 |
|
---|
51 | /**
|
---|
52 | Add a new HOB to the HOB List.
|
---|
53 |
|
---|
54 | @param HobType Type of the new HOB.
|
---|
55 | @param HobLength Length of the new HOB to allocate.
|
---|
56 |
|
---|
57 | @return NULL if there is no space to create a hob.
|
---|
58 | @return The address point to the new created hob.
|
---|
59 |
|
---|
60 | **/
|
---|
61 | VOID *
|
---|
62 | EFIAPI
|
---|
63 | CreateHob (
|
---|
64 | IN UINT16 HobType,
|
---|
65 | IN UINT16 HobLength
|
---|
66 | );
|
---|
67 |
|
---|
68 | /**
|
---|
69 | Update the Stack Hob if the stack has been moved
|
---|
70 |
|
---|
71 | @param BaseAddress The 64 bit physical address of the Stack.
|
---|
72 | @param Length The length of the stack in bytes.
|
---|
73 |
|
---|
74 | **/
|
---|
75 | VOID
|
---|
76 | EFIAPI
|
---|
77 | UpdateStackHob (
|
---|
78 | IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
---|
79 | IN UINT64 Length
|
---|
80 | );
|
---|
81 |
|
---|
82 | /**
|
---|
83 | Build a Handoff Information Table HOB
|
---|
84 |
|
---|
85 | This function initialize a HOB region from EfiMemoryBegin with length
|
---|
86 | EfiMemoryLength. And EfiFreeMemoryBottom and EfiFreeMemoryTop should
|
---|
87 | be inside the HOB region.
|
---|
88 |
|
---|
89 | @param[in] EfiMemoryBegin Total memory start address
|
---|
90 | @param[in] EfiMemoryLength Total memory length reported in handoff HOB.
|
---|
91 | @param[in] EfiFreeMemoryBottom Free memory start address
|
---|
92 | @param[in] EfiFreeMemoryTop Free memory end address.
|
---|
93 |
|
---|
94 | @return The pointer to the handoff HOB table.
|
---|
95 |
|
---|
96 | **/
|
---|
97 | EFI_HOB_HANDOFF_INFO_TABLE*
|
---|
98 | EFIAPI
|
---|
99 | HobConstructor (
|
---|
100 | IN VOID *EfiMemoryBegin,
|
---|
101 | IN UINTN EfiMemoryLength,
|
---|
102 | IN VOID *EfiFreeMemoryBottom,
|
---|
103 | IN VOID *EfiFreeMemoryTop
|
---|
104 | );
|
---|
105 |
|
---|
106 | /**
|
---|
107 | Find DXE core from FV and build DXE core HOBs.
|
---|
108 |
|
---|
109 | @param[out] DxeCoreEntryPoint DXE core entry point
|
---|
110 |
|
---|
111 | @retval EFI_SUCCESS If it completed successfully.
|
---|
112 | @retval EFI_NOT_FOUND If it failed to load DXE FV.
|
---|
113 | **/
|
---|
114 | EFI_STATUS
|
---|
115 | LoadDxeCore (
|
---|
116 | OUT PHYSICAL_ADDRESS *DxeCoreEntryPoint
|
---|
117 | );
|
---|
118 |
|
---|
119 | /**
|
---|
120 | Transfers control to DxeCore.
|
---|
121 |
|
---|
122 | This function performs a CPU architecture specific operations to execute
|
---|
123 | the entry point of DxeCore with the parameters of HobList.
|
---|
124 |
|
---|
125 | @param DxeCoreEntryPoint The entry point of DxeCore.
|
---|
126 | @param HobList The start of HobList passed to DxeCore.
|
---|
127 | **/
|
---|
128 | VOID
|
---|
129 | HandOffToDxeCore (
|
---|
130 | IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,
|
---|
131 | IN EFI_PEI_HOB_POINTERS HobList
|
---|
132 | );
|
---|
133 |
|
---|
134 | #endif
|
---|