Index: c/src/lib/libcpu/powerpc/ChangeLog
===================================================================
--- c/src/lib/libcpu/powerpc/ChangeLog	(revision b90855ceb3145675b9d1dcce3aa80e686734fc9a)
+++ c/src/lib/libcpu/powerpc/ChangeLog	(revision d700909e7e3754542c89220dbad644b75870c46a)
@@ -1,2 +1,10 @@
+2004-11-10	Richard Campbell <richard.campbell@oarcorp.com>
+
+	* configure.ac, mpc6xx/exceptions/raw_exception.c,
+	mpc6xx/exceptions/raw_exception.h, mpc6xx/mmu/bat.c,
+	mpc6xx/mmu/bat.h, mpc6xx/mmu/mmuAsm.S, shared/include/cpuIdent.c,
+	shared/include/cpuIdent.h: Add MPC8240 and MPC8245 support. There was
+	also a significant amount of spelling and whitespace cleanup.
+
 2004-05-22	Till Strauman <strauman@slac.stanford.edu>
 
Index: c/src/lib/libcpu/powerpc/configure.ac
===================================================================
--- c/src/lib/libcpu/powerpc/configure.ac	(revision b90855ceb3145675b9d1dcce3aa80e686734fc9a)
+++ c/src/lib/libcpu/powerpc/configure.ac	(revision d700909e7e3754542c89220dbad644b75870c46a)
@@ -32,4 +32,6 @@
 || test "$RTEMS_CPU_MODEL" = "mpc821" \
 || test "$RTEMS_CPU_MODEL" = "mpc860" \
+|| test "$RTEMS_CPU_MODEL" = "mpc8240" \
+|| test "$RTEMS_CPU_MODEL" = "mpc8245" \
 || test "$RTEMS_CPU_MODEL" = "mpc8260" \
 || test "$RTEMS_CPU_MODEL" = "mpc8xx" )
@@ -40,5 +42,7 @@
 || test "$RTEMS_CPU_MODEL" = "mpc604" \
 || test "$RTEMS_CPU_MODEL" = "mpc7400" \
-|| test "$RTEMS_CPU_MODEL" = "mpc750" )
+|| test "$RTEMS_CPU_MODEL" = "mpc750" \
+|| test "$RTEMS_CPU_MODEL" = "mpc8240" \
+|| test "$RTENS_CPU_MODEL" = "mpc8245" )
 AM_CONDITIONAL(mpc8xx, test "$RTEMS_CPU_MODEL" = "mpc8xx" \
 || test "$RTEMS_CPU_MODEL" = "mpc821" \
Index: c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c
===================================================================
--- c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c	(revision b90855ceb3145675b9d1dcce3aa80e686734fc9a)
+++ c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c	(revision d700909e7e3754542c89220dbad644b75870c46a)
@@ -1,6 +1,6 @@
 /*
  * raw_exception.c  - This file contains implementation of C function to
- *          	      Instanciate 60x ppc primary exception entries.
- *	 	      More detailled information can be found on motorola
+ *          	      Instantiate 60x ppc primary exception entries.
+ *	 	      More detailed information can be found on motorola
  *	    	      site and more precisely in the following book :
  *
@@ -34,4 +34,15 @@
 
 void * codemove(void *, const void *, unsigned int, unsigned long);
+
+void* mpc60x_get_vector_addr(rtems_vector vector)
+{
+  extern rtems_cpu_table Cpu_table;
+
+  if ( Cpu_table.exceptions_in_RAM )
+    return ((void*)  (((unsigned) vector) << 8));
+
+  return ((void*)  (((unsigned) vector) << 8) + 0xfff00000);
+}
+
 int mpc750_vector_is_valid(rtems_vector vector)
 
@@ -134,11 +145,15 @@
         case PPC_603e:
         case PPC_603ev:
+        case PPC_8260:
+        /* case PPC_8240: -- same value as 8260 */
+        case PPC_8245:
             if (!mpc603_vector_is_valid(vector)) {
                 return 0;
             }
             break;
-        default:
-            printk("Please complete libcpu/powerpc/mpc6xx/exceptions/raw_exception.c\n");
-            printk("current_ppc_cpu = %x\n", current_ppc_cpu);
+         default:
+            printk("Please complete "
+                   "libcpu/powerpc/mpc6xx/exceptions/raw_exception.c\n"
+                   "current_ppc_cpu = %x\n", current_ppc_cpu);
             return 0;
      }
@@ -151,4 +166,6 @@
 
     if (!mpc60x_vector_is_valid(except->exceptIndex)) {
+      printk("mpc60x_set_exception: vector %d is not valid\n",
+              except->exceptIndex);
       return 0;
     }
@@ -160,5 +177,9 @@
      * to get the previous handler before accepting to disconnect.
      */
-    if (memcmp(mpc60x_get_vector_addr(except->exceptIndex), (void*)default_raw_except_entry.hdl.raw_hdl,default_raw_except_entry.hdl.raw_hdl_size)) {
+
+    if (memcmp(mpc60x_get_vector_addr(except->exceptIndex),
+               (void*)default_raw_except_entry.hdl.raw_hdl,
+               default_raw_except_entry.hdl.raw_hdl_size)) {
+      printk("mpc60x_set_exception: raw vector not installed\n");
       return 0;
     }
Index: c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h
===================================================================
--- c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h	(revision b90855ceb3145675b9d1dcce3aa80e686734fc9a)
+++ c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h	(revision d700909e7e3754542c89220dbad644b75870c46a)
@@ -3,6 +3,6 @@
  *
  *	    This file contains implementation of C function to
- *          Instanciate 60x ppc primary exception entries.
- *	    More detailled information can be found on motorola
+ *          Instantiate 60x ppc primary exception entries.
+ *	    More detailed information can be found on motorola
  *	    site and more precisely in the following book :
  *
@@ -160,8 +160,4 @@
 extern int mpc750_vector_is_valid(rtems_vector vector);
 
-inline static  void* mpc60x_get_vector_addr(rtems_vector vector)
-{
-  return ((void*)  (((unsigned) vector) << 8));
-}
 /*
  * Exception global init.
Index: c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c
===================================================================
--- c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c	(revision b90855ceb3145675b9d1dcce3aa80e686734fc9a)
+++ c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c	(revision d700909e7e3754542c89220dbad644b75870c46a)
@@ -3,6 +3,6 @@
  *
  *	    This file contains the implementation of C function to
- *          Instanciate 60x/7xx ppc Block Address Translation (BAT) registers.
- *	    More detailled information can be found on motorola
+ *          Instantiate 60x/7xx ppc Block Address Translation (BAT) registers.
+ *	    More detailed information can be found on motorola
  *	    site and more precisely in the following book :
  *
Index: c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.h
===================================================================
--- c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.h	(revision b90855ceb3145675b9d1dcce3aa80e686734fc9a)
+++ c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.h	(revision d700909e7e3754542c89220dbad644b75870c46a)
@@ -3,6 +3,6 @@
  *
  *	    This file contains declaration of C function to
- *          Instanciate 60x/7xx ppc Block Address Translation (BAT) registers.
- *	    More detailled information can be found on motorola
+ *          Instantiate 60x/7xx ppc Block Address Translation (BAT) registers.
+ *	    More detailed information can be found on motorola
  *	    site and more precisely in the following book :
  *
Index: c/src/lib/libcpu/powerpc/mpc6xx/mmu/mmuAsm.S
===================================================================
--- c/src/lib/libcpu/powerpc/mpc6xx/mmu/mmuAsm.S	(revision b90855ceb3145675b9d1dcce3aa80e686734fc9a)
+++ c/src/lib/libcpu/powerpc/mpc6xx/mmu/mmuAsm.S	(revision d700909e7e3754542c89220dbad644b75870c46a)
@@ -36,4 +36,5 @@
 #define PPC_821   PPC_860
 #define PPC_8260  0x81
+#define PPC_8240  PPC_8260 
 
 /* ALTIVEC instructions (not recognized by off-the shelf gcc yet) */
Index: c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c
===================================================================
--- c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c	(revision b90855ceb3145675b9d1dcce3aa80e686734fc9a)
+++ c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c	(revision d700909e7e3754542c89220dbad644b75870c46a)
@@ -41,6 +41,8 @@
     case PPC_860:		return "MPC860";
     case PPC_8260:		return "MPC8260";
+    case PPC_8245:              return "MPC8245";
     default:
-      printk("Unknown CPU value of 0x%x. Please add it to <libcpu/powerpc/shared/include/cpuIdent.c>\n", cpu );
+      printk("Unknown CPU value of 0x%x. Please add it to "
+             "<libcpu/powerpc/shared/include/cpuIdent.c>\n", cpu );
   }
   return "UNKNOWN";
@@ -63,7 +65,9 @@
     case PPC_860:
     case PPC_8260:
+    case PPC_8245:
       return current_ppc_cpu;
     default:
-      printk("Unknown PVR value of 0x%x. Please add it to <libcpu/powerpc/shared/include/cpuIdent.c>\n", pvr );
+      printk("Unknown PVR value of 0x%x. Please add it to "
+             "<libcpu/powerpc/shared/include/cpuIdent.c>\n", pvr );
     return PPC_UNKNOWN;
   }
Index: c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h
===================================================================
--- c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h	(revision b90855ceb3145675b9d1dcce3aa80e686734fc9a)
+++ c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h	(revision d700909e7e3754542c89220dbad644b75870c46a)
@@ -33,5 +33,7 @@
   PPC_821 = PPC_860,
   PPC_8260 = 0x81,
-  PPC_UNKNOWN = 0xff
+  PPC_8240 = PPC_8260,
+  PPC_8245 = 0x8081,
+  PPC_UNKNOWN = 0xffff
 } ppc_cpu_id_t;
 
