/*
* PROJECT: ReactOS HAL
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: hal/halx86/generic/bus/pcibus.c
+ * FILE: hal/halx86/legacy/bus/pcibus.c
* PURPOSE: PCI Bus Support (Configuration Space, Resource Allocation)
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/
#define NDEBUG
#include <debug.h>
+#if defined(ALLOC_PRAGMA) && !defined(_MINIHAL_)
+#pragma alloc_text(INIT, HalpInitializePciStubs)
+#pragma alloc_text(INIT, HalpQueryPciRegistryInfo)
+#pragma alloc_text(INIT, HalpRegisterPciDebuggingDeviceInfo)
+#pragma alloc_text(INIT, HalpReleasePciDeviceForDebugging)
+#pragma alloc_text(INIT, HalpSetupPciDeviceForDebugging)
+#endif
+
/* GLOBALS *******************************************************************/
extern BOOLEAN HalpPciLockSettings;
* video card, so it appears to be present on 1:0:0 - 1:31:0.
* We hack around these problems by indicating "device not present" for devices
* 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
- if ((0 == BusHandler->BusNumber && 0 == Slot.u.bits.DeviceNumber &&
- (1 == Slot.u.bits.FunctionNumber || 2 == Slot.u.bits.FunctionNumber)) ||
- (1 == BusHandler->BusNumber && 0 != Slot.u.bits.DeviceNumber))
+ if ((BusHandler->BusNumber == 0 && Slot.u.bits.DeviceNumber == 0 &&
+ (Slot.u.bits.FunctionNumber == 1 || Slot.u.bits.FunctionNumber == 2)) ||
+ (BusHandler->BusNumber == 1 && Slot.u.bits.DeviceNumber != 0))
{
- DPRINT("Blacklisted PCI slot\n");
- if (0 == Offset && sizeof(USHORT) <= Length)
+ DPRINT("Blacklisted PCI slot (%d:%d:%d)\n", BusHandler->BusNumber, Slot.u.bits.DeviceNumber, Slot.u.bits.FunctionNumber);
+ if (Offset == 0 && Length >= sizeof(USHORT))
{
*(PUSHORT)Buffer = PCI_INVALID_VENDORID;
return sizeof(USHORT);
* video card, so it appears to be present on 1:0:0 - 1:31:0.
* We hack around these problems by indicating "device not present" for devices
* 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
- if ((0 == BusHandler->BusNumber && 0 == Slot.u.bits.DeviceNumber &&
- (1 == Slot.u.bits.FunctionNumber || 2 == Slot.u.bits.FunctionNumber)) ||
- (1 == BusHandler->BusNumber && 0 != Slot.u.bits.DeviceNumber))
+ if ((BusHandler->BusNumber == 0 && Slot.u.bits.DeviceNumber == 0 &&
+ (Slot.u.bits.FunctionNumber == 1 || Slot.u.bits.FunctionNumber == 2)) ||
+ (BusHandler->BusNumber == 1 && Slot.u.bits.DeviceNumber != 0))
{
- DPRINT1("Trying to set data on blacklisted PCI slot\n");
+ DPRINT1("Trying to set data on blacklisted PCI slot (%d:%d:%d)\n", BusHandler->BusNumber, Slot.u.bits.DeviceNumber, Slot.u.bits.FunctionNumber);
return 0;
}
#endif
return STATUS_SUCCESS;
}
+INIT_FUNCTION
NTSTATUS
NTAPI
-INIT_FUNCTION
HalpSetupPciDeviceForDebugging(IN PVOID LoaderBlock,
IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice)
{
return STATUS_NOT_IMPLEMENTED;
}
+INIT_FUNCTION
NTSTATUS
NTAPI
-INIT_FUNCTION
HalpReleasePciDeviceForDebugging(IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice)
{
DPRINT1("Unimplemented!\n");
return STATUS_NOT_IMPLEMENTED;
}
+INIT_FUNCTION
VOID
NTAPI
-INIT_FUNCTION
HalpRegisterPciDebuggingDeviceInfo(VOID)
{
BOOLEAN Found = FALSE;
return Length;
}
+INIT_FUNCTION
PPCI_REGISTRY_INFO_INTERNAL
NTAPI
-INIT_FUNCTION
HalpQueryPciRegistryInfo(VOID)
{
#ifndef _MINIHAL_
#endif
}
+INIT_FUNCTION
VOID
NTAPI
-INIT_FUNCTION
HalpInitializePciStubs(VOID)
{
PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo;