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
This commit is contained in:
parent
e659b9521f
commit
6a3088c64b
@ -7,6 +7,7 @@
|
||||
|
||||
#include <ACPI.h>
|
||||
#include <dpc.h>
|
||||
#include <PCI.h>
|
||||
#include <KernelExport.h>
|
||||
|
||||
#include <malloc.h>
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user