ReactOS 0.4.17-dev-1190-g4c812f4
uefihw.c
Go to the documentation of this file.
1/*
2 * PROJECT: FreeLoader UEFI Support
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Hardware detection routines
5 * COPYRIGHT: Copyright 2022 Justin Miller <justinmiller100@gmail.com>
6 */
7
8/* INCLUDES ******************************************************************/
9
10#include <uefildr.h>
11#include "../vidfb.h"
12
13#include <debug.h>
15
16/* GLOBALS *******************************************************************/
17
20
21/* From uefivid.c */
23extern ULONG VramSize;
25
28
29#if defined(_M_IX86) || defined(_M_AMD64)
30#define PCI_MAX_BUSES (PCI_MAX_BRIDGE_NUMBER + 1) // == 256
31
32#define PCI_HEADER_TYPE_MASK 0x7F
33#define PCI_HEADER_TYPE_BRIDGE PCI_BRIDGE_TYPE
34#endif
35
36/* FUNCTIONS *****************************************************************/
37
38VOID
40{
41 GlobalSystemTable->BootServices->Stall(Microseconds);
42}
43
44VOID
46{
50
51 /* Keep one timer event around and arm it each idle tick */
52 if (IdleTimerEvent == NULL)
53 {
54 Status = BootServices->CreateEvent(EVT_TIMER,
56 NULL,
57 NULL,
59 if (EFI_ERROR(Status))
60 {
61 StallExecutionProcessor(10000); /* 10 ms fallback */
62 return;
63 }
64 }
65
66 /* Set a 10ms (100,000 * 100ns) relative timer */
67 Status = BootServices->SetTimer(IdleTimerEvent, TimerRelative, 100000);
68 if (!EFI_ERROR(Status))
69 Status = BootServices->WaitForEvent(1, &IdleTimerEvent, &Index);
70 if (EFI_ERROR(Status))
71 StallExecutionProcessor(10000); /* 10 ms fallback */
72}
73
75{
76 return AcpiPresent;
77}
78
79static
82{
83 UINTN i;
84 RSDP_DESCRIPTOR* rsdp = NULL;
86
88 {
90 &acpi2_guid, sizeof(acpi2_guid)))
91 {
93 break;
94 }
95 }
96
97 return rsdp;
98}
99
103{
105 PRSDP_DESCRIPTOR Rsdp;
106
107 Rsdp = FindAcpiBios();
108 if (Rsdp == NULL)
109 return NULL;
110
111 if ((Rsdp->revision > 0) && (Rsdp->xsdt_physical_address != 0))
112 {
114
115 if ((Xsdt != NULL) && (Xsdt->Header.Length >= sizeof(Xsdt->Header)))
116 {
117 Count = (Xsdt->Header.Length - sizeof(Xsdt->Header)) / sizeof(Xsdt->Tables[0]);
118 for (Index = 0; Index < Count; ++Index)
119 {
122
123 if ((Header != NULL) && (Header->Signature == Signature))
124 return Header;
125 }
126 }
127 }
128
129 if (Rsdp->rsdt_physical_address != 0)
130 {
132
133 if ((Rsdt != NULL) && (Rsdt->Header.Length >= sizeof(Rsdt->Header)))
134 {
135 Count = (Rsdt->Header.Length - sizeof(Rsdt->Header)) / sizeof(Rsdt->Tables[0]);
136 for (Index = 0; Index < Count; ++Index)
137 {
140
141 if ((Header != NULL) && (Header->Signature == Signature))
142 return Header;
143 }
144 }
145 }
146
147 return NULL;
148}
149
150VOID
152{
154 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
155 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
156 PRSDP_DESCRIPTOR Rsdp;
157 PACPI_BIOS_DATA AcpiBiosData;
159
160 Rsdp = FindAcpiBios();
161
162 if (Rsdp)
163 {
164 /* Set up the flag in the loader block */
166
167 /* Calculate the table size */
168 TableSize = sizeof(ACPI_BIOS_DATA);
169
170 /* Set 'Configuration Data' value */
171 Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors[1]) + TableSize;
172 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
173 if (PartialResourceList == NULL)
174 {
175 ERR("Failed to allocate resource descriptor\n");
176 return;
177 }
178
179 RtlZeroMemory(PartialResourceList, Size);
180 PartialResourceList->Version = 0;
181 PartialResourceList->Revision = 0;
182 PartialResourceList->Count = 1;
183
184 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
185 PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
187 PartialDescriptor->u.DeviceSpecificData.DataSize = TableSize;
188
189 /* Fill the table */
190 AcpiBiosData = (PACPI_BIOS_DATA)(PartialDescriptor + 1);
191
192 if (Rsdp->revision > 0)
193 {
194 TRACE("ACPI >1.0, using XSDT address\n");
195 AcpiBiosData->RSDTAddress.QuadPart = Rsdp->xsdt_physical_address;
196 }
197 else
198 {
199 TRACE("ACPI 1.0, using RSDT address\n");
200 AcpiBiosData->RSDTAddress.LowPart = Rsdp->rsdt_physical_address;
201 }
202
203 AcpiBiosData->Count = 0;
204
205 TRACE("RSDT %p, data size %x\n", Rsdp->rsdt_physical_address, TableSize);
206
207 /* Create new bus key */
208 FldrCreateComponentKey(SystemKey,
211 0x0,
212 0x0,
213 0xFFFFFFFF,
214 "ACPI BIOS",
215 PartialResourceList,
216 Size,
217 &BiosKey);
218
219 /* Increment bus number */
220 (*BusNumber)++;
221 }
222}
223
224static VOID
227{
228 PCONFIGURATION_COMPONENT_DATA ControllerKey;
229 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
230 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
231 PCM_FRAMEBUF_DEVICE_DATA FramebufData;
232 ULONG Size;
233
234 if (!VramAddress || (VramSize == 0) || !FrameBufferData)
235 return;
236
237 Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors[2]) + sizeof(*FramebufData);
238 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
239 if (PartialResourceList == NULL)
240 {
241 ERR("Failed to allocate resource descriptor\n");
242 return;
243 }
244
245 /* Initialize resource descriptor */
246 RtlZeroMemory(PartialResourceList, Size);
247 PartialResourceList->Version = 1;
248 PartialResourceList->Revision = 2;
249 PartialResourceList->Count = 2;
250
251 /* Set Memory */
252 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
253 PartialDescriptor->Type = CmResourceTypeMemory;
255 PartialDescriptor->Flags = CM_RESOURCE_MEMORY_READ_WRITE;
256 PartialDescriptor->u.Memory.Start.QuadPart = VramAddress;
257 PartialDescriptor->u.Memory.Length = VramSize;
258
259 /* Set framebuffer-specific data */
260 PartialDescriptor = &PartialResourceList->PartialDescriptors[1];
261 PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
263 PartialDescriptor->Flags = 0;
264 PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(*FramebufData);
265
266 /* Get pointer to framebuffer-specific data */
267 FramebufData = (PCM_FRAMEBUF_DEVICE_DATA)(PartialDescriptor + 1);
268 RtlCopyMemory(FramebufData, FrameBufferData, sizeof(*FrameBufferData));
269 FramebufData->Version = 1;
270 FramebufData->Revision = 3;
271 FramebufData->VideoClock = 0; // FIXME: Use EDID
272
277 0,
278 0xFFFFFFFF,
279 "UEFI GOP Framebuffer",
280 PartialResourceList,
281 Size,
282 &ControllerKey);
283
284 // NOTE: Don't add a MonitorPeripheral for now.
285 // We should use EDID data for it.
286}
287
288static
289VOID
291{
292 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
294 ULONG Size;
295
296 /* Set 'Configuration Data' value */
297 Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors);
298 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
299 if (PartialResourceList == NULL)
300 {
301 ERR("Failed to allocate resource descriptor\n");
302 return;
303 }
304
305 /* Initialize resource descriptor */
306 RtlZeroMemory(PartialResourceList, Size);
307 PartialResourceList->Version = 1;
308 PartialResourceList->Revision = 1;
309 PartialResourceList->Count = 0;
310
311 /* Create new bus key */
312 FldrCreateComponentKey(SystemKey,
315 0,
316 0,
317 0xFFFFFFFF,
318 "UEFI Internal",
319 PartialResourceList,
320 Size,
321 &BusKey);
322
323 /* Increment bus number */
324 (*BusNumber)++;
325
326 /* Detect devices that do not belong to "standard" buses */
328
329 /* FIXME: Detect more devices */
330}
331
332#if defined(_M_IX86) || defined(_M_AMD64)
333static
334ULONG
335PciReadConfigDword(
336 _In_ UCHAR Bus,
340{
342
343 Cfg.u.AsULONG = 0;
344 Cfg.u.bits.Enable = 1;
345 Cfg.u.bits.BusNumber = Bus;
346 Cfg.u.bits.DeviceNumber = Device;
347 Cfg.u.bits.FunctionNumber = Function;
348 Cfg.u.bits.RegisterNumber = Register & ~3;
349
352}
353
354static
356PciScanFunction(
357 _In_ UCHAR Bus,
360 _Out_ PUCHAR MaxBridgeBusNumber)
361{
362 ULONG VendorDevice, HeaderTypeDword;
363 UCHAR HeaderType;
364
365 *MaxBridgeBusNumber = 0;
366
367 VendorDevice = PciReadConfigDword(Bus, Device, Function, 0x00);
368 if ((VendorDevice & 0xFFFF) == 0xFFFF)
369 return FALSE;
370
371 HeaderTypeDword = PciReadConfigDword(Bus, Device, Function, 0x0C);
372 HeaderType = (UCHAR)((HeaderTypeDword >> 16) & 0xFF);
373
374 if ((HeaderType & PCI_HEADER_TYPE_MASK) == PCI_HEADER_TYPE_BRIDGE)
375 {
376 ULONG BridgeBusNumbers = PciReadConfigDword(Bus, Device, Function, 0x18);
377 UCHAR SecondaryBus = (UCHAR)((BridgeBusNumbers >> 8) & 0xFF);
378 UCHAR SubordinateBus = (UCHAR)((BridgeBusNumbers >> 16) & 0xFF);
379
380 if (SecondaryBus > SubordinateBus)
381 {
382 ERR("Misconfigured PCI bridge: SecondaryBus (%u) > SubordinateBus (%u)\n",
383 SecondaryBus, SubordinateBus);
384 return FALSE;
385 }
386
387 //if (SecondaryBus != 0 && SecondaryBus != Bus && SubordinateBus >= SecondaryBus)
388 *MaxBridgeBusNumber = SubordinateBus;
389 }
390
391 return TRUE;
392}
393
394static
396UefiDetectPciBus(
400{
401 PMCFG_TABLE Mcfg;
402 UCHAR Bus = 0, HighestBus;
404 BOOLEAN AnyFound = FALSE;
405
406 UNREFERENCED_PARAMETER(SystemKey);
408
409 /* Prefer MCFG since it lists each segment's bus range directly */
411 if ((Mcfg != NULL) && (Mcfg->Header.Length >= sizeof(MCFG_TABLE)))
412 {
413 ULONG McfgCount, McfgIndex;
414 BOOLEAN FoundMcfgSegment0 = FALSE;
415
416 HighestBus = 0;
417 McfgCount = (Mcfg->Header.Length - FIELD_OFFSET(MCFG_TABLE, Allocation)) / sizeof(MCFG_ALLOCATION);
418 for (McfgIndex = 0; McfgIndex < McfgCount; ++McfgIndex)
419 {
420 PMCFG_ALLOCATION Alloc = &Mcfg->Allocation[McfgIndex];
421
422 /* Only enumerate "legacy" PCI, on segment group #0 */
423 if (Alloc->PciSegmentGroup != 0)
424 continue;
425
426 if (Alloc->EndBusNumber < Alloc->StartBusNumber)
427 continue; /* Malformed entry */
428
429 FoundMcfgSegment0 = TRUE;
430 HighestBus = max(HighestBus, Alloc->EndBusNumber);
431 }
432
433 if (FoundMcfgSegment0)
434 {
435 BusData->MajorRevision = 3;
436 BusData->MinorRevision = 0;
437 BusData->NoBuses = HighestBus + 1; // NOTE: Wraps when HighestBus == 0xFF
438 BusData->HardwareMechanism = 1;
439
440 TRACE("UEFI PCI: %u bus(es) found via MCFG\n", BusData->NoBuses);
441 return TRUE;
442 }
443 }
444
445 /* Supposing we only have one single PCI root bus (#0),
446 * loop over each device, and for every PCI bridge encountered,
447 * check its SubordinateBus. */
448 HighestBus = 0;
449
450 /* Loop through all devices */
451 for (Device = 0; Device < PCI_MAX_DEVICES; ++Device)
452 {
453 ULONG HeaderTypeDword;
454 UCHAR SubordinateBus = 0;
455
456 if (!PciScanFunction(Bus, (UCHAR)Device, 0, &SubordinateBus))
457 continue;
458
459 AnyFound = TRUE;
460 HighestBus = max(HighestBus, SubordinateBus);
461
462 HeaderTypeDword = PciReadConfigDword(Bus, (UCHAR)Device, 0, 0x0C);
463 if (!((HeaderTypeDword >> 16) & PCI_MULTIFUNCTION))
464 continue;
465
466 /* Loop through all functions */
468 {
469 if (PciScanFunction(Bus, (UCHAR)Device, (UCHAR)Function, &SubordinateBus))
470 {
471 AnyFound = TRUE;
472 HighestBus = max(HighestBus, SubordinateBus);
473 }
474 }
475 }
476
477 if (!AnyFound)
478 {
479 WARN("No PCI devices found\n");
480 return FALSE;
481 }
482
483 BusData->MajorRevision = 3;
484 BusData->MinorRevision = 0;
485 BusData->NoBuses = HighestBus + 1; // NOTE: Wraps when HighestBus == 0xFF
486 BusData->HardwareMechanism = 1;
487
488 TRACE("UEFI PCI probe: %u bus(es) found\n", BusData->NoBuses);
489 return TRUE;
490}
491#endif // _M_IX86 || _M_AMD64
492
496{
498 ULONG BusNumber = 0;
499
500 TRACE("DetectHardware()\n");
501
502 /* Create the 'System' key */
503#if defined(_M_IX86) || defined(_M_AMD64)
504 FldrCreateSystemKey(&SystemKey, "AT/AT COMPATIBLE");
505#elif defined(_M_IA64)
506 FldrCreateSystemKey(&SystemKey, "Intel Itanium processor family");
507#elif defined(_M_ARM) || defined(_M_ARM64)
508 FldrCreateSystemKey(&SystemKey, "ARM processor family");
509#else
510 #error Please define a system key for your architecture
511#endif
512
513 /* Detect buses */
514 DetectInternal(SystemKey, &BusNumber);
515#if defined(_M_IX86) || defined(_M_AMD64)
516 DetectPciBus(SystemKey, &BusNumber, UefiDetectPciBus);
517#endif
518 DetectAcpiBios(SystemKey, &BusNumber);
519
520 TRACE("DetectHardware() Done\n");
521 return SystemKey;
522}
#define EFI_ACPI_20_TABLE_GUID
Definition: Acpi.h:40
UINT32 UINTN
#define EFI_ERROR(A)
Definition: UefiBaseType.h:165
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:31
#define TPL_APPLICATION
Definition: UefiSpec.h:561
@ TimerRelative
Definition: UefiSpec.h:464
#define EVT_TIMER
Definition: UefiSpec.h:362
unsigned char BOOLEAN
Definition: actypes.h:127
VOID FldrCreateSystemKey(_Out_ PCONFIGURATION_COMPONENT_DATA *SystemNode, _In_ PCSTR IdentifierString)
Definition: archwsup.c:161
VOID FldrCreateComponentKey(_In_ PCONFIGURATION_COMPONENT_DATA SystemNode, _In_ CONFIGURATION_CLASS Class, _In_ CONFIGURATION_TYPE Type, _In_ IDENTIFIER_FLAG Flags, _In_ ULONG Key, _In_ ULONG Affinity, _In_ PCSTR IdentifierString, _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList, _In_ ULONG Size, _Out_ PCONFIGURATION_COMPONENT_DATA *ComponentKey)
Definition: archwsup.c:224
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
VOID DetectPciBus(_In_ PCONFIGURATION_COMPONENT_DATA SystemKey, _Inout_ PULONG BusNumber, _In_ DETECT_PCI_BUS MachDetectPciBus)
Detects and reports the PCI buses found on the platform. Only conventional PCI buses (or PCIe buses o...
Definition: hwpci.c:23
#define PCI_TYPE1_DATA_PORT
Definition: hardware.h:45
#define PCI_TYPE1_ADDRESS_PORT
Definition: hardware.h:44
#define DBG_DEFAULT_CHANNEL(ch)
Definition: debug.h:106
PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: heap.c:533
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
Definition: cdrom.h:1156
Definition: Header.h:9
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
static const WCHAR Signature[]
Definition: parser.c:141
#define PCI_HEADER_TYPE_MASK
Definition: hwpci.c:60
Status
Definition: gdiplustypes.h:24
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
ULONG NTAPI READ_PORT_ULONG(IN PULONG Port)
Definition: portio.c:70
VOID NTAPI WRITE_PORT_ULONG(IN PULONG Port, IN ULONG Value)
Definition: portio.c:123
_Must_inspect_result_ _In_ PUCXHUB_DEVICE_CREATE_INFO _Out_ UCXUSBDEVICE * Device
Definition: hubucx.h:258
#define CM_RESOURCE_MEMORY_READ_WRITE
Definition: cmtypes.h:121
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
int Count
Definition: noreturn.cpp:7
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
struct _ACPI_BIOS_DATA ACPI_BIOS_DATA
struct _ACPI_BIOS_DATA * PACPI_BIOS_DATA
#define PCI_HEADER_TYPE_BRIDGE
Definition: pcidef.h:63
_In_ ULONG BusNumber
Definition: pciidex.h:65
unsigned short USHORT
Definition: pedump.c:61
#define CmResourceTypeMemory
Definition: restypes.h:106
#define CmResourceTypeDeviceSpecific
Definition: restypes.h:108
@ ControllerClass
Definition: arc.h:103
@ AdapterClass
Definition: arc.h:102
@ MultiFunctionAdapter
Definition: arc.h:125
@ DisplayController
Definition: arc.h:132
@ ConsoleOut
Definition: arc.h:92
@ Output
Definition: arc.h:94
RSDT * PRSDT
Definition: acpi.h:207
struct _MCFG_TABLE MCFG_TABLE
#define MCFG_SIGNATURE
Definition: acpi.h:44
struct _MCFG_TABLE * PMCFG_TABLE
DESCRIPTION_HEADER * PDESCRIPTION_HEADER
Definition: acpi.h:110
XSDT * PXSDT
Definition: acpi.h:215
struct _CM_FRAMEBUF_DEVICE_DATA * PCM_FRAMEBUF_DEVICE_DATA
#define TRACE(s)
Definition: solgame.cpp:4
EFI_SET_TIMER SetTimer
Definition: UefiSpec.h:1820
EFI_CREATE_EVENT CreateEvent
Definition: UefiSpec.h:1819
EFI_WAIT_FOR_EVENT WaitForEvent
Definition: UefiSpec.h:1821
EFI_STALL Stall
Definition: UefiSpec.h:1852
EFI_BOOT_SERVICES * BootServices
Definition: UefiSpec.h:1959
EFI_CONFIGURATION_TABLE * ConfigurationTable
Definition: UefiSpec.h:1968
UINTN NumberOfTableEntries
Definition: UefiSpec.h:1963
ULONG rsdt_physical_address
Definition: winldr.h:26
UCHAR revision
Definition: winldr.h:25
ULONGLONG xsdt_physical_address
Definition: winldr.h:28
PHYSICAL_ADDRESS RSDTAddress
Definition: pcbios.h:77
ULONGLONG Count
Definition: pcbios.h:78
ReactOS Framebuffer-specific video device configuration data.
Definition: framebuf.h:35
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@494::@503 DeviceSpecificData
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@494 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@494::@499 Memory
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: restypes.h:100
MCFG_ALLOCATION Allocation[ANYSIZE_ARRAY]
Definition: acpi.h:282
DESCRIPTION_HEADER Header
Definition: acpi.h:280
struct _PCI_TYPE1_CFG_BITS::@157::@158 bits
union _PCI_TYPE1_CFG_BITS::@157 u
Definition: acpi.h:202
ULONG Tables[ANYSIZE_ARRAY]
Definition: acpi.h:205
DESCRIPTION_HEADER Header
Definition: acpi.h:204
Definition: acpi.h:210
PHYSICAL_ADDRESS Tables[ANYSIZE_ARRAY]
Definition: acpi.h:213
DESCRIPTION_HEADER Header
Definition: acpi.h:212
#define max(a, b)
Definition: svc.c:63
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: typedefs.h:53
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
const char * PCSTR
Definition: typedefs.h:52
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define TAG_HW_RESOURCE_LIST
Definition: uefidisk.c:15
VOID DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: uefihw.c:151
static VOID DetectDisplayController(_In_ PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: uefihw.c:225
static VOID DetectInternal(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: uefihw.c:290
PDESCRIPTION_HEADER UefiFindAcpiTable(_In_ ULONG Signature)
Definition: uefihw.c:101
ULONG_PTR VramAddress
Definition: uefivid.c:21
VOID UefiHwIdle(VOID)
Definition: uefihw.c:45
BOOLEAN IsAcpiPresent(VOID)
Definition: uefihw.c:74
BOOLEAN AcpiPresent
Definition: uefihw.c:26
PCONFIGURATION_COMPONENT_DATA UefiHwDetect(_In_opt_ PCSTR Options)
Definition: uefihw.c:494
EFI_SYSTEM_TABLE * GlobalSystemTable
Definition: uefildr.c:16
VOID StallExecutionProcessor(ULONG Microseconds)
Definition: uefihw.c:39
PCM_FRAMEBUF_DEVICE_DATA FrameBufferData
Definition: xboxvideo.c:31
static PRSDP_DESCRIPTOR FindAcpiBios(VOID)
Definition: uefihw.c:81
ULONG VramSize
Definition: uefivid.c:22
static EFI_EVENT IdleTimerEvent
Definition: uefihw.c:27
EFI_HANDLE GlobalImageHandle
Definition: uefildr.c:15
LONGLONG QuadPart
Definition: typedefs.h:114
ULONG LowPart
Definition: typedefs.h:106
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3540
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
@ CmResourceShareDeviceExclusive
Definition: cmtypes.h:241
@ CmResourceShareUndetermined
Definition: cmtypes.h:240
Allocation
Definition: exfuncs.h:598
#define PCI_MULTIFUNCTION
Definition: iotypes.h:3619
_Must_inspect_result_ typedef _Out_ PULONG TableSize
Definition: iotypes.h:4343
#define PCI_MAX_FUNCTION
Definition: iotypes.h:3614
#define PCI_MAX_DEVICES
Definition: iotypes.h:3613