* Made DPC an ACPI module dependency
* Moved DPC queue creation / deletion before/after ACPI subsystem init/shutdown repectively, as AcpiInitializeObjects() would eventually trigger some AcpiOsExecute() call, which need DPC to be ready. * Still missing: a DPC queue that run each call in its own thread, not sequentially... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33264 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <ACPI.h>
|
#include <ACPI.h>
|
||||||
|
#include <dpc.h>
|
||||||
#include <KernelExport.h>
|
#include <KernelExport.h>
|
||||||
#include <PCI.h>
|
#include <PCI.h>
|
||||||
|
|
||||||
@@ -35,6 +36,8 @@
|
|||||||
#define ACPI_DEVICE_ID_LENGTH 0x08
|
#define ACPI_DEVICE_ID_LENGTH 0x08
|
||||||
|
|
||||||
extern pci_module_info* gPCIManager;
|
extern pci_module_info* gPCIManager;
|
||||||
|
extern dpc_module_info* gDPC;
|
||||||
|
void* gDPCHandle = NULL;
|
||||||
|
|
||||||
|
|
||||||
static ACPI_STATUS
|
static ACPI_STATUS
|
||||||
@@ -107,6 +110,14 @@ acpi_std_ops(int32 op,...)
|
|||||||
ERROR("ACPI disabled\n");
|
ERROR("ACPI disabled\n");
|
||||||
return ENOSYS;
|
return ENOSYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gDPC->new_dpc_queue(&gDPCHandle, "acpi_task",
|
||||||
|
B_NORMAL_PRIORITY) != B_OK) {
|
||||||
|
ERROR("failed to create os execution queue\n");
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
AcpiGbl_EnableInterpreterSlack = true;
|
AcpiGbl_EnableInterpreterSlack = true;
|
||||||
// AcpiGbl_CreateOSIMethod = true;
|
// AcpiGbl_CreateOSIMethod = true;
|
||||||
|
|
||||||
@@ -169,6 +180,9 @@ acpi_std_ops(int32 op,...)
|
|||||||
{
|
{
|
||||||
if (AcpiTerminate() != AE_OK)
|
if (AcpiTerminate() != AE_OK)
|
||||||
ERROR("Could not bring system out of ACPI mode. Oh well.\n");
|
ERROR("Could not bring system out of ACPI mode. Oh well.\n");
|
||||||
|
|
||||||
|
gDPC->delete_dpc_queue(gDPCHandle);
|
||||||
|
gDPCHandle = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,6 @@
|
|||||||
#include <dpc.h>
|
#include <dpc.h>
|
||||||
#include <PCI.h>
|
#include <PCI.h>
|
||||||
|
|
||||||
dpc_module_info* gDPC = NULL;
|
|
||||||
void* gDPCHandle = NULL;
|
|
||||||
|
|
||||||
//#define TRACE_ACPI_MODULE
|
//#define TRACE_ACPI_MODULE
|
||||||
#ifdef TRACE_ACPI_MODULE
|
#ifdef TRACE_ACPI_MODULE
|
||||||
@@ -25,10 +23,12 @@ void* gDPCHandle = NULL;
|
|||||||
|
|
||||||
device_manager_info *gDeviceManager = NULL;
|
device_manager_info *gDeviceManager = NULL;
|
||||||
pci_module_info *gPCIManager = NULL;
|
pci_module_info *gPCIManager = NULL;
|
||||||
|
dpc_module_info* gDPC = NULL;
|
||||||
|
|
||||||
module_dependency module_dependencies[] = {
|
module_dependency module_dependencies[] = {
|
||||||
{B_DEVICE_MANAGER_MODULE_NAME, (module_info **)&gDeviceManager},
|
{B_DEVICE_MANAGER_MODULE_NAME, (module_info **)&gDeviceManager},
|
||||||
{B_PCI_MODULE_NAME, (module_info **)&gPCIManager},
|
{B_PCI_MODULE_NAME, (module_info **)&gPCIManager},
|
||||||
|
{B_DPC_MODULE_NAME, (module_info **)&gDPC},
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -172,16 +172,6 @@ acpi_module_register_child_devices(void *cookie)
|
|||||||
static status_t
|
static status_t
|
||||||
acpi_module_init(device_node *node, void **_cookie)
|
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;
|
*_cookie = node;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -190,10 +180,6 @@ acpi_module_init(device_node *node, void **_cookie)
|
|||||||
static void
|
static void
|
||||||
acpi_module_uninit(void *cookie)
|
acpi_module_uninit(void *cookie)
|
||||||
{
|
{
|
||||||
gDPC->delete_dpc_queue(gDPCHandle);
|
|
||||||
gDPCHandle = NULL;
|
|
||||||
put_module(B_DPC_MODULE_NAME);
|
|
||||||
gDPC = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user