summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@openbsd.org>2003-05-16 23:55:00 +0000
committerjason <jason@openbsd.org>2003-05-16 23:55:00 +0000
commitbc20dc66b5883cbfa47efb7baabd3e23046e8060 (patch)
treef09b017beda661e123122c48a3b52f9ea4757ec3
parentThis was using the wrong buffer, and wrong lengths. fix it from me and (diff)
downloadwireguard-openbsd-bc20dc66b5883cbfa47efb7baabd3e23046e8060.tar.xz
wireguard-openbsd-bc20dc66b5883cbfa47efb7baabd3e23046e8060.zip
fix up interrupt code (ie, actually deref the ih_clr ptr correctly)
and kill some debug code
-rw-r--r--sys/arch/sparc64/sparc64/intr.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sys/arch/sparc64/sparc64/intr.c b/sys/arch/sparc64/sparc64/intr.c
index ce208ac8711..c318d1f81a1 100644
--- a/sys/arch/sparc64/sparc64/intr.c
+++ b/sys/arch/sparc64/sparc64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.14 2003/05/16 17:18:15 jason Exp $ */
+/* $OpenBSD: intr.c,v 1.15 2003/05/16 23:55:00 jason Exp $ */
/* $NetBSD: intr.c,v 1.39 2001/07/19 23:38:11 eeh Exp $ */
/*
@@ -283,7 +283,7 @@ intr_establish(level, ih)
* new interrupt handler and interpose it.
*/
#ifdef DEBUG
- printf("\nintr_establish: intr reused %x", ih->ih_number);
+ printf("intr_establish: intr reused %x\n", ih->ih_number);
#endif
if (q->ih_fun != intr_list_handler) {
@@ -306,13 +306,6 @@ intr_establish(level, ih)
nih->ih_next = (struct intrhand *)q->ih_arg;
q->ih_arg = (void *)nih;
}
-#ifdef DEBUG
- printf("\nintr_establish: vector %x pil %x mapintr %p "
- "clrintr %p fun %p arg %p target %d",
- ih->ih_number, ih->ih_pil, (void *)ih->ih_map,
- (void *)ih->ih_clr, (void *)ih->ih_fun,
- (void *)ih->ih_arg, (int)(ih->ih_map ? INTTID(*ih->ih_map) : -1));
-#endif
if(ih->ih_map) {
id = CPU_UPAID;
@@ -320,9 +313,10 @@ intr_establish(level, ih)
if(INTTID(m) != id) {
printf("\nintr_establish: changing map 0x%llx -> ", m);
m = (m & ~INTMAP_TID) | (id << INTTID_SHIFT);
- *ih->ih_map = m;
printf("0x%llx (id=%llx) ", m, id);
}
+ m |= INTMAP_V;
+ *ih->ih_map = m;
}
else {
#ifdef DEBUG
@@ -333,7 +327,15 @@ intr_establish(level, ih)
}
if (ih->ih_clr != NULL) /* Set interrupt to idle */
- ih->ih_clr = INTCLR_IDLE;
+ *ih->ih_clr = INTCLR_IDLE;
+
+#ifdef DEBUG
+ printf("\nintr_establish: vector %x pil %x mapintr %p "
+ "clrintr %p fun %p arg %p target %d",
+ ih->ih_number, ih->ih_pil, (void *)ih->ih_map,
+ (void *)ih->ih_clr, (void *)ih->ih_fun,
+ (void *)ih->ih_arg, (int)(ih->ih_map ? INTTID(*ih->ih_map) : -1));
+#endif
splx(s);
}