Index: c/src/lib/libbsp/powerpc/ChangeLog
===================================================================
--- c/src/lib/libbsp/powerpc/ChangeLog	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/ChangeLog	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -1,2 +1,7 @@
+2009-11-03	Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
+
+	* shared/clock/clock.c: Remove classic decrementer handler
+	* shared/vme/vme_universe.c: removed non-prototype warnings
+
 2009-11-03	Ralf CorsÃ©pius <ralf.corsepius@rtems.org>
 
Index: c/src/lib/libbsp/powerpc/gen5200/ChangeLog
===================================================================
--- c/src/lib/libbsp/powerpc/gen5200/ChangeLog	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/gen5200/ChangeLog	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -1,2 +1,6 @@
+2009-11-02	Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
+
+	* start/start.S: call to boot_card checked, removed warning 
+
 2009-10-22	Sebastian Huber <sebastian.huber@embedded-brains.de>
 
Index: c/src/lib/libbsp/powerpc/gen5200/start/start.S
===================================================================
--- c/src/lib/libbsp/powerpc/gen5200/start/start.S	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/gen5200/start/start.S	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -91,9 +91,4 @@
 /***********************************************************************/
 
-#warning Call to boot_card has changed and needs checking.
-#warning The call is "void boot_card(const char* cmdline);"
-#warning You need to pass a NULL.
-#warning Please check and remove these warnings.
-	
 #include <rtems/powerpc/cache.h>
 
Index: c/src/lib/libbsp/powerpc/gen83xx/ChangeLog
===================================================================
--- c/src/lib/libbsp/powerpc/gen83xx/ChangeLog	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/gen83xx/ChangeLog	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -1,2 +1,6 @@
+2009-11-02	Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
+
+	* start/start.S: call to boot_card checked, removed warning 
+
 2009-10-22	Sebastian Huber <sebastian.huber@embedded-brains.de>
 
Index: c/src/lib/libbsp/powerpc/gen83xx/start/start.S
===================================================================
--- c/src/lib/libbsp/powerpc/gen83xx/start/start.S	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/gen83xx/start/start.S	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -20,9 +20,4 @@
 
 
-#warning Call to boot_card has changed and needs checking.
-#warning The call is "void boot_card(const char* cmdline);"
-#warning You need to pass a NULL.
-#warning Please check and remove these warnings.
-	
 #include <libcpu/powerpc-utility.h> 
 #include <rtems/powerpc/cache.h>
Index: c/src/lib/libbsp/powerpc/mpc8260ads/ChangeLog
===================================================================
--- c/src/lib/libbsp/powerpc/mpc8260ads/ChangeLog	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/mpc8260ads/ChangeLog	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -1,2 +1,8 @@
+2009-11-03	Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
+
+	* start/start.S: checked and removed boot_card warning
+	* irq/irq.c: adapted exception handler parameters
+	* startup/bspstart.c: removed non-prototype warnings
+
 2009-10-23	Sebastian Huber <sebastian.huber@embedded-brains.de>
 
Index: c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am
===================================================================
--- c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -31,6 +31,7 @@
 libbsp_a_SOURCES =
 
-# pclock
-libbsp_a_SOURCES += clock/p_clock.c
+# clock
+libbsp_a_SOURCES += ../shared/clock/clock.c
+
 # console
 libbsp_a_SOURCES += console/console.c
@@ -69,5 +70,4 @@
     ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
     ../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
-    ../../../libcpu/@RTEMS_CPU@/mpc8260/clock.rel \
     ../../../libcpu/@RTEMS_CPU@/mpc8260/console-generic.rel \
     ../../../libcpu/@RTEMS_CPU@/mpc8260/cpm.rel \
Index: c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq.c
===================================================================
--- c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq.c	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq.c	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -214,5 +214,5 @@
  * High level IRQ handler called from shared_raw_irq_code_entry
  */
-int C_dispatch_irq_handler (CPU_Interrupt_frame *frame, unsigned int excNum)
+int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned excNum)
 {
   register unsigned int irq;
Index: c/src/lib/libbsp/powerpc/mpc8260ads/start/start.S
===================================================================
--- c/src/lib/libbsp/powerpc/mpc8260ads/start/start.S	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/mpc8260ads/start/start.S	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -34,9 +34,4 @@
 #include <rtems/asm.h>
 
-#warning Call to boot_card has changed and needs checking.
-#warning The call is "void boot_card(const char* cmdline);"
-#warning You need to pass a NULL.
-#warning Please check and remove these warnings.
-	
 /*
  *  The initial stack is set to run BELOW the code base address.
Index: c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -90,5 +90,5 @@
 }
 
-void _BSP_GPLED0_on()
+void _BSP_GPLED0_on(void)
 {
   BCSR *csr;
@@ -97,5 +97,5 @@
 }
 
-void _BSP_GPLED0_off()
+void _BSP_GPLED0_off(void)
 {
   BCSR *csr;
@@ -104,5 +104,5 @@
 }
 
-void _BSP_GPLED1_on()
+void _BSP_GPLED1_on(void)
 {
   BCSR *csr;
@@ -111,5 +111,5 @@
 }
 
-void _BSP_GPLED1_off()
+void _BSP_GPLED1_off(void)
 {
   BCSR *csr;
@@ -118,5 +118,5 @@
 }
 
-void _BSP_Uart1_enable()
+void _BSP_Uart1_enable(void)
 {
   BCSR *csr;
@@ -125,5 +125,5 @@
 }
 
-void _BSP_Uart1_disable()
+void _BSP_Uart1_disable(void)
 {
   BCSR *csr;
@@ -132,5 +132,5 @@
 }
 
-void _BSP_Uart2_enable()
+void _BSP_Uart2_enable(void)
 {
   BCSR *csr;
@@ -139,5 +139,5 @@
 }
 
-void _BSP_Uart2_disable()
+void _BSP_Uart2_disable(void)
 {
   BCSR *csr;
@@ -150,5 +150,4 @@
 {
   rtems_status_code sc = RTEMS_SUCCESSFUL;
-  extern void *_WorkspaceBase;
   ppc_cpu_id_t myCpu;
   ppc_cpu_revision_t myCpuRevision;
Index: c/src/lib/libbsp/powerpc/shared/clock/clock.c
===================================================================
--- c/src/lib/libbsp/powerpc/shared/clock/clock.c	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/shared/clock/clock.c	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -95,33 +95,4 @@
 }
 
-static int ppc_clock_exception_handler_classic( BSP_Exception_frame *frame, unsigned number)
-{
-	uint32_t reg1;
-	uint32_t reg2;
-	uint32_t msr;
-
-	/* Set new decrementer value */
-	asm volatile(
-		"lwz %1, ppc_clock_decrementer_value@sdarel(13);"
-		"mfdec %0;"
-		"add %0, %0, %1;"
-		"mtdec %0"
-		: "=r" (reg1), "=r" (reg2)
-	);
-
-	/* Increment clock ticks */
-	Clock_driver_ticks += 1;
-
-	/* Enable external exceptions */
-	msr = ppc_external_exceptions_enable();
-
-	/* Call clock ticker  */
-	ppc_clock_tick();
-
-	/* Restore machine state */
-	ppc_external_exceptions_disable( msr);
-
-	return 0;
-}
 
 static int ppc_clock_exception_handler_booke( BSP_Exception_frame *frame, unsigned number)
Index: c/src/lib/libbsp/powerpc/shared/vme/vme_universe.c
===================================================================
--- c/src/lib/libbsp/powerpc/shared/vme/vme_universe.c	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/shared/vme/vme_universe.c	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -393,5 +393,5 @@
 #ifdef VME_CLEAR_BRIDGE_ERRORS
 	{
-	extern unsigned short (*_BSP_clear_vmebridge_errors)();
+	extern unsigned short (*_BSP_clear_vmebridge_errors)(void);
 
 	  _BSP_clear_vmebridge_errors = VME_CLEAR_BRIDGE_ERRORS;
Index: c/src/lib/libbsp/powerpc/tqm8xx/ChangeLog
===================================================================
--- c/src/lib/libbsp/powerpc/tqm8xx/ChangeLog	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/tqm8xx/ChangeLog	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -1,2 +1,6 @@
+2009-11-03	Thomas Doerfler  <Thomas.Doerfler@embedded-brains.de>
+
+	* startup/bspstart.s, console/console.c: various fixes
+
 2009-10-28	Thomas Doerfler  <Thomas.Doerfler@embedded-brains.de>
 
Index: c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
===================================================================
--- c/src/lib/libbsp/powerpc/tqm8xx/console/console.c	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/tqm8xx/console/console.c	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -67,5 +67,5 @@
  * Interrupt-driven input buffer
  */
-#define RXBUFSIZE	256
+#define RXBUFSIZE	16
 
 #define M8xx_SICR_BRG1 (0)
@@ -663,5 +663,5 @@
     }
     sccFrstRxBd[chan][i].length = 0;
-    sccFrstRxBd[chan][i].buffer = rxBuf[chan][i];
+    sccFrstRxBd[chan][i].buffer = (*rxBuf[chan])[i];
   }
   /*
@@ -729,30 +729,42 @@
 sccPollRead (int minor)
 {
-  unsigned char c;
+  int c = -1;
   int chan = minor;
 
-  if ((sccCurrRxBd[chan]->status & M8xx_BD_EMPTY) != 0) {
-    return -1;
-  }
-  rtems_cache_invalidate_multiple_data_lines((void *)sccCurrRxBd[chan]->buffer,
-					     sccCurrRxBd[chan]->length);
-  c = *((char *)sccCurrRxBd[chan]->buffer);
-  /*
-   * clear status
-   */
-  sccCurrRxBd[chan]->status = 
-    (sccCurrRxBd[chan]->status 
-     & (M8xx_BD_WRAP | M8xx_BD_INTERRUPT))
-    | M8xx_BD_EMPTY;
-  /*
-   * advance to next BD
-   */
-  if ((sccCurrRxBd[chan]->status & M8xx_BD_WRAP) != 0) {
-    sccCurrRxBd[chan] = sccFrstRxBd[chan];
-  }
-  else {
-    sccCurrRxBd[chan]++;
-  }
-  return c;
+  while(1) {
+    if ((sccCurrRxBd[chan]->status & M8xx_BD_EMPTY) != 0) {
+      return -1;
+    }
+    
+    if (0 == (sccCurrRxBd[chan]->status & (M8xx_BD_OVERRUN 
+					   | M8xx_BD_PARITY_ERROR 
+					   | M8xx_BD_FRAMING_ERROR
+					   | M8xx_BD_BREAK
+					   | M8xx_BD_IDLE))) {
+      /* character received and no error detected */
+      rtems_cache_invalidate_multiple_data_lines((void *)sccCurrRxBd[chan]->buffer,
+						 sccCurrRxBd[chan]->length);
+      c = (unsigned)*((char *)sccCurrRxBd[chan]->buffer);
+      /*
+       * clear status
+       */
+    }
+    sccCurrRxBd[chan]->status = 
+      (sccCurrRxBd[chan]->status 
+       & (M8xx_BD_WRAP | M8xx_BD_INTERRUPT))
+      | M8xx_BD_EMPTY;
+    /*
+     * advance to next BD
+     */
+    if ((sccCurrRxBd[chan]->status & M8xx_BD_WRAP) != 0) {
+      sccCurrRxBd[chan] = sccFrstRxBd[chan];
+    }
+    else {
+      sccCurrRxBd[chan]++;
+    }
+    if (c >= 0) {
+      return c;
+    }
+  }
 }
 
Index: c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -174,7 +174,5 @@
   }
 
-  bsp_clicks_per_usec = BSP_bus_frequency/16; /* force to zero to control 
-			    * PIT clock driver from EXTCLK
-			    */
+  bsp_clicks_per_usec = BSP_bus_frequency/1000000/16; 
   bsp_timer_least_valid = 3; 
   bsp_timer_average_overhead = 3;
Index: c/src/lib/libcpu/powerpc/ChangeLog
===================================================================
--- c/src/lib/libcpu/powerpc/ChangeLog	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libcpu/powerpc/ChangeLog	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -1,3 +1,27 @@
-2009-10-23  Thomas Doerfler  <Thomas.Doerfler@imd-systems.de>
+2009-11-03  Thomas Doerfler  <Thomas.Doerfler@imd-systems.de>
+
+	* shared/include/powerpc-utility.h, shared/include/byteorder.h,
+	shared/include/cpuIdent.h: 
+	add c++ declaration brackets
+	* Makefile.am, mpc8260/clock: removed mpc8260 specific clock
+	driver
+	* e500/mmu/e500_mmu.h, e500/mmu/mmu.c,: removed "non-prototype"
+	warning
+	* mpc8260/timer/timer.c: moved extern declarations outside
+	function body
+	* mpc8xx/mmu/mmu.c: enable data cache when MMU is off to avoid
+	cache confusion during exception entry
+
+2009-11-02  Thomas Doerfler  <Thomas.Doerfler@imd-systems.de>
+
+	* mpc8xx/mmu/mmu.c:
+	enable data chache, when MMU is disabled
+
+2009-10-30  Thomas Doerfler  <Thomas.Doerfler@imd-systems.de>
+
+	* mpc6xx/clock/c_clock.c:
+	moved timebase/decrementer access from cpukit to libcpu 
+
+2009-10-29  Thomas Doerfler  <Thomas.Doerfler@imd-systems.de>
 
 	* shared/include/powerpc-utility.h, mpc6xx/timer/timer.c:
Index: c/src/lib/libcpu/powerpc/Makefile.am
===================================================================
--- c/src/lib/libcpu/powerpc/Makefile.am	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libcpu/powerpc/Makefile.am	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -325,10 +325,4 @@
 mpc8260_console_generic_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
 
-# mpc8260/clock
-noinst_PROGRAMS += mpc8260/clock.rel
-mpc8260_clock_rel_SOURCES = mpc8260/clock/clock.c
-mpc8260_clock_rel_CPPFLAGS = $(AM_CPPFLAGS)
-mpc8260_clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
 # mpc8260/cpm
 include_mpc8260_HEADERS += mpc8260/include/cpm.h
Index: c/src/lib/libcpu/powerpc/e500/mmu/e500_mmu.h
===================================================================
--- c/src/lib/libcpu/powerpc/e500/mmu/e500_mmu.h	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libcpu/powerpc/e500/mmu/e500_mmu.h	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -130,5 +130,5 @@
  */
 int
-rtems_e500_initlb();
+rtems_e500_initlb(void);
 
 /*
Index: c/src/lib/libcpu/powerpc/e500/mmu/mmu.c
===================================================================
--- c/src/lib/libcpu/powerpc/e500/mmu/mmu.c	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libcpu/powerpc/e500/mmu/mmu.c	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -181,5 +181,5 @@
 /* Factory to generate inline macros for accessing the MAS registers */
 #define __RDWRMAS(mas,rmas)	\
-	static inline uint32_t _read_MAS##mas()	                                 \
+	static inline uint32_t _read_MAS##mas(void)	                                 \
 	{ uint32_t x; asm volatile("mfspr %0, %1": "=r"(x):"i"(rmas)); return x; } \
 	static inline void _write_MAS##mas(uint32_t x)                             \
Index: src/lib/libcpu/powerpc/mpc8260/clock/clock.c
===================================================================
--- c/src/lib/libcpu/powerpc/mpc8260/clock/clock.c	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ 	(revision )
@@ -1,181 +1,0 @@
-/*  clock.c
- *
- *  This routine initializes the PIT on the MPC8xx.
- *  The tick frequency is specified by the bsp.
- *
- *  Author: Jay Monkman (jmonkman@frasca.com)
- *  Copyright (C) 1998 by Frasca International, Inc.
- *
- *  Derived from c/src/lib/libcpu/ppc/ppc403/clock/clock.c:
- *
- *  Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- *  COPYRIGHT (c) 1995 by i-cubed ltd.
- *
- *  To anyone who acknowledges that this file is provided "AS IS"
- *  without any express or implied warranty:
- *      permission to use, copy, modify, and distribute this file
- *      for any purpose is hereby granted without fee, provided that
- *      the above copyright notice and this notice appears in all
- *      copies, and that the name of i-cubed limited not be used in
- *      advertising or publicity pertaining to distribution of the
- *      software without specific, written prior permission.
- *      i-cubed limited makes no representations about the suitability
- *      of this software for any purpose.
- *
- *  Derived from c/src/lib/libcpu/hppa1_1/clock/clock.c:
- *
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.com/license/LICENSE.
- *
- *  $Id$
- */
-
-#include <rtems.h>
-#include <rtems/clockdrv.h>
-#include <rtems/libio.h>
-
-#include <stdlib.h>                     /* for atexit() */
-#include <mpc8260.h>
-#include <bsp/irq.h>
-
-volatile uint32_t   Clock_driver_ticks;
-extern int BSP_get_clock_irq_level(void);
-extern int BSP_connect_clock_handler(rtems_isr_entry);
-extern int BSP_disconnect_clock_handler(void);
-
-void Clock_exit( void );
-
-uint32_t   decrementer_value;
-
-volatile int ClockInitialised = 0;
-
-
-/*
- * These are set by clock driver during its init
- */
- 
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
- 
-/*
- *  ISR Handler
- */
-rtems_isr Clock_isr(rtems_vector_number vector)
-{
-  int clicks;
-
-  if( ClockInitialised ) {
-    PPC_Get_decrementer( clicks );
-    do {
-      clicks += decrementer_value;
-      PPC_Set_decrementer( clicks );
-
-      Clock_driver_ticks++;
-      rtems_clock_tick();
-    } while( clicks < 100 );
-  }
-#if 0
-  m8260.piscr |= M8260_PISCR_PS;
-  Clock_driver_ticks++;
-  rtems_clock_tick();
-#endif
-
-
-}
-
-void clockOn(void* unused)
-{
-  extern uint32_t bsp_clicks_per_usec;
-
-  decrementer_value = rtems_configuration_get_microseconds_per_tick() *
-                      bsp_clicks_per_usec - 1;
-
-  PPC_Set_decrementer( decrementer_value );
-  Clock_driver_ticks = 0;
-
-  ClockInitialised = 1;
-}
-
-/*
- * Called via atexit()
- * Remove the clock interrupt handler by setting handler to NULL
- */
-void
-clockOff(void* unused)
-{
-#if 0
-  /* disable PIT and PIT interrupts */
-  m8260.piscr &= ~(M8260_PISCR_PTE | M8260_PISCR_PIE);
-#endif
-  ClockInitialised = 0;
-}
-
-int clockIsOn(void* unused)
-{
-  return ClockInitialised;
-#if 0
-  if (m8260.piscr & M8260_PISCR_PIE) return 1;
-  return 0;
-#endif
-
-}
-
-/*
- * Called via atexit()
- * Remove the clock interrupt handler by setting handler to NULL
- */
-void
-Clock_exit(void)
-{
-  (void) BSP_disconnect_clock_handler ();
-}
-
-void Install_clock(rtems_isr_entry clock_isr)
-{
-  extern uint32_t bsp_clicks_per_usec;
-
-  Clock_driver_ticks = 0;
-
-  decrementer_value = rtems_configuration_get_microseconds_per_tick() *
-                      bsp_clicks_per_usec - 1;
-
-  PPC_Set_decrementer( decrementer_value );
-
-  BSP_connect_clock_handler (clock_isr);
-
-
-  ClockInitialised = 1;
-
-  atexit(Clock_exit);
-
-}
-
-void
-ReInstall_clock(rtems_isr_entry new_clock_isr)
-{
-  BSP_connect_clock_handler (new_clock_isr);
-}
-
-
-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;
-}
Index: c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c
===================================================================
--- c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -79,10 +79,10 @@
 }
 
+extern uint32_t bsp_timer_least_valid;
+extern uint32_t bsp_timer_average_overhead;
 int benchmark_timer_read(void)
 {
   uint32_t   clicks;
   uint32_t   total;
-  extern uint32_t bsp_timer_least_valid;
-  extern uint32_t bsp_timer_average_overhead;
 
   clicks = get_itimer();
Index: c/src/lib/libcpu/powerpc/mpc8xx/mmu/mmu.c
===================================================================
--- c/src/lib/libcpu/powerpc/mpc8xx/mmu/mmu.c	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libcpu/powerpc/mpc8xx/mmu/mmu.c	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -51,6 +51,9 @@
    * 	GPM [0]			0b0 = PowerPC mode
    *	PPM [1]			0b0 = Page resolution of protection
-   *	CIDEF [2]		0b0/0b1 = Default cache-inhibit attribute = 
-   *							NO for IMMU, YES for DMMU!
+   *	CIDEF [2]		0b0/0b0 = Default cache-inhibit attribute = 
+   *							NO for IMMU, NO for DMMU
+   *                            NOTE: it is vital that data caching is ON, when
+   *                            DMMU is off, otherwise valid/dirty values in 
+   *                            cache would be ignored during exception entry
    *	reserved/WTDEF [3]	0b0 = Default write-through attribute = not
    *	RSV4x [4]		0b0 = 4 entries not reserved
@@ -68,5 +71,5 @@
   reg1 = M8xx_MI_CTR_ITLB_INDX(31);
   _mtspr( M8xx_MI_CTR, reg1 );
-  reg1 = M8xx_MD_CTR_CIDEF | M8xx_MD_CTR_TWAM | M8xx_MD_CTR_DTLB_INDX(31);
+  reg1 = M8xx_MD_CTR_TWAM | M8xx_MD_CTR_DTLB_INDX(31);
   _mtspr( M8xx_MD_CTR, reg1 );
   _isync;
Index: c/src/lib/libcpu/powerpc/shared/include/byteorder.h
===================================================================
--- c/src/lib/libcpu/powerpc/shared/include/byteorder.h	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libcpu/powerpc/shared/include/byteorder.h	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -19,4 +19,8 @@
 #ifndef _LIBCPU_BYTEORDER_H
 #define _LIBCPU_BYTEORDER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #ifdef __GNUC__
@@ -50,3 +54,7 @@
 #endif /* __GNUC__ */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _LIBCPU_BYTEORDER_H */
Index: c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h
===================================================================
--- c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -18,4 +18,8 @@
 
 #include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #ifndef ASM
@@ -131,3 +135,7 @@
 #endif /* ASM */
 
+#ifdef __cplusplus
+}
 #endif
+
+#endif
Index: c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h
===================================================================
--- c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h	(revision 16393b2fa84ae1fbfe7ffb26c8e8cea6e55b297b)
+++ c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h	(revision e08dbc5ea9ec881b6fc93cf926c18fb094d3bd55)
@@ -27,8 +27,8 @@
  */
 
-#ifndef LIBCPU_POWERPC_UTILITY_H
-#define LIBCPU_POWERPC_UTILITY_H
-
-#ifndef ASM
+#ifndef __LIBCPU_POWERPC_UTILITY_H
+#define __LIBCPU_POWERPC_UTILITY_H
+
+#if !defined(ASM)
   #include <rtems.h>
 #endif
@@ -38,5 +38,9 @@
 #include <rtems/powerpc/powerpc.h>
 
-#ifndef ASM
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(ASM)
 
 #include <rtems/bspIo.h>
@@ -243,5 +247,4 @@
 }
 
-#ifndef ASM
 /*
  *  Simple spin delay in microsecond units for device drivers.
@@ -292,7 +295,4 @@
   } while (0)
 
-#endif /* ASM */
-
-#ifndef ASM
 /*
  *  Routines to access the decrementer register
@@ -307,7 +307,4 @@
     asm volatile( "mfdec  %0" : "=r" (_clicks) )
 
-#endif /* ASM */
-
-#ifndef ASM
 /*
  *  Routines to access the time base register
@@ -351,5 +348,4 @@
   
 }
-#endif /* ASM */
 
 static inline uint32_t ppc_decrementer_register(void)
@@ -582,6 +578,7 @@
 void ppc_code_copy(void *dest, const void *src, size_t n);
 
-#else /* ASM */
-
+#endif /* ifndef ASM */
+
+#if defined(ASM)
 #include <rtems/asm.h>
 
@@ -657,3 +654,7 @@
 #endif /* ASM */
 
-#endif /* LIBCPU_POWERPC_UTILITY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __LIBCPU_POWERPC_UTILITY_H */
