summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2010-08-31 17:35:13 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2010-08-31 17:35:13 +0000
commit216741766ef7eeec3a46dc65b50f813bbf93f369 (patch)
tree939443ccb6be580a6ebe8f0957a50e845957af17 /sys/arch/loongson
parentc395dc4f10dfa38484e7cc311efff12e812909b6 (diff)
Do wsdisplay suspend/resume and also the bufq dance.
Reminded by oga@, okay deraadt@.
Diffstat (limited to 'sys/arch/loongson')
-rw-r--r--sys/arch/loongson/dev/apm.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/arch/loongson/dev/apm.c b/sys/arch/loongson/dev/apm.c
index 64412d8587e..fe3e71d664e 100644
--- a/sys/arch/loongson/dev/apm.c
+++ b/sys/arch/loongson/dev/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.4 2010/08/31 10:24:46 pirofti Exp $ */
+/* $OpenBSD: apm.c,v 1.5 2010/08/31 17:35:12 pirofti Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -32,6 +32,7 @@
*/
#include "apm.h"
+#include "wsdisplay.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -40,6 +41,7 @@
#include <sys/device.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
+#include <sys/buf.h>
#include <sys/event.h>
#include <sys/mount.h>
@@ -48,6 +50,8 @@
#include <machine/cpu.h>
#include <machine/apmvar.h>
+#include <dev/wscons/wsdisplayvar.h>
+
#include <loongson/dev/kb3310var.h>
#if defined(APMDEBUG)
@@ -369,6 +373,11 @@ apm_suspend()
{
int s;
+#if NSWDISPLAY > 0
+ wsdisplay_suspend();
+#endif
+ bufq_quiesce();
+
s = splhigh();
config_suspend(TAILQ_FIRST(&alldevs), DVACT_SUSPEND);
splx(s);
@@ -382,11 +391,18 @@ apm_suspend()
int
apm_resume()
{
- int s;
+ int s, rv;
s = splhigh();
config_suspend(TAILQ_FIRST(&alldevs), DVACT_RESUME);
splx(s);
- return sys_platform->resume();
+ rv = sys_platform->resume();
+
+ bufq_restart();
+#if NWSDISPLAY > 0
+ wsdisplay_resume();
+#endif
+
+ return rv;
}