PERFORCE change 140426 for review
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Tue Apr 22 21:27:13 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=140426
Change 140426 by gonzo at gonzo_jeeves on 2008/04/22 21:26:19
o Remove noisy printf's from mask/unmas functions
o Add new parameter (irq) to intr_event_create call
o Use intr_event_handle instead of handmade loop
Affected files ...
.. //depot/projects/mips2-jnpr/src/sys/mips/mips/intr_machdep.c#10 edit
Differences ...
==== //depot/projects/mips2-jnpr/src/sys/mips/mips/intr_machdep.c#10 (text+ko) ====
@@ -57,14 +57,12 @@
mips_mask_irq(void)
{
- printf("Unimplemented: %s\n", __func__);
}
void
mips_unmask_irq(void)
{
- printf("Unimplemented: %s\n", __func__);
}
void
@@ -84,9 +82,9 @@
event = hardintr_events[irq];
if (event == NULL) {
- error = intr_event_create(&event, (void *)irq, 0,
+ error = intr_event_create(&event, (void *)irq, 0, irq,
(mask_fn)mips_mask_irq, (mask_fn)mips_unmask_irq,
- (mask_fn)mips_unmask_irq, NULL, "hard intr%d:", irq);
+ NULL, NULL, "hard intr%d:", irq);
if (error)
return;
hardintr_events[irq] = event;
@@ -122,9 +120,9 @@
event = softintr_events[irq];
if (event == NULL) {
- error = intr_event_create(&event, (void *)irq, 0,
+ error = intr_event_create(&event, (void *)irq, 0, irq,
(mask_fn)mips_mask_irq, (mask_fn)mips_unmask_irq,
- (mask_fn)mips_unmask_irq, NULL, "intr%d:", irq);
+ NULL, NULL, "intr%d:", irq);
if (error)
return;
softintr_events[irq] = event;
@@ -139,13 +137,11 @@
void
cpu_intr(struct trapframe *tf)
{
- struct intr_handler *ih;
struct intr_event *event;
register_t cause;
int hard;
int intr;
int i;
- int thread;
critical_enter();
@@ -171,26 +167,16 @@
break;
}
- if (!event || TAILQ_EMPTY(&event->ie_handlers))
- {
- printf("stray %s interrupt %d\n",
- hard ? "hard" : "soft", i);
- continue;
+ if (!event || TAILQ_EMPTY(&event->ie_handlers)) {
+ printf("stray %s interrupt %d\n",
+ hard ? "hard" : "soft", i);
+ continue;
}
- /* Execute fast handlers. */
- thread = 0;
- TAILQ_FOREACH(ih, &event->ie_handlers, ih_next) {
- if (ih->ih_filter == NULL)
- thread = 1;
- else
- ih->ih_filter(ih->ih_argument ?
- ih->ih_argument : tf);
+ if (intr_event_handle(event, tf) != 0) {
+ printf("stray %s interrupt %d\n",
+ hard ? "hard" : "soft", i);
}
-
- /* Schedule thread if needed. */
- if (thread)
- intr_event_schedule_thread(event);
}
KASSERT(i == 0, ("all interrupts handled"));
More information about the p4-projects
mailing list