summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbenno <benno@FreeBSD.org>2003-02-01 07:20:36 +0000
committerbenno <benno@FreeBSD.org>2003-02-01 07:20:36 +0000
commitad96cd6ffb29da032bc653785d8b5d9fc53e9f02 (patch)
tree3b7fdc0cb2815c079906583d61a7b773e2733dff /sys
parent551f94c8c8ef3be88bfb0d73f48d3b5c81d78454 (diff)
downloadFreeBSD-src-ad96cd6ffb29da032bc653785d8b5d9fc53e9f02.zip
FreeBSD-src-ad96cd6ffb29da032bc653785d8b5d9fc53e9f02.tar.gz
- Introduce a flags value into the interrupt handler structure.
- Copy the flags passed to inthand_add into the flags value. - If the interrupt is INTR_FAST, re-enable the irq after running the handler.
Diffstat (limited to 'sys')
-rw-r--r--sys/powerpc/include/intr_machdep.h3
-rw-r--r--sys/powerpc/powerpc/intr_machdep.c15
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/powerpc/include/intr_machdep.h b/sys/powerpc/include/intr_machdep.h
index e01ebce..2d07a8b 100644
--- a/sys/powerpc/include/intr_machdep.h
+++ b/sys/powerpc/include/intr_machdep.h
@@ -37,10 +37,11 @@ struct intr_handler {
void *ih_arg;
struct ithd *ih_ithd;
u_int ih_irq;
+ u_int ih_flags;
};
void intr_init(void (*)(void), int, void (*)(int), void (*)(int));
-void intr_setup(u_int, ih_func_t *, void *);
+void intr_setup(u_int, ih_func_t *, void *, u_int);
int inthand_add(const char *, u_int, void (*)(void *), void *, int,
void **);
int inthand_remove(u_int, void *);
diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c
index 839bbeb..8682714 100644
--- a/sys/powerpc/powerpc/intr_machdep.c
+++ b/sys/powerpc/powerpc/intr_machdep.c
@@ -108,7 +108,6 @@ intr_init(void (*handler)(void), int nirq, void (*irq_e)(int),
{
int i;
u_int32_t msr;
- u_long offset;
if (intr_initialized != 0)
panic("intr_init: interrupts intialized twice\n");
@@ -129,6 +128,7 @@ intr_init(void (*handler)(void), int nirq, void (*irq_e)(int),
intr_handlers[i].ih_func = intr_stray_handler;
intr_handlers[i].ih_arg = &intr_handlers[i];
intr_handlers[i].ih_irq = i;
+ intr_handlers[i].ih_flags = 0;
}
msr = mfmsr();
@@ -145,7 +145,7 @@ intr_init(void (*handler)(void), int nirq, void (*irq_e)(int),
}
void
-intr_setup(u_int irq, ih_func_t *ihf, void *iha)
+intr_setup(u_int irq, ih_func_t *ihf, void *iha, u_int flags)
{
u_int32_t msr;
@@ -155,6 +155,7 @@ intr_setup(u_int irq, ih_func_t *ihf, void *iha)
intr_handlers[irq].ih_func = ihf;
intr_handlers[irq].ih_arg = iha;
intr_handlers[irq].ih_irq = irq;
+ intr_handlers[irq].ih_flags = flags;
mtmsr(msr);
}
@@ -200,7 +201,7 @@ inthand_add(const char *name, u_int irq, void (*handler)(void *), void *arg,
ithread_priority(flags), flags, cookiep);
if ((flags & INTR_FAST) == 0 || error) {
- intr_setup(irq, sched_ithd, ih);
+ intr_setup(irq, sched_ithd, ih, flags);
error = 0;
}
@@ -208,7 +209,7 @@ inthand_add(const char *name, u_int irq, void (*handler)(void *), void *arg,
return (error);
if (flags & INTR_FAST)
- intr_setup(irq, handler, arg);
+ intr_setup(irq, handler, arg, flags);
intr_stray_count[irq] = 0;
@@ -229,9 +230,9 @@ inthand_remove(u_int irq, void *cookie)
mtx_lock_spin(&intr_table_lock);
if (ih->ih_ithd == NULL) {
- intr_setup(irq, intr_stray_handler, ih);
+ intr_setup(irq, intr_stray_handler, ih, 0);
} else {
- intr_setup(irq, sched_ithd, ih);
+ intr_setup(irq, sched_ithd, ih, 0);
}
mtx_unlock_spin(&intr_table_lock);
@@ -245,6 +246,8 @@ intr_handle(u_int irq)
{
intr_handlers[irq].ih_func(intr_handlers[irq].ih_arg);
+ if ((intr_handlers[irq].ih_flags & INTR_FAST) != 0)
+ irq_enable(irq);
}
static void
OpenPOWER on IntegriCloud