diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2008-01-10 18:25:47 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2008-01-10 18:25:47 +0000 |
commit | bc0ff4737c6bc7f2ee76d3278085bd60b3f70b54 (patch) | |
tree | 519a8f55e772fff161af1d60205ea1fc44706f48 /c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/irq.c | |
parent | 2008-01-09 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-bc0ff4737c6bc7f2ee76d3278085bd60b3f70b54.tar.bz2 |
2008-01-10 Till Straumann <strauman@slac.stanford.edu>
* new-exceptions/bspsupport/irq.c: When unhooking
and ISR only disable IRQs at the PIC if we are
unhooking the last ISR.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/irq.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/irq.c b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/irq.c index 7a154e2195..054dd114bf 100644 --- a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/irq.c +++ b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/irq.c @@ -230,20 +230,13 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq) } } else - { - if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) - { - rtems_interrupt_enable(level); - return 0; - } - } - - /* - * disable_irq_at_pic is supposed to ignore - * requests to disable interrupts outside - * of the range handled by the PIC - */ - BSP_disable_irq_at_pic(irq->name); + { + if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) + { + rtems_interrupt_enable(level); + return 0; + } + } /* * Disable interrupt on device @@ -277,6 +270,16 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq) free(vchain); } + /* Only disable at PIC if we removed the last handler */ + if ( rtems_hdl_tbl[irq->name].hdl == default_rtems_entry.hdl ) { + /* + * disable_irq_at_pic is supposed to ignore + * requests to disable interrupts outside + * of the range handled by the PIC; + */ + BSP_disable_irq_at_pic(irq->name); + } + rtems_interrupt_enable(level); return 1; |