diff --git a/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c b/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c index f28bae5de3..8e39dd1154 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -27,6 +28,8 @@ status_t acpi_rescan_stub(void); extern dpc_module_info *gDPC; void *gDPChandle = NULL; +extern pci_module_info *gPCIManager; + struct acpi_module_info acpi_module = { { { @@ -85,6 +88,20 @@ acpi_std_ops(int32 op,...) return ENOSYS; } + #ifndef __HAIKU__ + { + // Once upon a time, there was no module(s) dependency(ies) automatic loading feature. + // Let's do it the old way + status_t status; + + status = get_module(B_DPC_MODULE_NAME, (module_info **) &gDPC); + if (status != B_OK) return status; + + status = get_module(B_PCI_MODULE_NAME, (module_info **) &gPCIManager); + if (status != B_OK) return status; + } + #endif + gDPChandle = gDPC->new_dpc_queue("acpi_task", B_NORMAL_PRIORITY, 10); #ifdef ACPI_DEBUG_OUTPUT @@ -131,6 +148,13 @@ acpi_std_ops(int32 op,...) gDPChandle = NULL; } + #ifndef __HAIKU__ + // Once upon a time, there was no module(s) dependency(ies) automatic UNloading feature. + // Let's do it the old way + put_module(B_DPC_MODULE_NAME); + put_module(B_PCI_MODULE_NAME); + #endif + break; default: return B_ERROR;