ReactOS  0.4.15-dev-326-g1c504f4
bussupp.c File Reference
#include <hal.h>
#include <debug.h>
#include "pci_classes.h"
#include "pci_vendors.h"
Include dependency graph for bussupp.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

INIT_FUNCTION PBUS_HANDLER NTAPI HalpAllocateAndInitPciBusHandler (IN ULONG PciType, IN ULONG BusNo, IN BOOLEAN TestAllocation)
 
INIT_FUNCTION VOID NTAPI HalpFixupPciSupportedRanges (IN ULONG BusCount)
 
INIT_FUNCTION NTSTATUS NTAPI HalpGetChipHacks (IN USHORT VendorId, IN USHORT DeviceId, IN UCHAR RevisionId, IN PULONG HackFlags)
 
INIT_FUNCTION BOOLEAN NTAPI HalpGetPciBridgeConfig (IN ULONG PciType, IN PUCHAR BusCount)
 
INIT_FUNCTION BOOLEAN NTAPI HalpIsBridgeDevice (IN PPCI_COMMON_CONFIG PciData)
 
INIT_FUNCTION BOOLEAN NTAPI HalpIsIdeDevice (IN PPCI_COMMON_CONFIG PciData)
 
INIT_FUNCTION BOOLEAN NTAPI HalpIsRecognizedCard (IN PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo, IN PPCI_COMMON_CONFIG PciData, IN ULONG Flags)
 
INIT_FUNCTION BOOLEAN NTAPI HalpIsValidPCIDevice (IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot)
 
INIT_FUNCTION NTSTATUS NTAPI HalpMarkChipsetDecode (IN BOOLEAN OverrideEnable)
 
INIT_FUNCTION VOID NTAPI HalpRegisterInternalBusHandlers (VOID)
 
INIT_FUNCTION VOID NTAPI ShowSize (IN ULONG Size)
 
PBUS_HANDLER NTAPI HalpAllocateBusHandler (IN INTERFACE_TYPE InterfaceType, IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN INTERFACE_TYPE ParentBusInterfaceType, IN ULONG ParentBusNumber, IN ULONG BusSpecificData)
 
INIT_FUNCTION NTSTATUS NTAPI HalpMarkChipsetDecode (BOOLEAN OverrideEnable)
 
INIT_FUNCTION VOID NTAPI ShowSize (ULONG x)
 
INIT_FUNCTION VOID NTAPI HalpDebugPciDumpBus (IN ULONG i, IN ULONG j, IN ULONG k, IN PPCI_COMMON_CONFIG PciData)
 
INIT_FUNCTION VOID NTAPI HalpInitializePciBus (VOID)
 
INIT_FUNCTION VOID NTAPI HalpInitBusHandlers (VOID)
 
INIT_FUNCTION VOID NTAPI HalpRegisterKdSupportFunctions (VOID)
 
NTSTATUS NTAPI HalpAssignSlotResources (IN PUNICODE_STRING RegistryPath, IN PUNICODE_STRING DriverClassName, IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT DeviceObject, IN INTERFACE_TYPE BusType, IN ULONG BusNumber, IN ULONG SlotNumber, IN OUT PCM_RESOURCE_LIST *AllocatedResources)
 
BOOLEAN NTAPI HaliFindBusAddressTranslation (IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress, IN OUT PULONG_PTR Context, IN BOOLEAN NextBus)
 
BOOLEAN NTAPI HaliTranslateBusAddress (IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
 
NTSTATUS NTAPI HalAdjustResourceList (IN PIO_RESOURCE_REQUIREMENTS_LIST *ResourceList)
 
NTSTATUS NTAPI HalAssignSlotResources (IN PUNICODE_STRING RegistryPath, IN PUNICODE_STRING DriverClassName, IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT DeviceObject, IN INTERFACE_TYPE BusType, IN ULONG BusNumber, IN ULONG SlotNumber, IN OUT PCM_RESOURCE_LIST *AllocatedResources)
 
ULONG NTAPI HalGetBusData (IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Length)
 
ULONG NTAPI HalGetBusDataByOffset (IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
 
ULONG NTAPI HalGetInterruptVector (IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN ULONG BusInterruptLevel, IN ULONG BusInterruptVector, OUT PKIRQL Irql, OUT PKAFFINITY Affinity)
 
ULONG NTAPI HalSetBusData (IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Length)
 
ULONG NTAPI HalSetBusDataByOffset (IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
 
BOOLEAN NTAPI HalTranslateBusAddress (IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
 

Variables

KSPIN_LOCK HalpPCIConfigLock
 
ULONG HalpPciIrqMask
 
static BOOLEAN WarningsGiven [5]
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file bussupp.c.

Function Documentation

◆ HalAdjustResourceList()

NTSTATUS NTAPI HalAdjustResourceList ( IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceList)

Definition at line 1408 of file bussupp.c.

1409 {
1411  ULONG Status;
1412  PAGED_CODE();
1413 
1414  /* Find the handler */
1415  Handler = HalReferenceHandlerForBus((*ResourceList)->InterfaceType,
1416  (*ResourceList)->BusNumber);
1417  if (!Handler) return STATUS_SUCCESS;
1418 
1419  /* Do the assignment */
1420  Status = Handler->AdjustResourceList(Handler,
1421  Handler,
1422  ResourceList);
1423 
1424  /* Dereference the handler and return */
1426  return Status;
1427 }
#define HalReferenceHandlerForBus
Definition: haltypes.h:286
#define HalDereferenceBusHandler
Definition: haltypes.h:288
const MUI_LANGUAGE_RESOURCE ResourceList[]
Definition: muilanguages.h:414
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:668
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define PAGED_CODE()

◆ HalAssignSlotResources()

NTSTATUS NTAPI HalAssignSlotResources ( IN PUNICODE_STRING  RegistryPath,
IN PUNICODE_STRING  DriverClassName,
IN PDRIVER_OBJECT  DriverObject,
IN PDEVICE_OBJECT  DeviceObject,
IN INTERFACE_TYPE  BusType,
IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN OUT PCM_RESOURCE_LIST AllocatedResources 
)

Definition at line 1434 of file bussupp.c.

1442 {
1443  PAGED_CODE();
1444 
1445  /* Check the bus type */
1446  if (BusType != PCIBus)
1447  {
1448  /* Call our internal handler */
1451  DriverObject,
1452  DeviceObject,
1453  BusType,
1454  BusNumber,
1455  SlotNumber,
1457  }
1458  else
1459  {
1460  /* Call the PCI registered function */
1463  DriverObject,
1464  DeviceObject,
1465  PCIBus,
1466  BusNumber,
1467  SlotNumber,
1469  }
1470 }
NTSTATUS NTAPI HalpAssignSlotResources(IN PUNICODE_STRING RegistryPath, IN PUNICODE_STRING DriverClassName, IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT DeviceObject, IN INTERFACE_TYPE BusType, IN ULONG BusNumber, IN ULONG SlotNumber, IN OUT PCM_RESOURCE_LIST *AllocatedResources)
Definition: bussupp.c:1263
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PCM_RESOURCE_LIST * AllocatedResources
Definition: ndis.h:4640
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE BusType
Definition: halfuncs.h:156
_In_opt_ PUNICODE_STRING DriverClassName
Definition: halfuncs.h:156
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define HalPciAssignSlotResources
Definition: halfuncs.h:42
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:28
#define PAGED_CODE()

◆ HalGetBusData()

ULONG NTAPI HalGetBusData ( IN BUS_DATA_TYPE  BusDataType,
IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Length 
)

Definition at line 1477 of file bussupp.c.

1482 {
1483  /* Call the extended function */
1484  return HalGetBusDataByOffset(BusDataType,
1485  BusNumber,
1486  SlotNumber,
1487  Buffer,
1488  0,
1489  Length);
1490 }
ULONG NTAPI HalGetBusDataByOffset(IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: bussupp.c:1497
Definition: bufpool.h:45
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156

◆ HalGetBusDataByOffset()

ULONG NTAPI HalGetBusDataByOffset ( IN BUS_DATA_TYPE  BusDataType,
IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Offset,
IN ULONG  Length 
)

Definition at line 1497 of file bussupp.c.

1503 {
1505  ULONG Status;
1506 
1507  /* Find the handler */
1509  if (!Handler) return 0;
1510 
1511  /* Do the assignment */
1512  Status = Handler->GetBusData(Handler,
1513  Handler,
1514  SlotNumber,
1515  Buffer,
1516  Offset,
1517  Length);
1518 
1519  /* Dereference the handler and return */
1521  return Status;
1522 }
#define HalDereferenceBusHandler
Definition: haltypes.h:288
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
Definition: bufpool.h:45
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
PBUS_HANDLER FASTCALL HaliReferenceHandlerForConfigSpace(IN BUS_DATA_TYPE ConfigType, IN ULONG BusNumber)
Definition: bushndlr.c:197
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:668
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1

Referenced by HalGetBusData().

◆ HalGetInterruptVector()

ULONG NTAPI HalGetInterruptVector ( IN INTERFACE_TYPE  InterfaceType,
IN ULONG  BusNumber,
IN ULONG  BusInterruptLevel,
IN ULONG  BusInterruptVector,
OUT PKIRQL  Irql,
OUT PKAFFINITY  Affinity 
)

Definition at line 1529 of file bussupp.c.

1535 {
1537  ULONG Vector;
1538  PAGED_CODE();
1539 
1540  /* Defaults */
1541  *Irql = 0;
1542  *Affinity = 0;
1543 
1544  /* Find the handler */
1545  Handler = HalReferenceHandlerForBus(InterfaceType, BusNumber);
1546  if (!Handler) return 0;
1547 
1548  /* Do the assignment */
1549  Vector = Handler->GetInterruptVector(Handler,
1550  Handler,
1553  Irql,
1554  Affinity);
1555  if ((Vector != IRQ2VECTOR(BusInterruptLevel)) ||
1557  {
1558  DPRINT1("Returning IRQL %lx, Vector %lx for Level/Vector: %lx/%lx\n",
1560  DPRINT1("Old HAL would've returned IRQL %lx and Vector %lx\n",
1563  }
1564 
1565  /* Dereference the handler and return */
1567  return Vector;
1568 }
#define HalReferenceHandlerForBus
Definition: haltypes.h:286
_In_ ULONG _In_ ULONG BusInterruptLevel
Definition: halfuncs.h:170
_In_ ULONG _In_ ULONG _In_ ULONG BusInterruptVector
Definition: halfuncs.h:170
#define HalDereferenceBusHandler
Definition: haltypes.h:288
_Out_ PKIRQL Irql
Definition: csq.h:179
#define VECTOR2IRQL(vector)
Definition: halirq.h:26
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:170
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:668
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG Vector
Definition: iofuncs.h:798
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
#define IRQ2VECTOR(irq)
Definition: halirq.h:27
#define PAGED_CODE()

◆ HaliFindBusAddressTranslation()

BOOLEAN NTAPI HaliFindBusAddressTranslation ( IN PHYSICAL_ADDRESS  BusAddress,
IN OUT PULONG  AddressSpace,
OUT PPHYSICAL_ADDRESS  TranslatedAddress,
IN OUT PULONG_PTR  Context,
IN BOOLEAN  NextBus 
)

Definition at line 1298 of file bussupp.c.

1303 {
1304  PHAL_BUS_HANDLER BusHandler;
1306  PLIST_ENTRY NextEntry;
1307  ULONG ContextValue;
1308 
1309  /* Make sure we have a context */
1310  if (!Context) return FALSE;
1311  ASSERT((*Context) || (NextBus == TRUE));
1312 
1313  /* Read the context */
1314  ContextValue = *Context;
1315 
1316  /* Find the bus handler */
1317  Handler = HalpContextToBusHandler(ContextValue);
1318  if (!Handler) return FALSE;
1319 
1320  /* Check if this is an ongoing lookup */
1321  if (NextBus)
1322  {
1323  /* Get the HAL bus handler */
1325  NextEntry = &BusHandler->AllHandlers;
1326 
1327  /* Get the next one if we were already with one */
1328  if (ContextValue) NextEntry = NextEntry->Flink;
1329 
1330  /* Start scanning */
1331  while (TRUE)
1332  {
1333  /* Check if this is the last one */
1334  if (NextEntry == &HalpAllBusHandlers)
1335  {
1336  /* Quit */
1337  *Context = 1;
1338  return FALSE;
1339  }
1340 
1341  /* Call this translator */
1342  BusHandler = CONTAINING_RECORD(NextEntry, HAL_BUS_HANDLER, AllHandlers);
1344  BusHandler->Handler.BusNumber,
1345  BusAddress,
1346  AddressSpace,
1347  TranslatedAddress)) break;
1348 
1349  /* Try the next one */
1350  NextEntry = NextEntry->Flink;
1351  }
1352 
1353  /* If we made it, we're done */
1354  *Context = (ULONG_PTR)&BusHandler->Handler;
1355  return TRUE;
1356  }
1357 
1358  /* Try the first one through */
1359  if (!HalTranslateBusAddress(Handler->InterfaceType,
1360  Handler->BusNumber,
1361  BusAddress,
1362  AddressSpace,
1363  TranslatedAddress)) return FALSE;
1364 
1365  /* Remember for next time */
1367  return TRUE;
1368 }
#define TRUE
Definition: types.h:120
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2268
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
ULONG BusNumber
Definition: haltypes.h:226
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
Definition: typedefs.h:118
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:668
BUS_HANDLER Handler
Definition: bus.h:274
BOOLEAN NTAPI HalTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
Definition: bussupp.c:1627
PBUS_HANDLER NTAPI HalpContextToBusHandler(IN ULONG_PTR ContextValue)
Definition: bushndlr.c:206
INTERFACE_TYPE InterfaceType
Definition: haltypes.h:224
struct tagContext Context
Definition: acpixf.h:1034
unsigned int ULONG
Definition: retypes.h:1
LIST_ENTRY HalpAllBusHandlers
Definition: bushndlr.c:19
#define ULONG_PTR
Definition: config.h:101
LIST_ENTRY AllHandlers
Definition: bus.h:272

Referenced by HalpInitBusHandler().

◆ HaliTranslateBusAddress()

BOOLEAN NTAPI HaliTranslateBusAddress ( IN INTERFACE_TYPE  InterfaceType,
IN ULONG  BusNumber,
IN PHYSICAL_ADDRESS  BusAddress,
IN OUT PULONG  AddressSpace,
OUT PPHYSICAL_ADDRESS  TranslatedAddress 
)

Definition at line 1372 of file bussupp.c.

1377 {
1379  BOOLEAN Status;
1380 
1381  /* Find the handler */
1382  Handler = HalReferenceHandlerForBus(InterfaceType, BusNumber);
1383  if (!(Handler) || !(Handler->TranslateBusAddress))
1384  {
1385  DPRINT1("No translator Interface: %x, Bus: %x, Handler: %p, BusAddress: %x!\n", InterfaceType, BusNumber, Handler, BusAddress);
1386  return FALSE;
1387  }
1388 
1389  /* Do the assignment */
1390  Status = Handler->TranslateBusAddress(Handler,
1391  Handler,
1392  BusAddress,
1393  AddressSpace,
1395 
1396  /* Dereference the handler and return */
1398  return Status;
1399 }
#define HalReferenceHandlerForBus
Definition: haltypes.h:286
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
#define HalDereferenceBusHandler
Definition: haltypes.h:288
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2268
unsigned char BOOLEAN
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:668
Status
Definition: gdiplustypes.h:24
#define DPRINT1
Definition: precomp.h:8

Referenced by HalpInitBusHandler(), and HalTranslateBusAddress().

◆ HalpAllocateAndInitPciBusHandler()

INIT_FUNCTION PBUS_HANDLER NTAPI HalpAllocateAndInitPciBusHandler ( IN ULONG  PciType,
IN ULONG  BusNo,
IN BOOLEAN  TestAllocation 
)

Definition at line 300 of file bussupp.c.

303 {
304  PBUS_HANDLER Bus;
305  PPCIPBUSDATA BusData;
306 
307  /* Allocate the bus handler */
310  BusNo,
311  Internal,
312  0,
313  sizeof(PCIPBUSDATA));
314 
315  /* Set it up */
316  Bus->GetBusData = HalpGetPCIData;
317  Bus->SetBusData = HalpSetPCIData;
321  Bus->BusAddresses->Dma.Limit = 0;
322 
323  /* Get our custom bus data */
324  BusData = (PPCIPBUSDATA)Bus->BusData;
325 
326  /* Setup custom bus data */
327  BusData->CommonData.Tag = PCI_DATA_TAG;
333  BusData->MaxDevice = PCI_MAX_DEVICES;
335 
336  /* Initialize the bitmap */
337  RtlInitializeBitMap(&BusData->DeviceConfigured, BusData->ConfiguredBits, 256);
338 
339  /* Check the type of PCI bus */
340  switch (PciType)
341  {
342  /* Type 1 PCI Bus */
343  case 1:
344 
345  /* Copy the Type 1 handler data */
348  sizeof(PCIConfigHandler));
349 
350  /* Set correct I/O Ports */
351  BusData->Config.Type1.Address = PCI_TYPE1_ADDRESS_PORT;
352  BusData->Config.Type1.Data = PCI_TYPE1_DATA_PORT;
353  break;
354 
355  /* Type 2 PCI Bus */
356  case 2:
357 
358  /* Copy the Type 1 handler data */
361  sizeof (PCIConfigHandler));
362 
363  /* Set correct I/O Ports */
364  BusData->Config.Type2.CSE = PCI_TYPE2_CSE_PORT;
365  BusData->Config.Type2.Forward = PCI_TYPE2_FORWARD_PORT;
366  BusData->Config.Type2.Base = PCI_TYPE2_ADDRESS_BASE;
367 
368  /* Only 16 devices supported, not 32 */
369  BusData->MaxDevice = 16;
370  break;
371 
372  default:
373 
374  /* Invalid type */
375  DbgPrint("HAL: Unnkown PCI type\n");
376  }
377 
378  /* Return the bus handler */
379  return Bus;
380 }
PSUPPORTED_RANGES BusAddresses
Definition: haltypes.h:231
VOID NTAPI HalpPCIISALine2Pin(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PCI_SLOT_NUMBER SlotNumber, IN PPCI_COMMON_CONFIG PciNewData, IN PPCI_COMMON_CONFIG PciOldData)
Definition: pcibus.c:571
LONGLONG Limit
Definition: haltypes.h:199
PCI_CONFIG_HANDLER PCIConfigHandlerType2
Definition: pci.c:54
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define PCI_TYPE2_FORWARD_PORT
Definition: bus.h:171
ULONG MaxDevice
Definition: bus.h:100
VOID NTAPI HalpPCIPin2ISALine(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PCI_SLOT_NUMBER SlotNumber, IN PPCI_COMMON_CONFIG PciData)
Definition: pcibus.c:561
#define DbgPrint
Definition: loader.c:25
#define PCI_TYPE1_ADDRESS_PORT
Definition: bus.h:164
NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP, PULONG, ULONG)
ULONG Tag
Definition: iotypes.h:4923
struct _PCIPBUSDATA::@1428::@1429 Type1
#define PCI_DATA_TAG
Definition: iotypes.h:4919
PciReadWriteConfig WriteConfig
Definition: iotypes.h:4926
VOID NTAPI HalpWritePCIConfig(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pci.c:281
PCIBUSDATA CommonData
Definition: bus.h:85
struct _PCIPBUSDATA::@1428::@1430 Type2
union _PCIPBUSDATA::@1428 Config
ULONG NTAPI HalpGetPCIIntOnISABus(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN ULONG BusInterruptLevel, IN ULONG BusInterruptVector, OUT PKIRQL Irql, OUT PKAFFINITY Affinity)
Definition: pcibus.c:540
PciPin2Line Pin2Line
Definition: iotypes.h:4927
NTSTATUS NTAPI HalpGetISAFixedPCIIrq(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PCI_SLOT_NUMBER PciSlot, OUT PSUPPORTED_RANGE *Range)
Definition: pcibus.c:582
PCI_CONFIG_HANDLER PCIConfigHandlerType1
Definition: pci.c:32
#define PCI_TYPE1_DATA_PORT
Definition: bus.h:165
VOID NTAPI HalpReadPCIConfig(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pci.c:255
PciReadWriteConfig ReadConfig
Definition: iotypes.h:4925
#define PCI_MAX_DEVICES
Definition: iotypes.h:3242
PBUS_HANDLER NTAPI HalpAllocateBusHandler(IN INTERFACE_TYPE InterfaceType, IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN INTERFACE_TYPE ParentBusInterfaceType, IN ULONG ParentBusNumber, IN ULONG BusSpecificData)
Definition: bussupp.c:129
#define PCI_DATA_VERSION
Definition: iotypes.h:4920
PASSIGNSLOTRESOURCES AssignSlotResources
Definition: haltypes.h:236
NTSTATUS NTAPI HalpAdjustPCIResourceList(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN OUT PIO_RESOURCE_REQUIREMENTS_LIST *pResourceList)
Definition: pcibus.c:683
#define PCI_TYPE2_CSE_PORT
Definition: bus.h:170
ULONG NTAPI HalpGetPCIData(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PCI_SLOT_NUMBER Slot, IN PUCHAR Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pci.c:338
ULONG NTAPI HalpSetPCIData(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PCI_SLOT_NUMBER Slot, IN PUCHAR Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pci.c:409
NTSTATUS NTAPI HalpAssignPCISlotResources(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PUNICODE_STRING RegistryPath, IN PUNICODE_STRING DriverClassName OPTIONAL, IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN ULONG Slot, IN OUT PCM_RESOURCE_LIST *pAllocatedResources)
Definition: pci.c:490
PGETSETBUSDATA SetBusData
Definition: haltypes.h:234
PGETINTERRUPTVECTOR GetInterruptVector
Definition: haltypes.h:237
ULONG Version
Definition: iotypes.h:4924
PciLine2Pin Line2Pin
Definition: iotypes.h:4928
struct _PCIPBUSDATA * PPCIPBUSDATA
PGETSETBUSDATA GetBusData
Definition: haltypes.h:233
PADJUSTRESOURCELIST AdjustResourceList
Definition: haltypes.h:235
RTL_BITMAP DeviceConfigured
Definition: bus.h:117
SUPPORTED_RANGE Dma
Definition: haltypes.h:214
PciIrqRange GetIrqRange
Definition: bus.h:111
#define PCI_TYPE2_ADDRESS_BASE
Definition: bus.h:172
PVOID BusData
Definition: haltypes.h:229
ULONG ConfiguredBits[PCI_MAX_DEVICES *PCI_MAX_FUNCTION/32]
Definition: bus.h:118
PCI_CONFIG_HANDLER PCIConfigHandler
Definition: pci.c:20

Referenced by HalpInitializePciBus().

◆ HalpAllocateBusHandler()

PBUS_HANDLER NTAPI HalpAllocateBusHandler ( IN INTERFACE_TYPE  InterfaceType,
IN BUS_DATA_TYPE  BusDataType,
IN ULONG  BusNumber,
IN INTERFACE_TYPE  ParentBusInterfaceType,
IN ULONG  ParentBusNumber,
IN ULONG  BusSpecificData 
)

Definition at line 129 of file bussupp.c.

135 {
136  PBUS_HANDLER Bus;
137 
138  /* Register the bus handler */
139  HalRegisterBusHandler(InterfaceType,
140  BusDataType,
141  BusNumber,
142  ParentBusInterfaceType,
143  ParentBusNumber,
144  BusSpecificData,
145  NULL,
146  &Bus);
147  if (!Bus)
148  {
149  return NULL;
150  }
151 
152  /* Check for a valid interface */
153  if (InterfaceType != InterfaceTypeUndefined)
154  {
155  /* Allocate address ranges and zero them out */
157  sizeof(SUPPORTED_RANGES),
158  TAG_HAL);
160 
161  /* Build the data structure */
163  Bus->BusAddresses->Dma.Limit = 7;
164  Bus->BusAddresses->Memory.Limit = 0xFFFFFFFF;
165  Bus->BusAddresses->IO.Limit = 0xFFFF;
167  Bus->BusAddresses->PrefetchMemory.Base = 1;
168  }
169 
170  /* Return the bus address */
171  return Bus;
172 }
PSUPPORTED_RANGES BusAddresses
Definition: haltypes.h:231
#define HalRegisterBusHandler
Definition: halfuncs.h:38
LONGLONG Limit
Definition: haltypes.h:199
SUPPORTED_RANGE IO
Definition: haltypes.h:208
LONGLONG Base
Definition: haltypes.h:198
SUPPORTED_RANGE PrefetchMemory
Definition: haltypes.h:212
#define HAL_SUPPORTED_RANGE_VERSION
Definition: haltypes.h:192
ULONG SystemAddressSpace
Definition: haltypes.h:196
smooth NULL
Definition: ftsmooth.c:416
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define TAG_HAL
Definition: hal.h:55
SUPPORTED_RANGE Memory
Definition: haltypes.h:210
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
SUPPORTED_RANGE Dma
Definition: haltypes.h:214

Referenced by HalpAllocateAndInitPciBusHandler(), and HalpRegisterInternalBusHandlers().

◆ HalpAssignSlotResources()

NTSTATUS NTAPI HalpAssignSlotResources ( IN PUNICODE_STRING  RegistryPath,
IN PUNICODE_STRING  DriverClassName,
IN PDRIVER_OBJECT  DriverObject,
IN PDEVICE_OBJECT  DeviceObject,
IN INTERFACE_TYPE  BusType,
IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN OUT PCM_RESOURCE_LIST AllocatedResources 
)

Definition at line 1263 of file bussupp.c.

1271 {
1273  NTSTATUS Status;
1274  PAGED_CODE();
1275  DPRINT1("Slot assignment for %d on bus %u\n", BusType, BusNumber);
1276 
1277  /* Find the handler */
1279  if (!Handler) return STATUS_NOT_FOUND;
1280 
1281  /* Do the assignment */
1282  Status = Handler->AssignSlotResources(Handler,
1283  Handler,
1284  RegistryPath,
1286  DriverObject,
1287  DeviceObject,
1288  SlotNumber,
1290 
1291  /* Dereference the handler and return */
1293  return Status;
1294 }
#define HalReferenceHandlerForBus
Definition: haltypes.h:286
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PCM_RESOURCE_LIST * AllocatedResources
Definition: ndis.h:4640
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE BusType
Definition: halfuncs.h:156
LONG NTSTATUS
Definition: precomp.h:26
#define HalDereferenceBusHandler
Definition: haltypes.h:288
_In_opt_ PUNICODE_STRING DriverClassName
Definition: halfuncs.h:156
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
#define STATUS_NOT_FOUND
Definition: shellext.h:72
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:668
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define DPRINT1
Definition: precomp.h:8
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:28
#define PAGED_CODE()

Referenced by HalAssignSlotResources().

◆ HalpDebugPciDumpBus()

INIT_FUNCTION VOID NTAPI HalpDebugPciDumpBus ( IN ULONG  i,
IN ULONG  j,
IN ULONG  k,
IN PPCI_COMMON_CONFIG  PciData 
)

Definition at line 807 of file bussupp.c.

811 {
812  PCHAR p, ClassName, Boundary, SubClassName, VendorName, ProductName, SubVendorName;
813  ULONG Length;
814  CHAR LookupString[16] = "";
815  CHAR bSubClassName[64] = "Unknown";
816  CHAR bVendorName[64] = "";
817  CHAR bProductName[128] = "Unknown device";
818  CHAR bSubVendorName[128] = "Unknown";
819  ULONG Size, Mem, b;
820 
821  /* Isolate the class name */
822  sprintf(LookupString, "C %02x ", PciData->BaseClass);
823  ClassName = strstr((PCHAR)ClassTable, LookupString);
824  if (ClassName)
825  {
826  /* Isolate the subclass name */
827  ClassName += strlen("C 00 ");
828  Boundary = strstr(ClassName, "\nC ");
829  sprintf(LookupString, "\n\t%02x ", PciData->SubClass);
830  SubClassName = strstr(ClassName, LookupString);
831  if (Boundary && SubClassName > Boundary)
832  {
833  SubClassName = NULL;
834  }
835  if (!SubClassName)
836  {
837  SubClassName = ClassName;
838  }
839  else
840  {
841  SubClassName += strlen("\n\t00 ");
842  }
843  /* Copy the subclass into our buffer */
844  p = strpbrk(SubClassName, "\r\n");
845  Length = p - SubClassName;
846  if (Length >= sizeof(bSubClassName)) Length = sizeof(bSubClassName) - 1;
847  strncpy(bSubClassName, SubClassName, Length);
848  bSubClassName[Length] = '\0';
849  }
850 
851  /* Isolate the vendor name */
852  sprintf(LookupString, "\r\n%04x ", PciData->VendorID);
853  VendorName = strstr((PCHAR)VendorTable, LookupString);
854  if (VendorName)
855  {
856  /* Copy the vendor name into our buffer */
857  VendorName += strlen("\r\n0000 ");
858  p = strpbrk(VendorName, "\r\n");
859  Length = p - VendorName;
860  if (Length >= sizeof(bVendorName)) Length = sizeof(bVendorName) - 1;
861  strncpy(bVendorName, VendorName, Length);
862  bVendorName[Length] = '\0';
863  p += strlen("\r\n");
864  while (*p == '\t' || *p == '#')
865  {
866  p = strpbrk(p, "\r\n");
867  p += strlen("\r\n");
868  }
869  Boundary = p;
870 
871  /* Isolate the product name */
872  sprintf(LookupString, "\t%04x ", PciData->DeviceID);
873  ProductName = strstr(VendorName, LookupString);
874  if (Boundary && ProductName >= Boundary)
875  {
876  ProductName = NULL;
877  }
878  if (ProductName)
879  {
880  /* Copy the product name into our buffer */
881  ProductName += strlen("\t0000 ");
882  p = strpbrk(ProductName, "\r\n");
883  Length = p - ProductName;
884  if (Length >= sizeof(bProductName)) Length = sizeof(bProductName) - 1;
885  strncpy(bProductName, ProductName, Length);
886  bProductName[Length] = '\0';
887  p += strlen("\r\n");
888  while ((*p == '\t' && *(p + 1) == '\t') || *p == '#')
889  {
890  p = strpbrk(p, "\r\n");
891  p += strlen("\r\n");
892  }
893  Boundary = p;
894 
895  /* Isolate the subvendor and subsystem name */
896  sprintf(LookupString,
897  "\t\t%04x %04x ",
898  PciData->u.type0.SubVendorID,
899  PciData->u.type0.SubSystemID);
900  SubVendorName = strstr(ProductName, LookupString);
901  if (Boundary && SubVendorName >= Boundary)
902  {
903  SubVendorName = NULL;
904  }
905  if (SubVendorName)
906  {
907  /* Copy the subvendor name into our buffer */
908  SubVendorName += strlen("\t\t0000 0000 ");
909  p = strpbrk(SubVendorName, "\r\n");
910  Length = p - SubVendorName;
911  if (Length >= sizeof(bSubVendorName)) Length = sizeof(bSubVendorName) - 1;
912  strncpy(bSubVendorName, SubVendorName, Length);
913  bSubVendorName[Length] = '\0';
914  }
915  }
916  }
917 
918  /* Print out the data */
919  DbgPrint("%02x:%02x.%x %s [%02x%02x]: %s %s [%04x:%04x] (rev %02x)\n"
920  "\tSubsystem: %s [%04x:%04x]\n",
921  i,
922  j,
923  k,
924  bSubClassName,
925  PciData->BaseClass,
926  PciData->SubClass,
927  bVendorName,
928  bProductName,
929  PciData->VendorID,
930  PciData->DeviceID,
931  PciData->RevisionID,
932  bSubVendorName,
933  PciData->u.type0.SubVendorID,
934  PciData->u.type0.SubSystemID);
935 
936  /* Print out and decode flags */
937  DbgPrint("\tFlags:");
938  if (PciData->Command & PCI_ENABLE_BUS_MASTER) DbgPrint(" bus master,");
939  if (PciData->Status & PCI_STATUS_66MHZ_CAPABLE) DbgPrint(" 66MHz,");
940  if ((PciData->Status & PCI_STATUS_DEVSEL) == 0x000) DbgPrint(" fast devsel,");
941  if ((PciData->Status & PCI_STATUS_DEVSEL) == 0x200) DbgPrint(" medium devsel,");
942  if ((PciData->Status & PCI_STATUS_DEVSEL) == 0x400) DbgPrint(" slow devsel,");
943  if ((PciData->Status & PCI_STATUS_DEVSEL) == 0x600) DbgPrint(" unknown devsel,");
944  DbgPrint(" latency %d", PciData->LatencyTimer);
945  if (PciData->u.type0.InterruptPin != 0 &&
946  PciData->u.type0.InterruptLine != 0 &&
947  PciData->u.type0.InterruptLine != 0xFF) DbgPrint(", IRQ %02d", PciData->u.type0.InterruptLine);
948  else if (PciData->u.type0.InterruptPin != 0) DbgPrint(", IRQ assignment required");
949  DbgPrint("\n");
950 
951  /* Scan addresses */
952  Size = 0;
953  for (b = 0; b < PCI_TYPE0_ADDRESSES; b++)
954  {
955  /* Check for a BAR */
956  Mem = PciData->u.type0.BaseAddresses[b];
957  if (Mem)
958  {
959  /* Decode the address type */
960  if (Mem & PCI_ADDRESS_IO_SPACE)
961  {
962  /* Guess the size */
963  Size = 1 << 2;
964  while (!(Mem & Size) && (Size)) Size <<= 1;
965 
966  /* Print it out */
967  DbgPrint("\tI/O ports at %04lx", Mem & PCI_ADDRESS_IO_ADDRESS_MASK);
968  ShowSize(Size);
969  }
970  else
971  {
972  /* Guess the size */
973  Size = 1 << 8;
974  while (!(Mem & Size) && (Size)) Size <<= 1;
975 
976  /* Print it out */
977  DbgPrint("\tMemory at %08lx (%d-bit, %sprefetchable)",
979  (Mem & PCI_ADDRESS_MEMORY_TYPE_MASK) == PCI_TYPE_32BIT ? 32 : 64,
980  (Mem & PCI_ADDRESS_MEMORY_PREFETCHABLE) ? "" : "non-");
981  ShowSize(Size);
982  }
983  DbgPrint("\n");
984  }
985  }
986 }
signed char * PCHAR
Definition: retypes.h:7
#define PCI_TYPE0_ADDRESSES
Definition: iotypes.h:3144
INIT_FUNCTION VOID NTAPI ShowSize(IN ULONG Size)
#define PCI_ADDRESS_IO_ADDRESS_MASK
Definition: iotypes.h:3877
#define DbgPrint
Definition: loader.c:25
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strpbrk(const char *String, const char *Delimiters)
Definition: utclib.c:302
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
char CHAR
Definition: xmlstorage.h:175
#define PCI_ADDRESS_MEMORY_TYPE_MASK
Definition: iotypes.h:3875
#define PCI_TYPE_32BIT
Definition: iotypes.h:3881
#define sprintf(buf, format,...)
Definition: sprintf.c:55
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
#define PCI_STATUS_DEVSEL
Definition: iotypes.h:3279
#define PCI_ADDRESS_MEMORY_ADDRESS_MASK
Definition: iotypes.h:3878
smooth NULL
Definition: ftsmooth.c:416
#define b
Definition: ke_i.h:79
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 GLint GLint j
Definition: glfuncs.h:250
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define PCI_ENABLE_BUS_MASTER
Definition: iotypes.h:3262
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define PCI_STATUS_66MHZ_CAPABLE
Definition: iotypes.h:3275
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
static const char VendorName[]
Definition: ParaNdis-Oid.c:36
#define PCI_ADDRESS_MEMORY_PREFETCHABLE
Definition: iotypes.h:3876
unsigned int ULONG
Definition: retypes.h:1
GLfloat GLfloat p
Definition: glext.h:8902
#define PCI_ADDRESS_IO_SPACE
Definition: iotypes.h:3874
int k
Definition: mpi.c:3369

Referenced by HalpInitializePciBus().

◆ HalpFixupPciSupportedRanges()

INIT_FUNCTION VOID NTAPI HalpFixupPciSupportedRanges ( IN ULONG  BusCount)

Definition at line 712 of file bussupp.c.

713 {
714  ULONG i;
715  PBUS_HANDLER Bus, ParentBus;
716 
717  /* Loop all buses */
718  for (i = 0; i < BusCount; i++)
719  {
720  /* Get PCI bus handler */
721  Bus = HalHandlerForBus(PCIBus, i);
722 
723  /* Loop all parent buses */
724  ParentBus = Bus->ParentHandler;
725  while (ParentBus)
726  {
727  /* Should merge addresses */
728  if (!WarningsGiven[0]++) DPRINT1("Found parent bus (indicating PCI Bridge). PCI devices may fail!\n");
729 
730  /* Check the next parent */
731  ParentBus = ParentBus->ParentHandler;
732  }
733  }
734 
735  /* Loop all buses again */
736  for (i = 0; i < BusCount; i++)
737  {
738  /* Get PCI bus handler */
739  Bus = HalHandlerForBus(PCIBus, i);
740 
741  /* Check if this is a PCI 2.2 Bus with Subtractive Decode */
742  if (!((PPCIPBUSDATA)Bus->BusData)->Subtractive)
743  {
744  /* Loop all parent buses */
745  ParentBus = Bus->ParentHandler;
746  while (ParentBus)
747  {
748  /* But check only PCI parent buses specifically */
749  if (ParentBus->InterfaceType == PCIBus)
750  {
751  /* Should trim addresses */
752  if (!WarningsGiven[1]++) DPRINT1("Found parent PCI Bus (indicating PCI-to-PCI Bridge). PCI devices may fail!\n");
753  }
754 
755  /* Check the next parent */
756  ParentBus = ParentBus->ParentHandler;
757  }
758  }
759  }
760 
761  /* Loop buses one last time */
762  for (i = 0; i < BusCount; i++)
763  {
764  /* Get the PCI bus handler */
765  Bus = HalHandlerForBus(PCIBus, i);
766 
767  /* Sort and combine (trim) bus address range information */
768  DPRINT("Warning: Bus addresses not being optimized!\n");
769  }
770 }
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
void DPRINT(...)
Definition: polytest.cpp:61
struct _BUS_HANDLER * ParentHandler
Definition: haltypes.h:228
static BOOLEAN WarningsGiven[5]
Definition: bussupp.c:442
#define DPRINT1
Definition: precomp.h:8
INTERFACE_TYPE InterfaceType
Definition: haltypes.h:224
unsigned int ULONG
Definition: retypes.h:1
#define HalHandlerForBus
Definition: halfuncs.h:35
PVOID BusData
Definition: haltypes.h:229

Referenced by HalpInitializePciBus().

◆ HalpGetChipHacks()

INIT_FUNCTION NTSTATUS NTAPI HalpGetChipHacks ( IN USHORT  VendorId,
IN USHORT  DeviceId,
IN UCHAR  RevisionId,
IN PULONG  HackFlags 
)

Definition at line 447 of file bussupp.c.

451 {
456  WCHAR Buffer[32];
457  KEY_VALUE_PARTIAL_INFORMATION PartialInfo;
459 
460  /* Setup the object attributes for the key */
462  L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET\\"
463  L"Control\\HAL");
465  &KeyName,
467  NULL,
468  NULL);
469 
470  /* Open the key */
471  Status = ZwOpenKey(&KeyHandle, KEY_READ, &ObjectAttributes);
472  if (!NT_SUCCESS(Status)) return Status;
473 
474  /* Query value */
475  swprintf(Buffer, L"%04X%04X", VendorId, DeviceId);
477  Status = ZwQueryValueKey(KeyHandle,
478  &ValueName,
480  &PartialInfo,
481  sizeof(PartialInfo),
482  &ResultLength);
483  if (NT_SUCCESS(Status))
484  {
485  /* Return the flags */
486  DbgPrint("\tFound HackFlags for your chipset\n");
487  *HackFlags = *(PULONG)PartialInfo.Data;
488  DbgPrint("\t\tHack Flags: %lx (Hack Revision: %lx-Your Revision: %lx)\n",
489  *HackFlags, HALP_REVISION_FROM_HACK_FLAGS(*HackFlags), RevisionId);
490 
491  /* Does it apply to this revision? */
492  if ((RevisionId) && (RevisionId >= (HALP_REVISION_FROM_HACK_FLAGS(*HackFlags))))
493  {
494  /* Read the revision flags */
495  *HackFlags = HALP_REVISION_HACK_FLAGS(*HackFlags);
496  }
497 
498  /* Throw out revision data */
499  *HackFlags = HALP_HACK_FLAGS(*HackFlags);
500  if (!*HackFlags) DbgPrint("\tNo HackFlags for your chipset's revision!\n");
501  }
502 
503  /* Close the handle and return */
505  return Status;
506 }
IN CINT OUT PVOID IN ULONG OUT PULONG ResultLength
Definition: conport.c:47
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4711
#define HALP_REVISION_FROM_HACK_FLAGS(x)
Definition: halp.h:143
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711
#define DbgPrint
Definition: loader.c:25
#define KEY_READ
Definition: nt_native.h:1023
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
_In_ PUNICODE_STRING ValueName
Definition: cmfuncs.h:264
#define HALP_HACK_FLAGS(x)
Definition: halp.h:145
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define swprintf(buf, format,...)
Definition: sprintf.c:56
static const WCHAR L[]
Definition: oid.c:1250
Status
Definition: gdiplustypes.h:24
unsigned int * PULONG
Definition: retypes.h:1
#define HALP_REVISION_HACK_FLAGS(x)
Definition: halp.h:144
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106

Referenced by HalpInitializePciBus().

◆ HalpGetPciBridgeConfig()

INIT_FUNCTION BOOLEAN NTAPI HalpGetPciBridgeConfig ( IN ULONG  PciType,
IN PUCHAR  BusCount 
)

Definition at line 659 of file bussupp.c.

661 {
662  PCI_SLOT_NUMBER PciSlot;
663  ULONG i, j, k;
664  UCHAR DataBuffer[PCI_COMMON_HDR_LENGTH];
665  PPCI_COMMON_CONFIG PciData = (PPCI_COMMON_CONFIG)DataBuffer;
666  PBUS_HANDLER BusHandler;
667 
668  /* Loop PCI buses */
669  PciSlot.u.bits.Reserved = 0;
670  for (i = 0; i < *BusCount; i++)
671  {
672  /* Get the bus handler */
673  BusHandler = HalHandlerForBus(PCIBus, i);
674 
675  /* Loop every device */
676  for (j = 0; j < PCI_MAX_DEVICES; j++)
677  {
678  /* Loop every function */
679  PciSlot.u.bits.DeviceNumber = j;
680  for (k = 0; k < PCI_MAX_FUNCTION; k++)
681  {
682  /* Build the final slot structure */
683  PciSlot.u.bits.FunctionNumber = k;
684 
685  /* Read the configuration information */
686  HalpReadPCIConfig(BusHandler,
687  PciSlot,
688  PciData,
689  0,
691 
692  /* Skip if this is an invalid function */
693  if (PciData->VendorID == PCI_INVALID_VENDORID) continue;
694 
695  /* Make sure that this is a PCI bridge or a cardbus bridge */
696  if (!HalpIsBridgeDevice(PciData)) continue;
697 
698  /* Not supported */
699  if (!WarningsGiven[2]++) DPRINT1("Your machine has a PCI-to-PCI or CardBUS Bridge. PCI devices may fail!\n");
700  continue;
701  }
702  }
703  }
704 
705  /* If we exited the loop, then there's no bridge to worry about */
706  return FALSE;
707 }
struct _PCI_COMMON_CONFIG * PPCI_COMMON_CONFIG
struct _PCI_SLOT_NUMBER::@3695::@3696 bits
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
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 GLint GLint j
Definition: glfuncs.h:250
VOID NTAPI HalpReadPCIConfig(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pci.c:255
#define PCI_INVALID_VENDORID
Definition: iotypes.h:3245
static BOOLEAN WarningsGiven[5]
Definition: bussupp.c:442
#define PCI_MAX_DEVICES
Definition: iotypes.h:3242
unsigned char UCHAR
Definition: xmlstorage.h:181
INIT_FUNCTION BOOLEAN NTAPI HalpIsBridgeDevice(IN PPCI_COMMON_CONFIG PciData)
Definition: bussupp.c:645
#define PCI_MAX_FUNCTION
Definition: iotypes.h:3243
union _PCI_SLOT_NUMBER::@3695 u
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
#define HalHandlerForBus
Definition: halfuncs.h:35
int k
Definition: mpi.c:3369
#define PCI_COMMON_HDR_LENGTH
Definition: iotypes.h:3238

Referenced by HalpInitializePciBus().

◆ HalpInitBusHandlers()

INIT_FUNCTION VOID NTAPI HalpInitBusHandlers ( VOID  )

Definition at line 1231 of file bussupp.c.

1232 {
1233  /* Register the HAL Bus Handler support */
1235 }
INIT_FUNCTION VOID NTAPI HalpRegisterInternalBusHandlers(VOID)
Definition: bussupp.c:177

◆ HalpInitializePciBus()

INIT_FUNCTION VOID NTAPI HalpInitializePciBus ( VOID  )

Definition at line 992 of file bussupp.c.

993 {
994 #ifndef _MINIHAL_
995  PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo;
996  UCHAR PciType;
997  PCI_SLOT_NUMBER PciSlot;
998  ULONG i, j, k;
999  UCHAR DataBuffer[PCI_COMMON_HDR_LENGTH];
1000  PPCI_COMMON_CONFIG PciData = (PPCI_COMMON_CONFIG)DataBuffer;
1001  PBUS_HANDLER BusHandler;
1002  ULONG HackFlags;
1003  BOOLEAN ExtendedAddressDecoding = FALSE;
1004  NTSTATUS Status;
1005 
1006  /* Query registry information */
1007  PciRegistryInfo = HalpQueryPciRegistryInfo();
1008  if (!PciRegistryInfo) return;
1009 
1010  /* Initialize the PCI configuration lock */
1012 
1013  /* Get the type and free the info structure */
1014  PciType = PciRegistryInfo->HardwareMechanism & 0xF;
1015 
1016  /* Check if this is a type 2 PCI bus with at least one bus */
1017  if ((PciRegistryInfo->NoBuses) && (PciType == 2))
1018  {
1019  /* Setup the PCI slot */
1020  PciSlot.u.bits.Reserved = 0;
1021  PciSlot.u.bits.FunctionNumber = 0;
1022 
1023  /* Loop all slots */
1024  for (i = 0; i < 32; i++)
1025  {
1026  /* Try to setup a Type 2 PCI slot */
1027  PciType = 2;
1028  BusHandler = HalpAllocateAndInitPciBusHandler(2, 0, TRUE);
1029  if (!BusHandler) break;
1030 
1031  /* Now check if it's valid */
1032  if (HalpIsValidPCIDevice(BusHandler, PciSlot)) break;
1033 
1034  /* Heh, the BIOS lied... try Type 1 */
1035  PciType = 1;
1036  BusHandler = HalpAllocateAndInitPciBusHandler(1, 0, TRUE);
1037  if (!BusHandler) break;
1038 
1039  /* Now check if it's valid */
1040  if (HalpIsValidPCIDevice(BusHandler, PciSlot)) break;
1041 
1042  /* Keep trying */
1043  PciType = 2;
1044  }
1045 
1046  /* Now allocate the correct kind of handler */
1048  }
1049 
1050  /* Okay, now loop all PCI bridges */
1051  do
1052  {
1053  /* Loop all PCI buses */
1054  for (i = 0; i < PciRegistryInfo->NoBuses; i++)
1055  {
1056  /* Check if we have a handler for it */
1057  if (!HalHandlerForBus(PCIBus, i))
1058  {
1059  /* Allocate it */
1061  }
1062  }
1063  /* Go to the next bridge */
1064  } while (HalpGetPciBridgeConfig(PciType, &PciRegistryInfo->NoBuses));
1065 
1066  /* Now build correct address range informaiton */
1067  HalpFixupPciSupportedRanges(PciRegistryInfo->NoBuses);
1068 
1069  /* Loop every bus */
1070  DbgPrint("\n====== PCI BUS HARDWARE DETECTION =======\n\n");
1071  PciSlot.u.bits.Reserved = 0;
1072  for (i = 0; i < PciRegistryInfo->NoBuses; i++)
1073  {
1074  /* Get the bus handler */
1075  BusHandler = HalHandlerForBus(PCIBus, i);
1076 
1077  /* Loop every device */
1078  for (j = 0; j < 32; j++)
1079  {
1080  /* Loop every function */
1081  PciSlot.u.bits.DeviceNumber = j;
1082  for (k = 0; k < 8; k++)
1083  {
1084  /* Build the final slot structure */
1085  PciSlot.u.bits.FunctionNumber = k;
1086 
1087  /* Read the configuration information */
1088  HalpReadPCIConfig(BusHandler,
1089  PciSlot,
1090  PciData,
1091  0,
1093 
1094  /* Skip if this is an invalid function */
1095  if (PciData->VendorID == PCI_INVALID_VENDORID) continue;
1096 
1097  /* Print out the entry */
1098  HalpDebugPciDumpBus(i, j, k, PciData);
1099 
1100  /* Check if this is a Cardbus bridge */
1102  {
1103  /* Not supported */
1104  DbgPrint("\tDevice is a PCI Cardbus Bridge. It will not work!\n");
1105  continue;
1106  }
1107 
1108  /* Check if this is a PCI device */
1109  if (PCI_CONFIGURATION_TYPE(PciData) != PCI_BRIDGE_TYPE)
1110  {
1111  /* Check if it has an interrupt pin and line registered */
1112  if ((PciData->u.type1.InterruptPin) &&
1113  (PciData->u.type1.InterruptLine))
1114  {
1115  /* Check if this interrupt line is connected to the bus */
1116  if (PciData->u.type1.InterruptLine < 16)
1117  {
1118  /* Is this an IDE device? */
1119  if (!HalpIsIdeDevice(PciData))
1120  {
1121  /* We'll mask out this interrupt then */
1122  DbgPrint("\tDevice is using IRQ %d! ISA Cards using that IRQ may fail!\n",
1123  PciData->u.type1.InterruptLine);
1124  HalpPciIrqMask |= (1 << PciData->u.type1.InterruptLine);
1125  }
1126  }
1127  }
1128  }
1129 
1130  /* Check for broken Intel chips */
1131  if (PciData->VendorID == 0x8086)
1132  {
1133  /* Check for broken 82830 PCI controller */
1134  if ((PciData->DeviceID == 0x04A3) &&
1135  (PciData->RevisionID < 0x11))
1136  {
1137  /* Skip */
1138  DbgPrint("\tDevice is a broken Intel 82430 PCI Controller. It will not work!\n\n");
1139  continue;
1140  }
1141 
1142  /* Check for broken 82378 PCI-to-ISA Bridge */
1143  if ((PciData->DeviceID == 0x0484) &&
1144  (PciData->RevisionID <= 3))
1145  {
1146  /* Skip */
1147  DbgPrint("\tDevice is a broken Intel 82378 PCI-to-ISA Bridge. It will not work!\n\n");
1148  continue;
1149  }
1150 
1151  /* Check for broken 82450 PCI Bridge */
1152  if ((PciData->DeviceID == 0x84C4) &&
1153  (PciData->RevisionID <= 4))
1154  {
1155  DbgPrint("\tDevice is a Intel Orion 82450 PCI Bridge. It will not work!\n\n");
1156  continue;
1157  }
1158  }
1159 
1160  /* Do we know this card? */
1161  if (!ExtendedAddressDecoding)
1162  {
1163  /* Check for it */
1164  if (HalpIsRecognizedCard(PciRegistryInfo,
1165  PciData,
1167  {
1168  /* We'll do chipset checks later */
1169  DbgPrint("\tDevice has Extended Address Decoding. It may fail to work on older BIOSes!\n");
1170  ExtendedAddressDecoding = TRUE;
1171  }
1172  }
1173 
1174  /* Now check the registry for chipset hacks */
1175  Status = HalpGetChipHacks(PciData->VendorID,
1176  PciData->DeviceID,
1177  PciData->RevisionID,
1178  &HackFlags);
1179  if (NT_SUCCESS(Status))
1180  {
1181  /* Check for broken ACPI routing */
1183  {
1184  DbgPrint("This chipset has broken ACPI IRQ Routing! Be aware!\n\n");
1185  continue;
1186  }
1187 
1188  /* Check for broken ACPI timer */
1189  if (HackFlags & HAL_PCI_CHIP_HACK_BROKEN_ACPI_TIMER)
1190  {
1191  DbgPrint("This chipset has a broken ACPI timer! Be aware!\n\n");
1192  continue;
1193  }
1194 
1195  /* Check for hibernate-disable */
1196  if (HackFlags & HAL_PCI_CHIP_HACK_DISABLE_HIBERNATE)
1197  {
1198  DbgPrint("This chipset has a broken PCI device which is incompatible with hibernation. Be aware!\n\n");
1199  continue;
1200  }
1201 
1202  /* Check for USB controllers that generate SMIs */
1203  if (HackFlags & HAL_PCI_CHIP_HACK_USB_SMI_DISABLE)
1204  {
1205  DbgPrint("This chipset has a USB controller which generates SMIs. ReactOS will likely fail to boot!\n\n");
1206  continue;
1207  }
1208  }
1209 
1210  /* Terminate the entry */
1211  DbgPrint("\n");
1212  }
1213  }
1214  }
1215 
1216  /* Initialize NMI Crash Flag */
1218 
1219  /* Free the registry data */
1220  ExFreePoolWithTag(PciRegistryInfo, TAG_HAL);
1221 
1222  /* Tell PnP if this hard supports correct decoding */
1223  HalpMarkChipsetDecode(ExtendedAddressDecoding);
1224  DbgPrint("====== PCI BUS DETECTION COMPLETE =======\n\n");
1225 #endif
1226 }
#define TRUE
Definition: types.h:120
INIT_FUNCTION NTSTATUS NTAPI HalpMarkChipsetDecode(IN BOOLEAN OverrideEnable)
#define DbgPrint
Definition: loader.c:25
ULONG HalpPciIrqMask
Definition: bussupp.c:123
LONG NTSTATUS
Definition: precomp.h:26
struct _PCI_COMMON_CONFIG * PPCI_COMMON_CONFIG
KSPIN_LOCK HalpPCIConfigLock
Definition: pci.c:19
#define HAL_PCI_CHIP_HACK_DISABLE_ACPI_IRQ_ROUTING
Definition: haltypes.h:254
INIT_FUNCTION BOOLEAN NTAPI HalpGetPciBridgeConfig(IN ULONG PciType, IN PUCHAR BusCount)
Definition: bussupp.c:659
struct _PCI_SLOT_NUMBER::@3695::@3696 bits
INIT_FUNCTION PBUS_HANDLER NTAPI HalpAllocateAndInitPciBusHandler(IN ULONG PciType, IN ULONG BusNo, IN BOOLEAN TestAllocation)
Definition: bussupp.c:300
#define HAL_PCI_CHIP_HACK_DISABLE_HIBERNATE
Definition: haltypes.h:253
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
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
unsigned char BOOLEAN
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 GLint GLint j
Definition: glfuncs.h:250
#define HAL_PCI_CHIP_HACK_BROKEN_ACPI_TIMER
Definition: haltypes.h:252
#define HALP_CARD_FEATURE_FULL_DECODE
Definition: halp.h:150
#define HAL_PCI_CHIP_HACK_USB_SMI_DISABLE
Definition: haltypes.h:255
VOID NTAPI HalpReadPCIConfig(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pci.c:255
#define PCI_INVALID_VENDORID
Definition: iotypes.h:3245
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
INIT_FUNCTION NTSTATUS NTAPI HalpGetChipHacks(IN USHORT VendorId, IN USHORT DeviceId, IN UCHAR RevisionId, IN PULONG HackFlags)
Definition: bussupp.c:447
INIT_FUNCTION BOOLEAN NTAPI HalpIsRecognizedCard(IN PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo, IN PPCI_COMMON_CONFIG PciData, IN ULONG Flags)
Definition: bussupp.c:511
unsigned char UCHAR
Definition: xmlstorage.h:181
#define TAG_HAL
Definition: hal.h:55
PPCI_REGISTRY_INFO_INTERNAL NTAPI HalpQueryPciRegistryInfo(VOID)
Definition: pci.c:543
Status
Definition: gdiplustypes.h:24
INIT_FUNCTION BOOLEAN NTAPI HalpIsValidPCIDevice(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot)
Definition: bussupp.c:385
INIT_FUNCTION VOID NTAPI HalpFixupPciSupportedRanges(IN ULONG BusCount)
Definition: bussupp.c:712
union _PCI_SLOT_NUMBER::@3695 u
INIT_FUNCTION VOID NTAPI HalpGetNMICrashFlag(VOID)
Definition: usage.c:571
INIT_FUNCTION BOOLEAN NTAPI HalpIsIdeDevice(IN PPCI_COMMON_CONFIG PciData)
Definition: bussupp.c:592
#define PCI_CONFIGURATION_TYPE(PciData)
Definition: iotypes.h:3253
unsigned int ULONG
Definition: retypes.h:1
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define HalHandlerForBus
Definition: halfuncs.h:35
int k
Definition: mpi.c:3369
#define PCI_CARDBUS_BRIDGE_TYPE
Definition: iotypes.h:3251
INIT_FUNCTION VOID NTAPI HalpDebugPciDumpBus(IN ULONG i, IN ULONG j, IN ULONG k, IN PPCI_COMMON_CONFIG PciData)
Definition: bussupp.c:807
#define PCI_COMMON_HDR_LENGTH
Definition: iotypes.h:3238
#define PCI_BRIDGE_TYPE
Definition: iotypes.h:3250

◆ HalpIsBridgeDevice()

INIT_FUNCTION BOOLEAN NTAPI HalpIsBridgeDevice ( IN PPCI_COMMON_CONFIG  PciData)

Definition at line 645 of file bussupp.c.

646 {
647  /* Either this is a PCI-to-PCI Bridge, or a CardBUS Bridge */
648  return (((PCI_CONFIGURATION_TYPE(PciData) == PCI_BRIDGE_TYPE) &&
649  (PciData->BaseClass == PCI_CLASS_BRIDGE_DEV) &&
650  (PciData->SubClass == PCI_SUBCLASS_BR_PCI_TO_PCI)) ||
652  (PciData->BaseClass == PCI_CLASS_BRIDGE_DEV) &&
653  (PciData->SubClass == PCI_SUBCLASS_BR_CARDBUS)));
654 }
#define PCI_SUBCLASS_BR_CARDBUS
Definition: iotypes.h:3812
#define PCI_SUBCLASS_BR_PCI_TO_PCI
Definition: iotypes.h:3809
#define PCI_CONFIGURATION_TYPE(PciData)
Definition: iotypes.h:3253
#define PCI_CLASS_BRIDGE_DEV
Definition: iotypes.h:3753
#define PCI_CARDBUS_BRIDGE_TYPE
Definition: iotypes.h:3251
#define PCI_BRIDGE_TYPE
Definition: iotypes.h:3250

Referenced by HalpGetPciBridgeConfig().

◆ HalpIsIdeDevice()

INIT_FUNCTION BOOLEAN NTAPI HalpIsIdeDevice ( IN PPCI_COMMON_CONFIG  PciData)

Definition at line 592 of file bussupp.c.

593 {
594  /* Simple test first */
595  if ((PciData->BaseClass == PCI_CLASS_MASS_STORAGE_CTLR) &&
596  (PciData->SubClass == PCI_SUBCLASS_MSC_IDE_CTLR))
597  {
598  /* The device is nice enough to admit it */
599  return TRUE;
600  }
601 
602  /* Symphony 82C101 */
603  if (PciData->VendorID == 0x1C1C) return TRUE;
604 
605  /* ALi MS4803 or M5219 */
606  if ((PciData->VendorID == 0x10B9) &&
607  ((PciData->DeviceID == 0x5215) || (PciData->DeviceID == 0x5219)))
608  {
609  return TRUE;
610  }
611 
612  /* Appian Technology */
613  if ((PciData->VendorID == 0x1097) && (PciData->DeviceID == 0x38)) return TRUE;
614 
615  /* Compaq Triflex Dual EIDE Controller */
616  if ((PciData->VendorID == 0xE11) && (PciData->DeviceID == 0xAE33)) return TRUE;
617 
618  /* Micron PC Tech RZ1000 */
619  if ((PciData->VendorID == 0x1042) && (PciData->DeviceID == 0x1000)) return TRUE;
620 
621  /* SiS 85C601 or 5513 [IDE] */
622  if ((PciData->VendorID == 0x1039) &&
623  ((PciData->DeviceID == 0x601) || (PciData->DeviceID == 0x5513)))
624  {
625  return TRUE;
626  }
627 
628  /* Symphony Labs W83769F */
629  if ((PciData->VendorID == 0x10AD) &&
630  ((PciData->DeviceID == 0x1) || (PciData->DeviceID == 0x150)))
631  {
632  return TRUE;
633  }
634 
635  /* UMC UM8673F */
636  if ((PciData->VendorID == 0x1060) && (PciData->DeviceID == 0x101)) return TRUE;
637 
638  /* You've survived */
639  return FALSE;
640 }
#define TRUE
Definition: types.h:120
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define PCI_SUBCLASS_MSC_IDE_CTLR
Definition: iotypes.h:3773
#define PCI_CLASS_MASS_STORAGE_CTLR
Definition: iotypes.h:3748

Referenced by HalpInitializePciBus().

◆ HalpIsRecognizedCard()

INIT_FUNCTION BOOLEAN NTAPI HalpIsRecognizedCard ( IN PPCI_REGISTRY_INFO_INTERNAL  PciRegistryInfo,
IN PPCI_COMMON_CONFIG  PciData,
IN ULONG  Flags 
)

Definition at line 511 of file bussupp.c.

514 {
515  ULONG ElementCount, i;
516  PPCI_CARD_DESCRIPTOR CardDescriptor;
517 
518  /* How many PCI Cards that we know about? */
519  ElementCount = PciRegistryInfo->ElementCount;
520  if (!ElementCount) return FALSE;
521 
522  /* Loop all descriptors */
523  CardDescriptor = &PciRegistryInfo->CardList[0];
524  for (i = 0; i < ElementCount; i++, CardDescriptor++)
525  {
526  /* Check for flag match */
527  if (CardDescriptor->Flags != Flags) continue;
528 
529  /* Check for VID-PID match */
530  if ((CardDescriptor->VendorID != PciData->VendorID) ||
531  (CardDescriptor->DeviceID != PciData->DeviceID))
532  {
533  /* Skip */
534  continue;
535  }
536 
537  /* Check for revision match, if requested */
538  if ((CardDescriptor->Flags & HALP_CHECK_CARD_REVISION_ID) &&
539  (CardDescriptor->RevisionID != PciData->RevisionID))
540  {
541  /* Skip */
542  continue;
543  }
544 
545  /* Check what kind of device this is */
546  switch (PCI_CONFIGURATION_TYPE(PciData))
547  {
548  /* CardBUS Bridge */
550 
551  /* This means the real device header is in the device-specific data */
552  PciData = (PPCI_COMMON_CONFIG)PciData->DeviceSpecific;
553 
554  /* Normal PCI device */
555  case PCI_DEVICE_TYPE:
556 
557  /* Check for subvendor match, if requested */
558  if ((CardDescriptor->Flags & HALP_CHECK_CARD_SUBVENDOR_ID) &&
559  (CardDescriptor->SubsystemVendorID != PciData->u.type0.SubVendorID))
560  {
561  /* Skip */
562  continue;
563  }
564 
565  /* Check for subsystem match, if requested */
566  if ((CardDescriptor->Flags & HALP_CHECK_CARD_SUBSYSTEM_ID) &&
567  (CardDescriptor->SubsystemID != PciData->u.type0.SubSystemID))
568  {
569  /* Skip */
570  continue;
571  }
572 
573  /* You made it! */
574  return TRUE;
575 
576  /* PCI Bridge -- don't bother */
577  case PCI_BRIDGE_TYPE:
578  default:
579 
580  /* Recognize it */
581  return TRUE;
582  }
583  }
584 
585  /* This means the card isn't recognized */
586  return FALSE;
587 }
#define TRUE
Definition: types.h:120
#define HALP_CHECK_CARD_SUBSYSTEM_ID
Definition: halp.h:157
struct _PCI_COMMON_CONFIG * PPCI_COMMON_CONFIG
#define HALP_CHECK_CARD_SUBVENDOR_ID
Definition: halp.h:156
USHORT SubsystemVendorID
Definition: pci.h:122
USHORT SubsystemID
Definition: pci.h:123
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define PCI_DEVICE_TYPE
Definition: iotypes.h:3249
#define HALP_CHECK_CARD_REVISION_ID
Definition: halp.h:155
#define PCI_CONFIGURATION_TYPE(PciData)
Definition: iotypes.h:3253
unsigned int ULONG
Definition: retypes.h:1
USHORT DeviceID
Definition: pci.h:120
USHORT VendorID
Definition: pci.h:119
#define PCI_CARDBUS_BRIDGE_TYPE
Definition: iotypes.h:3251
USHORT RevisionID
Definition: pci.h:121
#define PCI_BRIDGE_TYPE
Definition: iotypes.h:3250

Referenced by HalpInitializePciBus().

◆ HalpIsValidPCIDevice()

INIT_FUNCTION BOOLEAN NTAPI HalpIsValidPCIDevice ( IN PBUS_HANDLER  BusHandler,
IN PCI_SLOT_NUMBER  Slot 
)

Definition at line 385 of file bussupp.c.

387 {
388  UCHAR DataBuffer[PCI_COMMON_HDR_LENGTH];
389  PPCI_COMMON_CONFIG PciHeader = (PVOID)DataBuffer;
390  ULONG i;
392 
393  /* Read the PCI header */
394  HalpReadPCIConfig(BusHandler, Slot, PciHeader, 0, PCI_COMMON_HDR_LENGTH);
395 
396  /* Make sure it's a valid device */
397  if ((PciHeader->VendorID == PCI_INVALID_VENDORID) ||
398  (PCI_CONFIGURATION_TYPE(PciHeader) != PCI_DEVICE_TYPE))
399  {
400  /* Bail out */
401  return FALSE;
402  }
403 
404  /* Make sure interrupt numbers make sense */
405  if (((PciHeader->u.type0.InterruptPin) &&
406  (PciHeader->u.type0.InterruptPin > 4)) ||
407  (PciHeader->u.type0.InterruptLine & 0x70))
408  {
409  /* Bail out */
410  return FALSE;
411  }
412 
413  /* Now scan PCI BARs */
414  for (i = 0; i < PCI_TYPE0_ADDRESSES; i++)
415  {
416  /* Check what kind of address it is */
417  Address = PciHeader->u.type0.BaseAddresses[i];
419  {
420  /* Highest I/O port is 65535 */
421  if (Address > 0xFFFF) return FALSE;
422  }
423  else
424  {
425  /* MMIO should be higher than 0x80000 */
426  if ((Address > 0xF) && (Address < 0x80000)) return FALSE;
427  }
428 
429  /* Is this a 64-bit address? */
430  if (!(Address & PCI_ADDRESS_IO_SPACE) &&
432  {
433  /* Check the next-next entry, since this one 64-bits wide */
434  i++;
435  }
436  }
437 
438  /* Header, interrupt and address data all make sense */
439  return TRUE;
440 }
#define PCI_TYPE0_ADDRESSES
Definition: iotypes.h:3144
#define TRUE
Definition: types.h:120
#define PCI_ADDRESS_MEMORY_TYPE_MASK
Definition: iotypes.h:3875
uint32_t ULONG_PTR
Definition: typedefs.h:64
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
static WCHAR Address[46]
Definition: ping.c:68
void * PVOID
Definition: retypes.h:9
VOID NTAPI HalpReadPCIConfig(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pci.c:255
#define PCI_INVALID_VENDORID
Definition: iotypes.h:3245
#define PCI_DEVICE_TYPE
Definition: iotypes.h:3249
unsigned char UCHAR
Definition: xmlstorage.h:181
#define PCI_TYPE_64BIT
Definition: iotypes.h:3883
#define PCI_CONFIGURATION_TYPE(PciData)
Definition: iotypes.h:3253
unsigned int ULONG
Definition: retypes.h:1
#define PCI_ADDRESS_IO_SPACE
Definition: iotypes.h:3874
#define PCI_COMMON_HDR_LENGTH
Definition: iotypes.h:3238

Referenced by HalpInitializePciBus().

◆ HalpMarkChipsetDecode() [1/2]

INIT_FUNCTION NTSTATUS NTAPI HalpMarkChipsetDecode ( IN BOOLEAN  OverrideEnable)

Referenced by HalpInitializePciBus().

◆ HalpMarkChipsetDecode() [2/2]

INIT_FUNCTION NTSTATUS NTAPI HalpMarkChipsetDecode ( BOOLEAN  OverrideEnable)

Definition at line 252 of file bussupp.c.

253 {
255  UNICODE_STRING KeyString;
256  ULONG Data = OverrideEnable;
258 
259  /* Open CCS key */
260  RtlInitUnicodeString(&KeyString,
261  L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET");
263  if (NT_SUCCESS(Status))
264  {
265  /* Open PNP Bios key */
266  RtlInitUnicodeString(&KeyString, L"Control\\Biosinfo\\PNPBios");
268  Handle,
269  &KeyString,
271  TRUE);
272 
273  /* Close root key */
274  ZwClose(Handle);
275 
276  /* Check if PNP BIOS key exists */
277  if (NT_SUCCESS(Status))
278  {
279  /* Set the override value */
280  RtlInitUnicodeString(&KeyString, L"FullDecodeChipsetOverride");
281  Status = ZwSetValueKey(KeyHandle,
282  &KeyString,
283  0,
284  REG_DWORD,
285  &Data,
286  sizeof(Data));
287 
288  /* Close subkey */
290  }
291  }
292 
293  /* Return status */
294  return Status;
295 }
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI HalpOpenRegistryKey(IN PHANDLE KeyHandle, IN HANDLE RootKey, IN PUNICODE_STRING KeyName, IN ACCESS_MASK DesiredAccess, IN BOOLEAN Create)
Definition: misc.c:113
_In_ HANDLE Handle
Definition: extypes.h:390
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static const WCHAR L[]
Definition: oid.c:1250
Status
Definition: gdiplustypes.h:24
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define REG_DWORD
Definition: sdbapi.c:596

◆ HalpRegisterInternalBusHandlers()

INIT_FUNCTION VOID NTAPI HalpRegisterInternalBusHandlers ( VOID  )

Definition at line 177 of file bussupp.c.

178 {
179  PBUS_HANDLER Bus;
180 
181  /* Only do processor 1 */
182  if (KeGetCurrentPrcb()->Number) return;
183 
184  /* Register root support */
186 
187  /* Allocate the system bus */
190  0,
192  0,
193  0);
194  if (Bus)
195  {
196  /* Set it up */
199  }
200 
201  /* Allocate the CMOS bus */
203  Cmos,
204  0,
206  0,
207  0);
208  if (Bus)
209  {
210  /* Set it up */
213  }
214 
215  /* Allocate the CMOS bus */
217  Cmos,
218  1,
220  0,
221  0);
222  if (Bus)
223  {
224  /* Set it up */
227  }
228 
229  /* Allocate ISA bus */
232  0,
233  Internal,
234  0,
235  0);
236  if (Bus)
237  {
238  /* Set it up */
239  Bus->GetBusData = HalpNoBusData;
240  Bus->BusAddresses->Memory.Limit = 0xFFFFFF;
242  }
243 
244  /* No support for EISA or MCA */
246 }
PSUPPORTED_RANGES BusAddresses
Definition: haltypes.h:231
ULONG NTAPI HalpcSetCmosData(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: cmosbus.c:34
LONGLONG Limit
Definition: haltypes.h:199
ULONG NTAPI HalpNoBusData(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: bushndlr.c:108
VOID NTAPI HalpInitBusHandler(VOID)
Definition: bushndlr.c:420
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1063
BOOLEAN NTAPI HalpTranslateIsaBusAddress(PBUS_HANDLER BusHandler, ULONG BusNumber, PHYSICAL_ADDRESS BusAddress, PULONG AddressSpace, PPHYSICAL_ADDRESS TranslatedAddress)
Definition: isa.c:37
BOOLEAN NTAPI HalpTranslateSystemBusAddress(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
Definition: sysbus.c:21
ULONG HalpBusType
Definition: bus.c:17
Definition: miniport.h:89
#define MACHINE_TYPE_ISA
Definition: ketypes.h:52
PBUS_HANDLER NTAPI HalpAllocateBusHandler(IN INTERFACE_TYPE InterfaceType, IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN INTERFACE_TYPE ParentBusInterfaceType, IN ULONG ParentBusNumber, IN ULONG BusSpecificData)
Definition: bussupp.c:129
PTRANSLATEBUSADDRESS TranslateBusAddress
Definition: haltypes.h:238
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:204
ULONG NTAPI HalpGetSystemInterruptVector(IN ULONG BusNumber, IN ULONG BusInterruptLevel, IN ULONG BusInterruptVector, OUT PKIRQL Irql, OUT PKAFFINITY Affinity)
Definition: bus.c:84
PGETSETBUSDATA SetBusData
Definition: haltypes.h:234
PGETINTERRUPTVECTOR GetInterruptVector
Definition: haltypes.h:237
ULONG NTAPI HalpcGetCmosData(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: cmosbus.c:21
SUPPORTED_RANGE Memory
Definition: haltypes.h:210
PGETSETBUSDATA GetBusData
Definition: haltypes.h:233

Referenced by HalpInitBusHandlers().

◆ HalpRegisterKdSupportFunctions()

INIT_FUNCTION VOID NTAPI HalpRegisterKdSupportFunctions ( VOID  )

Definition at line 1240 of file bussupp.c.

1241 {
1242  /* Register PCI Device Functions */
1245 
1246  /* Register memory functions */
1247 #ifndef _MINIHAL_
1248 #if (NTDDI_VERSION >= NTDDI_VISTA)
1251 #else
1254 #endif
1255 #endif
1256 
1257  /* Register ACPI stub */
1259 }
PVOID NTAPI HalpMapPhysicalMemory64Vista(IN PHYSICAL_ADDRESS PhysicalAddress, IN PFN_COUNT PageCount, IN BOOLEAN FlushCurrentTLB)
Definition: memory.c:156
VOID NTAPI HalpCheckPowerButton(VOID)
Definition: misc.c:20
#define KdUnmapVirtualAddress
Definition: halfuncs.h:53
NTSTATUS NTAPI HalpSetupPciDeviceForDebugging(IN PVOID LoaderBlock, IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Definition: pci.c:473
PVOID NTAPI HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress, IN ULONG NumberPage)
Definition: misc.c:28
VOID NTAPI HalpUnmapVirtualAddressVista(IN PVOID VirtualAddress, IN PFN_COUNT PageCount, IN BOOLEAN FlushCurrentTLB)
Definition: memory.c:227
#define KdMapPhysicalMemory64
Definition: halfuncs.h:52
VOID NTAPI HalpUnmapVirtualAddress(IN PVOID VirtualAddress, IN ULONG NumberPages)
Definition: misc.c:39
#define KdSetupPciDeviceForDebugging
Definition: halfuncs.h:47
NTSTATUS NTAPI HalpReleasePciDeviceForDebugging(IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Definition: pci.c:482
#define KdCheckPowerButton
Definition: halfuncs.h:50
#define KdReleasePciDeviceforDebugging
Definition: halfuncs.h:48

◆ HalSetBusData()

ULONG NTAPI HalSetBusData ( IN BUS_DATA_TYPE  BusDataType,
IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Length 
)

Definition at line 1575 of file bussupp.c.

1580 {
1581  /* Call the extended function */
1582  return HalSetBusDataByOffset(BusDataType,
1583  BusNumber,
1584  SlotNumber,
1585  Buffer,
1586  0,
1587  Length);
1588 }
ULONG NTAPI HalSetBusDataByOffset(IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: bussupp.c:1595
Definition: bufpool.h:45
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156

◆ HalSetBusDataByOffset()

ULONG NTAPI HalSetBusDataByOffset ( IN BUS_DATA_TYPE  BusDataType,
IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Offset,
IN ULONG  Length 
)

Definition at line 1595 of file bussupp.c.

1601 {
1603  ULONG Status;
1604 
1605  /* Find the handler */
1607  if (!Handler) return 0;
1608 
1609  /* Do the assignment */
1610  Status = Handler->SetBusData(Handler,
1611  Handler,
1612  SlotNumber,
1613  Buffer,
1614  Offset,
1615  Length);
1616 
1617  /* Dereference the handler and return */
1619  return Status;
1620 }
#define HalDereferenceBusHandler
Definition: haltypes.h:288
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
Definition: bufpool.h:45
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
PBUS_HANDLER FASTCALL HaliReferenceHandlerForConfigSpace(IN BUS_DATA_TYPE ConfigType, IN ULONG BusNumber)
Definition: bushndlr.c:197
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:668
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1

Referenced by HalSetBusData().

◆ HalTranslateBusAddress()

BOOLEAN NTAPI HalTranslateBusAddress ( IN INTERFACE_TYPE  InterfaceType,
IN ULONG  BusNumber,
IN PHYSICAL_ADDRESS  BusAddress,
IN OUT PULONG  AddressSpace,
OUT PPHYSICAL_ADDRESS  TranslatedAddress 
)

Definition at line 1627 of file bussupp.c.

1632 {
1633  /* Look as the bus type */
1634  if (InterfaceType == PCIBus)
1635  {
1636  /* Call the PCI registered function */
1638  BusNumber,
1639  BusAddress,
1640  AddressSpace,
1642  }
1643  else
1644  {
1645  /* Call the bus handler */
1646  return HaliTranslateBusAddress(InterfaceType,
1647  BusNumber,
1648  BusAddress,
1649  AddressSpace,
1651  }
1652 }
#define HalPciTranslateBusAddress
Definition: halfuncs.h:41
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2268
BOOLEAN NTAPI HaliTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
Definition: bussupp.c:1372
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156

Referenced by HaliFindBusAddressTranslation().

◆ ShowSize() [1/2]

INIT_FUNCTION VOID NTAPI ShowSize ( IN ULONG  Size)

Referenced by HalpDebugPciDumpBus().

◆ ShowSize() [2/2]

INIT_FUNCTION VOID NTAPI ShowSize ( ULONG  x)

Definition at line 775 of file bussupp.c.

776 {
777  if (!x) return;
778  DbgPrint(" [size=");
779  if (x < 1024)
780  {
781  DbgPrint("%d", (int) x);
782  }
783  else if (x < 1048576)
784  {
785  DbgPrint("%dK", (int)(x / 1024));
786  }
787  else if (x < 0x80000000)
788  {
789  DbgPrint("%dM", (int)(x / 1048576));
790  }
791  else
792  {
793  DbgPrint("%d", x);
794  }
795  DbgPrint("]");
796 }
#define DbgPrint
Definition: loader.c:25
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

Variable Documentation

◆ HalpPCIConfigLock

◆ HalpPciIrqMask

ULONG HalpPciIrqMask

Definition at line 123 of file bussupp.c.

Referenced by HalpInitializePciBus().

◆ WarningsGiven

BOOLEAN WarningsGiven[5]
static

Definition at line 442 of file bussupp.c.

Referenced by HalpFixupPciSupportedRanges(), and HalpGetPciBridgeConfig().