Module: xenomai-2.5
Branch: master
Commit: 419039b5e68b339a5466a217320f5d2f9d452757
URL:    
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=419039b5e68b339a5466a217320f5d2f9d452757

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Jan 11 17:31:31 2010 +0100

nios2: use rthal_irqdesc_lock/unlock()

---

 ksrc/arch/nios2/hal.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/ksrc/arch/nios2/hal.c b/ksrc/arch/nios2/hal.c
index fdee09a..3e5deea 100644
--- a/ksrc/arch/nios2/hal.c
+++ b/ksrc/arch/nios2/hal.c
@@ -132,12 +132,16 @@ int rthal_irq_host_request(unsigned irq,
            rthal_irq_descp(irq) == NULL)
                return -EINVAL;
 
+       rthal_irqdesc_lock(irq, flags);
+
        if (rthal_linux_irq[irq].count++ == 0 && rthal_irq_descp(irq)->action) {
                rthal_linux_irq[irq].flags =
                    rthal_irq_descp(irq)->action->flags;
                rthal_irq_descp(irq)->action->flags |= IRQF_SHARED;
        }
 
+       rthal_irqdesc_unlock(irq, flags);
+
        return request_irq(irq, handler, IRQF_SHARED, name, dev_id);
 }
 
@@ -150,10 +154,14 @@ int rthal_irq_host_release(unsigned irq, void *dev_id)
 
        free_irq(irq, dev_id);
 
+       rthal_irqdesc_lock(irq, flags);
+
        if (--rthal_linux_irq[irq].count == 0 && rthal_irq_descp(irq)->action)
                rthal_irq_descp(irq)->action->flags =
                    rthal_linux_irq[irq].flags;
 
+       rthal_irqdesc_unlock(irq, flags);
+
        return 0;
 }
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to