X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/fd883ff8b15778611731b6e7c9cdacb5470c3901..a2eb4407e9772cf1057e7ea093250d5d38245c1d:/lincan/src/can_devrtl.c diff --git a/lincan/src/can_devrtl.c b/lincan/src/can_devrtl.c index c7ff970..ad6d6c2 100644 --- a/lincan/src/can_devrtl.c +++ b/lincan/src/can_devrtl.c @@ -52,14 +52,21 @@ unsigned int can_rtl_isr( unsigned int irq_num, struct pt_regs *r ) set_bit(MSGOBJ_WORKER_WAKE_b,&chip->pend_flags); if(chip->flags & CHIP_IRQ_PCI) irq2linux=1; +#ifdef CAN_ENABLE_VME_SUPPORT + if (chip->flags & CHIP_IRQ_VME) + tundra_rtl_ack_irq_vector(irq_num); +#endif if(!chip->worker_thread) continue; thread=chip->worker_thread; pthread_kill(thread,RTL_SIGNAL_WAKEUP); } } - if(irq2linux) - rtl_global_pend_irq(irq_num); + /* The following lines are commented out because of it is not + * possible to share level activated (PCI) IRQs between Linux + * and RT-Linux. */ +/* if(irq2linux) */ +/* rtl_global_pend_irq(irq_num); */ /*if(thread) rtl_reschedule_thread(thread);*/ @@ -88,6 +95,7 @@ void * can_chip_worker_thread(void *arg) struct msgobj_t *obj; int ret, i; int loop_cnt; + rtl_irqstate_t flags; if(!chip) return 0; @@ -154,11 +162,14 @@ void * can_chip_worker_thread(void *arg) } + rtl_no_interrupts (flags); RTL_MARK_SUSPENDED(pthread_self()); if(test_and_clear_bit(MSGOBJ_WORKER_WAKE_b,&chip->pend_flags)){ RTL_MARK_READY(pthread_self()); + rtl_restore_interrupts (flags); continue; } + rtl_restore_interrupts (flags); rtl_schedule(); }