]> git.proxmox.com Git - mirror_edk2.git/blame - UefiPayloadPkg/Include/Library/BlParseLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / UefiPayloadPkg / Include / Library / BlParseLib.h
CommitLineData
04af8bf2
DG
1/** @file\r
2 This library will parse the coreboot table in memory and extract those required\r
3 information.\r
4\r
422e5d2f 5 Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>\r
04af8bf2
DG
6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
7\r
8**/\r
e5efcf8b 9\r
6ef57974
GD
10#ifndef BOOTLOADER_PARSE_LIB_\r
11#define BOOTLOADER_PARSE_LIB_\r
12\r
04af8bf2
DG
13#include <PiPei.h>\r
14#include <Guid/GraphicsInfoHob.h>\r
15#include <Guid/MemoryMapInfoGuid.h>\r
16#include <Guid/SerialPortInfoGuid.h>\r
04af8bf2 17#include <Guid/AcpiBoardInfoGuid.h>\r
e7663fdd
KBT
18#include <UniversalPayload/AcpiTable.h>\r
19#include <UniversalPayload/SmbiosTable.h>\r
04af8bf2 20\r
e5efcf8b 21#define GET_BOOTLOADER_PARAMETER() PcdGet64 (PcdBootloaderParameter)\r
04af8bf2
DG
22\r
23typedef RETURN_STATUS \\r
e5efcf8b
MK
24(*BL_MEM_INFO_CALLBACK) (\r
25 MEMORY_MAP_ENTRY *MemoryMapEntry,\r
26 VOID *Param\r
27 );\r
04af8bf2
DG
28\r
29/**\r
30 This function retrieves the parameter base address from boot loader.\r
31\r
32 This function will get bootloader specific parameter address for UEFI payload.\r
33 e.g. HobList pointer for Slim Bootloader, and coreboot table header for Coreboot.\r
34\r
35 @retval NULL Failed to find the GUID HOB.\r
36 @retval others GUIDed HOB data pointer.\r
37\r
38**/\r
39VOID *\r
40EFIAPI\r
41GetParameterBase (\r
42 VOID\r
43 );\r
44\r
45/**\r
46 Acquire the memory map information.\r
47\r
48 @param MemInfoCallback The callback routine\r
49 @param Params Pointer to the callback routine parameter\r
50\r
51 @retval RETURN_SUCCESS Successfully find out the memory information.\r
52 @retval RETURN_NOT_FOUND Failed to find the memory information.\r
53\r
54**/\r
55RETURN_STATUS\r
56EFIAPI\r
57ParseMemoryInfo (\r
e5efcf8b
MK
58 IN BL_MEM_INFO_CALLBACK MemInfoCallback,\r
59 IN VOID *Params\r
04af8bf2
DG
60 );\r
61\r
62/**\r
e7663fdd 63 Acquire SMBIOS table from bootloader.\r
04af8bf2 64\r
e7663fdd 65 @param SmbiosTable Pointer to the system table info\r
04af8bf2
DG
66\r
67 @retval RETURN_SUCCESS Successfully find out the tables.\r
68 @retval RETURN_NOT_FOUND Failed to find the tables.\r
69\r
70**/\r
71RETURN_STATUS\r
72EFIAPI\r
e7663fdd 73ParseSmbiosTable (\r
e5efcf8b 74 OUT UNIVERSAL_PAYLOAD_SMBIOS_TABLE *SmbiosTable\r
04af8bf2
DG
75 );\r
76\r
e7663fdd
KBT
77/**\r
78 Acquire ACPI table from bootloader.\r
79\r
80 @param AcpiTableHob Pointer to the ACPI table info.\r
81\r
82 @retval RETURN_SUCCESS Successfully find out the tables.\r
83 @retval RETURN_NOT_FOUND Failed to find the tables.\r
84\r
85**/\r
86RETURN_STATUS\r
87EFIAPI\r
88ParseAcpiTableInfo (\r
e5efcf8b 89 OUT UNIVERSAL_PAYLOAD_ACPI_TABLE *AcpiTableHob\r
e7663fdd 90 );\r
04af8bf2
DG
91\r
92/**\r
93 Find the serial port information\r
94\r
6ef57974 95 @param SerialPortInfo Pointer to serial port info structure\r
04af8bf2
DG
96\r
97 @retval RETURN_SUCCESS Successfully find the serial port information.\r
98 @retval RETURN_NOT_FOUND Failed to find the serial port information .\r
99\r
100**/\r
101RETURN_STATUS\r
102EFIAPI\r
103ParseSerialInfo (\r
e5efcf8b 104 OUT SERIAL_PORT_INFO *SerialPortInfo\r
04af8bf2
DG
105 );\r
106\r
04af8bf2
DG
107/**\r
108 Find the video frame buffer information\r
109\r
110 @param GfxInfo Pointer to the EFI_PEI_GRAPHICS_INFO_HOB structure\r
111\r
112 @retval RETURN_SUCCESS Successfully find the video frame buffer information.\r
113 @retval RETURN_NOT_FOUND Failed to find the video frame buffer information .\r
114\r
115**/\r
116RETURN_STATUS\r
117EFIAPI\r
118ParseGfxInfo (\r
e5efcf8b 119 OUT EFI_PEI_GRAPHICS_INFO_HOB *GfxInfo\r
04af8bf2
DG
120 );\r
121\r
122/**\r
123 Find the video frame buffer device information\r
124\r
125 @param GfxDeviceInfo Pointer to the EFI_PEI_GRAPHICS_DEVICE_INFO_HOB structure\r
126\r
127 @retval RETURN_SUCCESS Successfully find the video frame buffer information.\r
128 @retval RETURN_NOT_FOUND Failed to find the video frame buffer information .\r
129\r
130**/\r
131RETURN_STATUS\r
132EFIAPI\r
133ParseGfxDeviceInfo (\r
e5efcf8b 134 OUT EFI_PEI_GRAPHICS_DEVICE_INFO_HOB *GfxDeviceInfo\r
04af8bf2
DG
135 );\r
136\r
978d428e
MM
137/**\r
138 Parse and handle the misc info provided by bootloader\r
139\r
140 @retval RETURN_SUCCESS The misc information was parsed successfully.\r
141 @retval RETURN_NOT_FOUND Could not find required misc info.\r
142 @retval RETURN_OUT_OF_RESOURCES Insufficant memory space.\r
143\r
144**/\r
145RETURN_STATUS\r
146EFIAPI\r
147ParseMiscInfo (\r
148 VOID\r
149 );\r
150\r
04af8bf2 151#endif\r