summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2010-09-01 13:10:43 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2010-09-01 13:10:43 +0000
commit0f2f71bb272dbc114719fadbea707bd36f9c8726 (patch)
tree156cbb1e198ee41b74a1d4607fceb5c719ec6c3e /sys/arch/loongson
parenta18ca8e9d46f435d0896ef5eda92f2d2eb889cb7 (diff)
Clean-up the spl dance around suspend/resume. Okay miod@.
Diffstat (limited to 'sys/arch/loongson')
-rw-r--r--sys/arch/loongson/dev/apm.c13
-rw-r--r--sys/arch/loongson/dev/kb3310.c10
2 files changed, 6 insertions, 17 deletions
diff --git a/sys/arch/loongson/dev/apm.c b/sys/arch/loongson/dev/apm.c
index fe3e71d664e..1897af61e22 100644
--- a/sys/arch/loongson/dev/apm.c
+++ b/sys/arch/loongson/dev/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.5 2010/08/31 17:35:12 pirofti Exp $ */
+/* $OpenBSD: apm.c,v 1.6 2010/09/01 13:10:42 pirofti Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -87,6 +87,7 @@ int filt_apmread(struct knote *kn, long hint);
int apmkqfilter(dev_t dev, struct knote *kn);
int apm_getdefaultinfo(struct apm_power_info *);
+int apm_saved_spl;
int apm_suspend(void);
int apm_resume(void);
@@ -371,16 +372,13 @@ apm_record_event(u_int event, const char *src, const char *msg)
int
apm_suspend()
{
- int s;
-
#if NSWDISPLAY > 0
wsdisplay_suspend();
#endif
bufq_quiesce();
- s = splhigh();
+ apm_saved_spl = splhigh();
config_suspend(TAILQ_FIRST(&alldevs), DVACT_SUSPEND);
- splx(s);
if (cold)
vfs_syncwait(0);
@@ -391,13 +389,12 @@ apm_suspend()
int
apm_resume()
{
- int s, rv;
+ int rv;
- s = splhigh();
config_suspend(TAILQ_FIRST(&alldevs), DVACT_RESUME);
- splx(s);
rv = sys_platform->resume();
+ splx(apm_saved_spl);
bufq_restart();
#if NWSDISPLAY > 0
diff --git a/sys/arch/loongson/dev/kb3310.c b/sys/arch/loongson/dev/kb3310.c
index e986d6e7298..a91ed859b38 100644
--- a/sys/arch/loongson/dev/kb3310.c
+++ b/sys/arch/loongson/dev/kb3310.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kb3310.c,v 1.13 2010/08/31 12:22:38 miod Exp $ */
+/* $OpenBSD: kb3310.c,v 1.14 2010/09/01 13:10:42 pirofti Exp $ */
/*
* Copyright (c) 2010 Otto Moerbeek <otto@drijf.net>
*
@@ -93,7 +93,6 @@ struct ykbec_softc {
static struct ykbec_softc *ykbec_sc;
static int ykbec_chip_config;
-static int ykbec_apmspl;
extern void loongson_set_isa_imr(uint);
@@ -446,9 +445,6 @@ ykbec_suspend()
struct ykbec_softc *sc = ykbec_sc;
int ctrl;
- /* IRQ */
- DPRINTF(("IRQ\n"));
- ykbec_apmspl = splhigh();
/* enable isa irq 1 and 12 (PS/2 input devices) */
loongson_set_isa_imr((1 << 1) | (1 << 12));
@@ -482,10 +478,6 @@ ykbec_resume()
{
struct ykbec_softc *sc = ykbec_sc;
- /* IRQ */
- DPRINTF(("IRQ\n"));
- splx(ykbec_apmspl);
-
/* CPU */
DPRINTF(("CPU\n"));
REGVAL(LOONGSON_CHIP_CONFIG0) = ykbec_chip_config;