summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1999-07-12 18:08:33 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1999-07-12 18:08:33 +0000
commit4e1dabe54d84a3694f330a533becc66e0c70813a (patch)
treead45182b2ec4237c21c7f747a44e1fb63360d756 /sys/arch
parent236d65c5509d5dd20c815ed24f7bbd56fd5f508e (diff)
better set_psw() usage
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/hppa/dev/pdc.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/sys/arch/hppa/dev/pdc.c b/sys/arch/hppa/dev/pdc.c
index 9b5bd32234b..100f4dd1fca 100644
--- a/sys/arch/hppa/dev/pdc.c
+++ b/sys/arch/hppa/dev/pdc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdc.c,v 1.6 1999/04/20 20:24:18 mickey Exp $ */
+/* $OpenBSD: pdc.c,v 1.7 1999/07/12 18:08:32 mickey Exp $ */
/*
* Copyright (c) 1998,1999 Michael Shalayeff
@@ -321,30 +321,25 @@ pdc_call(func, pdc_flag)
iodcio_t func;
int pdc_flag;
{
- register register_t ret, psw;
+ register register_t ret, opsw;
va_list va;
- int args[11], i;
+ int args[10], 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);
- }
+ if (kernelmapped)
+ opsw = set_psw(PSW_Q |
+ ((!pdc_flag && args[0] == PDC_PIM)? PSW_M:0));
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]);
+ args[5], args[6], args[7], args[8], args[9]);
- if (kernelmapped) {
- set_psw(KERNEL_PSW);
- }
+ if (kernelmapped)
+ set_psw(opsw);
return ret;
}
+