summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-02-20 19:33:02 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-02-20 19:33:02 +0000
commit4bc7467c1b8f07253aa5d3cd1a7ff84886abf14b (patch)
tree1521f0cf84bffa74d9854feab659dfa3a0121c36 /sys
parentc72c118a97848396302fbe79664a3007ce878b5f (diff)
setup power failure handler (for sw-controlled power button), move toc handler
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hppa/hppa/locore.S56
-rw-r--r--sys/arch/hppa/hppa/machdep.c16
2 files changed, 53 insertions, 19 deletions
diff --git a/sys/arch/hppa/hppa/locore.S b/sys/arch/hppa/hppa/locore.S
index db667355df5..62a3825a1be 100644
--- a/sys/arch/hppa/hppa/locore.S
+++ b/sys/arch/hppa/hppa/locore.S
@@ -1,7 +1,7 @@
-/* $OpenBSD: locore.S,v 1.53 2002/02/12 05:23:27 mickey Exp $ */
+/* $OpenBSD: locore.S,v 1.54 2002/02/20 19:33:01 mickey Exp $ */
/*
- * Copyright (c) 1998-2001 Michael Shalayeff
+ * Copyright (c) 1998-2002 Michael Shalayeff
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -62,6 +62,7 @@
*/
#include <sys/errno.h>
+#include <sys/reboot.h>
#include <machine/param.h>
#include <machine/asm.h>
#include <machine/psl.h>
@@ -1027,21 +1028,6 @@ hpmc_never_dies
nop
EXIT(TLABEL(hpmc))
-ENTRY(hppa_toc,0)
-
- .import boot, code
- ldil L%boot, t1
- ldo R%boot(t1), t1
- ldi 0, arg0
- .call
- blr r0, rp
- bv,n 0(t1)
- nop
-
-ALTENTRY(hppa_toc_end)
- .word 0
-EXIT(hppa_toc)
-
.export TLABEL(emu), entry
LEAF_ENTRY(TLABEL(emu))
/* restore %r1 from CTRAP() */
@@ -1861,6 +1847,42 @@ $trapnowvirt
$trap$all$end
EXIT(TLABEL(all))
+/*
+ * transfer of control handler
+ */
+ENTRY(hppa_toc,0)
+
+ .import boot, code
+ ldil L%boot, t1
+ ldo R%boot(t1), t1
+ ldi 0, arg0
+ .call
+ blr r0, rp
+ bv,n 0(t1)
+ nop
+
+ALTENTRY(hppa_toc_end)
+ .word 0
+EXIT(hppa_toc)
+
+/*
+ * power fail recovery handler
+ */
+ENTRY(hppa_pfr,0)
+
+ .import boot, code
+ ldil L%boot, t1
+ ldo R%boot(t1), t1
+ ldi RB_HALT|RB_POWERDOWN, arg0
+ .call
+ blr r0, rp
+ bv,n 0(t1)
+ nop
+
+ALTENTRY(hppa_pfr_end)
+ .word 0
+EXIT(hppa_pfr)
+
.align 32
.export TLABEL(ibrk), entry
ENTRY(TLABEL(ibrk),0)
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index 92bc59add0d..df159898f11 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.59 2002/02/17 22:59:52 maja Exp $ */
+/* $OpenBSD: machdep.c,v 1.60 2002/02/20 19:33:01 mickey Exp $ */
/*
* Copyright (c) 1999-2002 Michael Shalayeff
@@ -349,7 +349,19 @@ hppa_init(start)
*p = cksum;
PAGE0->ivec_toc = (int (*)(void))hppa_toc;
- PAGE0->ivec_toclen = hppa_toc_end - hppa_toc + 1;
+ PAGE0->ivec_toclen = (hppa_toc_end - hppa_toc + 1) * 4;
+ }
+
+ {
+ extern u_int hppa_pfr[], hppa_pfr_end[];
+ register u_int cksum, *p;
+
+ for (cksum = 0, p = hppa_pfr; p < hppa_pfr_end; p++)
+ cksum += *p;
+
+ *p = cksum;
+ PAGE0->ivec_mempf = (int (*)(void))hppa_pfr;
+ PAGE0->ivec_mempflen = (hppa_pfr_end - hppa_pfr + 1) * 4;
}
/* BTLB params */