From: David Schleef Date: Mon, 13 Aug 2001 10:23:35 +0000 (+0000) Subject: Initial priority IRQ support X-Git-Tag: r0_7_61~181 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c914846be66fa2750388925a4a655f033d08f1f0;p=comedi.git Initial priority IRQ support --- diff --git a/comedi/Makefile b/comedi/Makefile index dce14283..f911ec9b 100644 --- a/comedi/Makefile +++ b/comedi/Makefile @@ -13,9 +13,11 @@ ifneq ($(CONFIG_COMEDI_KLIB),) endif ifeq ($(CONFIG_COMEDI_RT),y) + ifneq ($(CONFIG_COMEDI_PIRQ),y) MOD_SUB_DIRS += rt_pend_tq SUB_DIRS += rt_pend_tq EXTRA_OBJS := rt_pend_tq/rt_pend_tq.o + endif endif MOD_LIST_NAME := MISC_MODULES diff --git a/comedi/rt.c b/comedi/rt.c index b481a52c..f382a54a 100644 --- a/comedi/rt.c +++ b/comedi/rt.c @@ -59,6 +59,12 @@ #define RT_spin_unlock_irq(x) do{rtl_spin_unlock(x);RT_unprotect();}while(0) #endif +#ifdef CONFIG_PRIORITY_IRQ +#define RT_protect() __local_irq_disable() +#define RT_unprotect() __local_irq_enable() +#define RT_spin_lock_irq(x) spin_lock_hard_irq(x) +#define RT_spin_unlock_irq(x) spin_unlock_hard_irq(x) +#endif struct comedi_irq_struct { int rt; @@ -346,4 +352,37 @@ void comedi_rt_cleanup(void) #endif +#ifdef CONFIG_COMEDI_PIRQ +static int rt_get_irq(struct comedi_irq_struct *it) +{ + int ret; + + free_irq(it->irq,it->dev_id); + ret=request_irq(it->irq,it->handler,it->flags|SA_PRIORITY, + it->device,it->dev_id); + + return ret; +} + +static int rt_release_irq(struct comedi_irq_struct *it) +{ + int ret; + + free_irq(it->irq,it->dev_id); + ret=request_irq(it->irq,it->handler,it->flags, + it->device,it->dev_id); + + return ret; +} + +void comedi_rt_init(void) +{ + //rt_pend_tq_init(); +} + +void comedi_rt_cleanup(void) +{ + //rt_pend_tq_cleanup(); +} +#endif