Index: c/src/lib/libbsp/arm/gp32/ChangeLog
===================================================================
--- c/src/lib/libbsp/arm/gp32/ChangeLog	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/arm/gp32/ChangeLog	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -1,2 +1,12 @@
+2007-12-03	Joel Sherrill <joel.sherrill@OARcorp.com>
+
+	* Makefile.am, include/bsp.h, startup/bspstart.c: Moved most of the
+	remaining CPU Table fields to the Configuration Table. This included
+	pretasking_hook, predriver_hook, postdriver_hook, idle_task,
+	do_zero_of_workspace, extra_mpci_receive_server_stack,
+	stack_allocate_hook, and stack_free_hook. As a side-effect of this
+	effort some multiprocessing code was made conditional and some style
+	clean up occurred.
+
 2007-09-12	Joel Sherrill <joel.sherrill@OARcorp.com>
 
Index: c/src/lib/libbsp/arm/gp32/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/gp32/Makefile.am	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/arm/gp32/Makefile.am	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -29,4 +29,5 @@
 noinst_PROGRAMS += startup.rel
 startup_rel_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
+    ../../shared/bsppredriverhook.c \
     startup/bspstart.c startup/exit.c startup/memmap.c \
     ../../shared/bootcard.c ../../shared/sbrk.c \
Index: c/src/lib/libbsp/arm/gp32/include/bsp.h
===================================================================
--- c/src/lib/libbsp/arm/gp32/include/bsp.h	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/arm/gp32/include/bsp.h	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -65,4 +65,13 @@
 #define CONFIGURE_INTERRUPT_STACK_MEMORY  (16 * 1024)
 
+/*
+ *  This BSP provides its own IDLE task to override the RTEMS one.
+ *  So we prototype it and define the constant confdefs.h expects
+ *  to configure a BSP specific one.
+ */
+void bsp_idle_task(void);
+
+#define BSP_IDLE_TASK_BODY bsp_idle_task
+
 #ifdef __cplusplus
 }
Index: c/src/lib/libbsp/arm/gp32/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/arm/gp32/startup/bspstart.c	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/arm/gp32/startup/bspstart.c	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -100,12 +100,4 @@
     uint32_t REFCNT;
     int i;
-    /* If we don't have command line arguments set default program name. */
-
-    Cpu_table.pretasking_hook      = bsp_pretasking_hook; /* init libc, etc. */
-    Cpu_table.predriver_hook       = NULL;                /* use system's    */
-    Cpu_table.postdriver_hook      = bsp_postdriver_hook;
-    Cpu_table.idle_task            = bsp_idle_task;
-    Cpu_table.interrupt_stack_size = 4096;
-    Cpu_table.extra_mpci_receive_server_stack = 0;
 
     /* stop RTC */
Index: c/src/lib/libbsp/arm/rtl22xx/ChangeLog
===================================================================
--- c/src/lib/libbsp/arm/rtl22xx/ChangeLog	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/arm/rtl22xx/ChangeLog	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -1,2 +1,12 @@
+2007-12-03	Joel Sherrill <joel.sherrill@OARcorp.com>
+
+	* Makefile.am, include/bsp.h, startup/bspstart.c: Moved most of the
+	remaining CPU Table fields to the Configuration Table. This included
+	pretasking_hook, predriver_hook, postdriver_hook, idle_task,
+	do_zero_of_workspace, extra_mpci_receive_server_stack,
+	stack_allocate_hook, and stack_free_hook. As a side-effect of this
+	effort some multiprocessing code was made conditional and some style
+	clean up occurred.
+
 2007-11-03      Ray Xu <rayx.cn@gmail.com>
 
Index: c/src/lib/libbsp/arm/rtl22xx/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/rtl22xx/Makefile.am	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/arm/rtl22xx/Makefile.am	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -30,7 +30,7 @@
 include_HEADERS += ../../arm/shared/comm/uart.h
 startup_rel_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
+    ../../shared/bsppredriverhook.c \
     startup/bspstart.c startup/bspclean.c ../../shared/bootcard.c \
-    ../../shared/sbrk.c \
-    ../../shared/gnatinstallhandler.c
+    ../../shared/sbrk.c ../../shared/gnatinstallhandler.c
 startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
 startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
@@ -76,4 +76,5 @@
 startup_rel-bsplibc.o \
 startup_rel-bsppost.o \
+startup_rel-bsppredriverhook.o \
 startup_rel-bspstart.o \
 startup_rel-sbrk.o
Index: c/src/lib/libbsp/arm/rtl22xx/include/bsp.h
===================================================================
--- c/src/lib/libbsp/arm/rtl22xx/include/bsp.h	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/arm/rtl22xx/include/bsp.h	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -122,13 +122,4 @@
 #define RTL8019AS_BASE            0x82000000                //
 
-
-
-
-/*
- *  Define the interrupt mechanism for Time Test 27
- *
- *  NOTE: Following are not defined and are board independent
- *
- */
 struct rtems_bsdnet_ifconfig;
 int cs8900_driver_attach (struct rtems_bsdnet_ifconfig *config,
@@ -146,4 +137,9 @@
 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH	cs8900_driver_attach
 
+/*
+ *  BSP Configuration Default Overrides
+ */
+#define BSP_ZERO_WORKSPACE_AUTOMATICALLY TRUE
+
 #ifdef __cplusplus
 }
Index: c/src/lib/libbsp/arm/rtl22xx/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/arm/rtl22xx/startup/bspstart.c	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/arm/rtl22xx/startup/bspstart.c	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -185,9 +185,4 @@
     VICProtection = 0;
 
-
-    Cpu_table.pretasking_hook        = bsp_pretasking_hook;
-    Cpu_table.postdriver_hook        = bsp_postdriver_hook;
-    Cpu_table.do_zero_of_workspace   = TRUE;
-    BSP_Configuration.microseconds_per_tick=100000;
     /* Place RTEMS workspace at beginning of free memory. */
     BSP_Configuration.work_space_start = (void *)&_bss_free_start;
Index: c/src/lib/libbsp/powerpc/mvme5500/ChangeLog
===================================================================
--- c/src/lib/libbsp/powerpc/mvme5500/ChangeLog	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/powerpc/mvme5500/ChangeLog	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -1,2 +1,12 @@
+2007-12-03	Joel Sherrill <joel.sherrill@OARcorp.com>
+
+	* Makefile.am, include/bsp.h, startup/bspstart.c: Moved most of the
+	remaining CPU Table fields to the Configuration Table. This included
+	pretasking_hook, predriver_hook, postdriver_hook, idle_task,
+	do_zero_of_workspace, extra_mpci_receive_server_stack,
+	stack_allocate_hook, and stack_free_hook. As a side-effect of this
+	effort some multiprocessing code was made conditional and some style
+	clean up occurred.
+
 2007-11-30	Till Straumann <strauman@slac.stanford.edu>
 
Index: c/src/lib/libbsp/powerpc/mvme5500/Makefile.am
===================================================================
--- c/src/lib/libbsp/powerpc/mvme5500/Makefile.am	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/powerpc/mvme5500/Makefile.am	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -35,5 +35,6 @@
     ../../powerpc/shared/startup/pretaskinghook.c \
     ../../powerpc/shared/startup/sbrk.c ../../shared/bootcard.c \
-    startup/bspclean.c ../../shared/bsplibc.c ../../shared/bsppost.c \
+    ../../shared/bsppredriverhook.c startup/bspclean.c \
+    ../../shared/bsplibc.c ../../shared/bsppost.c \
     ../../shared/gnatinstallhandler.c startup/reboot.c
 startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
Index: c/src/lib/libbsp/powerpc/mvme5500/include/bsp.h
===================================================================
--- c/src/lib/libbsp/powerpc/mvme5500/include/bsp.h	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/powerpc/mvme5500/include/bsp.h	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -124,4 +124,9 @@
 RTEMS_BSP_NETWORK_DRIVER_ATTACH(/* struct rtems_bsdnet_ifconfig * */);
 
+/*
+ *  BSP Configuration Default Overrides
+ */
+#define BSP_ZERO_WORKSPACE_AUTOMATICALLY TRUE
+
 /* As per Linux, This should be in the ppc/system.h */
 
Index: c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c	(revision 8e1b35fb0d50736e26a480994b4b8ffe9ce71cdb)
+++ c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c	(revision b5e70186139ba74db65dea2abd8acae36ea6d572)
@@ -20,5 +20,5 @@
  *  Modified to support the MVME5500 board.
  *  Also, the settings of L1, L2, and L3 caches is not necessary here.
- *  (C) by Brookhaven National Lab., S. Kate Feng <feng1@bnl.gov>, 2003, 2004, 2005
+ *  (C) by Brookhaven National Lab., S. Kate Feng <feng1@bnl.gov>, 2003-2007
  *  
  *  $Id$
@@ -79,17 +79,17 @@
 
 typedef struct CmdLineRec_ {
-		unsigned long	size;
-		char		buf[0];
+    unsigned long  size;
+    char           buf[0];
 } CmdLineRec, *CmdLine;
 
 
-#define	mtspr(reg, val)	\
-	__asm __volatile("mtspr %0,%1" : : "K"(reg), "r"(val))
-
-
-#define	mfspr(reg) \
-	( { unsigned val; \
-	  __asm __volatile("mfspr %0,%1" : "=r"(val) : "K"(reg)); \
-	  val; } )
+#define mtspr(reg, val)  \
+  __asm __volatile("mtspr %0,%1" : : "K"(reg), "r"(val))
+
+
+#define mfspr(reg) \
+  ( { unsigned val; \
+    __asm __volatile("mfspr %0,%1" : "=r"(val) : "K"(reg)); \
+    val; } )
 
 /*
@@ -122,5 +122,5 @@
 unsigned char ConfVPD_buff[200];
 
-#define CMDLINE_BUF_SIZE	2048
+#define CMDLINE_BUF_SIZE  2048
 
 static char cmdline_buf[CMDLINE_BUF_SIZE];
@@ -173,7 +173,20 @@
   extern unsigned long __bss_start[], __SBSS_START__[], __SBSS_END__[];
   extern unsigned long __SBSS2_START__[], __SBSS2_END__[];
-  memset(__SBSS_START__, 0, ((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__));
-  memset(__SBSS2_START__, 0, ((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__));
-  memset(__bss_start, 0, ((unsigned) __rtems_end) - ((unsigned)__bss_start));
+
+  memset(
+    __SBSS_START__,
+    0,
+    ((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__)
+  );
+  memset(
+    __SBSS2_START__,
+    0,
+    ((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__)
+  );
+  memset(
+    __bss_start,
+    0,
+    ((unsigned) __rtems_end) - ((unsigned)__bss_start)
+  );
 }
 
@@ -214,13 +227,21 @@
  */
 void
-save_boot_params(void *r3, void *r4, void* r5, char *cmdline_start, char *cmdline_end)
+save_boot_params(
+  void *r3,
+  void *r4,
+  void* r5,
+  char *cmdline_start,
+  char *cmdline_end
+)
 {
-int		i=cmdline_end-cmdline_start;
-	if ( i >= CMDLINE_BUF_SIZE )
-		i = CMDLINE_BUF_SIZE-1;
-	else if ( i < 0 )
-		i = 0;
-        memmove(cmdline_buf, cmdline_start, i);
-	cmdline_buf[i]=0;
+  int i=cmdline_end-cmdline_start;
+
+  if ( i >= CMDLINE_BUF_SIZE )
+    i = CMDLINE_BUF_SIZE-1;
+  else if ( i < 0 )
+    i = 0;
+
+  memmove(cmdline_buf, cmdline_start, i);
+  cmdline_buf[i]=0;
 }
 
@@ -237,5 +258,5 @@
 #endif
   unsigned char *stack;
-  unsigned long	 *r1sp;
+  unsigned long   *r1sp;
 #ifdef SHOW_LCR1_REGISTER
   unsigned l1cr;
@@ -252,5 +273,5 @@
   ppc_cpu_id_t myCpu;
   ppc_cpu_revision_t myCpuRevision;
-  Triv121PgTbl	pt=0;
+  Triv121PgTbl  pt=0;
 
   /* Till Straumann: 4/2005
@@ -275,5 +296,5 @@
    * store the result in global variables so that it can be used latter...
    */
-  myCpu 	= get_ppc_cpu_type();
+  myCpu   = get_ppc_cpu_type();
   myCpuRevision = get_ppc_cpu_revision();
 
@@ -288,7 +309,8 @@
    * so that it can be printed without accessing R1.
    */
-  stack = ((unsigned char*) __rtems_end) + INIT_STACK_SIZE - PPC_MINIMUM_STACK_FRAME_SIZE;
-
- /* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
+  stack = ((unsigned char*) __rtems_end) +
+          INIT_STACK_SIZE - PPC_MINIMUM_STACK_FRAME_SIZE;
+
+  /* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
   *((uint32_t *)stack) = 0;
 
@@ -296,5 +318,5 @@
   __asm__ __volatile__("mr %0, %%r1":"=r"(r1sp));
   while (--r1sp >= (unsigned long*)__rtems_end)
-	  *r1sp=0xeeeeeeee;
+    *r1sp=0xeeeeeeee;
 
   /*
@@ -324,4 +346,5 @@
    */
   initialize_exceptions();
+
   /*
    * Init MMU block address translation to enable hardware
@@ -355,10 +378,13 @@
 #endif  
 
-  BSP_mem_size 				=  _512M;
-  /* TODO: calculate the BSP_bus_frequency using the REF_CLK bit of System Status  register */
+  BSP_mem_size         =  _512M;
+  /* TODO: calculate the BSP_bus_frequency using the REF_CLK bit
+   *       of System Status  register
+   */
   /* rtems_bsp_delay_in_bus_cycles are defined in registers.h */
-  BSP_bus_frequency			= 133333333;
-  BSP_processor_frequency		= 1000000000;
-  BSP_time_base_divisor			= 4000;/* P94 : 7455 clocks the TB/DECR at 1/4 of the system bus clock frequency */
+  BSP_bus_frequency      = 133333333;
+  BSP_processor_frequency    = 1000000000;
+  /* P94 : 7455 clocks the TB/DECR at 1/4 of the system bus clock frequency */
+  BSP_time_base_divisor      = 4000;
 
 
@@ -383,17 +409,19 @@
    */
 
-  Cpu_table.pretasking_hook 	 = bsp_pretasking_hook;    /* init libc, etc. */
-  Cpu_table.postdriver_hook 	 = bsp_postdriver_hook;
-  Cpu_table.do_zero_of_workspace = TRUE;
   Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
   /* P94 : 7455 TB/DECR is clocked by the system bus clock frequency */
-  _CPU_Table                     = Cpu_table;/* S. Kate Feng <feng1@bnl.gov>, for rtems_bsp_delay() */
-
-  bsp_clicks_per_usec 	 = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
-  printk("BSP_Configuration.work_space_size = %x\n", BSP_Configuration.work_space_size); 
+
+  bsp_clicks_per_usec    = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
+
+  printk(
+    "BSP_Configuration.work_space_size = %x\n",
+     BSP_Configuration.work_space_size
+  ); 
+
   work_space_start = 
     (unsigned char *)BSP_mem_size - BSP_Configuration.work_space_size;
 
-  if ( work_space_start <= ((unsigned char *)__rtems_end) + INIT_STACK_SIZE + INTR_STACK_SIZE) {
+  if ( work_space_start <=
+       ((unsigned char *)__rtems_end) + INIT_STACK_SIZE + INTR_STACK_SIZE) {
     printk( "bspstart: Not enough RAM!!!\n" );
     bsp_cleanup();
