[ros-diffs] [cgutman] 47729: [ACPI] - Create a resource list for the PCI root bus (even though it doesn't use any resources according to ACPI) and fill it with a bus number resource descriptor - Fixes PCI device detection with ACPI enabled

cgutman at svn.reactos.org cgutman at svn.reactos.org
Thu Jun 10 00:02:37 CET 2010


Author: cgutman
Date: Wed Jun  9 23:02:34 2010
New Revision: 47729

URL: http://svn.reactos.org/svn/reactos?rev=47729&view=rev
Log:
[ACPI]
- Create a resource list for the PCI root bus (even though it doesn't use any resources according to ACPI) and fill it with a bus number resource descriptor
- Fixes PCI device detection with ACPI enabled

Modified:
    trunk/reactos/drivers/bus/acpi/buspdo.c

Modified: trunk/reactos/drivers/bus/acpi/buspdo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/buspdo.c?rev=47729&r1=47728&r2=47729&view=diff
==============================================================================
--- trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] Wed Jun  9 23:02:34 2010
@@ -644,6 +644,37 @@
 	ACPI_RESOURCE* resource;
 	ULONG ResourceListSize;
 	ULONG i;
+	ULONGLONG BusNumber;
+
+    /* A bus number resource is not included in the list of current resources
+     * for the root PCI bus so we manually query one here and if we find it
+     * we create a resource list and add a bus number descriptor to it */
+    AcpiStatus = acpi_evaluate_integer(DeviceData->AcpiHandle, "_BBN", NULL, &BusNumber);
+    if (AcpiStatus == AE_OK)
+    {
+        DPRINT1("Found PCI root hub: %d\n", BusNumber);
+
+	ResourceListSize = sizeof(CM_RESOURCE_LIST);
+	ResourceList = (PCM_RESOURCE_LIST)ExAllocatePool(PagedPool, ResourceListSize);
+	if (!ResourceList)
+		return STATUS_INSUFFICIENT_RESOURCES;
+
+	ResourceList->Count = 1;
+	ResourceList->List[0].InterfaceType = Internal;
+	ResourceList->List[0].BusNumber = 0;
+	ResourceList->List[0].PartialResourceList.Version = 1;
+	ResourceList->List[0].PartialResourceList.Revision = 1;
+	ResourceList->List[0].PartialResourceList.Count = 1;
+	ResourceDescriptor = ResourceList->List[0].PartialResourceList.PartialDescriptors;
+
+	ResourceDescriptor->Type = CmResourceTypeBusNumber;
+	ResourceDescriptor->ShareDisposition = CmResourceShareDeviceExclusive;
+	ResourceDescriptor->u.BusNumber.Start = BusNumber;
+	ResourceDescriptor->u.BusNumber.Length = 1;
+
+	Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
+	return STATUS_SUCCESS;
+    }
 
     /* Get current resources */
     Buffer.Length = 0;




More information about the Ros-diffs mailing list