Author: sir_richard
Date: Mon Jun 7 23:26:09 2010
New Revision: 47683
URL:
http://svn.reactos.org/svn/reactos?rev=47683&view=rev
Log:
[HAL]: Use Bus Handlers for HalpAssignSlotResources. Warn that current PCI Slot assignment
code is frelled.
[HAL]: Add PAGED_CODE();
[HAL]: Fix HALACPI build break.
Modified:
trunk/reactos/hal/halx86/generic/legacy/bus/pcibus.c
trunk/reactos/hal/halx86/generic/legacy/bussupp.c
trunk/reactos/hal/halx86/include/bus.h
Modified: trunk/reactos/hal/halx86/generic/legacy/bus/pcibus.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/legacy/…
==============================================================================
--- trunk/reactos/hal/halx86/generic/legacy/bus/pcibus.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/legacy/bus/pcibus.c [iso-8859-1] Mon Jun 7 23:26:09
2010
@@ -648,6 +648,7 @@
PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor;
PCI_SLOT_NUMBER SlotNumber;
ULONG WriteBuffer;
+ DPRINT1("WARNING: PCI Slot Resource Assignment is FOOBAR\n");
/* FIXME: Should handle 64-bit addresses */
Modified: trunk/reactos/hal/halx86/generic/legacy/bussupp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/legacy/…
==============================================================================
--- trunk/reactos/hal/halx86/generic/legacy/bussupp.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/legacy/bussupp.c [iso-8859-1] Mon Jun 7 23:26:09
2010
@@ -1126,25 +1126,28 @@
IN ULONG SlotNumber,
IN OUT PCM_RESOURCE_LIST *AllocatedResources)
{
- BUS_HANDLER BusHandler;
+ PBUS_HANDLER Handler;
+ NTSTATUS Status;
PAGED_CODE();
-
- /* Only PCI is supported */
- if (BusType != PCIBus) return STATUS_NOT_IMPLEMENTED;
-
- /* Setup fake PCI Bus handler */
- RtlCopyMemory(&BusHandler, &HalpFakePciBusHandler, sizeof(BUS_HANDLER));
- BusHandler.BusNumber = BusNumber;
-
- /* Call the PCI function */
- return HalpAssignPCISlotResources(&BusHandler,
- &BusHandler,
- RegistryPath,
- DriverClassName,
- DriverObject,
- DeviceObject,
- SlotNumber,
- AllocatedResources);
+ DPRINT1("Slot assignment for %d on bus %d\n", BusType, BusNumber);
+
+ /* Find the handler */
+ Handler = HalReferenceHandlerForBus(BusType, BusNumber);
+ if (!Handler) return STATUS_NOT_FOUND;
+
+ /* Do the assignment */
+ Status = Handler->AssignSlotResources(Handler,
+ Handler,
+ RegistryPath,
+ DriverClassName,
+ DriverObject,
+ DeviceObject,
+ SlotNumber,
+ AllocatedResources);
+
+ /* Dereference the handler and return */
+ HalDereferenceBusHandler(Handler);
+ return Status;
}
BOOLEAN
@@ -1238,6 +1241,7 @@
{
PBUS_HANDLER Handler;
ULONG Status;
+ PAGED_CODE();
/* Find the handler */
Handler = HalReferenceHandlerForBus((*ResourceList)->InterfaceType,
@@ -1268,6 +1272,8 @@
IN ULONG SlotNumber,
IN OUT PCM_RESOURCE_LIST *AllocatedResources)
{
+ PAGED_CODE();
+
/* Check the bus type */
if (BusType != PCIBus)
{
Modified: trunk/reactos/hal/halx86/include/bus.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/bus.h?r…
==============================================================================
--- trunk/reactos/hal/halx86/include/bus.h [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/include/bus.h [iso-8859-1] Mon Jun 7 23:26:09 2010
@@ -368,6 +368,16 @@
BOOLEAN
NTAPI
+HalpTranslateBusAddress(
+ IN INTERFACE_TYPE InterfaceType,
+ IN ULONG BusNumber,
+ IN PHYSICAL_ADDRESS BusAddress,
+ IN OUT PULONG AddressSpace,
+ OUT PPHYSICAL_ADDRESS TranslatedAddress
+);
+
+BOOLEAN
+NTAPI
HaliTranslateBusAddress(
IN INTERFACE_TYPE InterfaceType,
IN ULONG BusNumber,