Already get the DCP module when init the ACPI modul.
Doing it on demand in AcpiOsExecute leads to kernel panic on my machine. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31481 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c85e773511
commit
2f0441f7e3
@ -13,7 +13,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <ACPI.h>
|
||||
#include <dpc.h>
|
||||
#include <KernelExport.h>
|
||||
#include <PCI.h>
|
||||
|
||||
@ -33,9 +32,6 @@
|
||||
#define ERROR(x...) dprintf("acpi: " x)
|
||||
|
||||
|
||||
extern dpc_module_info* gDPC;
|
||||
void* gDPCHandle = NULL;
|
||||
|
||||
extern pci_module_info* gPCIManager;
|
||||
|
||||
|
||||
@ -138,7 +134,7 @@ acpi_std_ops(int32 op,...)
|
||||
AcpiFormatException(status));
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
/* Phew. Now in ACPI mode */
|
||||
TRACE("ACPI initialized\n");
|
||||
return B_OK;
|
||||
@ -151,17 +147,6 @@ acpi_std_ops(int32 op,...)
|
||||
{
|
||||
if (AcpiTerminate() != AE_OK)
|
||||
ERROR("Could not bring system out of ACPI mode. Oh well.\n");
|
||||
|
||||
/* This isn't so terrible. We'll just fail silently */
|
||||
if (gDPC != NULL) {
|
||||
if (gDPCHandle != NULL) {
|
||||
gDPC->delete_dpc_queue(gDPCHandle);
|
||||
gDPCHandle = NULL;
|
||||
}
|
||||
|
||||
put_module(B_DPC_MODULE_NAME);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include <dpc.h>
|
||||
#include <PCI.h>
|
||||
|
||||
dpc_module_info* gDPC = NULL;
|
||||
void* gDPCHandle = NULL;
|
||||
|
||||
//#define TRACE_ACPI_MODULE
|
||||
#ifdef TRACE_ACPI_MODULE
|
||||
@ -170,6 +172,16 @@ acpi_module_register_child_devices(void *cookie)
|
||||
static status_t
|
||||
acpi_module_init(device_node *node, void **_cookie)
|
||||
{
|
||||
if (get_module(B_DPC_MODULE_NAME, (module_info **)&gDPC) != B_OK) {
|
||||
dprintf("failed to get dpc module\n");
|
||||
return B_ERROR;
|
||||
}
|
||||
if (gDPC->new_dpc_queue(&gDPCHandle, "acpi_task",
|
||||
B_NORMAL_PRIORITY) != B_OK) {
|
||||
dprintf("failed to create os execution queue\n");
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
*_cookie = node;
|
||||
return B_OK;
|
||||
}
|
||||
@ -178,6 +190,10 @@ acpi_module_init(device_node *node, void **_cookie)
|
||||
static void
|
||||
acpi_module_uninit(void *cookie)
|
||||
{
|
||||
gDPC->delete_dpc_queue(gDPCHandle);
|
||||
gDPCHandle = NULL;
|
||||
put_module(B_DPC_MODULE_NAME);
|
||||
gDPC = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -132,7 +132,7 @@
|
||||
#include <PCI.h>
|
||||
extern pci_module_info *gPCIManager;
|
||||
#include <dpc.h>
|
||||
dpc_module_info *gDPC = NULL;
|
||||
extern dpc_module_info *gDPC;
|
||||
extern void *gDPCHandle;
|
||||
#endif
|
||||
|
||||
@ -822,20 +822,6 @@ AcpiOsExecute(ACPI_EXECUTE_TYPE Type, ACPI_OSD_EXEC_CALLBACK Function,
|
||||
break;
|
||||
}
|
||||
|
||||
if (gDPC == NULL && get_module(B_DPC_MODULE_NAME,
|
||||
(module_info **)&gDPC) != B_OK) {
|
||||
dprintf("failed to get dpc module for os execution\n");
|
||||
return AE_ERROR;
|
||||
}
|
||||
|
||||
if (gDPCHandle == NULL) {
|
||||
if (gDPC->new_dpc_queue(&gDPCHandle, "acpi_task",
|
||||
B_NORMAL_PRIORITY) != B_OK) {
|
||||
dprintf("failed to create os execution queue\n");
|
||||
return AE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (gDPC->queue_dpc(gDPCHandle, Function, Context) != B_OK)
|
||||
return AE_ERROR;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user