summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2008-01-10 18:25:47 +0000
committerTill Straumann <strauman@slac.stanford.edu>2008-01-10 18:25:47 +0000
commitbc0ff4737c6bc7f2ee76d3278085bd60b3f70b54 (patch)
tree519a8f55e772fff161af1d60205ea1fc44706f48 /c
parent2008-01-09 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-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 'c')
-rw-r--r--c/src/lib/libcpu/powerpc/ChangeLog6
-rw-r--r--c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/irq.c31
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 <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.
+
2007-12-11 Till Straumann <strauman@slac.stanford.edu>
* 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;