Index: c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c
===================================================================
--- c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c	(revision 9073f554f82e6a0b0512a7ef054f08b15fd44b5d)
+++ c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c	(revision 4e8de7e72a4dc33406c92655656ce926d46055e9)
@@ -1,4 +1,4 @@
-/*
- *  Clock Tick Device Driver
+/**
+ *  @brief Clock Tick Device Driver
  *
  *  This routine utilizes the Decrementer Register common to the PPC family.
@@ -6,5 +6,7 @@
  *  The tick frequency is directly programmed to the configured number of
  *  microseconds per tick.
- *
+ */
+
+/*
  *  COPYRIGHT (c) 1989-2007.
  *  On-Line Applications Research Corporation (OAR).
@@ -18,7 +20,7 @@
  */
 
-#include <rtems/system.h>
 #include <rtems.h>
 #include <rtems/libio.h>
+#include <rtems/clockdrv.h>
 #include <stdlib.h>                     /* for atexit() */
 #include <assert.h>
@@ -40,5 +42,4 @@
  *  Clock ticks since initialization
  */
-
 volatile uint32_t   Clock_driver_ticks;
 
@@ -46,17 +47,9 @@
  *  This is the value programmed into the count down timer.
  */
-
 uint32_t   Clock_Decrementer_value;
 
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
 void clockOff(void* unused)
 {
-rtems_interrupt_level l;
+  rtems_interrupt_level l;
 
   if ( ppc_cpu_is_bookE() ) {
@@ -65,8 +58,8 @@
     rtems_interrupt_enable(l);
   } else {
-  /*
-   * Nothing to do as we cannot disable all interrupts and
-   * the decrementer interrupt enable is MSR_EE
-   */
+    /*
+     * Nothing to do as we cannot disable all interrupts and
+     * the decrementer interrupt enable is MSR_EE
+     */
   }
 }
@@ -74,5 +67,5 @@
 void clockOn(void* unused)
 {
-rtems_interrupt_level l;
+  rtems_interrupt_level l;
 
   PPC_Set_decrementer( Clock_Decrementer_value );
@@ -95,5 +88,4 @@
 static void clockHandler(void)
 {
-
   #if (CLOCK_DRIVER_USE_FAST_IDLE == 1)
     do {
@@ -127,23 +119,26 @@
 void clockIsr(void *unused)
 {
-int decr;
+  int decr;
+
   /*
    *  The driver has seen another tick.
    */
   do {
-  register uint32_t flags;
-  rtems_interrupt_disable(flags);
-  __asm__ volatile (
-    "mfdec %0; add %0, %0, %1; mtdec %0"
-    : "=&r"(decr)
-    : "r"(Clock_Decrementer_value));
-  rtems_interrupt_enable(flags);
-
-  Clock_driver_ticks += 1;
-
-  /*
-   *  Real Time Clock counter/timer is set to automatically reload.
-   */
-  clock_handler();
+    register uint32_t flags;
+
+    rtems_interrupt_disable(flags);
+      __asm__ volatile (
+	"mfdec %0; add %0, %0, %1; mtdec %0"
+	: "=&r"(decr)
+	: "r"(Clock_Decrementer_value)
+      );
+    rtems_interrupt_enable(flags);
+
+    Clock_driver_ticks += 1;
+
+    /*
+     *  Real Time Clock counter/timer is set to automatically reload.
+     */
+    clock_handler();
   } while ( decr < 0 );
 }
@@ -179,10 +174,9 @@
    */
   clock_handler();
-
 }
 
 int clockIsOn(void* unused)
 {
-uint32_t   msr_value;
+  uint32_t   msr_value;
 
   _CPU_MSR_GET( msr_value );
@@ -210,5 +204,4 @@
  *
  */
-
 void Clock_exit( void )
 {
@@ -216,5 +209,5 @@
 }
 
-uint32_t Clock_driver_nanoseconds_since_last_tick(void)
+static uint32_t Clock_driver_nanoseconds_since_last_tick(void)
 {
   uint32_t clicks, tmp;
@@ -253,5 +246,5 @@
 )
 {
-rtems_interrupt_level l,tcr;
+  rtems_interrupt_level l,tcr;
 
   Clock_Decrementer_value = (BSP_bus_frequency/BSP_time_base_divisor)*
@@ -270,8 +263,8 @@
     rtems_interrupt_disable(l);
 
-    tcr  = _read_BOOKE_TCR();
-    tcr |= BOOKE_TCR_ARE;
-    tcr &= ~BOOKE_TCR_DIE;
-    _write_BOOKE_TCR(tcr);
+      tcr  = _read_BOOKE_TCR();
+      tcr |= BOOKE_TCR_ARE;
+      tcr &= ~BOOKE_TCR_DIE;
+      _write_BOOKE_TCR(tcr);
 
     rtems_interrupt_enable(l);
@@ -286,5 +279,6 @@
   );
 
-  /* if a decrementer exception was pending, it is cleared by
+  /*
+   * If a decrementer exception was pending, it is cleared by
    * executing the default (nop) handler at this point;
    * The next exception will then be taken by our clock handler.
@@ -292,5 +286,4 @@
    * the correct value.
    */
-
   clock_handler = clockHandler;
   if (!BSP_connect_clock_handler ()) {
@@ -298,8 +291,4 @@
     rtems_fatal_error_occurred(1);
   }
-  /* make major/minor avail to others such as shared memory driver */
-
-  rtems_clock_major = major;
-  rtems_clock_minor = minor;
 
   return RTEMS_SUCCESSFUL;
