summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-10-16 17:28:53 +0000
committerjhb <jhb@FreeBSD.org>2002-10-16 17:28:53 +0000
commit4cd3dda29171288aa0573256111fd627b057ca9b (patch)
tree1b6f9ed7a4251559f2049f2eba5dec525f9d6ff1 /sys/dev/acpica
parenta307d114081c6667904ee03c3fb7c2bc079ee3ce (diff)
downloadFreeBSD-src-4cd3dda29171288aa0573256111fd627b057ca9b.zip
FreeBSD-src-4cd3dda29171288aa0573256111fd627b057ca9b.tar.gz
Catch up to changes in acpivar.h to add support for using ACPI on
4-stable systems. Sponsored by: The Weather Channel
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/Osd/OsdInterrupt.c2
-rw-r--r--sys/dev/acpica/acpi.c12
-rw-r--r--sys/dev/acpica/acpi_battery.c2
-rw-r--r--sys/dev/acpica/acpi_cpu.c2
-rw-r--r--sys/dev/acpica/acpi_ec.c2
-rw-r--r--sys/dev/acpica/acpi_lid.c2
-rw-r--r--sys/dev/acpica/acpi_powerres.c2
-rw-r--r--sys/dev/acpica/acpi_thermal.c11
8 files changed, 23 insertions, 12 deletions
diff --git a/sys/dev/acpica/Osd/OsdInterrupt.c b/sys/dev/acpica/Osd/OsdInterrupt.c
index 927d8d9..d848145 100644
--- a/sys/dev/acpica/Osd/OsdInterrupt.c
+++ b/sys/dev/acpica/Osd/OsdInterrupt.c
@@ -129,6 +129,8 @@ AcpiOsRemoveInterruptHandler (UINT32 InterruptNumber, OSD_HANDLER ServiceRoutine
static void
InterruptWrapper(void *arg)
{
+ ACPI_LOCK_DECL;
+
ACPI_LOCK;
InterruptHandler(arg);
ACPI_UNLOCK;
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 29c17db..f8699f9 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -33,9 +33,7 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/proc.h>
-#include <sys/lock.h>
#include <sys/malloc.h>
-#include <sys/mutex.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/ioccom.h>
@@ -96,7 +94,9 @@ static const char* sleep_state_names[] = {
/* this has to be static, as the softc is gone when we need it */
static int acpi_off_state = ACPI_STATE_S5;
+#if __FreeBSD_version >= 500000
struct mtx acpi_mutex;
+#endif
static int acpi_modevent(struct module *mod, int event, void *junk);
static void acpi_identify(driver_t *driver, device_t parent);
@@ -230,8 +230,10 @@ acpi_identify(driver_t *driver, device_t parent)
if (device_find_child(parent, "acpi", 0) != NULL)
return_VOID;
+#if __FreeBSD_version >= 500000
/* initialise the ACPI mutex */
mtx_init(&acpi_mutex, "ACPI global lock", NULL, MTX_DEF);
+#endif
/*
* Start up the ACPI CA subsystem.
@@ -281,6 +283,7 @@ acpi_probe(device_t dev)
char buf[20];
ACPI_STATUS status;
int error;
+ ACPI_LOCK_DECL;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
@@ -315,6 +318,7 @@ acpi_attach(device_t dev)
#ifdef ACPI_DEBUGGER
char *debugpoint;
#endif
+ ACPI_LOCK_DECL;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
ACPI_LOCK;
@@ -692,6 +696,7 @@ acpi_isa_get_logicalid(device_t dev)
ACPI_DEVICE_INFO devinfo;
ACPI_STATUS error;
u_int32_t pnpid;
+ ACPI_LOCK_DECL;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
@@ -1439,6 +1444,7 @@ acpi_Disable(struct acpi_softc *sc)
static void
acpi_system_eventhandler_sleep(void *arg, int state)
{
+ ACPI_LOCK_DECL;
ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, state);
ACPI_LOCK;
@@ -1451,6 +1457,7 @@ acpi_system_eventhandler_sleep(void *arg, int state)
static void
acpi_system_eventhandler_wakeup(void *arg, int state)
{
+ ACPI_LOCK_DECL;
ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, state);
/* Well, what to do? :-) */
@@ -1803,6 +1810,7 @@ acpiioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td)
struct acpi_softc *sc;
struct acpi_ioctl_hook *hp;
int error, xerror, state;
+ ACPI_LOCK_DECL;
ACPI_LOCK;
diff --git a/sys/dev/acpica/acpi_battery.c b/sys/dev/acpica/acpi_battery.c
index f245c8f..329d64a 100644
--- a/sys/dev/acpica/acpi_battery.c
+++ b/sys/dev/acpica/acpi_battery.c
@@ -30,9 +30,7 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/proc.h>
-#include <sys/lock.h>
#include <sys/malloc.h>
-#include <sys/mutex.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/ioccom.h>
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index d37ccfd..30c1cfe 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -259,6 +259,7 @@ static void
acpi_cpu_init_throttling(void *arg)
{
int cpu_temp_speed;
+ ACPI_LOCK_DECL;
ACPI_LOCK;
@@ -352,6 +353,7 @@ acpi_cpu_power_profile(void *arg)
{
int state;
u_int32_t new;
+ ACPI_LOCK_DECL;
state = power_profile_get_state();
if (state != POWER_PROFILE_PERFORMANCE &&
diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c
index cfb2239..96da6d3 100644
--- a/sys/dev/acpica/acpi_ec.c
+++ b/sys/dev/acpica/acpi_ec.c
@@ -618,9 +618,7 @@ EcWaitEventIntr(struct acpi_ec_softc *sc, EC_EVENT Event)
ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, (UINT32)Event);
/* XXX this should test whether interrupts are available some other way */
-#ifdef ACPI_EC_EVENT_DRIVEN
if(cold)
-#endif
return_ACPI_STATUS(EcWaitEvent(sc, Event));
if (!EcIsLocked(sc))
diff --git a/sys/dev/acpica/acpi_lid.c b/sys/dev/acpica/acpi_lid.c
index f83b2de..5a4b8cc 100644
--- a/sys/dev/acpica/acpi_lid.c
+++ b/sys/dev/acpica/acpi_lid.c
@@ -33,8 +33,6 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/bus.h>
-#include <sys/lock.h>
-#include <sys/mutex.h>
#include <sys/proc.h>
#include "acpi.h"
diff --git a/sys/dev/acpica/acpi_powerres.c b/sys/dev/acpica/acpi_powerres.c
index 1526a93..fc42695 100644
--- a/sys/dev/acpica/acpi_powerres.c
+++ b/sys/dev/acpica/acpi_powerres.c
@@ -30,9 +30,7 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/proc.h>
-#include <sys/lock.h>
#include <sys/malloc.h>
-#include <sys/mutex.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/ioccom.h>
diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c
index 74fc962..7806180 100644
--- a/sys/dev/acpica/acpi_thermal.c
+++ b/sys/dev/acpica/acpi_thermal.c
@@ -31,8 +31,6 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/kthread.h>
-#include <sys/lock.h>
-#include <sys/mutex.h>
#include <sys/bus.h>
#include <sys/proc.h>
#include <sys/reboot.h>
@@ -145,6 +143,7 @@ static int
acpi_tz_probe(device_t dev)
{
int result;
+ ACPI_LOCK_DECL;
ACPI_LOCK;
@@ -171,6 +170,7 @@ acpi_tz_attach(device_t dev)
struct acpi_softc *acpi_sc;
int error;
char oidname[8];
+ ACPI_LOCK_DECL;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
@@ -665,6 +665,7 @@ acpi_tz_active_sysctl(SYSCTL_HANDLER_ARGS)
struct acpi_tz_softc *sc;
int active;
int error;
+ ACPI_LOCK_DECL;
ACPI_LOCK;
@@ -757,6 +758,7 @@ acpi_tz_power_profile(void *arg)
ACPI_STATUS status;
struct acpi_tz_softc *sc = (struct acpi_tz_softc *)arg;
int state;
+ ACPI_LOCK_DECL;
state = power_profile_get_state();
if (state != POWER_PROFILE_PERFORMANCE &&
@@ -796,6 +798,7 @@ acpi_tz_thread(void *arg)
{
device_t *devs;
int devcount, i;
+ ACPI_LOCK_DECL;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
@@ -806,7 +809,9 @@ acpi_tz_thread(void *arg)
for (;;) {
tsleep(&acpi_tz_proc, PZERO, "nothing", hz * acpi_tz_polling_rate);
+#if __FreeBSD_version >= 500000
mtx_lock(&Giant);
+#endif
if (devcount == 0)
devclass_get_devices(acpi_tz_devclass, &devs, &devcount);
@@ -816,6 +821,8 @@ acpi_tz_thread(void *arg)
acpi_tz_timeout(device_get_softc(devs[i]));
ACPI_UNLOCK;
+#if __FreeBSD_version >= 500000
mtx_unlock(&Giant);
+#endif
}
}
OpenPOWER on IntegriCloud