summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-02-12 05:23:28 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-02-12 05:23:28 +0000
commit8d8c991cf0d879846a6732ca48f7952c9bd0a879 (patch)
tree2fc278f3d04abff49a613e8ec43e1a0499c1c44e /sys
parenta01373409717027e19a0dd93cef069497aa498ec (diff)
small repairs to hpmc and toc handlers
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hppa/hppa/locore.S17
-rw-r--r--sys/arch/hppa/hppa/machdep.c27
2 files changed, 38 insertions, 6 deletions
diff --git a/sys/arch/hppa/hppa/locore.S b/sys/arch/hppa/hppa/locore.S
index f0e86519fc4..db667355df5 100644
--- a/sys/arch/hppa/hppa/locore.S
+++ b/sys/arch/hppa/hppa/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.52 2002/02/11 21:29:37 mickey Exp $ */
+/* $OpenBSD: locore.S,v 1.53 2002/02/12 05:23:27 mickey Exp $ */
/*
* Copyright (c) 1998-2001 Michael Shalayeff
@@ -1027,6 +1027,21 @@ 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() */
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index 7e39aa3d9c8..3f135d0cd7b 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.56 2002/02/11 19:42:11 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.57 2002/02/12 05:23:27 mickey Exp $ */
/*
* Copyright (c) 1999-2002 Michael Shalayeff
@@ -323,15 +323,29 @@ hppa_init(start)
/* setup hpmc handler */
{
- extern u_int hpmc_v; /* from locore.s */
- register u_int *p = &hpmc_v;
+ extern u_int hpmc_v[]; /* from locore.s */
+ register u_int *p = hpmc_v;
if (pdc_call((iodcio_t)pdc, 0, PDC_INSTR, PDC_INSTR_DFLT, p))
- *p = 0; /* XXX nop is more appropriate? */
+ *p = 0x08000240;
+ p[6] = (u_int)&hpmc_dump;
+ p[7] = 32;
p[5] = -(p[0] + p[1] + p[2] + p[3] + p[4] + p[6] + p[7]);
}
+ {
+ extern u_int hppa_toc[], hppa_toc_end[];
+ register u_int cksum, *p;
+
+ for (cksum = 0, p = hppa_toc; p < hppa_toc_end; p++)
+ cksum += *p;
+
+ *p = cksum;
+ PAGE0->ivec_toc = (int (*)(void))hppa_toc;
+ PAGE0->ivec_toclen = hppa_toc_end - hppa_toc + 1;
+ }
+
/* BTLB params */
if ((error = pdc_call((iodcio_t)pdc, 0, PDC_BLOCK_TLB,
PDC_BTLB_DEFAULT, &pdc_btlb)) < 0) {
@@ -912,8 +926,8 @@ boot(howto)
if (howto & RB_DUMP)
dumpsys();
-haltsys:
doshutdownhooks();
+haltsys:
if (howto & RB_HALT) {
printf("System halted!\n");
@@ -955,7 +969,10 @@ cpu_dumpsize()
void
hpmc_dump()
{
+ printf("HPMC\n");
+ cold = 0;
+ boot(RB_NOSYNC);
}
int