From 6a3088c64b4bc9ae49036bc87224f9d78ec59ef5 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Fri, 13 Jul 2007 09:33:17 +0000 Subject: [PATCH] Fixed ACPI main module for non-haiku targets: * On these targets, we must load ACPI's modules dependencies ourself! * Only the main B_ACPI_MODULE_NAME will work on non-Haiku targets, as the (work-in-progress?) extra ACPI modules (ACPI_ROOT_MODULE_NAME, ACPI_NS_DUMP_MODULE_NAME, and ACPI_DEVICE_MODULE_NAME) needs Haiku's Device Manager. * "cat /dev/power/namespace" was successfully tested on a BeOS R5+Bone system. * My P5W DH Deluxe-based system have a huge ACPI namespace ;-) * A graphical ACPI Namespace Viewer will be welcomed (Hint) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21595 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/bus_managers/acpi/acpi_busman.c | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) 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;