From: Ian Abbott Date: Mon, 16 Jul 2007 17:39:58 +0000 (+0000) Subject: Fix real-time interrupt handlers for 2.6.19. X-Git-Tag: r0_7_74~48 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5be6dee65ef175dc7a6edb05fc754618d59a0a6f;p=comedi.git Fix real-time interrupt handlers for 2.6.19. --- diff --git a/comedi/rt.c b/comedi/rt.c index debe8a1b..968d0c8a 100644 --- a/comedi/rt.c +++ b/comedi/rt.c @@ -54,7 +54,7 @@ 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; @@ -65,7 +65,8 @@ static int comedi_rt_release_irq(struct comedi_irq_struct *it); 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; @@ -194,7 +195,7 @@ static void handle_void_irq(int irq) 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 } @@ -312,7 +313,7 @@ static void fusion_handle_irq(unsigned int irq, void *cookie) { 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); } @@ -345,13 +346,13 @@ void comedi_rt_cleanup(void) /* 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; } diff --git a/comedi/rt_pend_tq.c b/comedi/rt_pend_tq.c index 2681ef9d..a261169a 100644 --- a/comedi/rt_pend_tq.c +++ b/comedi/rt_pend_tq.c @@ -69,7 +69,7 @@ void rt_pend_irq_handler(void) #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) { diff --git a/include/linux/comedi_rt.h b/include/linux/comedi_rt.h index 8e23dfb3..8fc06446 100644 --- a/include/linux/comedi_rt.h +++ b/include/linux/comedi_rt.h @@ -57,8 +57,8 @@ #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); diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 1cea8d93..881f02b8 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -56,8 +56,12 @@ typedef void irqreturn_t; /* 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