PERFORCE change 112655 for review
Paolo Pisati
piso at FreeBSD.org
Sun Jan 7 08:06:29 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=112655
Change 112655 by piso at piso_newluxor on 2007/01/07 16:05:58
Move intr_eoi_src() and intr_disab_src() into struct intr_event.
Affected files ...
.. //depot/projects/soc2006/intr_filter/amd64/amd64/intr_machdep.c#18 edit
.. //depot/projects/soc2006/intr_filter/arm/arm/intr.c#17 edit
.. //depot/projects/soc2006/intr_filter/i386/i386/intr_machdep.c#25 edit
.. //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#17 edit
.. //depot/projects/soc2006/intr_filter/kern/kern_intr.c#29 edit
.. //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#23 edit
.. //depot/projects/soc2006/intr_filter/sparc64/sparc64/intr_machdep.c#17 edit
.. //depot/projects/soc2006/intr_filter/sys/interrupt.h#14 edit
Differences ...
==== //depot/projects/soc2006/intr_filter/amd64/amd64/intr_machdep.c#18 (text+ko) ====
@@ -143,7 +143,7 @@
error = intr_event_create(&isrc->is_event, isrc, 0,
(mask_fn)isrc->is_pic->pic_enable_source,
(int (*)(void *))isrc->is_pic->pic_source_pending,
- "irq%d:", vector);
+ intr_eoi_src, intr_disab_eoi_src, "irq%d:", vector);
if (error)
return (error);
mtx_lock_spin(&intr_table_lock);
@@ -274,7 +274,7 @@
if (vector == 0)
clkintr_pending = 1;
- res = intr_event_handle(ie, frame, intr_eoi_src, intr_disab_eoi_src);
+ res = intr_event_handle(ie, frame);
switch(res) {
case 0:
break;
==== //depot/projects/soc2006/intr_filter/arm/arm/intr.c#17 (text+ko) ====
@@ -62,6 +62,7 @@
void arm_handler_execute(struct trapframe *, int);
void intr_callout_reset(void);
+static void intr_disab_eoi_src(void *arg);
extern struct bus_space i80321_bs_tag;
@@ -77,7 +78,8 @@
event = intr_events[irq];
if (event == NULL) {
error = intr_event_create(&event, (void *)irq, 0,
- (void (*)(void *))arm_unmask_irq, NULL, "intr%d:", irq);
+ (void (*)(void *))arm_unmask_irq, NULL, intr_eoi_src_stub,
+ intr_disab_eoi_src, "intr%d:", irq);
if (error)
return;
intr_events[irq] = event;
@@ -141,8 +143,7 @@
while ((i = arm_get_next_irq()) != -1) {
intrcnt[intrcnt_tab[i]]++;
event = intr_events[i];
- intr_event_handle(event, frame, intr_eoi_src_stub,
- intr_disab_eoi_src);
+ intr_event_handle(event, frame);
}
}
==== //depot/projects/soc2006/intr_filter/i386/i386/intr_machdep.c#25 (text+ko) ====
@@ -141,7 +141,7 @@
error = intr_event_create(&isrc->is_event, isrc, 0,
(mask_fn)isrc->is_pic->pic_enable_source,
(int (*)(void *))isrc->is_pic->pic_source_pending,
- "irq%d:", vector);
+ intr_eoi_src, intr_disab_eoi_src, "irq%d:", vector);
if (error)
return (error);
mtx_lock_spin(&intr_table_lock);
@@ -262,7 +262,7 @@
if (vector == 0)
clkintr_pending = 1;
- res = intr_event_handle(ie, frame, intr_eoi_src, intr_disab_eoi_src);
+ res = intr_event_handle(ie, frame);
switch(res) {
case 0:
break;
==== //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#17 (text+ko) ====
@@ -78,6 +78,7 @@
#endif
volatile int mc_expected, mc_received;
+static void intr_eoi_src(void *arg);
static void
dummy_perf(unsigned long vector, struct trapframe *tf)
@@ -327,7 +328,8 @@
bcopy(name, intrname, strlen(name));
}
errcode = intr_event_create(&i->event, (void *)vector, 0,
- (void (*)(void *))ia64_send_eoi, NULL, "intr:");
+ (void (*)(void *))ia64_send_eoi, NULL, intr_eoi_src,
+ intr_disab_eoi_src_stub, "intr:");
if (errcode) {
free(i, M_DEVBUF);
return errcode;
@@ -405,8 +407,7 @@
if (i->cntp)
atomic_add_long(i->cntp, 1);
- res = intr_event_handle(i->event, frame, intr_eoi_src,
- intr_disab_eoi_src_stub);
+ res = intr_event_handle(i->event, frame);
switch (res) {
case 0:
break;
==== //depot/projects/soc2006/intr_filter/kern/kern_intr.c#29 (text+ko) ====
@@ -239,7 +239,8 @@
int
intr_event_create(struct intr_event **event, void *source, int flags,
- void (*enable)(void *), int (*pending)(void *), const char *fmt, ...)
+ void (*enable)(void *), int (*pending)(void *), void (*eoi)(void *),
+ void (*disab)(void *), const char *fmt, ...)
{
struct intr_event *ie;
va_list ap;
@@ -250,7 +251,9 @@
ie = malloc(sizeof(struct intr_event), M_ITHREAD, M_WAITOK | M_ZERO);
ie->ie_source = source;
ie->ie_enable = enable;
- ie->ie_pending = pending;
+ ie->ie_pending = pending;
+ ie->ie_eoi = eoi;
+ ie->ie_disab = disab;
ie->ie_flags = flags;
TAILQ_INIT(&ie->ie_handlers);
mtx_init(&ie->ie_lock, "intr event", NULL, MTX_DEF);
@@ -983,29 +986,12 @@
* o ie: the event connected to this interrupt.
* o frame: some archs (i.e. i386) pass a frame to some.
* handlers as their main argument.
- * o intr_eoi_src(): turn off an irq.
- * o intr_disab_eoi_src(): mask and turn off an irq.
- *
- * NOTA BENE: i386 and amd64 handle their
- * interrupt controllers through the
- * intr_*_src() functions, so they are
- * defined in the MD code for these archs.
- * All the other archs (arm, ia64,
- * powerpc, sparc64, etcetc) that don't
- * use these facilities, will pass a NULL
- * pointer for arg, and use the stub
- * functions intr_eoi_src_stub() for
- * intr_eoi_src() and
- * intr_disab_eoi_src_stub() for
- * intr_disab_eoi_src().
- *
* Return value:
* o 0: everything ok.
* o EINVAL: stray interrupt.
*/
int
-intr_event_handle(struct intr_event *ie, struct trapframe *frame,
- void (*intr_eoi_src)(void *), void (*intr_disab_eoi_src)(void *))
+intr_event_handle(struct intr_event *ie, struct trapframe *frame)
{
struct intr_thread *ithd;
struct thread *td;
@@ -1028,9 +1014,9 @@
* it an EOI.
*/
if (thread & FILTER_HANDLED)
- intr_eoi_src(ie->ie_source);
+ ie->ie_eoi(ie->ie_source);
else
- intr_disab_eoi_src(ie->ie_source);
+ ie->ie_disab(ie->ie_source);
critical_exit();
/* Interrupt storm logic */
==== //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#23 (text+ko) ====
@@ -96,6 +96,7 @@
static int intrcnt_index;
static void (*irq_enable)(uintptr_t);
+static void intr_eoi_src(void *arg);
static void
intrcnt_setname(const char *name, int index)
@@ -153,7 +154,8 @@
if (i == NULL)
return (ENOMEM);
error = intr_event_create(&i->event, (void *)irq, 0,
- (void (*)(void *))irq_enable, "irq%d:", irq);
+ (void (*)(void *))irq_enable, NULL, intr_eoi_src,
+ intr_disab_eoi_src, "irq%d:", irq);
if (error) {
free(i, M_INTR);
return (error);
@@ -289,8 +291,7 @@
ie = i->event;
KASSERT(ie != NULL, ("%s: interrupt without an event", __func__));
- res = intr_event_handle(ie, NULL, intr_eoi_src,
- intr_disab_eoi_src_stub);
+ res = intr_event_handle(ie, NULL);
switch(res) {
case 0:
break;
==== //depot/projects/soc2006/intr_filter/sparc64/sparc64/intr_machdep.c#17 (text+ko) ====
@@ -272,8 +272,7 @@
iv = cookie;
ie = iv->iv_event;
- res = intr_event_handle(ie, NULL, intr_eoi_src_stub,
- intr_disab_eoi_src_stub);
+ res = intr_event_handle(ie, NULL);
switch (res) {
case 0:
break;
@@ -305,7 +304,8 @@
mtx_unlock_spin(&intr_table_lock);
if (ie == NULL) {
errcode = intr_event_create(&ie, (void *)(intptr_t)vec, 0, NULL,
- NULL, "vec%d:", vec);
+ NULL, intr_eoi_src_stub, intr_disab_eoi_src_stub, "vec%d:",
+ vec);
if (errcode)
return (errcode);
mtx_lock_spin(&intr_table_lock);
==== //depot/projects/soc2006/intr_filter/sys/interrupt.h#14 (text+ko) ====
@@ -74,6 +74,8 @@
struct intr_thread *ie_thread; /* Thread we are connected to. */
void (*ie_enable)(void *);
int (*ie_pending)(void *);
+ void (*ie_eoi)(void *);
+ void (*ie_disab)(void *);
int ie_flags;
int ie_count; /* Loop counter. */
int ie_warned; /* Warned about interrupt storm. */
More information about the p4-projects
mailing list