[HAL]: Use Bus Handlers for HalpAssignSlotResources. Warn that current PCI Slot assig...
authorSir Richard <sir_richard@svn.reactos.org>
Mon, 7 Jun 2010 21:26:09 +0000 (21:26 +0000)
committerSir Richard <sir_richard@svn.reactos.org>
Mon, 7 Jun 2010 21:26:09 +0000 (21:26 +0000)
[HAL]: Add PAGED_CODE();
[HAL]: Fix HALACPI build break.

svn path=/trunk/; revision=47683

reactos/hal/halx86/generic/legacy/bus/pcibus.c
reactos/hal/halx86/generic/legacy/bussupp.c
reactos/hal/halx86/include/bus.h

index e3f363d..6cdbfb1 100644 (file)
@@ -648,6 +648,7 @@ HalpAssignPCISlotResources(IN PBUS_HANDLER BusHandler,
     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 */
 
index 1ece910..a697860 100644 (file)
@@ -1126,25 +1126,28 @@ HalpAssignSlotResources(IN PUNICODE_STRING RegistryPath,
                         IN ULONG SlotNumber,
                         IN OUT PCM_RESOURCE_LIST *AllocatedResources)
 {
-    BUS_HANDLER BusHandler;
+    PBUS_HANDLER Handler;
+    NTSTATUS Status;
     PAGED_CODE();
+    DPRINT1("Slot assignment for %d on bus %d\n", BusType, BusNumber);
+    
+    /* Find the handler */
+    Handler = HalReferenceHandlerForBus(BusType, BusNumber);
+    if (!Handler) return STATUS_NOT_FOUND;
 
-    /* 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);
+    /* 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 @@ HalAdjustResourceList(IN PIO_RESOURCE_REQUIREMENTS_LIST *ResourceList)
 {
     PBUS_HANDLER Handler;
     ULONG Status;
+    PAGED_CODE();
     
     /* Find the handler */
     Handler = HalReferenceHandlerForBus((*ResourceList)->InterfaceType,
@@ -1268,6 +1272,8 @@ HalAssignSlotResources(IN PUNICODE_STRING RegistryPath,
                        IN ULONG SlotNumber,
                        IN OUT PCM_RESOURCE_LIST *AllocatedResources)
 {
+    PAGED_CODE();
+    
     /* Check the bus type */
     if (BusType != PCIBus)
     {
index 91fa6bb..5af43db 100644 (file)
@@ -366,6 +366,16 @@ HalpInitializePciStubs(
     VOID
 );
 
+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(