diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-04-30 01:12:30 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-04-30 01:12:30 +0000 |
commit | 88066c9a0811bfa66b9e85d8790cbfab53d8d481 (patch) | |
tree | ad08df2b2e5d355769383393b043398e0c0dc4b0 /sys/arch/sparc/include | |
parent | 953dd9ca5783b67d25ed99deab898083deb94c3f (diff) |
Fix an ancient problem in how sparc interrupts are handled.
There are many interrupt handlers that assume that they don't need to do
any spl protection in their code because the interrupt of some level can't
be interrupted by an interrupt of the same level. The problem is that some
interrupt handlers have hardware levels that are lower then their "software"
levels.
Fix this by adding an additional field to struct intrhand that specifies which
"software" level an interrupt handler has and blocks that level while handling
the interrupt. This new field is initialized in intr_establish which gets
an additional argument (which can be -1 meaning that the interrupt handler
doesn't need to block any additional level).
ok deraadt@
Diffstat (limited to 'sys/arch/sparc/include')
-rw-r--r-- | sys/arch/sparc/include/cpu.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/sparc/include/cpu.h b/sys/arch/sparc/include/cpu.h index 7400cc6e4c0..97778d3740e 100644 --- a/sys/arch/sparc/include/cpu.h +++ b/sys/arch/sparc/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.13 2002/03/14 03:16:00 millert Exp $ */ +/* $OpenBSD: cpu.h,v 1.14 2002/04/30 01:12:28 art Exp $ */ /* $NetBSD: cpu.h,v 1.24 1997/03/15 22:25:15 pk Exp $ */ /* @@ -153,15 +153,18 @@ extern int foundfpu; /* true => we have an FPU */ * ``not me'' or 1 (``I took care of it''). intr_establish() inserts a * handler into the list. The handler is called with its (single) * argument, or with a pointer to a clockframe if ih_arg is NULL. + * ih_ipl specifies the interrupt level that should be blocked when + * executing this handler. */ struct intrhand { int (*ih_fun)(void *); void *ih_arg; + int ih_ipl; struct intrhand *ih_next; }; extern struct intrhand *intrhand[15]; -void intr_establish(int level, struct intrhand *); -void vmeintr_establish(int vec, int level, struct intrhand *); +void intr_establish(int level, struct intrhand *, int); +void vmeintr_establish(int vec, int level, struct intrhand *, int); /* * intr_fasttrap() is a lot like intr_establish, but is used for ``fast'' |