Re: [Fault-injection-developer] RFC: KIRQ
Status: Alpha
Brought to you by:
rustyl
From: Rusty L. <ru...@li...> - 2003-01-02 23:45:44
|
I found another problem when I tried to compile you latest fi_irq.c code that uses kirq. This header file is declaring kirq_list, so that multiple object files attempt to include this header file (which I see if I try to build fi_irq.c into the kernel) then the compile fails because multiple instances of kirq_list are created. You can fix this by moving > +struct kirq kirq_list[NR_IRQS] = > + { [0 ... NR_IRQS-1] = { NULL, NULL, NULL}}; > + to kirq.c -rustyl > diff -Nru a/include/asm-i386/kirq.h b/include/asm-i386/kirq.h > --- /dev/null Wed Dec 31 16:00:00 1969 > +++ b/include/asm-i386/kirq.h Fri Dec 20 14:24:01 2002 > @@ -0,0 +1,28 @@ > +#ifndef _ASM_KIRQ_H > +#define _ASM_KIRQ_H > + > +#include <linux/errno.h> > + > +/* Define return value for kirq handler. */ > +#define KIRQ_CONTINUE 0 > +#define KIRQ_SKIP 1 > + > +struct kirq; > +typedef int (*kirq_handler_t)(struct kirq *, int, void *, struct pt_regs > *); > +struct kirq { > + void *dev_id; > + void (*isr)(int, void *, struct pt_regs *); > + kirq_handler_t handler; > +}; > + > +struct kirq kirq_list[NR_IRQS] = > + { [0 ... NR_IRQS-1] = { NULL, NULL, NULL}}; > + > +#ifdef CONFIG_KIRQ > +extern int register_kirq(int irq, char *devname, kirq_handler_t handler); > +extern int unregister_kirq(int irq); > +#else > +int register_kirq(int irq, char *devname, kirq_handler_t handler) { return > -ENOSYS; } > +int unregister_kirq(int irq) {} > +#endif /*CONFIG_KIRQ*/ > +#endif /*_ASM_KIRQ_H*/ |