summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2014-09-19 20:02:26 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2014-09-19 20:02:26 +0000
commit8cabda8ec0e797cb869e8400d594ff5b45a648cf (patch)
treed1d008c50ffec7240784188a92f92da49193b4d2 /sys
parent3049847412a00294a6ba23ef63f9054ed62d2cdd (diff)
Use config_suspend_all(9).
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/acpi_machdep.c4
-rw-r--r--sys/arch/amd64/amd64/machdep.c8
-rw-r--r--sys/arch/i386/i386/acpi_machdep.c4
-rw-r--r--sys/arch/i386/i386/apm.c13
-rw-r--r--sys/arch/i386/i386/machdep.c8
-rw-r--r--sys/dev/acpi/acpi.c11
-rw-r--r--sys/kern/subr_hibernate.c6
7 files changed, 22 insertions, 32 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c
index df188e3a2bc..2e686a2b546 100644
--- a/sys/arch/amd64/amd64/acpi_machdep.c
+++ b/sys/arch/amd64/amd64/acpi_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi_machdep.c,v 1.62 2014/07/16 07:42:50 mlarkin Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.63 2014/09/19 20:02:25 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -317,7 +317,7 @@ acpi_sleep_cpu(struct acpi_softc *sc, int state)
* when we get to DVACT_POWERDOWN.
*/
boothowto |= RB_POWERDOWN;
- config_suspend(device_mainbus(), DVACT_POWERDOWN);
+ config_suspend_all(DVACT_POWERDOWN);
boothowto &= ~RB_POWERDOWN;
acpi_sleep_pm(sc, state);
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 1754f3c6dcc..ff4a9ac9e83 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.189 2014/07/21 17:25:47 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.190 2014/09/19 20:02:25 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -746,8 +746,6 @@ struct pcb dumppcb;
__dead void
boot(int howto)
{
- struct device *mainbus;
-
if ((howto & RB_POWERDOWN) != 0)
lid_suspend = 0;
@@ -781,9 +779,7 @@ boot(int howto)
haltsys:
doshutdownhooks();
- mainbus = device_mainbus();
- if (mainbus != NULL)
- config_suspend(mainbus, DVACT_POWERDOWN);
+ config_suspend_all(DVACT_POWERDOWN);
#ifdef MULTIPROCESSOR
x86_broadcast_ipi(X86_IPI_HALT);
diff --git a/sys/arch/i386/i386/acpi_machdep.c b/sys/arch/i386/i386/acpi_machdep.c
index 397daeea4a5..64f9d7cc90b 100644
--- a/sys/arch/i386/i386/acpi_machdep.c
+++ b/sys/arch/i386/i386/acpi_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi_machdep.c,v 1.55 2014/07/16 07:42:50 mlarkin Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.56 2014/09/19 20:02:25 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -340,7 +340,7 @@ acpi_sleep_cpu(struct acpi_softc *sc, int state)
* when we get to DVACT_POWERDOWN.
*/
boothowto |= RB_POWERDOWN;
- config_suspend(device_mainbus(), DVACT_POWERDOWN);
+ config_suspend_all(DVACT_POWERDOWN);
boothowto &= ~RB_POWERDOWN;
acpi_sleep_pm(sc, state);
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c
index 2981e7028d8..61cd57a5e33 100644
--- a/sys/arch/i386/i386/apm.c
+++ b/sys/arch/i386/i386/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.106 2014/09/14 14:17:23 jsg Exp $ */
+/* $OpenBSD: apm.c,v 1.107 2014/09/19 20:02:25 kettenis Exp $ */
/*-
* Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved.
@@ -241,26 +241,25 @@ apm_perror(const char *str, struct apmregs *regs)
void
apm_suspend(int state)
{
- struct device *mainbus = device_mainbus();
extern int perflevel;
int s;
#if NWSDISPLAY > 0
wsdisplay_suspend();
#endif /* NWSDISPLAY > 0 */
- config_suspend(mainbus, DVACT_QUIESCE);
+ config_suspend_all(DVACT_QUIESCE);
bufq_quiesce();
s = splhigh();
disable_intr();
- config_suspend(mainbus, DVACT_SUSPEND);
+ config_suspend_all(DVACT_SUSPEND);
/* XXX
* Flag to disk drivers that they should "power down" the disk
* when we get to DVACT_POWERDOWN.
*/
boothowto |= RB_POWERDOWN;
- config_suspend(mainbus, DVACT_POWERDOWN);
+ config_suspend_all(DVACT_POWERDOWN);
boothowto &= ~RB_POWERDOWN;
/* Send machine to sleep */
@@ -273,7 +272,7 @@ apm_suspend(int state)
rtcstart(); /* in i8254 mode, rtc is profclock */
inittodr(time_second);
- config_suspend(mainbus, DVACT_RESUME);
+ config_suspend_all(DVACT_RESUME);
enable_intr();
splx(s);
@@ -282,7 +281,7 @@ apm_suspend(int state)
cpu_setperf(perflevel);
bufq_restart();
- config_suspend(mainbus, DVACT_WAKEUP);
+ config_suspend_all(DVACT_WAKEUP);
#if NWSDISPLAY > 0
wsdisplay_resume();
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index e51d974b695..739614f811c 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.550 2014/07/21 17:25:47 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.551 2014/09/19 20:02:25 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -2557,8 +2557,6 @@ struct pcb dumppcb;
__dead void
boot(int howto)
{
- struct device *mainbus;
-
if ((howto & RB_POWERDOWN) != 0)
lid_suspend = 0;
@@ -2592,9 +2590,7 @@ boot(int howto)
haltsys:
doshutdownhooks();
- mainbus = device_mainbus();
- if (mainbus != NULL)
- config_suspend(mainbus, DVACT_POWERDOWN);
+ config_suspend_all(DVACT_POWERDOWN);
#ifdef MULTIPROCESSOR
i386_broadcast_ipi(I386_IPI_HALT);
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 3967d2c0ca9..5bf1fb3222c 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.268 2014/09/08 20:25:03 kettenis Exp $ */
+/* $OpenBSD: acpi.c,v 1.269 2014/09/19 20:02:25 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -2110,7 +2110,6 @@ acpi_indicator(struct acpi_softc *sc, int led_state)
int
acpi_sleep_state(struct acpi_softc *sc, int state)
{
- struct device *mainbus = device_mainbus();
int error = ENXIO;
int s;
@@ -2139,7 +2138,7 @@ acpi_sleep_state(struct acpi_softc *sc, int state)
wsdisplay_suspend();
#endif /* NWSDISPLAY > 0 */
- if (config_suspend(mainbus, DVACT_QUIESCE))
+ if (config_suspend_all(DVACT_QUIESCE))
goto fail_quiesce;
#ifdef HIBERNATE
@@ -2161,7 +2160,7 @@ acpi_sleep_state(struct acpi_softc *sc, int state)
disable_intr(); /* PSL_I for resume; PIC/APIC broken until repair */
cold = 1; /* Force other code to delay() instead of tsleep() */
- if (config_suspend(mainbus, DVACT_SUSPEND) != 0)
+ if (config_suspend_all(DVACT_SUSPEND) != 0)
goto fail_suspend;
acpi_sleep_clocks(sc, state);
@@ -2200,7 +2199,7 @@ acpi_sleep_state(struct acpi_softc *sc, int state)
acpi_resume_cpu(sc);
fail_pts:
- config_suspend(mainbus, DVACT_RESUME);
+ config_suspend_all(DVACT_RESUME);
fail_suspend:
cold = 0;
@@ -2220,7 +2219,7 @@ fail_suspend:
bufq_restart();
fail_quiesce:
- config_suspend(mainbus, DVACT_WAKEUP);
+ config_suspend_all(DVACT_WAKEUP);
#if NWSDISPLAY > 0
wsdisplay_resume();
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c
index 522287c0f01..99323129106 100644
--- a/sys/kern/subr_hibernate.c
+++ b/sys/kern/subr_hibernate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_hibernate.c,v 1.99 2014/07/21 01:57:55 mlarkin Exp $ */
+/* $OpenBSD: subr_hibernate.c,v 1.100 2014/09/19 20:02:25 kettenis Exp $ */
/*
* Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl>
@@ -1243,7 +1243,7 @@ hibernate_resume(void)
goto fail;
DPRINTF("hibernate: quiescing devices\n");
- if (config_suspend(device_mainbus(), DVACT_QUIESCE) != 0)
+ if (config_suspend_all(DVACT_QUIESCE) != 0)
goto fail;
(void) splhigh();
@@ -1251,7 +1251,7 @@ hibernate_resume(void)
cold = 1;
DPRINTF("hibernate: suspending devices\n");
- if (config_suspend(device_mainbus(), DVACT_SUSPEND) != 0) {
+ if (config_suspend_all(DVACT_SUSPEND) != 0) {
cold = 0;
hibernate_enable_intr_machdep();
goto fail;