struct comedi_irq_struct {
int rt;
int irq;
- irqreturn_t (*handler)(int irq,void *dev_id,struct pt_regs *regs);
+ irqreturn_t (*handler)(int irq,void *dev_id PT_REGS_ARG);
unsigned long flags;
const char *device;
comedi_device *dev_id;
static struct comedi_irq_struct *comedi_irqs[NR_IRQS];
-int comedi_request_irq(unsigned irq, irqreturn_t (*handler)(int, void *,struct pt_regs *),
+int comedi_request_irq(unsigned irq, irqreturn_t (*handler)(int, void *
+ PT_REGS_ARG),
unsigned long flags,const char *device,comedi_device *dev_id)
{
struct comedi_irq_struct *it;
rt_printk("comedi: null irq struct?\n");
return;
}
- it->handler(irq, it->dev_id, NULL);
+ it->handler(irq, it->dev_id PT_REGS_NULL);
rt_enable_irq(irq); //needed by rtai-adeos, seems like it shouldn't hurt earlier versions
}
{
struct comedi_irq_struct *it = cookie;
- it->handler(irq, it->dev_id, NULL);
+ it->handler(irq, it->dev_id PT_REGS_NULL);
rthal_irq_enable(irq);
}
/* RTLinux section */
#ifdef CONFIG_COMEDI_RTL
-static unsigned int handle_rtl_irq(unsigned int irq,struct pt_regs *regs)
+static unsigned int handle_rtl_irq(unsigned int irq PT_REGS_ARG)
{
struct comedi_irq_struct *it;
it = comedi_irqs[irq];
if( it == NULL ) return 0;
- it->handler( irq, it->dev_id, regs );
+ it->handler( irq, it->dev_id PT_REGS_NULL );
rtl_hard_enable_irq(irq);
return 0;
}
#elif defined(CONFIG_COMEDI_FUSION)
void rt_pend_irq_handler(void * cookie)
#elif defined(CONFIG_COMEDI_RTL)
-void rt_pend_irq_handler(int irq, void *dev, struct pt_regs * regs)
+void rt_pend_irq_handler(int irq, void *dev PT_REGS_ARG)
#endif
{
while(rt_pend_head!=rt_pend_tail) {
#define rt_printk printk
#endif
-int comedi_request_irq(unsigned int irq,irqreturn_t (*handler)(int,void *,
- struct pt_regs *regs),unsigned long flags,const char *device,
+int comedi_request_irq(unsigned int irq,irqreturn_t (*handler)(int,void *
+ PT_REGS_ARG),unsigned long flags,const char *device,
comedi_device *dev_id);
void comedi_free_irq(unsigned int irq,comedi_device *dev_id);
void comedi_rt_init(void);
/* if interrupt handler prototype has pt_regs* parameter */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
#define PT_REGS_ARG , struct pt_regs *regs
+#define PT_REGS_CALL , regs
+#define PT_REGS_NULL , NULL
#else
#define PT_REGS_ARG
+#define PT_REGS_CALL
+#define PT_REGS_NULL
#endif
#endif