Catch up to changes in acpivar.h to add support for using ACPI on
4-stable systems. Sponsored by: The Weather Channel
This commit is contained in:
parent
3a65df0084
commit
fc0ea94a7d
@ -129,6 +129,8 @@ AcpiOsRemoveInterruptHandler (UINT32 InterruptNumber, OSD_HANDLER ServiceRoutine
|
||||
static void
|
||||
InterruptWrapper(void *arg)
|
||||
{
|
||||
ACPI_LOCK_DECL;
|
||||
|
||||
ACPI_LOCK;
|
||||
InterruptHandler(arg);
|
||||
ACPI_UNLOCK;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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 &&
|
||||
|
@ -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))
|
||||
|
@ -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"
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user