Index: c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
===================================================================
--- c/src/lib/libcpu/powerpc/ppc403/clock/clock.c	(revision 73b5bd5d0e7481ac2459b682a88ac43383265448)
+++ c/src/lib/libcpu/powerpc/ppc403/clock/clock.c	(revision 73cdeb6a514de2310ab01d71ef2cff3155035c52)
@@ -41,6 +41,15 @@
 #include <rtems/clockdrv.h>
 #include <rtems/libio.h>
-
 #include <stdlib.h>                     /* for atexit() */
+#include <rtems/bspIo.h>
+/*
+ * check, which exception handling code is present
+ */
+#if !defined(ppc405)
+#define PPC_HAS_CLASSIC_EXCEPTIONS TRUE
+#else
+#define PPC_HAS_CLASSIC_EXCEPTIONS FALSE
+#include <bsp/irq.h>
+#endif
 
 volatile uint32_t   Clock_driver_ticks;
@@ -79,9 +88,12 @@
  *  ISR Handler
  */
- 
-rtems_isr
-Clock_isr(rtems_vector_number vector)
-{
-      uint32_t   clicks_til_next_interrupt;
+
+#if PPC_HAS_CLASSIC_EXCEPTIONS
+rtems_isr Clock_isr(rtems_vector_number vector)
+#else
+void Clock_isr(void* handle)
+#endif
+{
+    uint32_t   clicks_til_next_interrupt;
     if (!auto_restart)
     {
@@ -139,7 +151,40 @@
 }
 
-void Install_clock(rtems_isr_entry clock_isr)
-{
-    rtems_isr_entry previous_isr;
+#if !PPC_HAS_CLASSIC_EXCEPTIONS
+int ClockIsOn(const rtems_irq_connect_data* unused)
+{
+    register uint32_t   tcr;
+ 
+    asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */
+ 
+    return (tcr & 0x04000000) != 0;
+}
+#endif
+
+void ClockOff(
+#if PPC_HAS_CLASSIC_EXCEPTIONS
+	      void
+#else
+	      const rtems_irq_connect_data* unused
+#endif
+	      )
+{
+    register uint32_t   tcr;
+ 
+    asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */
+ 
+    tcr &= ~ 0x04400000;
+ 
+    asm volatile ("mtspr 0x3da, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */ 
+}
+
+void ClockOn(
+#if PPC_HAS_CLASSIC_EXCEPTIONS
+	      void
+#else
+	      const rtems_irq_connect_data* unused
+#endif
+	      )
+{
     uint32_t   iocr;
     register uint32_t   tcr;
@@ -193,4 +238,40 @@
     pit_value = rtems_configuration_get_microseconds_per_tick() *
       rtems_cpu_configuration_get_clicks_per_usec();
+ 
+     /*
+      * Set PIT value
+      */
+
+    asm volatile ("mtspr 0x3db, %0" : : "r" (pit_value)); /* PIT */
+ 
+     /*     
+      * Set timer to autoreload, bit TCR->ARE = 1  0x0400000
+      * Enable PIT interrupt, bit TCR->PIE = 1     0x4000000
+      */
+    tick_time = get_itimer() + pit_value;
+
+    asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */ 
+    tcr = (tcr & ~0x04400000) | (auto_restart ? 0x04400000 : 0x04000000);
+#if 1
+    asm volatile ("mtspr 0x3da, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */
+#endif
+
+}
+
+
+
+void Install_clock(
+#if PPC_HAS_CLASSIC_EXCEPTIONS
+		   rtems_isr_entry clock_isr
+#else
+		   void (*clock_isr)(void *)
+#endif
+		   )
+{
+#ifdef ppc403
+    uint32_t   pvr;
+#endif /* ppc403 */
+ 
+    Clock_driver_ticks = 0;
  
     /*
@@ -202,35 +283,72 @@
      */
 
+#if PPC_HAS_CLASSIC_EXCEPTIONS
+ {
+    rtems_isr_entry previous_isr;
     rtems_interrupt_catch(clock_isr, PPC_IRQ_PIT, &previous_isr);
-
-     /*
-      * Set PIT value
-      */
-
-    asm volatile ("mtspr 0x3db, %0" : : "r" (pit_value)); /* PIT */
- 
-     /*     
-      * Set timer to autoreload, bit TCR->ARE = 1  0x0400000
-      * Enable PIT interrupt, bit TCR->PIE = 1     0x4000000
-      */
-    tick_time = get_itimer() + pit_value;
-    asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */ 
-    tcr = (tcr & ~0x04400000) | (auto_restart ? 0x04400000 : 0x04000000);
-    asm volatile ("mtspr 0x3da, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */
-
+    ClockOn();
+ }
+#else
+ {
+   rtems_irq_connect_data clockIrqConnData;
+   clockIrqConnData.on   = ClockOn;
+   clockIrqConnData.off  = ClockOff;
+   clockIrqConnData.isOn = ClockIsOn;
+   clockIrqConnData.name = BSP_PIT;
+   clockIrqConnData.hdl  = clock_isr;
+   if (!BSP_install_rtems_irq_handler (&clockIrqConnData)) {
+     printk("Unable to connect Clock Irq handler\n");
+     rtems_fatal_error_occurred(1);
+   }
+ }
+#endif
     atexit(Clock_exit);
 }
 
 void
-ReInstall_clock(rtems_isr_entry new_clock_isr)
-{
-    rtems_isr_entry previous_isr;
-    uint32_t   isrlevel = 0;
-
-    rtems_interrupt_disable(isrlevel);
+ReInstall_clock(
+#if PPC_HAS_CLASSIC_EXCEPTIONS
+		rtems_isr_entry new_clock_isr
+#else
+		void (*new_clock_isr)(void *)
+#endif
+)
+{
+  uint32_t   isrlevel = 0;
+  
+  rtems_interrupt_disable(isrlevel);
+  
+#if PPC_HAS_CLASSIC_EXCEPTIONS
+ {
+   rtems_isr_entry previous_isr;
+   rtems_interrupt_catch(new_clock_isr, PPC_IRQ_PIT, &previous_isr);
+   ClockOn();
+ }
+#else
+  {
+    rtems_irq_connect_data clockIrqConnData;
     
-    rtems_interrupt_catch(new_clock_isr, PPC_IRQ_PIT, &previous_isr);
-
-    rtems_interrupt_enable(isrlevel);
+    clockIrqConnData.name = BSP_PIT;
+    if (!BSP_get_current_rtems_irq_handler(&clockIrqConnData)) {
+      printk("Unable to stop system clock\n");
+      rtems_fatal_error_occurred(1);
+    }
+    
+    BSP_remove_rtems_irq_handler (&clockIrqConnData);
+    
+    clockIrqConnData.on   = ClockOn;
+    clockIrqConnData.off  = ClockOff;
+    clockIrqConnData.isOn = ClockIsOn;
+    clockIrqConnData.name = BSP_PIT;
+    clockIrqConnData.hdl  = new_clock_isr;
+
+    if (!BSP_install_rtems_irq_handler (&clockIrqConnData)) {
+      printk("Unable to connect Clock Irq handler\n");
+      rtems_fatal_error_occurred(1);
+    }
+  }
+#endif
+
+  rtems_interrupt_enable(isrlevel);
 }
 
@@ -244,16 +362,23 @@
  */
 
-void
-Clock_exit(void)
-{
-    register uint32_t   tcr;
- 
-    asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */
- 
-    tcr &= ~ 0x04400000;
- 
-    asm volatile ("mtspr 0x3da, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */
- 
-    (void) set_vector(0, PPC_IRQ_PIT, 1);
+void Clock_exit(void)
+{
+#if PPC_HAS_CLASSIC_EXCEPTIONS
+  ClockOff();
+ 
+  (void) set_vector(0, PPC_IRQ_PIT, 1);
+#else
+ {
+    rtems_irq_connect_data clockIrqConnData;
+    
+    clockIrqConnData.name = BSP_PIT;
+    if (!BSP_get_current_rtems_irq_handler(&clockIrqConnData)) {
+      printk("Unable to stop system clock\n");
+      rtems_fatal_error_occurred(1);
+    }
+    
+    BSP_remove_rtems_irq_handler (&clockIrqConnData);
+ }
+#endif
 }
 
@@ -294,5 +419,9 @@
     if (args->command == rtems_build_name('I', 'S', 'R', ' '))
     {
+#if PPC_HAS_CLASSIC_EXCEPTIONS
         Clock_isr(PPC_IRQ_PIT);
+#else
+        Clock_isr(NULL);
+#endif
     }
     else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
