Author: hpoussin Date: Mon Nov 12 13:01:52 2007 New Revision: 30377
URL: http://svn.reactos.org/svn/reactos?rev=30377&view=rev Log: Use NEXT_RESOURCE macro in acpi driver Move pci hack a little bit later
Modified: trunk/reactos/drivers/bus/acpi/ospm/fdo.c trunk/reactos/drivers/bus/pci/fdo.c
Modified: trunk/reactos/drivers/bus/acpi/ospm/fdo.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/ospm/fdo.c... ============================================================================== --- trunk/reactos/drivers/bus/acpi/ospm/fdo.c (original) +++ trunk/reactos/drivers/bus/acpi/ospm/fdo.c Mon Nov 12 13:01:52 2007 @@ -209,7 +209,7 @@ break; } } - resource = (RESOURCE *) ((NATIVE_UINT) resource + (NATIVE_UINT) resource->length); + resource = NEXT_RESOURCE(resource); }
/* Allocate memory */ @@ -350,7 +350,7 @@ break; } } - resource = (RESOURCE *) ((NATIVE_UINT) resource + (NATIVE_UINT) resource->length); + resource = NEXT_RESOURCE(resource); }
acpi_rs_dump_resource_list(resource);
Modified: trunk/reactos/drivers/bus/pci/fdo.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pci/fdo.c?rev=3... ============================================================================== --- trunk/reactos/drivers/bus/pci/fdo.c (original) +++ trunk/reactos/drivers/bus/pci/fdo.c Mon Nov 12 13:01:52 2007 @@ -368,16 +368,6 @@ DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
AllocatedResources = IoGetCurrentIrpStackLocation(Irp)->Parameters.StartDevice.AllocatedResources; - /* HACK due to a bug in ACPI driver, which doesn't report the bus number */ - if (!FoundBuggyAllocatedResourcesList && - (!AllocatedResources || AllocatedResources->Count == 0)) - { - FoundBuggyAllocatedResourcesList = TRUE; - DPRINT1("No bus number resource found (bug in acpi.sys?), assuming bus number #0\n"); - DeviceExtension->BusNumber = 0; - goto next; - } - /* END HACK */ if (!AllocatedResources) { DPRINT("No allocated resources sent to driver\n"); @@ -412,6 +402,15 @@ DPRINT1("Unknown resource descriptor type 0x%x\n", ResourceDescriptor->Type); } } + /* HACK due to a bug in ACPI driver, which doesn't report the bus number */ + if (!FoundBuggyAllocatedResourcesList && !FoundBusNumber) + { + FoundBuggyAllocatedResourcesList = TRUE; + DPRINT1("No bus number resource found (bug in acpi.sys?), assuming bus number #0\n"); + DeviceExtension->BusNumber = 0; + goto next; + } + /* END HACK */ if (!FoundBusNumber) { DPRINT("Some required resources were not found in allocated resources list\n");