VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h

Last change on this file was 101291, checked in by vboxsync, 19 months ago

EFI/FirmwareNew: Make edk2-stable202308 build on all supported platforms (using gcc at least, msvc not tested yet), bugref:4643

  • Property svn:eol-style set to native
File size: 4.3 KB
Line 
1/** @file
2 Platform BDS customizations include file.
3
4 Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7Module Name:
8
9 BdsPlatform.h
10
11Abstract:
12
13 Head file for BDS Platform specific code
14
15**/
16
17#ifndef _PLATFORM_SPECIFIC_BDS_PLATFORM_H_
18#define _PLATFORM_SPECIFIC_BDS_PLATFORM_H_
19
20#include <PiDxe.h>
21
22#include <IndustryStandard/Pci.h>
23#include <IndustryStandard/Acpi.h>
24#include <IndustryStandard/SmBios.h>
25#include <IndustryStandard/PeImage.h>
26#include <IndustryStandard/Virtio095.h>
27
28#include <Library/DebugLib.h>
29#include <Library/BaseMemoryLib.h>
30#include <Library/UefiBootServicesTableLib.h>
31#include <Library/UefiRuntimeServicesTableLib.h>
32#include <Library/MemoryAllocationLib.h>
33#include <Library/BaseLib.h>
34#include <Library/PcdLib.h>
35#include <Library/PciLib.h>
36#include <Library/UefiBootManagerLib.h>
37#include <Library/BootLogoLib.h>
38#include <Library/HobLib.h>
39#include <Library/UefiLib.h>
40#include <Library/DxeServicesTableLib.h>
41#include <Library/DevicePathLib.h>
42#include <Library/IoLib.h>
43#include <Library/NvVarsFileLib.h>
44#include <Library/QemuFwCfgLib.h>
45#include <Library/QemuFwCfgS3Lib.h>
46#include <Library/QemuBootOrderLib.h>
47
48#include <Protocol/Decompress.h>
49#include <Protocol/PciIo.h>
50#include <Protocol/FirmwareVolume2.h>
51#include <Protocol/SimpleFileSystem.h>
52#include <Protocol/PciRootBridgeIo.h>
53#include <Protocol/S3SaveState.h>
54#include <Protocol/DxeSmmReadyToLock.h>
55#include <Protocol/LoadedImage.h>
56
57#include <Guid/Acpi.h>
58#include <Guid/SmBios.h>
59#include <Guid/HobList.h>
60#include <Guid/GlobalVariable.h>
61#include <Guid/EventGroup.h>
62#include <Guid/DebugAgentGuid.h>
63
64#include <OvmfPlatforms.h>
65
66extern EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[];
67extern ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode;
68extern ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode;
69extern UART_DEVICE_PATH gUartDeviceNode;
70extern VENDOR_DEVICE_PATH gTerminalTypeDeviceNode;
71
72#define PCI_DEVICE_PATH_NODE(Func, Dev) \
73 { \
74 { \
75 HARDWARE_DEVICE_PATH, \
76 HW_PCI_DP, \
77 { \
78 (UINT8) (sizeof (PCI_DEVICE_PATH)), \
79 (UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8) \
80 } \
81 }, \
82 (Func), \
83 (Dev) \
84 }
85
86#define PNPID_DEVICE_PATH_NODE(PnpId) \
87 { \
88 { \
89 ACPI_DEVICE_PATH, \
90 ACPI_DP, \
91 { \
92 (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
93 (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
94 }, \
95 }, \
96 EISA_PNP_ID((PnpId)), \
97 0 \
98 }
99
100#define gPciIsaBridge \
101 PCI_DEVICE_PATH_NODE(0, 0x1f)
102
103#define gP2PBridge \
104 PCI_DEVICE_PATH_NODE(0, 0x1e)
105
106#define gPnpPs2Keyboard \
107 PNPID_DEVICE_PATH_NODE(0x0303)
108
109#define gPnp16550ComPort \
110 PNPID_DEVICE_PATH_NODE(0x0501)
111
112#define gUart \
113 { \
114 { \
115 MESSAGING_DEVICE_PATH, \
116 MSG_UART_DP, \
117 { \
118 (UINT8) (sizeof (UART_DEVICE_PATH)), \
119 (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8) \
120 } \
121 }, \
122 0, \
123 115200, \
124 8, \
125 1, \
126 1 \
127 }
128
129#define gVtUtf8Terminal \
130 { \
131 { \
132 MESSAGING_DEVICE_PATH, \
133 MSG_VENDOR_DP, \
134 { \
135 (UINT8) (sizeof (VENDOR_DEVICE_PATH)), \
136 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \
137 } \
138 }, \
139 DEVICE_PATH_MESSAGING_VT_UTF8 \
140 }
141
142#define gEndEntire \
143 { \
144 END_DEVICE_PATH_TYPE, \
145 END_ENTIRE_DEVICE_PATH_SUBTYPE, \
146 { \
147 END_DEVICE_PATH_LENGTH, \
148 0 \
149 } \
150 }
151
152#define PCI_CLASS_SCC 0x07
153#define PCI_SUBCLASS_SERIAL 0x00
154#define PCI_IF_16550 0x02
155#define IS_PCI_16550SERIAL(_p) IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550)
156#define IS_PCI_ISA_PDECODE(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA_PDECODE, 0)
157
158typedef struct {
159 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
160 UINTN ConnectType;
161} PLATFORM_CONSOLE_CONNECT_ENTRY;
162
163#define CONSOLE_OUT BIT0
164#define CONSOLE_IN BIT1
165#define STD_ERROR BIT2
166extern PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[];
167extern PLATFORM_CONSOLE_CONNECT_ENTRY gXenPlatformConsole[];
168
169//
170// Platform BDS Functions
171//
172
173VOID
174PlatformInitializeConsole (
175 IN PLATFORM_CONSOLE_CONNECT_ENTRY *PlatformConsole
176 );
177
178/**
179 Loads and boots UEFI Linux via the FwCfg interface.
180
181 @retval EFI_NOT_FOUND - The Linux kernel was not found
182
183**/
184EFI_STATUS
185TryRunningQemuKernel (
186 VOID
187 );
188
189#endif // _PLATFORM_SPECIFIC_BDS_PLATFORM_H_
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette