Index: c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
===================================================================
--- c/src/lib/libcpu/powerpc/ppc403/clock/clock.c	(revision 3235ad9a2cd717df901853ad5220a4aaffae84a9)
+++ c/src/lib/libcpu/powerpc/ppc403/clock/clock.c	(revision 3a4ae6c210bcc37754767966f1128ae23c77b6af)
@@ -34,4 +34,5 @@
 #include <bsp.h>
 #include <clockdrv.h>
+#include <rtems/libio.h>
 
 #include <stdlib.h>                     /* for atexit() */
@@ -43,30 +44,13 @@
 static rtems_boolean auto_restart;
 
-rtems_device_driver Clock_initialize(
-  rtems_device_major_number major,
-  rtems_device_minor_number minor,
-  void *pargp,
-  rtems_id tid,
-  rtems_unsigned32 *rval
-)
-{
-    Install_clock(Clock_isr);
-}
-
-
-void
-ReInstall_clock(rtems_isr_entry new_clock_isr)
-{
-    rtems_isr_entry previous_isr;
-    rtems_unsigned32 isrlevel = 0;
-
-    rtems_interrupt_disable(isrlevel);
-    
-    rtems_interrupt_catch(new_clock_isr, PPC_IRQ_PIT,
-			  &previous_isr);
-
-    rtems_interrupt_enable(isrlevel);
-}
-
+void Clock_exit( void );
+ 
+/*
+ * These are set by clock driver during its init
+ */
+ 
+rtems_device_major_number rtems_clock_major = ~0;
+rtems_device_minor_number rtems_clock_minor;
+ 
 static INLINE rtems_unsigned32 get_itimer(void)
 {
@@ -76,4 +60,67 @@
 
     return rc;
+}
+
+/*
+ *  ISR Handler
+ */
+ 
+rtems_isr
+Clock_isr(rtems_vector_number vector)
+{
+    if (!auto_restart)
+	{
+	    rtems_unsigned32 clicks_til_next_interrupt;
+	    rtems_unsigned32 itimer_value;
+
+	    /*
+	     * setup for next interrupt; making sure the new value is reasonably
+	     * in the future.... in case we lost out on an interrupt somehow
+	     */
+
+	    itimer_value = get_itimer();
+	    tick_time += pit_value;
+
+	    /*
+	     * how far away is next interrupt *really*
+	     * It may be a long time; this subtraction works even if
+	     * Clock_clicks_interrupt < Clock_clicks_low_order via
+	     * the miracle of unsigned math.
+	     */
+	    clicks_til_next_interrupt = tick_time - itimer_value;
+
+	    /*
+	     * If it is too soon then bump it up.
+	     * This should only happen if CPU_HPPA_CLICKS_PER_TICK is too small.
+	     * But setting it low is useful for debug, so...
+	     */
+
+	    if (clicks_til_next_interrupt < 400)
+		{
+		    tick_time = itimer_value + 1000;
+		    clicks_til_next_interrupt = 1000;
+		    /* XXX: count these! this should be rare */
+		}
+
+	    /*
+	     * If it is too late, that means we missed the interrupt somehow.
+	     * Rather than wait 35-50s for a wrap, we just fudge it here.
+	     */
+	    
+	    if (clicks_til_next_interrupt > pit_value)
+		{
+		    tick_time = itimer_value + 1000;
+		    clicks_til_next_interrupt = 1000;
+		    /* XXX: count these! this should never happen :-) */
+		}
+
+	    asm volatile ("mtpit %0" :: "r" (clicks_til_next_interrupt));
+	}
+
+    asm volatile ( "mttsr %0" :: "r" (0x08000000));
+
+    Clock_driver_ticks++;
+
+    rtems_clock_tick();
 }
 
@@ -132,63 +179,18 @@
 }
 
-
-rtems_isr
-Clock_isr(rtems_vector_number vector)
-{
-    if (!auto_restart)
-	{
-	    rtems_unsigned32 clicks_til_next_interrupt;
-	    rtems_unsigned32 itimer_value;
-
-	    /*
-	     * setup for next interrupt; making sure the new value is reasonably
-	     * in the future.... in case we lost out on an interrupt somehow
-	     */
-
-	    itimer_value = get_itimer();
-	    tick_time += pit_value;
-
-	    /*
-	     * how far away is next interrupt *really*
-	     * It may be a long time; this subtraction works even if
-	     * Clock_clicks_interrupt < Clock_clicks_low_order via
-	     * the miracle of unsigned math.
-	     */
-	    clicks_til_next_interrupt = tick_time - itimer_value;
-
-	    /*
-	     * If it is too soon then bump it up.
-	     * This should only happen if CPU_HPPA_CLICKS_PER_TICK is too small.
-	     * But setting it low is useful for debug, so...
-	     */
-
-	    if (clicks_til_next_interrupt < 400)
-		{
-		    tick_time = itimer_value + 1000;
-		    clicks_til_next_interrupt = 1000;
-		    /* XXX: count these! this should be rare */
-		}
-
-	    /*
-	     * If it is too late, that means we missed the interrupt somehow.
-	     * Rather than wait 35-50s for a wrap, we just fudge it here.
-	     */
-	    
-	    if (clicks_til_next_interrupt > pit_value)
-		{
-		    tick_time = itimer_value + 1000;
-		    clicks_til_next_interrupt = 1000;
-		    /* XXX: count these! this should never happen :-) */
-		}
-
-	    asm volatile ("mtpit %0" :: "r" (clicks_til_next_interrupt));
-	}
-
-    asm volatile ( "mttsr %0" :: "r" (0x08000000));
-
-    Clock_driver_ticks++;
-
-    rtems_clock_tick();
-}
+void
+ReInstall_clock(rtems_isr_entry new_clock_isr)
+{
+    rtems_isr_entry previous_isr;
+    rtems_unsigned32 isrlevel = 0;
+
+    rtems_interrupt_disable(isrlevel);
+    
+    rtems_interrupt_catch(new_clock_isr, PPC_IRQ_PIT,
+			  &previous_isr);
+
+    rtems_interrupt_enable(isrlevel);
+}
+
 
 /*
@@ -214,2 +216,49 @@
 }
 
+rtems_device_driver Clock_initialize(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void *pargp
+)
+{
+  Install_clock( Clock_isr );
+ 
+  /*
+   * make major/minor avail to others such as shared memory driver
+   */
+ 
+  rtems_clock_major = major;
+  rtems_clock_minor = minor;
+ 
+  return RTEMS_SUCCESSFUL;
+}
+ 
+rtems_device_driver Clock_control(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void *pargp
+)
+{
+    rtems_libio_ioctl_args_t *args = pargp;
+ 
+    if (args == 0)
+        goto done;
+ 
+    /*
+     * This is hokey, but until we get a defined interface
+     * to do this, it will just be this simple...
+     */
+ 
+    if (args->command == rtems_build_name('I', 'S', 'R', ' '))
+    {
+        Clock_isr(PPC_IRQ_PIT);
+    }
+    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
+    {
+        ReInstall_clock(args->buffer);
+    }
+ 
+done:
+    return RTEMS_SUCCESSFUL;
+}
+
Index: c/src/lib/libcpu/powerpc/ppc403/console/console.c
===================================================================
--- c/src/lib/libcpu/powerpc/ppc403/console/console.c	(revision 3235ad9a2cd717df901853ad5220a4aaffae84a9)
+++ c/src/lib/libcpu/powerpc/ppc403/console/console.c	(revision 3a4ae6c210bcc37754767966f1128ae23c77b6af)
@@ -32,7 +32,6 @@
 #define NO_BSP_INIT
 
-#include <rtems.h>
-#include "console.h"
-#include "bsp.h"
+#include <bsp.h>
+#include <rtems/libio.h>
 
 extern rtems_cpu_table           Cpu_table;             /* owned by BSP */
@@ -140,9 +139,8 @@
   rtems_device_major_number  major,
   rtems_device_minor_number  minor,
-  void                      *arg,
-  rtems_id                   self,
-  rtems_unsigned32          *status
-)
-{
+  void                      *arg
+)
+{
+  rtems_status_code status;
   register unsigned tmp;
 
@@ -165,5 +163,14 @@
   port->SPHS = (HSRDsr | HSRCts);
 
-  *status = RTEMS_SUCCESSFUL;
+  status = rtems_io_register_name(
+    "/dev/console",
+    major,
+    (rtems_device_minor_number) 0
+  );
+ 
+  if (status != RTEMS_SUCCESSFUL)
+    rtems_fatal_error_occurred(status);
+ 
+  return RTEMS_SUCCESSFUL;
 }
 
@@ -281,47 +288,102 @@
 
 /*
- * __read  -- read bytes from the serial port. Ignore fd, since
- *            we only have stdin.
- */
-
-int __read(
-  int fd,
-  char *buf,
-  int nbytes
-)
-{
-  int i = 0;
-
-  for (i = 0; i < nbytes; i++) {
-    *(buf + i) = inbyte();
-    if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) {
-      (*(buf + i++)) = '\n';
-      (*(buf + i)) = 0;
+ *  Open entry point
+ */
+ 
+rtems_device_driver console_open(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  return RTEMS_SUCCESSFUL;
+}
+ 
+/*
+ *  Close entry point
+ */
+ 
+rtems_device_driver console_close(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  return RTEMS_SUCCESSFUL;
+}
+ 
+/*
+ * read bytes from the serial port. We only have stdin.
+ */
+ 
+rtems_device_driver console_read(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  rtems_libio_rw_args_t *rw_args;
+  char *buffer;
+  int maximum;
+  int count = 0;
+ 
+  rw_args = (rtems_libio_rw_args_t *) arg;
+ 
+  buffer = rw_args->buffer;
+  maximum = rw_args->count;
+ 
+  for (count = 0; count < maximum; count++) {
+    buffer[ count ] = inbyte();
+    if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
+      buffer[ count++ ]  = '\n';
+      buffer[ count ]  = 0;
       break;
     }
   }
-  return (i);
-}
-
-/*
- * __write -- write bytes to the serial port. Ignore fd, since
- *            stdout and stderr are the same. Since we have no filesystem,
- *            open will only return an error.
- */
-
-int __write(
-  int fd,
-  char *buf,
-  int nbytes
-)
-{
-  int i;
-
-  for (i = 0; i < nbytes; i++) {
-    if (*(buf + i) == '\n') {
-      outbyte ('\r');
-    }
-    outbyte (*(buf + i));
+ 
+  rw_args->bytes_moved = count;
+  return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
+}
+ 
+/*
+ * write bytes to the serial port. Stdout and stderr are the same.
+ */
+ 
+rtems_device_driver console_write(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  int count;
+  int maximum;
+  rtems_libio_rw_args_t *rw_args;
+  char *buffer;
+ 
+  rw_args = (rtems_libio_rw_args_t *) arg;
+ 
+  buffer = rw_args->buffer;
+  maximum = rw_args->count;
+ 
+  for (count = 0; count < maximum; count++) {
+    if ( buffer[ count ] == '\n') {
+      outbyte('\r');
+    }
+    outbyte( buffer[ count ] );
   }
-  return (nbytes);
-}
+  return maximum;
+}
+ 
+/*
+ *  IO Control entry point
+ */
+ 
+rtems_device_driver console_control(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  return RTEMS_SUCCESSFUL;
+}
+
