summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/dev/pdc.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1998-11-23 02:58:12 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1998-11-23 02:58:12 +0000
commit88e7d4486875fc2fcb7b311894048afcd2fea558 (patch)
tree81048daec1ea564058cc76d7ce1b2e4403724e56 /sys/arch/hppa/dev/pdc.c
parent59681b69f6a242cd9407d07761e6f51142bf7a9b (diff)
merge all PDC stuff in one file
Diffstat (limited to 'sys/arch/hppa/dev/pdc.c')
-rw-r--r--sys/arch/hppa/dev/pdc.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/sys/arch/hppa/dev/pdc.c b/sys/arch/hppa/dev/pdc.c
index 3ae34033a8a..4aaa73ce692 100644
--- a/sys/arch/hppa/dev/pdc.c
+++ b/sys/arch/hppa/dev/pdc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdc.c,v 1.3 1998/10/29 17:47:15 mickey Exp $ */
+/* $OpenBSD: pdc.c,v 1.4 1998/11/23 02:58:11 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -316,3 +316,35 @@ pdccnpollc(dev, on)
}
+int
+pdc_call(func, pdc_flag)
+ iodcio_t func;
+ int pdc_flag;
+{
+ register register_t ret, psw;
+ va_list va;
+ int args[11], i;
+
+ va_start(va, pdc_flag);
+ for (i = 0; i < sizeof(args)/sizeof(args[0]); i++)
+ args[i] = va_arg(va, int);
+ va_end(va);
+
+ if (kernelmapped) {
+ psw = PSW_Q;
+
+ if (!pdc_flag && args[0] == PDC_PIM)
+ psw |= PSW_M;
+
+ set_psw(psw);
+ }
+
+ ret = (func)((void *)args[0], args[1], args[2], args[3], args[4],
+ args[5], args[6], args[7], args[8], args[9], args[10]);
+
+ if (kernelmapped) {
+ set_psw(KERNEL_PSW);
+ }
+
+ return ret;
+}