From bc0ff4737c6bc7f2ee76d3278085bd60b3f70b54 Mon Sep 17 00:00:00 2001 From: Till Straumann Date: Thu, 10 Jan 2008 18:25:47 +0000 Subject: [PATCH] 2008-01-10 Till Straumann * new-exceptions/bspsupport/irq.c: When unhooking and ISR only disable IRQs at the PIC if we are unhooking the last ISR. --- c/src/lib/libcpu/powerpc/ChangeLog | 6 ++++ .../powerpc/new-exceptions/bspsupport/irq.c | 31 ++++++++++--------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/c/src/lib/libcpu/powerpc/ChangeLog b/c/src/lib/libcpu/powerpc/ChangeLog index bbf218f76a..8d3eb4755e 100644 --- a/c/src/lib/libcpu/powerpc/ChangeLog +++ b/c/src/lib/libcpu/powerpc/ChangeLog @@ -1,3 +1,9 @@ +2008-01-10 Till Straumann + + * new-exceptions/bspsupport/irq.c: When unhooking + and ISR only disable IRQs at the PIC if we are + unhooking the last ISR. + 2007-12-11 Till Straumann * Makefile.am: don't normally build-in test code 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;