Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Like in rest of the acpi(4) stack, queue all re...
details: https://anonhg.NetBSD.org/src/rev/160c492594fd
branches: trunk
changeset: 763431:160c492594fd
user: jruoho <jruoho%NetBSD.org@localhost>
date: Sat Mar 19 12:57:30 2011 +0000
description:
Like in rest of the acpi(4) stack, queue all resume hooks.
diffstat:
sys/dev/acpi/acpi_cpu.c | 11 ++++++-----
sys/dev/acpi/acpi_cpu.h | 14 +++++++-------
sys/dev/acpi/acpi_cpu_cstate.c | 22 ++++++++--------------
sys/dev/acpi/acpi_cpu_pstate.c | 36 ++++++++++++++++++++----------------
sys/dev/acpi/acpi_cpu_tstate.c | 22 +++++++++++-----------
5 files changed, 52 insertions(+), 53 deletions(-)
diffs (260 lines):
diff -r 8f363eba80d8 -r 160c492594fd sys/dev/acpi/acpi_cpu.c
--- a/sys/dev/acpi/acpi_cpu.c Sat Mar 19 08:42:41 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu.c Sat Mar 19 12:57:30 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.c,v 1.37 2011/03/05 09:47:19 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.c,v 1.38 2011/03/19 12:57:30 jruoho Exp $ */
/*-
* Copyright (c) 2010, 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.37 2011/03/05 09:47:19 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.38 2011/03/19 12:57:30 jruoho Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -695,17 +695,18 @@
acpicpu_resume(device_t self, const pmf_qual_t *qual)
{
struct acpicpu_softc *sc = device_private(self);
+ static const int handler = OSL_NOTIFY_HANDLER;
sc->sc_cold = false;
if ((sc->sc_flags & ACPICPU_FLAG_C) != 0)
- (void)acpicpu_cstate_resume(self);
+ (void)AcpiOsExecute(handler, acpicpu_cstate_resume, self);
if ((sc->sc_flags & ACPICPU_FLAG_P) != 0)
- (void)acpicpu_pstate_resume(self);
+ (void)AcpiOsExecute(handler, acpicpu_pstate_resume, self);
if ((sc->sc_flags & ACPICPU_FLAG_T) != 0)
- (void)acpicpu_tstate_resume(self);
+ (void)AcpiOsExecute(handler, acpicpu_tstate_resume, self);
return true;
}
diff -r 8f363eba80d8 -r 160c492594fd sys/dev/acpi/acpi_cpu.h
--- a/sys/dev/acpi/acpi_cpu.h Sat Mar 19 08:42:41 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu.h Sat Mar 19 12:57:30 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.h,v 1.38 2011/03/17 15:59:36 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.h,v 1.39 2011/03/19 12:57:31 jruoho Exp $ */
/*-
* Copyright (c) 2010, 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -235,16 +235,16 @@
void acpicpu_cstate_attach(device_t);
int acpicpu_cstate_detach(device_t);
void acpicpu_cstate_start(device_t);
-bool acpicpu_cstate_suspend(device_t);
-bool acpicpu_cstate_resume(device_t);
+void acpicpu_cstate_suspend(void *);
+void acpicpu_cstate_resume(void *);
void acpicpu_cstate_callback(void *);
void acpicpu_cstate_idle(void);
void acpicpu_pstate_attach(device_t);
int acpicpu_pstate_detach(device_t);
void acpicpu_pstate_start(device_t);
-bool acpicpu_pstate_suspend(device_t);
-bool acpicpu_pstate_resume(device_t);
+void acpicpu_pstate_suspend(void *);
+void acpicpu_pstate_resume(void *);
void acpicpu_pstate_callback(void *);
int acpicpu_pstate_get(struct cpu_info *, uint32_t *);
void acpicpu_pstate_set(struct cpu_info *, uint32_t);
@@ -252,8 +252,8 @@
void acpicpu_tstate_attach(device_t);
int acpicpu_tstate_detach(device_t);
void acpicpu_tstate_start(device_t);
-bool acpicpu_tstate_suspend(device_t);
-bool acpicpu_tstate_resume(device_t);
+void acpicpu_tstate_suspend(void *);
+void acpicpu_tstate_resume(void *);
void acpicpu_tstate_callback(void *);
int acpicpu_tstate_get(struct cpu_info *, uint32_t *);
void acpicpu_tstate_set(struct cpu_info *, uint32_t);
diff -r 8f363eba80d8 -r 160c492594fd sys/dev/acpi/acpi_cpu_cstate.c
--- a/sys/dev/acpi/acpi_cpu_cstate.c Sat Mar 19 08:42:41 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu_cstate.c Sat Mar 19 12:57:30 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.51 2011/03/17 15:32:18 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.52 2011/03/19 12:57:31 jruoho Exp $ */
/*-
* Copyright (c) 2010, 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.51 2011/03/17 15:32:18 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.52 2011/03/19 12:57:31 jruoho Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -134,22 +134,16 @@
(void)acpicpu_md_cstate_start(sc);
}
-bool
-acpicpu_cstate_suspend(device_t self)
+void
+acpicpu_cstate_suspend(void *aux)
{
- return true;
+ /* Nothing. */
}
-bool
-acpicpu_cstate_resume(device_t self)
+void
+acpicpu_cstate_resume(void *aux)
{
- static const ACPI_OSD_EXEC_CALLBACK func = acpicpu_cstate_callback;
- struct acpicpu_softc *sc = device_private(self);
-
- if ((sc->sc_flags & ACPICPU_FLAG_C_FADT) == 0)
- (void)AcpiOsExecute(OSL_NOTIFY_HANDLER, func, sc->sc_dev);
-
- return true;
+ acpicpu_cstate_callback(aux);
}
void
diff -r 8f363eba80d8 -r 160c492594fd sys/dev/acpi/acpi_cpu_pstate.c
--- a/sys/dev/acpi/acpi_cpu_pstate.c Sat Mar 19 08:42:41 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu_pstate.c Sat Mar 19 12:57:30 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.46 2011/03/17 15:59:36 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.47 2011/03/19 12:57:31 jruoho Exp $ */
/*-
* Copyright (c) 2010, 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.46 2011/03/17 15:59:36 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.47 2011/03/19 12:57:31 jruoho Exp $");
#include <sys/param.h>
#include <sys/kmem.h>
@@ -210,15 +210,19 @@
aprint_error_dev(self, "failed to start P-states (err %d)\n", rv);
}
-bool
-acpicpu_pstate_suspend(device_t self)
+void
+acpicpu_pstate_suspend(void *aux)
{
- struct acpicpu_softc *sc = device_private(self);
struct acpicpu_pstate *ps = NULL;
- struct cpu_info *ci = sc->sc_ci;
+ struct acpicpu_softc *sc;
+ struct cpu_info *ci;
+ device_t self = aux;
uint64_t xc;
int32_t i;
+ sc = device_private(self);
+ ci = sc->sc_ci;
+
/*
* Reset any dynamic limits.
*/
@@ -246,28 +250,28 @@
mutex_exit(&sc->sc_mtx);
if (__predict_false(ps == NULL))
- return true;
+ return;
if (sc->sc_pstate_saved == ps->ps_freq)
- return true;
+ return;
xc = xc_unicast(0, acpicpu_pstate_set_xcall, &ps->ps_freq, NULL, ci);
xc_wait(xc);
-
- return true;
}
-bool
-acpicpu_pstate_resume(device_t self)
+void
+acpicpu_pstate_resume(void *aux)
{
- struct acpicpu_softc *sc = device_private(self);
- uint32_t freq = sc->sc_pstate_saved;
+ struct acpicpu_softc *sc;
+ device_t self = aux;
+ uint32_t freq;
uint64_t xc;
+ sc = device_private(self);
+ freq = sc->sc_pstate_saved;
+
xc = xc_unicast(0, acpicpu_pstate_set_xcall, &freq, NULL, sc->sc_ci);
xc_wait(xc);
-
- return true;
}
void
diff -r 8f363eba80d8 -r 160c492594fd sys/dev/acpi/acpi_cpu_tstate.c
--- a/sys/dev/acpi/acpi_cpu_tstate.c Sat Mar 19 08:42:41 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu_tstate.c Sat Mar 19 12:57:30 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_tstate.c,v 1.26 2011/03/01 05:57:04 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_tstate.c,v 1.27 2011/03/19 12:57:31 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.26 2011/03/01 05:57:04 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.27 2011/03/19 12:57:31 jruoho Exp $");
#include <sys/param.h>
#include <sys/kmem.h>
@@ -145,23 +145,23 @@
/* Nothing. */
}
-bool
-acpicpu_tstate_suspend(device_t self)
+void
+acpicpu_tstate_suspend(void *aux)
{
- struct acpicpu_softc *sc = device_private(self);
+ struct acpicpu_softc *sc;
+ device_t self = aux;
+
+ sc = device_private(self);
mutex_enter(&sc->sc_mtx);
acpicpu_tstate_reset(sc);
mutex_exit(&sc->sc_mtx);
-
- return true;
}
-bool
-acpicpu_tstate_resume(device_t self)
+void
+acpicpu_tstate_resume(void *aux)
{
-
- return true;
+ /* Nothing. */
}
void
Home |
Main Index |
Thread Index |
Old Index