[PATCH 19/40] bsps: Convert all bsp_predriver_hook()

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Apr 19 13:26:44 UTC 2018


Use RTEMS_SYSINIT_ITEM() instead.

Update #2408.
---
 bsps/include/bsp/bootcard.h                        |  2 -
 .../m68k/mrm332/start/bspstart.c                   | 14 +++-
 bsps/powerpc/motorola_powerpc/start/bspstart.c     |  8 ++
 bsps/powerpc/mvme3100/include/bsp.h                |  1 -
 bsps/shared/start/bootcard.c                       |  6 --
 .../sparc/erc32/start/bspstart.c                   | 20 +++--
 c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am  |  1 -
 c/src/lib/libbsp/arm/atsam/Makefile.am             |  1 -
 c/src/lib/libbsp/arm/beagle/Makefile.am            |  1 -
 c/src/lib/libbsp/arm/csb336/Makefile.am            |  1 -
 c/src/lib/libbsp/arm/csb337/Makefile.am            |  2 +-
 c/src/lib/libbsp/arm/edb7312/Makefile.am           |  1 -
 c/src/lib/libbsp/arm/gdbarmsim/Makefile.am         |  1 -
 c/src/lib/libbsp/arm/gumstix/Makefile.am           |  1 -
 c/src/lib/libbsp/arm/imx/Makefile.am               |  1 -
 c/src/lib/libbsp/arm/lm3s69xx/Makefile.am          |  1 -
 c/src/lib/libbsp/arm/lpc176x/Makefile.am           |  1 -
 c/src/lib/libbsp/arm/lpc24xx/Makefile.am           |  1 -
 c/src/lib/libbsp/arm/lpc32xx/Makefile.am           |  1 -
 c/src/lib/libbsp/arm/raspberrypi/Makefile.am       |  1 -
 c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am   |  1 -
 c/src/lib/libbsp/arm/rtl22xx/Makefile.am           |  1 -
 c/src/lib/libbsp/arm/smdk2410/Makefile.am          |  1 -
 c/src/lib/libbsp/arm/stm32f4/Makefile.am           |  1 -
 c/src/lib/libbsp/arm/tms570/Makefile.am            |  1 -
 c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am       |  1 -
 c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c  | 13 ++--
 .../lib/libbsp/bfin/bf537Stamp/startup/bspstart.c  | 14 ++--
 c/src/lib/libbsp/bfin/eZKit533/startup/bspstart.c  | 14 ++--
 c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am |  1 -
 c/src/lib/libbsp/i386/pc386/Makefile.am            |  1 -
 c/src/lib/libbsp/lm32/shared/startup/bspstart.c    |  6 --
 c/src/lib/libbsp/m32c/m32cbsp/Makefile.am          |  1 -
 c/src/lib/libbsp/m68k/av5282/Makefile.am           |  1 -
 c/src/lib/libbsp/m68k/csb360/Makefile.am           |  1 -
 c/src/lib/libbsp/m68k/gen68340/Makefile.am         |  1 -
 c/src/lib/libbsp/m68k/gen68360/Makefile.am         |  1 -
 c/src/lib/libbsp/m68k/genmcf548x/Makefile.am       |  1 -
 c/src/lib/libbsp/m68k/mcf5206elite/Makefile.am     |  1 -
 c/src/lib/libbsp/m68k/mcf52235/Makefile.am         |  1 -
 c/src/lib/libbsp/m68k/mcf5225x/Makefile.am         |  1 -
 c/src/lib/libbsp/m68k/mcf5235/Makefile.am          |  1 -
 c/src/lib/libbsp/m68k/mcf5329/Makefile.am          |  1 -
 c/src/lib/libbsp/m68k/mrm332/Makefile.am           |  3 +-
 c/src/lib/libbsp/m68k/mvme147/Makefile.am          |  1 -
 c/src/lib/libbsp/m68k/mvme147s/Makefile.am         |  1 -
 c/src/lib/libbsp/m68k/mvme162/Makefile.am          |  1 -
 c/src/lib/libbsp/m68k/mvme167/Makefile.am          |  1 -
 c/src/lib/libbsp/m68k/uC5282/Makefile.am           |  1 -
 c/src/lib/libbsp/mips/csb350/Makefile.am           |  1 -
 c/src/lib/libbsp/mips/hurricane/Makefile.am        |  1 -
 c/src/lib/libbsp/mips/jmr3904/Makefile.am          |  1 -
 c/src/lib/libbsp/mips/malta/Makefile.am            |  1 -
 c/src/lib/libbsp/mips/rbtx4925/Makefile.am         |  1 -
 c/src/lib/libbsp/mips/rbtx4938/Makefile.am         |  1 -
 c/src/lib/libbsp/moxie/moxiesim/Makefile.am        |  1 -
 c/src/lib/libbsp/nios2/nios2_iss/Makefile.am       |  1 -
 c/src/lib/libbsp/no_cpu/no_bsp/Makefile.am         |  1 -
 c/src/lib/libbsp/or1k/generic_or1k/Makefile.am     |  1 -
 c/src/lib/libbsp/powerpc/beatnik/Makefile.am       |  1 -
 .../lib/libbsp/powerpc/beatnik/startup/bspstart.c  |  8 ++
 c/src/lib/libbsp/powerpc/gen5200/Makefile.am       |  1 -
 c/src/lib/libbsp/powerpc/gen83xx/Makefile.am       |  1 -
 c/src/lib/libbsp/powerpc/haleakala/Makefile.am     |  1 -
 .../libbsp/powerpc/motorola_powerpc/Makefile.am    |  1 -
 c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am    |  1 -
 c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am    |  1 -
 c/src/lib/libbsp/powerpc/mvme3100/Makefile.am      |  1 -
 .../lib/libbsp/powerpc/mvme3100/startup/bspstart.c | 19 +++++
 c/src/lib/libbsp/powerpc/mvme5500/Makefile.am      |  1 -
 .../lib/libbsp/powerpc/mvme5500/startup/bspstart.c |  8 ++
 c/src/lib/libbsp/powerpc/psim/Makefile.am          |  1 -
 c/src/lib/libbsp/powerpc/qemuppc/Makefile.am       |  1 -
 c/src/lib/libbsp/powerpc/qoriq/Makefile.am         |  1 -
 .../powerpc/qoriq/startup/bsppredriverhook.c       | 31 --------
 c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c  | 10 +++
 .../powerpc/shared/startup/bsppredriverhook.c      | 70 -----------------
 c/src/lib/libbsp/powerpc/ss555/Makefile.am         |  1 -
 c/src/lib/libbsp/powerpc/t32mppc/Makefile.am       |  1 -
 c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am        |  1 -
 c/src/lib/libbsp/powerpc/virtex/Makefile.am        |  1 -
 c/src/lib/libbsp/powerpc/virtex4/start/start.S     |  2 +-
 .../lib/libbsp/powerpc/virtex4/startup/bspstart.c  |  9 ++-
 .../lib/libbsp/powerpc/virtex5/startup/bspstart.c  |  9 ++-
 c/src/lib/libbsp/riscv/riscv_generic/Makefile.am   |  1 -
 c/src/lib/libbsp/sh/gensh1/Makefile.am             |  1 -
 c/src/lib/libbsp/sh/gensh2/Makefile.am             |  1 -
 c/src/lib/libbsp/sh/gensh4/Makefile.am             |  1 -
 c/src/lib/libbsp/sh/shsim/Makefile.am              |  1 -
 c/src/lib/libbsp/shared/bsppredriverhook.c         | 16 ----
 c/src/lib/libbsp/sparc/erc32/Makefile.am           |  3 +-
 c/src/lib/libbsp/sparc/leon2/Makefile.am           |  1 -
 .../lib/libbsp/sparc/leon2/startup/bsppredriver.c  | 88 ----------------------
 c/src/lib/libbsp/sparc/leon2/startup/bspstart.c    | 77 +++++++++++++++++++
 c/src/lib/libbsp/sparc/leon3/Makefile.am           |  1 -
 .../lib/libbsp/sparc/leon3/startup/bsppredriver.c  | 56 --------------
 c/src/lib/libbsp/sparc/leon3/startup/bspstart.c    | 43 +++++++++++
 c/src/lib/libbsp/sparc64/niagara/Makefile.am       |  1 -
 c/src/lib/libbsp/sparc64/usiii/Makefile.am         |  1 -
 c/src/lib/libbsp/v850/gdbv850sim/Makefile.am       |  1 -
 100 files changed, 236 insertions(+), 389 deletions(-)
 rename c/src/lib/libbsp/m68k/mrm332/startup/bsppredriverhook.c => bsps/m68k/mrm332/start/bspstart.c (59%)
 rename c/src/lib/libbsp/sparc/erc32/startup/bsppredriver.c => bsps/sparc/erc32/start/bspstart.c (60%)
 delete mode 100644 c/src/lib/libbsp/powerpc/qoriq/startup/bsppredriverhook.c
 delete mode 100644 c/src/lib/libbsp/powerpc/shared/startup/bsppredriverhook.c
 delete mode 100644 c/src/lib/libbsp/shared/bsppredriverhook.c
 delete mode 100644 c/src/lib/libbsp/sparc/leon2/startup/bsppredriver.c
 delete mode 100644 c/src/lib/libbsp/sparc/leon3/startup/bsppredriver.c

diff --git a/bsps/include/bsp/bootcard.h b/bsps/include/bsp/bootcard.h
index aaac42e8e2..4dc3f4c2b0 100644
--- a/bsps/include/bsp/bootcard.h
+++ b/bsps/include/bsp/bootcard.h
@@ -53,8 +53,6 @@ extern const char *bsp_boot_cmdline;
 
 void bsp_start(void);
 
-void bsp_predriver_hook(void);
-
 void bsp_reset(void);
 
 /**
diff --git a/c/src/lib/libbsp/m68k/mrm332/startup/bsppredriverhook.c b/bsps/m68k/mrm332/start/bspstart.c
similarity index 59%
rename from c/src/lib/libbsp/m68k/mrm332/startup/bsppredriverhook.c
rename to bsps/m68k/mrm332/start/bspstart.c
index 004a7052e0..285f34de9d 100644
--- a/c/src/lib/libbsp/m68k/mrm332/startup/bsppredriverhook.c
+++ b/bsps/m68k/mrm332/start/bspstart.c
@@ -9,14 +9,20 @@
 
 #include <bsp.h>
 #include <bsp/bootcard.h>
+#include <rtems/sysinit.h>
 
 extern void Spurious_Initialize(void);
 
 /*
- *  Call Spurious_Initialize in bsp_predriver_hook because
- *  bsp_predriver_hook is call after the _ISR_Vector_Table allocation
+ * Must be called after the _ISR_Vector_Table allocation
  */
-void bsp_predriver_hook(void)
+RTEMS_SYSINIT_ITEM(
+  Spurious_Initialize,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
+
+void bsp_start(void)
 {
-  Spurious_Initialize();
+  /* Nothing to do */
 }
diff --git a/bsps/powerpc/motorola_powerpc/start/bspstart.c b/bsps/powerpc/motorola_powerpc/start/bspstart.c
index dac4b2452d..3ab9588af0 100644
--- a/bsps/powerpc/motorola_powerpc/start/bspstart.c
+++ b/bsps/powerpc/motorola_powerpc/start/bspstart.c
@@ -20,6 +20,7 @@
 #include <bsp/bootcard.h>
 #include <rtems/bspIo.h>
 #include <rtems/counter.h>
+#include <rtems/sysinit.h>
 #include <bsp/consoleIo.h>
 #include <libcpu/spr.h>
 #include <bsp/residual.h>
@@ -30,6 +31,7 @@
 #include <libcpu/pte121.h>
 #include <libcpu/cpuIdent.h>
 #include <bsp/vectors.h>
+#include <bsp/VME.h>
 #include <bsp/motorola.h>
 #include <rtems/powerpc/powerpc.h>
 
@@ -374,3 +376,9 @@ void bsp_start( void )
   printk("Exit from bspstart\n");
 #endif
 }
+
+RTEMS_SYSINIT_ITEM(
+  BSP_vme_config,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/bsps/powerpc/mvme3100/include/bsp.h b/bsps/powerpc/mvme3100/include/bsp.h
index 2959e96813..671c8180f4 100644
--- a/bsps/powerpc/mvme3100/include/bsp.h
+++ b/bsps/powerpc/mvme3100/include/bsp.h
@@ -176,7 +176,6 @@ extern "C" {
  *
  */
 int BSP_i2c_initialize(void);
-#define BSP_PREDRIVER_I2C_INIT
 
 /* System Control Register */
 #define BSP_MVME3100_SYS_CR				((volatile uint8_t *)0xe2000001)
diff --git a/bsps/shared/start/bootcard.c b/bsps/shared/start/bootcard.c
index 3e243d2569..83030f29ba 100644
--- a/bsps/shared/start/bootcard.c
+++ b/bsps/shared/start/bootcard.c
@@ -49,12 +49,6 @@ RTEMS_SYSINIT_ITEM(
   RTEMS_SYSINIT_ORDER_MIDDLE
 );
 
-RTEMS_SYSINIT_ITEM(
-  bsp_predriver_hook,
-  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
-
 /*
  *  This is the initialization framework routine that weaves together
  *  calls to RTEMS and the BSP in the proper sequence to initialize
diff --git a/c/src/lib/libbsp/sparc/erc32/startup/bsppredriver.c b/bsps/sparc/erc32/start/bspstart.c
similarity index 60%
rename from c/src/lib/libbsp/sparc/erc32/startup/bsppredriver.c
rename to bsps/sparc/erc32/start/bspstart.c
index 6c6ea1e634..80447b9457 100644
--- a/c/src/lib/libbsp/sparc/erc32/startup/bsppredriver.c
+++ b/bsps/sparc/erc32/start/bspstart.c
@@ -12,14 +12,13 @@
 
 #include <bsp.h>
 #include <bsp/bootcard.h>
+#include <rtems/sysinit.h>
 
 /*
- *  bsp_predriver_hook
- *
- *  BSP predriver hook. Called just before drivers are initialized.
- *  Is used to initialize shared interrupt handling.
+ * Called just before drivers are initialized.  Is used to initialize shared
+ * interrupt handling.
  */
-void bsp_predriver_hook( void )
+static void erc32_pre_driver_hook( void )
 {
   bsp_spurious_initialize();
 
@@ -28,3 +27,14 @@ void bsp_predriver_hook( void )
    */
   BSP_shared_interrupt_init();
 }
+
+RTEMS_SYSINIT_ITEM(
+  erc32_pre_driver_hook,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
+
+void bsp_start(void)
+{
+  /* Nothing to do */
+}
diff --git a/c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am b/c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am
index 4e94bec90a..b7625af8c9 100644
--- a/c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am
+++ b/c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am
@@ -80,7 +80,6 @@ librtemsbsp_a_SOURCES += hwlib/src/hwmgr/alt_reset_manager.c
 
 # Shared
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../shared/timerstub.c
diff --git a/c/src/lib/libbsp/arm/atsam/Makefile.am b/c/src/lib/libbsp/arm/atsam/Makefile.am
index fd01c8a8ea..a8db8b77a5 100644
--- a/c/src/lib/libbsp/arm/atsam/Makefile.am
+++ b/c/src/lib/libbsp/arm/atsam/Makefile.am
@@ -36,7 +36,6 @@ librtemsbsp_a_LIBADD =
 # Shared
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
diff --git a/c/src/lib/libbsp/arm/beagle/Makefile.am b/c/src/lib/libbsp/arm/beagle/Makefile.am
index 3c1bf2586f..7d3167f34d 100644
--- a/c/src/lib/libbsp/arm/beagle/Makefile.am
+++ b/c/src/lib/libbsp/arm/beagle/Makefile.am
@@ -41,7 +41,6 @@ librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bsp-fdt.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../shared/gpio.c
diff --git a/c/src/lib/libbsp/arm/csb336/Makefile.am b/c/src/lib/libbsp/arm/csb336/Makefile.am
index 51b3cf9dc6..5833c9428a 100644
--- a/c/src/lib/libbsp/arm/csb336/Makefile.am
+++ b/c/src/lib/libbsp/arm/csb336/Makefile.am
@@ -19,7 +19,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
diff --git a/c/src/lib/libbsp/arm/csb337/Makefile.am b/c/src/lib/libbsp/arm/csb337/Makefile.am
index 8cce848ba1..d81e4337e7 100644
--- a/c/src/lib/libbsp/arm/csb337/Makefile.am
+++ b/c/src/lib/libbsp/arm/csb337/Makefile.am
@@ -24,9 +24,9 @@ dist_project_lib_DATA += startup/linkcmds.csb637
 
 
 project_lib_LIBRARIES = librtemsbsp.a
+librtemsbsp_a_SOURCES =
 
 # startup
-librtemsbsp_a_SOURCES = ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
diff --git a/c/src/lib/libbsp/arm/edb7312/Makefile.am b/c/src/lib/libbsp/arm/edb7312/Makefile.am
index 715b4a488d..358aec8dd1 100644
--- a/c/src/lib/libbsp/arm/edb7312/Makefile.am
+++ b/c/src/lib/libbsp/arm/edb7312/Makefile.am
@@ -18,7 +18,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
diff --git a/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am b/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am
index 1fc905b70f..cb1de3e0d5 100644
--- a/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am
+++ b/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am
@@ -19,7 +19,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspstart-empty.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += startup/bspreset.c
diff --git a/c/src/lib/libbsp/arm/gumstix/Makefile.am b/c/src/lib/libbsp/arm/gumstix/Makefile.am
index 5f63008f7b..23ac9d1294 100644
--- a/c/src/lib/libbsp/arm/gumstix/Makefile.am
+++ b/c/src/lib/libbsp/arm/gumstix/Makefile.am
@@ -17,7 +17,6 @@ project_lib_DATA += linkcmds
 project_lib_LIBRARIES = librtemsbsp.a
 
 librtemsbsp_a_SOURCES =
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
diff --git a/c/src/lib/libbsp/arm/imx/Makefile.am b/c/src/lib/libbsp/arm/imx/Makefile.am
index ebb4e04330..6bf4584814 100644
--- a/c/src/lib/libbsp/arm/imx/Makefile.am
+++ b/c/src/lib/libbsp/arm/imx/Makefile.am
@@ -31,7 +31,6 @@ librtemsbsp_a_SOURCES =
 # Shared
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
diff --git a/c/src/lib/libbsp/arm/lm3s69xx/Makefile.am b/c/src/lib/libbsp/arm/lm3s69xx/Makefile.am
index 171dee82ca..700ff5f23a 100644
--- a/c/src/lib/libbsp/arm/lm3s69xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/lm3s69xx/Makefile.am
@@ -34,7 +34,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterread.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
diff --git a/c/src/lib/libbsp/arm/lpc176x/Makefile.am b/c/src/lib/libbsp/arm/lpc176x/Makefile.am
index a278b0a837..ba69e7f77b 100644
--- a/c/src/lib/libbsp/arm/lpc176x/Makefile.am
+++ b/c/src/lib/libbsp/arm/lpc176x/Makefile.am
@@ -43,7 +43,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/uart-output-char.c
diff --git a/c/src/lib/libbsp/arm/lpc24xx/Makefile.am b/c/src/lib/libbsp/arm/lpc24xx/Makefile.am
index e58a174f63..33b9b54673 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/lpc24xx/Makefile.am
@@ -52,7 +52,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/uart-output-char.c
diff --git a/c/src/lib/libbsp/arm/lpc32xx/Makefile.am b/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
index a38fb525c8..590ab76cef 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
@@ -43,7 +43,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
diff --git a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
index 4c618e8845..eb5d6b8474 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
+++ b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
@@ -39,7 +39,6 @@ librtemsbsp_a_SOURCES =
 # Shared
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterread.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
diff --git a/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am b/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
index 5b4e942025..7ed5d22555 100644
--- a/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
+++ b/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
@@ -40,7 +40,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../shared/timerstub.c
diff --git a/c/src/lib/libbsp/arm/rtl22xx/Makefile.am b/c/src/lib/libbsp/arm/rtl22xx/Makefile.am
index 84834e0325..b110954a06 100644
--- a/c/src/lib/libbsp/arm/rtl22xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/rtl22xx/Makefile.am
@@ -19,7 +19,6 @@ project_lib_LIBRARIES = librtemsbsp.a
 librtemsbsp_a_SOURCES =
 
 # startup
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
diff --git a/c/src/lib/libbsp/arm/smdk2410/Makefile.am b/c/src/lib/libbsp/arm/smdk2410/Makefile.am
index 6273aeea1b..0d3b63e5be 100644
--- a/c/src/lib/libbsp/arm/smdk2410/Makefile.am
+++ b/c/src/lib/libbsp/arm/smdk2410/Makefile.am
@@ -24,7 +24,6 @@ librtemsbsp_a_SOURCES += startup/memmap.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterread.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
diff --git a/c/src/lib/libbsp/arm/stm32f4/Makefile.am b/c/src/lib/libbsp/arm/stm32f4/Makefile.am
index e7a237819e..00950c02b8 100644
--- a/c/src/lib/libbsp/arm/stm32f4/Makefile.am
+++ b/c/src/lib/libbsp/arm/stm32f4/Makefile.am
@@ -33,7 +33,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterread.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
diff --git a/c/src/lib/libbsp/arm/tms570/Makefile.am b/c/src/lib/libbsp/arm/tms570/Makefile.am
index 0a0fe7174e..e188dbf4f2 100644
--- a/c/src/lib/libbsp/arm/tms570/Makefile.am
+++ b/c/src/lib/libbsp/arm/tms570/Makefile.am
@@ -42,7 +42,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
diff --git a/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am b/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am
index ad960750d0..b557a0a35f 100644
--- a/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am
+++ b/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am
@@ -38,7 +38,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/cpucounterdiff.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../shared/timerstub.c
diff --git a/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c b/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c
index 2614273dcd..4c8302a7ba 100644
--- a/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c
+++ b/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c
@@ -16,6 +16,7 @@
 #include <cplb.h>
 #include <bsp/interrupt.h>
 #include <libcpu/ebiuRegs.h>
+#include <rtems/sysinit.h>
 
 const unsigned int dcplbs_table[16][2] = {  
   { 0xFFA00000, (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) },
@@ -121,13 +122,11 @@ static void Init_Flags(void)
   *((uint16_t*)PORTHIO_SET)  = 0x1<<15;
 }
 
-/*
- *  bsp_predriver_hook
- */
-void bsp_predriver_hook(void)
-{
-  bfin_interrupt_init();
-}
+RTEMS_SYSINIT_ITEM(
+  bfin_interrupt_init,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
 
 void bsp_start( void )
 {
diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/startup/bspstart.c b/c/src/lib/libbsp/bfin/bf537Stamp/startup/bspstart.c
index 074feb873f..ffc2d950c7 100644
--- a/c/src/lib/libbsp/bfin/bf537Stamp/startup/bspstart.c
+++ b/c/src/lib/libbsp/bfin/bf537Stamp/startup/bspstart.c
@@ -22,7 +22,7 @@
 #include <libcpu/mmu.h>
 #include <libcpu/mmuRegs.h>
 #include <libcpu/interrupt.h>
-
+#include <rtems/sysinit.h>
 
 static bfin_mmu_config_t mmuRegions = {
     /* instruction */
@@ -69,13 +69,11 @@ static void initPLL(void);
 static void initEBIU(void);
 static void initGPIO(void);
 
-/*
- *  BSP predriver hook.
- */
-void bsp_predriver_hook(void)
-{
-  bfin_interrupt_init();
-}
+RTEMS_SYSINIT_ITEM(
+  bfin_interrupt_init,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
 
 void bsp_start(void)
 {
diff --git a/c/src/lib/libbsp/bfin/eZKit533/startup/bspstart.c b/c/src/lib/libbsp/bfin/eZKit533/startup/bspstart.c
index 4b34e8cdd9..3579dd7766 100644
--- a/c/src/lib/libbsp/bfin/eZKit533/startup/bspstart.c
+++ b/c/src/lib/libbsp/bfin/eZKit533/startup/bspstart.c
@@ -17,6 +17,7 @@
 #include <bsp/bootcard.h>
 #include <cplb.h>
 #include <libcpu/interrupt.h>
+#include <rtems/sysinit.h>
 
 const unsigned int dcplbs_table[16][2] = {
   { 0xFFA00000,   (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) },
@@ -117,14 +118,11 @@ static void Init_Flags(void)
   *((uint8_t*)FlashA_PortB_Data) = 0x00;
 }
 
-/*
- * BSP predriver hook.  Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- */
-void bsp_predriver_hook(void)
-{
-  bfin_interrupt_init();
-}
+RTEMS_SYSINIT_ITEM(
+  bfin_interrupt_init,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
 
 void bsp_start( void )
 {
diff --git a/c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am b/c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am
index 4022519133..a13e767968 100644
--- a/c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am
+++ b/c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am
@@ -37,7 +37,6 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspstart-empty.c
 # Shared
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am
index 42fd1ccdd3..d50edebfee 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.am
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.am
@@ -104,7 +104,6 @@ librtemsbsp_a_SOURCES += ../../shared/pci/pci_bus_count.c
 librtemsbsp_a_SOURCES += ../../shared/pci/pci_find_device.c
 
 # startup
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += startup/bsp_fatal_halt.c
 librtemsbsp_a_SOURCES += startup/bspgetworkarea.c
 librtemsbsp_a_SOURCES += startup/bspidle.S
diff --git a/c/src/lib/libbsp/lm32/shared/startup/bspstart.c b/c/src/lib/libbsp/lm32/shared/startup/bspstart.c
index c84b689bb5..6a419e869e 100644
--- a/c/src/lib/libbsp/lm32/shared/startup/bspstart.c
+++ b/c/src/lib/libbsp/lm32/shared/startup/bspstart.c
@@ -33,9 +33,3 @@ void bsp_start(void)
   /* Setup console baud rate */
   BSP_uart_init(UART_BAUD_RATE);
 }
-
-void bsp_predriver_hook(void)
-{
-}
-
-
diff --git a/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am b/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am
index 0b96b79197..46a587b412 100644
--- a/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am
+++ b/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am
@@ -17,7 +17,6 @@ project_lib_DATA += linkcmds
 project_lib_LIBRARIES = librtemsbsp.a
 librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
diff --git a/c/src/lib/libbsp/m68k/av5282/Makefile.am b/c/src/lib/libbsp/m68k/av5282/Makefile.am
index 3509223388..ff434036ea 100644
--- a/c/src/lib/libbsp/m68k/av5282/Makefile.am
+++ b/c/src/lib/libbsp/m68k/av5282/Makefile.am
@@ -19,7 +19,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-loop.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += startup/init5282.c
diff --git a/c/src/lib/libbsp/m68k/csb360/Makefile.am b/c/src/lib/libbsp/m68k/csb360/Makefile.am
index fc70964d5f..c042d860d2 100644
--- a/c/src/lib/libbsp/m68k/csb360/Makefile.am
+++ b/c/src/lib/libbsp/m68k/csb360/Makefile.am
@@ -19,7 +19,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspstart-empty.c
 librtemsbsp_a_SOURCES += startup/init5272.c
diff --git a/c/src/lib/libbsp/m68k/gen68340/Makefile.am b/c/src/lib/libbsp/m68k/gen68340/Makefile.am
index 2046210a30..1b0663f8ac 100644
--- a/c/src/lib/libbsp/m68k/gen68340/Makefile.am
+++ b/c/src/lib/libbsp/m68k/gen68340/Makefile.am
@@ -19,7 +19,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspstart-empty.c
 librtemsbsp_a_SOURCES += startup/init68340.c
diff --git a/c/src/lib/libbsp/m68k/gen68360/Makefile.am b/c/src/lib/libbsp/m68k/gen68360/Makefile.am
index ec16e6cde0..4dc4122a8e 100644
--- a/c/src/lib/libbsp/m68k/gen68360/Makefile.am
+++ b/c/src/lib/libbsp/m68k/gen68360/Makefile.am
@@ -22,7 +22,6 @@ librtemsbsp_a_SOURCES =
 # startup
 librtemsbsp_a_SOURCES += startup/alloc360.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspstart-empty.c
 librtemsbsp_a_SOURCES += startup/init68360.c
diff --git a/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am b/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am
index d7b1a105c7..5e827193ab 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am
+++ b/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am
@@ -25,7 +25,6 @@ librtemsbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-loop.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += startup/init548x.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
diff --git a/c/src/lib/libbsp/m68k/mcf5206elite/Makefile.am b/c/src/lib/libbsp/m68k/mcf5206elite/Makefile.am
index cefdbe25bf..32eb2823e8 100644
--- a/c/src/lib/libbsp/m68k/mcf5206elite/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5206elite/Makefile.am
@@ -24,7 +24,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspstart-empty.c
 librtemsbsp_a_SOURCES += startup/init5206e.c
diff --git a/c/src/lib/libbsp/m68k/mcf52235/Makefile.am b/c/src/lib/libbsp/m68k/mcf52235/Makefile.am
index cce0f55e6b..d3105cf88c 100644
--- a/c/src/lib/libbsp/m68k/mcf52235/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf52235/Makefile.am
@@ -19,7 +19,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-loop.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += startup/init52235.c
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am b/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
index 49f12fe02f..1f182fe5e4 100644
--- a/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
@@ -17,7 +17,6 @@ project_lib_DATA += linkcmds
 project_lib_LIBRARIES = librtemsbsp.a
 librtemsbsp_a_SOURCES = ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-loop.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += startup/init5225x.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
diff --git a/c/src/lib/libbsp/m68k/mcf5235/Makefile.am b/c/src/lib/libbsp/m68k/mcf5235/Makefile.am
index 61920da102..c9b2d5f7d7 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5235/Makefile.am
@@ -21,7 +21,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-loop.c
 librtemsbsp_a_SOURCES += startup/bspgetcpuclockspeed.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
diff --git a/c/src/lib/libbsp/m68k/mcf5329/Makefile.am b/c/src/lib/libbsp/m68k/mcf5329/Makefile.am
index 08136d0365..5398ec64c4 100644
--- a/c/src/lib/libbsp/m68k/mcf5329/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5329/Makefile.am
@@ -20,7 +20,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-loop.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += startup/init5329.c
diff --git a/c/src/lib/libbsp/m68k/mrm332/Makefile.am b/c/src/lib/libbsp/m68k/mrm332/Makefile.am
index 282645a193..150748b6ab 100644
--- a/c/src/lib/libbsp/m68k/mrm332/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mrm332/Makefile.am
@@ -18,8 +18,7 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += startup/start_c.c
-librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspstart-empty.c
-librtemsbsp_a_SOURCES += startup/bsppredriverhook.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/m68k/mrm332/start/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
diff --git a/c/src/lib/libbsp/m68k/mvme147/Makefile.am b/c/src/lib/libbsp/m68k/mvme147/Makefile.am
index d65efa51ea..47193b0cf9 100644
--- a/c/src/lib/libbsp/m68k/mvme147/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mvme147/Makefile.am
@@ -23,7 +23,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += startup/bspclean.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../shared/setvec.c
diff --git a/c/src/lib/libbsp/m68k/mvme147s/Makefile.am b/c/src/lib/libbsp/m68k/mvme147s/Makefile.am
index 4ff43bbc21..06ba4c88d4 100644
--- a/c/src/lib/libbsp/m68k/mvme147s/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mvme147s/Makefile.am
@@ -21,7 +21,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../shared/setvec.c
diff --git a/c/src/lib/libbsp/m68k/mvme162/Makefile.am b/c/src/lib/libbsp/m68k/mvme162/Makefile.am
index 19a621d83d..d6bd69b556 100644
--- a/c/src/lib/libbsp/m68k/mvme162/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mvme162/Makefile.am
@@ -20,7 +20,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += startup/bspclean.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += startup/page_table.c
diff --git a/c/src/lib/libbsp/m68k/mvme167/Makefile.am b/c/src/lib/libbsp/m68k/mvme167/Makefile.am
index 922cf12a1c..fc62a7db54 100644
--- a/c/src/lib/libbsp/m68k/mvme167/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mvme167/Makefile.am
@@ -19,7 +19,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += startup/bspclean.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
diff --git a/c/src/lib/libbsp/m68k/uC5282/Makefile.am b/c/src/lib/libbsp/m68k/uC5282/Makefile.am
index c9f768dfa2..f3ad1ef0e5 100644
--- a/c/src/lib/libbsp/m68k/uC5282/Makefile.am
+++ b/c/src/lib/libbsp/m68k/uC5282/Makefile.am
@@ -20,7 +20,6 @@ librtemsbsp_a_SOURCES =
 # startup
 librtemsbsp_a_SOURCES += startup/bspclean.c
 librtemsbsp_a_SOURCES += startup/bspreset.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += startup/init5282.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
diff --git a/c/src/lib/libbsp/mips/csb350/Makefile.am b/c/src/lib/libbsp/mips/csb350/Makefile.am
index 176ec625e2..11ac351788 100644
--- a/c/src/lib/libbsp/mips/csb350/Makefile.am
+++ b/c/src/lib/libbsp/mips/csb350/Makefile.am
@@ -20,7 +20,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += startup/bspreset.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
diff --git a/c/src/lib/libbsp/mips/hurricane/Makefile.am b/c/src/lib/libbsp/mips/hurricane/Makefile.am
index 59edbe870c..22bae1deb7 100644
--- a/c/src/lib/libbsp/mips/hurricane/Makefile.am
+++ b/c/src/lib/libbsp/mips/hurricane/Makefile.am
@@ -21,7 +21,6 @@ librtemsbsp_a_SOURCES =
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
diff --git a/c/src/lib/libbsp/mips/jmr3904/Makefile.am b/c/src/lib/libbsp/mips/jmr3904/Makefile.am
index 96fbbef576..ef95674ff3 100644
--- a/c/src/lib/libbsp/mips/jmr3904/Makefile.am
+++ b/c/src/lib/libbsp/mips/jmr3904/Makefile.am
@@ -20,7 +20,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
diff --git a/c/src/lib/libbsp/mips/malta/Makefile.am b/c/src/lib/libbsp/mips/malta/Makefile.am
index 076283814b..14b8e211f5 100644
--- a/c/src/lib/libbsp/mips/malta/Makefile.am
+++ b/c/src/lib/libbsp/mips/malta/Makefile.am
@@ -25,7 +25,6 @@ librtemsbsp_a_SOURCES =
 # startup
 librtemsbsp_a_SOURCES += startup/simple_access.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += startup/bspreset.c
diff --git a/c/src/lib/libbsp/mips/rbtx4925/Makefile.am b/c/src/lib/libbsp/mips/rbtx4925/Makefile.am
index 912988c5c0..5eb887c810 100644
--- a/c/src/lib/libbsp/mips/rbtx4925/Makefile.am
+++ b/c/src/lib/libbsp/mips/rbtx4925/Makefile.am
@@ -21,7 +21,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
diff --git a/c/src/lib/libbsp/mips/rbtx4938/Makefile.am b/c/src/lib/libbsp/mips/rbtx4938/Makefile.am
index d4e8727959..88d67494d4 100644
--- a/c/src/lib/libbsp/mips/rbtx4938/Makefile.am
+++ b/c/src/lib/libbsp/mips/rbtx4938/Makefile.am
@@ -22,7 +22,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
diff --git a/c/src/lib/libbsp/moxie/moxiesim/Makefile.am b/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
index 0447f7e576..950f69da27 100644
--- a/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
+++ b/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
@@ -22,7 +22,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspstart-empty.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am b/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am
index 4c1765251e..960d57b495 100644
--- a/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am
+++ b/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am
@@ -27,7 +27,6 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-defa
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += startup/setvec.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 
 # clock
 librtemsbsp_a_SOURCES += clock/clock.c
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/Makefile.am b/c/src/lib/libbsp/no_cpu/no_bsp/Makefile.am
index 8ff6eb12c5..b78b30e55f 100644
--- a/c/src/lib/libbsp/no_cpu/no_bsp/Makefile.am
+++ b/c/src/lib/libbsp/no_cpu/no_bsp/Makefile.am
@@ -14,7 +14,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/startup/bspgetworkarea.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
diff --git a/c/src/lib/libbsp/or1k/generic_or1k/Makefile.am b/c/src/lib/libbsp/or1k/generic_or1k/Makefile.am
index 846f5c8f4f..60e3919764 100644
--- a/c/src/lib/libbsp/or1k/generic_or1k/Makefile.am
+++ b/c/src/lib/libbsp/or1k/generic_or1k/Makefile.am
@@ -44,7 +44,6 @@ librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 
diff --git a/c/src/lib/libbsp/powerpc/beatnik/Makefile.am b/c/src/lib/libbsp/powerpc/beatnik/Makefile.am
index c9eec22263..2a741f78a6 100644
--- a/c/src/lib/libbsp/powerpc/beatnik/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/beatnik/Makefile.am
@@ -47,7 +47,6 @@ librtemsbsp_a_SOURCES += startup/bspreset.c
 librtemsbsp_a_SOURCES += startup/i2c_init.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspgetworkarea.c
 librtemsbsp_a_SOURCES += ../shared/startup/probeMemEnd.c
-librtemsbsp_a_SOURCES += ../shared/startup/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../shared/startup/zerobss.c
 librtemsbsp_a_SOURCES += ../shared/startup/pgtbl_setup.c
 librtemsbsp_a_SOURCES += ../shared/startup/pgtbl_activate.c
diff --git a/c/src/lib/libbsp/powerpc/beatnik/startup/bspstart.c b/c/src/lib/libbsp/powerpc/beatnik/startup/bspstart.c
index b6ac2323ac..c3f2c0ceda 100644
--- a/c/src/lib/libbsp/powerpc/beatnik/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/beatnik/startup/bspstart.c
@@ -32,6 +32,7 @@
 #include <rtems/bspIo.h>
 #include <rtems/counter.h>
 #include <rtems/powerpc/powerpc.h>
+#include <rtems/sysinit.h>
 /*#include <bsp/consoleIo.h>*/
 #include <libcpu/spr.h>   /* registers.h is included here */
 #include <bsp.h>
@@ -44,6 +45,7 @@
 #include <libcpu/pte121.h>
 #include <libcpu/cpuIdent.h>
 #include <bsp/vectors.h>
+#include <bsp/VME.h>
 #include <bsp/vpd.h>
 
 #define SHOW_MORE_INIT_SETTINGS
@@ -377,3 +379,9 @@ void bsp_start( void )
   printk("Exit from bspstart\n");
 #endif
 }
+
+RTEMS_SYSINIT_ITEM(
+  BSP_vme_config,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/c/src/lib/libbsp/powerpc/gen5200/Makefile.am b/c/src/lib/libbsp/powerpc/gen5200/Makefile.am
index 0c9b010738..b844fb3f73 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/gen5200/Makefile.am
@@ -90,7 +90,6 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/rtc/rtc-support.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bsp-uboot-board-info.c
 librtemsbsp_a_SOURCES += ../shared/showbats.c
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
index cfc50a8cf5..9ddd979394 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
@@ -31,7 +31,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../shared/src/tictac.c
 librtemsbsp_a_SOURCES += startup/cpuinit.c
diff --git a/c/src/lib/libbsp/powerpc/haleakala/Makefile.am b/c/src/lib/libbsp/powerpc/haleakala/Makefile.am
index 3dcb486e67..a95999f5ff 100644
--- a/c/src/lib/libbsp/powerpc/haleakala/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/haleakala/Makefile.am
@@ -21,7 +21,6 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-loop.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += mmu/mmu_405.c
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
index 71567fc38a..7b29824f2a 100644
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
@@ -37,7 +37,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/motorola_powerpc/start/bspstart.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspgetworkarea.c
 librtemsbsp_a_SOURCES += ../shared/showbats.c
-librtemsbsp_a_SOURCES += ../shared/startup/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../shared/startup/zerobss.c
 librtemsbsp_a_SOURCES += ../shared/startup/pgtbl_setup.c
 librtemsbsp_a_SOURCES += ../shared/startup/pgtbl_activate.c
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am b/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
index fbbc2f90bf..a41bc570bf 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
@@ -42,7 +42,6 @@ librtemsbsp_a_SOURCES =
 # startup
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
 librtemsbsp_a_SOURCES += ../shared/src/bsp-start-zero.S
 librtemsbsp_a_SOURCES += ../shared/src/memcpy.c
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am b/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am
index 8d13b32ea9..6524244052 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am
@@ -33,7 +33,6 @@ librtemsbsp_a_SOURCES += irq/irq.c
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspidle.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
diff --git a/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am b/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
index 1da4eff93d..3b6d0fdeb4 100644
--- a/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
@@ -40,7 +40,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += startup/misc.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspgetworkarea.c
-librtemsbsp_a_SOURCES += ../shared/startup/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../shared/startup/zerobss.c
 librtemsbsp_a_SOURCES += ../shared/startup/sbrk.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
diff --git a/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c
index e0c30b673a..27b483332c 100644
--- a/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c
@@ -25,6 +25,7 @@
 #include <bsp/bootcard.h>
 #include <rtems/bspIo.h>
 #include <rtems/counter.h>
+#include <rtems/sysinit.h>
 #include <libcpu/spr.h>
 #include <libcpu/io.h>
 #include <libcpu/e500_mmu.h>
@@ -34,6 +35,7 @@
 #include <bsp/vpd.h>
 #include <libcpu/cpuIdent.h>
 #include <bsp/vectors.h>
+#include <bsp/VME.h>
 #include <rtems/powerpc/powerpc.h>
 
 #define SHOW_MORE_INIT_SETTINGS
@@ -419,3 +421,20 @@ VpdBufRec          vpdData [] = {
   printk("Exit from bspstart\n");
 #endif
 }
+
+static void mvme3100_i2c_initialize(void)
+{
+  BSP_i2c_initialize();
+}
+
+RTEMS_SYSINIT_ITEM(
+  mvme3100_i2c_initialize,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
+
+RTEMS_SYSINIT_ITEM(
+  BSP_vme_config,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am b/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am
index 122122defa..d4c5201263 100644
--- a/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am
@@ -17,7 +17,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../shared/startup/pgtbl_setup.c
 librtemsbsp_a_SOURCES += startup/pgtbl_activate.c
-librtemsbsp_a_SOURCES += ../shared/startup/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../shared/startup/zerobss.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspgetworkarea.c
 librtemsbsp_a_SOURCES += ../shared/startup/sbrk.c
diff --git a/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c
index 2310be7965..279524eb8f 100644
--- a/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include <ctype.h>
 
+#include <rtems/sysinit.h>
 #include <rtems/system.h>
 #include <rtems/powerpc/powerpc.h>
 
@@ -37,6 +38,7 @@
 #include <libcpu/pte121.h>
 #include <libcpu/cpuIdent.h>
 #include <bsp/vectors.h>
+#include <bsp/VME.h>
 #include <bsp/bspException.h>
 
 #include <rtems/bspIo.h>
@@ -341,3 +343,9 @@ unsigned char ReadConfVPD_buff(int offset)
 {
   return(ConfVPD_buff[offset]);
 }
+
+RTEMS_SYSINIT_ITEM(
+  BSP_vme_config,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/c/src/lib/libbsp/powerpc/psim/Makefile.am b/c/src/lib/libbsp/powerpc/psim/Makefile.am
index 0c416ae26a..d38d759a16 100644
--- a/c/src/lib/libbsp/powerpc/psim/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/psim/Makefile.am
@@ -23,7 +23,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am b/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
index f7320d707b..f6d16d8830 100644
--- a/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
@@ -22,7 +22,6 @@ project_lib_LIBRARIES = librtemsbsp.a
 librtemsbsp_a_SOURCES =
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
diff --git a/c/src/lib/libbsp/powerpc/qoriq/Makefile.am b/c/src/lib/libbsp/powerpc/qoriq/Makefile.am
index baa3016206..b9735779ff 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/qoriq/Makefile.am
@@ -50,7 +50,6 @@ librtemsbsp_a_SOURCES += startup/mmu-tlb1.S
 librtemsbsp_a_SOURCES += startup/mmu-config.c
 librtemsbsp_a_SOURCES += startup/portal.c
 librtemsbsp_a_SOURCES += startup/restart.S
-librtemsbsp_a_SOURCES += startup/bsppredriverhook.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += startup/bspreset.c
 librtemsbsp_a_SOURCES += startup/bsprestart.c
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/bsppredriverhook.c b/c/src/lib/libbsp/powerpc/qoriq/startup/bsppredriverhook.c
deleted file mode 100644
index 26e91250b9..0000000000
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/bsppredriverhook.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * @file
- *
- * @ingroup QorIQ
- *
- * @brief bsp_predriver_hook() implementation.
- */
-
-/*
- * Copyright (c) 2011 embedded brains GmbH.  All rights reserved.
- *
- *  embedded brains GmbH
- *  Obere Lagerstr. 30
- *  82178 Puchheim
- *  Germany
- *  <rtems at embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#include <bsp/bootcard.h>
-#include <bsp/intercom.h>
-
-void bsp_predriver_hook(void)
-{
-  #ifdef RTEMS_MULTIPROCESSING
-    qoriq_intercom_init();
-  #endif
-}
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
index 9475c6fad5..7d9fa0d3c7 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
@@ -25,6 +25,7 @@
 #include <rtems.h>
 #include <rtems/config.h>
 #include <rtems/counter.h>
+#include <rtems/sysinit.h>
 
 #include <libcpu/powerpc-utility.h>
 
@@ -33,6 +34,7 @@
 #include <bsp/console-termios.h>
 #include <bsp/fatal.h>
 #include <bsp/fdt.h>
+#include <bsp/intercom.h>
 #include <bsp/irq-generic.h>
 #include <bsp/linker-symbols.h>
 #include <bsp/mmu.h>
@@ -185,3 +187,11 @@ uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t icells)
   return intr[0];
 #endif
 }
+
+#ifdef RTEMS_MULTIPROCESSING
+RTEMS_SYSINIT_ITEM(
+  qoriq_intercom_init,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
+#endif
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/bsppredriverhook.c b/c/src/lib/libbsp/powerpc/shared/startup/bsppredriverhook.c
deleted file mode 100644
index fc3916eadf..0000000000
--- a/c/src/lib/libbsp/powerpc/shared/startup/bsppredriverhook.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *  bsp_predriver_hook().
- *  Optionally initializes I2C and VME.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  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.org/license/LICENSE.
- *
- *  Modified to support the MCP750.
- *  Modifications Copyright (C) 1999 Eric Valette. valette at crf.canon.fr
- */
-
-#include <string.h>
-
-#include <bsp.h>
-#include <bsp/bootcard.h>
-#ifndef BSP_HAS_NO_VME
-#include <bsp/VME.h>
-#endif
-
-#ifdef SHOW_MORE_INIT_SETTINGS
-#include <rtems/bspIo.h>
-#endif
-
-/*
- *  bsp_predriver_hook
- *
- *  Description:
- *      BSP predriver hook.  Called just before drivers are initialized.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
-
-void bsp_predriver_hook(void)
-{
-#ifdef BSP_PREDRIVER_I2C_INIT
-  /* Some drivers (RTC) may need i2c */
-  BSP_i2c_initialize();
-#endif
-
-  /* Note that VME support may be omitted also by
-   * providing a no-op  BSP_vme_config routine
-   */
-#ifndef BSP_HAS_NO_VME
-  /*
-   * Initialize VME bridge - needs working PCI
-   * and IRQ subsystems...
-   *
-   * NOTE: vmeUniverse driver now uses shared interrupts.
-   *       this requires malloc/free which are not available
-   *       from bspstart()...
-   */
-#ifdef SHOW_MORE_INIT_SETTINGS
-  printk("Going to initialize VME bridge\n");
-#endif
-  BSP_vme_config();
-#endif
-
-#ifdef SHOW_MORE_INIT_SETTINGS
-  printk("Leaving bsp_predriver_hook\n");
-#endif
-}
diff --git a/c/src/lib/libbsp/powerpc/ss555/Makefile.am b/c/src/lib/libbsp/powerpc/ss555/Makefile.am
index adbfa36ec9..57e157e39e 100644
--- a/c/src/lib/libbsp/powerpc/ss555/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/ss555/Makefile.am
@@ -22,7 +22,6 @@ librtemsbsp_a_SOURCES += clock/p_clock.c
 librtemsbsp_a_SOURCES += console/console.c
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += startup/iss555.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
diff --git a/c/src/lib/libbsp/powerpc/t32mppc/Makefile.am b/c/src/lib/libbsp/powerpc/t32mppc/Makefile.am
index 32bc5d6816..73c627a831 100644
--- a/c/src/lib/libbsp/powerpc/t32mppc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/t32mppc/Makefile.am
@@ -27,7 +27,6 @@ librtemsbsp_a_SOURCES =
 
 # Startup
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am b/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am
index d1855819a8..903782727a 100644
--- a/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am
@@ -39,7 +39,6 @@ librtemsbsp_a_SOURCES += spi/spi.c
 librtemsbsp_a_SOURCES += timer/timer.c
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspidle.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += startup/bspgetworkarea.c
diff --git a/c/src/lib/libbsp/powerpc/virtex/Makefile.am b/c/src/lib/libbsp/powerpc/virtex/Makefile.am
index 13dcfa0534..de384a7309 100644
--- a/c/src/lib/libbsp/powerpc/virtex/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/virtex/Makefile.am
@@ -34,7 +34,6 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-defa
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-loop.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../shared/src/bsp-start-zero.S
 
diff --git a/c/src/lib/libbsp/powerpc/virtex4/start/start.S b/c/src/lib/libbsp/powerpc/virtex4/start/start.S
index e2c4534771..21948409bf 100644
--- a/c/src/lib/libbsp/powerpc/virtex4/start/start.S
+++ b/c/src/lib/libbsp/powerpc/virtex4/start/start.S
@@ -284,7 +284,7 @@ startupBL:
         * PowerPC EABI.
         *
         * boot_card() supervises the initialization of RTEMS and the C
-        * library.  It calls bsp_start(), bsp_predriver_hook(), etc.
+        * library.  It calls bsp_start(), etc.
         *------------------------------------------------------------------*/
         lwz     r2,toc_pointer-base_addr(r1)        /* set r2 to toc */
         lwz     r1,stack_top-base_addr(r1)          /* set r1 to stack_top */
diff --git a/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c b/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c
index f67c1c3603..d5c255be6d 100644
--- a/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c
@@ -57,6 +57,7 @@
 #include <rtems/counter.h>
 #include <rtems/libio.h>
 #include <rtems/libcsupport.h>
+#include <rtems/sysinit.h>
 
 #include <libcpu/cpuIdent.h>
 #include <libcpu/spr.h>
@@ -206,7 +207,13 @@ void bsp_start(void)
  *  BSP predriver hook.  Called by boot_card() just before drivers are
  *  initialized.  Clear out any stale interrupts here.
  */
-void bsp_predriver_hook(void)
+static void virtex4_pre_driver_hook(void)
 {
   app_bsp_predriver_hook();
 }
+
+RTEMS_SYSINIT_ITEM(
+  virtex4_pre_driver_hook,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c b/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
index 44e7512e55..ff821574a9 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
@@ -58,6 +58,7 @@
 #include <rtems/counter.h>
 #include <rtems/libio.h>
 #include <rtems/libcsupport.h>
+#include <rtems/sysinit.h>
 
 #include <libcpu/cpuIdent.h>
 #include <libcpu/spr.h>
@@ -227,7 +228,13 @@ void bsp_start(void)
  *  BSP predriver hook.  Called by boot_card() just before drivers are
  *  initialized.  Clear out any stale interrupts here.
  */
-void bsp_predriver_hook(void)
+static void virtex5_pre_driver_hook(void)
 {
   app_bsp_predriver_hook();
 }
+
+RTEMS_SYSINIT_ITEM(
+  virtex5_pre_driver_hook,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/c/src/lib/libbsp/riscv/riscv_generic/Makefile.am b/c/src/lib/libbsp/riscv/riscv_generic/Makefile.am
index b64548e46d..35f3b13ece 100644
--- a/c/src/lib/libbsp/riscv/riscv_generic/Makefile.am
+++ b/c/src/lib/libbsp/riscv/riscv_generic/Makefile.am
@@ -37,7 +37,6 @@ librtemsbsp_a_SOURCES += startup/bsp_fatal_halt.c
 
 # Shared
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/stackalloc.c
diff --git a/c/src/lib/libbsp/sh/gensh1/Makefile.am b/c/src/lib/libbsp/sh/gensh1/Makefile.am
index 74bc75d7d7..cd5aa48b33 100644
--- a/c/src/lib/libbsp/sh/gensh1/Makefile.am
+++ b/c/src/lib/libbsp/sh/gensh1/Makefile.am
@@ -24,7 +24,6 @@ BUILT_SOURCES = scitab.c
 CLEANFILES = scitab.c
 
 # startup
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-loop.c
diff --git a/c/src/lib/libbsp/sh/gensh2/Makefile.am b/c/src/lib/libbsp/sh/gensh2/Makefile.am
index cf1f18a72a..4ad28131ab 100644
--- a/c/src/lib/libbsp/sh/gensh2/Makefile.am
+++ b/c/src/lib/libbsp/sh/gensh2/Makefile.am
@@ -27,7 +27,6 @@ CLEANFILES = scitab.c
 
 # startup
 librtemsbsp_a_SOURCES += startup/hw_init.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
diff --git a/c/src/lib/libbsp/sh/gensh4/Makefile.am b/c/src/lib/libbsp/sh/gensh4/Makefile.am
index f7dae9e159..860a3eb328 100644
--- a/c/src/lib/libbsp/sh/gensh4/Makefile.am
+++ b/c/src/lib/libbsp/sh/gensh4/Makefile.am
@@ -18,7 +18,6 @@ project_lib_LIBRARIES = librtemsbsp.a
 librtemsbsp_a_SOURCES =
 
 # startup
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
diff --git a/c/src/lib/libbsp/sh/shsim/Makefile.am b/c/src/lib/libbsp/sh/shsim/Makefile.am
index 35f036b8e0..7f80ca99a9 100644
--- a/c/src/lib/libbsp/sh/shsim/Makefile.am
+++ b/c/src/lib/libbsp/sh/shsim/Makefile.am
@@ -17,7 +17,6 @@ project_lib_LIBRARIES = librtemsbsp.a
 librtemsbsp_a_SOURCES =
 
 # startup
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
diff --git a/c/src/lib/libbsp/shared/bsppredriverhook.c b/c/src/lib/libbsp/shared/bsppredriverhook.c
deleted file mode 100644
index 10ee058f19..0000000000
--- a/c/src/lib/libbsp/shared/bsppredriverhook.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- *  This is a dummy bsp_predriver_hook routine.
- *
- *  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.org/license/LICENSE.
- */
-
-#include <bsp/bootcard.h>
-
-void bsp_predriver_hook( void )
-{
-}
diff --git a/c/src/lib/libbsp/sparc/erc32/Makefile.am b/c/src/lib/libbsp/sparc/erc32/Makefile.am
index 616da2bde2..526cf3fb4d 100644
--- a/c/src/lib/libbsp/sparc/erc32/Makefile.am
+++ b/c/src/lib/libbsp/sparc/erc32/Makefile.am
@@ -21,10 +21,9 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += startup/bsppredriver.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspgetworkarea.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
-librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspstart-empty.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/erc32/start/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += startup/setvec.c
diff --git a/c/src/lib/libbsp/sparc/leon2/Makefile.am b/c/src/lib/libbsp/sparc/leon2/Makefile.am
index a6d5d48564..edbe4ce025 100644
--- a/c/src/lib/libbsp/sparc/leon2/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon2/Makefile.am
@@ -23,7 +23,6 @@ librtemsbsp_a_SOURCES =
 
 # startup
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += startup/bsppredriver.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspgetworkarea.c
diff --git a/c/src/lib/libbsp/sparc/leon2/startup/bsppredriver.c b/c/src/lib/libbsp/sparc/leon2/startup/bsppredriver.c
deleted file mode 100644
index b11ad4cb59..0000000000
--- a/c/src/lib/libbsp/sparc/leon2/startup/bsppredriver.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * @file
- * @ingroup sparc_leon2
- * @brief Installs BSP pre-driver hook
- */
-
-/*  Installs the BSP pre-driver hook
- *
- *  COPYRIGHT (c) 2011
- *  Aeroflex Gaisler
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#include <bsp.h>
-#include <bsp/bootcard.h>
-
-/* If RTEMS_DRVMGR_STARTUP is defined extra code is added that
- * registers the LEON2 AMBA bus driver as root driver into the
- * driver manager.
- *
- * The structues here are declared weak so that the user can override
- * the configuration and add custom cores in the RTEMS project.
- */
-#ifdef RTEMS_DRVMGR_STARTUP
-#include <drvmgr/drvmgr.h>
-#include <drvmgr/leon2_amba_bus.h>
-
-/* All drivers included by BSP, this is overridden by the user by including
- * the devmgr_confdefs.h. No specifc drivers needed by BSP since IRQ/TIMER/UART
- * is not drvmgr drivers.
- */
-drvmgr_drv_reg_func drvmgr_drivers[] __attribute__((weak)) =
-{
-  NULL /* End array with NULL */
-};
-
-/* Defines what cores are avilable on the bus in addition to the standard
- * LEON2 peripherals.
- */
-struct leon2_core leon2_amba_custom_cores[] __attribute__((weak)) =
-{
-  EMPTY_LEON2_CORE
-};
-
-/* Configure LEON2 Root bus driver */
-struct leon2_bus leon2_bus_config __attribute__((weak)) =
-{
-  &leon2_std_cores[0], /* The standard cores, defined by driver */
-  &leon2_amba_custom_cores[0],   /* custom cores, defined by us */
-  DRVMGR_TRANSLATE_ONE2ONE,
-  DRVMGR_TRANSLATE_ONE2ONE,
-};
-
-/* Driver resources on LEON2 AMBA bus. Used to set options for particular
- * LEON2 cores, it is up to the driver to look at the configuration paramters
- * once started.
- */
-struct drvmgr_bus_res leon2_amba_res __attribute__((weak)) =
-{
-  .next = NULL,
-  .resource = {
-    DRVMGR_RES_EMPTY
-  },
-};
-#endif /* RTEMS_DRVMGR_STARTUP */
-
-/*
- *  bsp_predriver_hook
- *
- *  BSP predriver hook. Called just before drivers are initialized.
- *  Is used to initialize shared interrupt handling.
- */
-void bsp_predriver_hook( void )
-{
-  bsp_spurious_initialize();
-
-  /* Initialize shared interrupt handling, must be done after IRQ
-   * controller has been found and initialized.
-   */
-  BSP_shared_interrupt_init();
-
-#ifdef RTEMS_DRVMGR_STARTUP
-  leon2_root_register(&leon2_bus_config, &leon2_amba_res);
-#endif
-}
diff --git a/c/src/lib/libbsp/sparc/leon2/startup/bspstart.c b/c/src/lib/libbsp/sparc/leon2/startup/bspstart.c
index b3da955410..f2ed8ae16c 100644
--- a/c/src/lib/libbsp/sparc/leon2/startup/bspstart.c
+++ b/c/src/lib/libbsp/sparc/leon2/startup/bspstart.c
@@ -7,6 +7,8 @@
 /*
  *  LEON2 Cache Snooping Support
  *
+ *  COPYRIGHT (c) 2011
+ *  Aeroflex Gaisler
  *
  *  COPYRIGHT (c) 1989-2009.
  *  On-Line Applications Research Corporation (OAR).
@@ -25,6 +27,7 @@
 
 #include <bsp.h>
 #include <bsp/bootcard.h>
+#include <rtems/sysinit.h>
 
 /*
  * Tells us if data cache snooping is available
@@ -48,3 +51,77 @@ void bsp_start( void )
 {
   CPU_SPARC_HAS_SNOOPING = set_snooping();
 }
+
+/* If RTEMS_DRVMGR_STARTUP is defined extra code is added that
+ * registers the LEON2 AMBA bus driver as root driver into the
+ * driver manager.
+ *
+ * The structues here are declared weak so that the user can override
+ * the configuration and add custom cores in the RTEMS project.
+ */
+#ifdef RTEMS_DRVMGR_STARTUP
+#include <drvmgr/drvmgr.h>
+#include <drvmgr/leon2_amba_bus.h>
+
+/* All drivers included by BSP, this is overridden by the user by including
+ * the devmgr_confdefs.h. No specifc drivers needed by BSP since IRQ/TIMER/UART
+ * is not drvmgr drivers.
+ */
+drvmgr_drv_reg_func drvmgr_drivers[] __attribute__((weak)) =
+{
+  NULL /* End array with NULL */
+};
+
+/* Defines what cores are avilable on the bus in addition to the standard
+ * LEON2 peripherals.
+ */
+struct leon2_core leon2_amba_custom_cores[] __attribute__((weak)) =
+{
+  EMPTY_LEON2_CORE
+};
+
+/* Configure LEON2 Root bus driver */
+struct leon2_bus leon2_bus_config __attribute__((weak)) =
+{
+  &leon2_std_cores[0], /* The standard cores, defined by driver */
+  &leon2_amba_custom_cores[0],   /* custom cores, defined by us */
+  DRVMGR_TRANSLATE_ONE2ONE,
+  DRVMGR_TRANSLATE_ONE2ONE,
+};
+
+/* Driver resources on LEON2 AMBA bus. Used to set options for particular
+ * LEON2 cores, it is up to the driver to look at the configuration paramters
+ * once started.
+ */
+struct drvmgr_bus_res leon2_amba_res __attribute__((weak)) =
+{
+  .next = NULL,
+  .resource = {
+    DRVMGR_RES_EMPTY
+  },
+};
+#endif /* RTEMS_DRVMGR_STARTUP */
+
+/*
+ * Called just before drivers are initialized.  Is used to initialize shared
+ * interrupt handling.
+ */
+static void leon2_pre_driver_hook( void )
+{
+  bsp_spurious_initialize();
+
+  /* Initialize shared interrupt handling, must be done after IRQ
+   * controller has been found and initialized.
+   */
+  BSP_shared_interrupt_init();
+
+#ifdef RTEMS_DRVMGR_STARTUP
+  leon2_root_register(&leon2_bus_config, &leon2_amba_res);
+#endif
+}
+
+RTEMS_SYSINIT_ITEM(
+  leon2_pre_driver_hook,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index 2f8c294b57..27c1a96144 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -28,7 +28,6 @@ librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += startup/bspclean.c
 librtemsbsp_a_SOURCES += startup/bspstart.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
-librtemsbsp_a_SOURCES += startup/bsppredriver.c
 librtemsbsp_a_SOURCES += ../shared/startup/bspgetworkarea.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += startup/setvec.c
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bsppredriver.c b/c/src/lib/libbsp/sparc/leon3/startup/bsppredriver.c
deleted file mode 100644
index ba35624d33..0000000000
--- a/c/src/lib/libbsp/sparc/leon3/startup/bsppredriver.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * @file
- * @ingroup sparc_leon3
- * @brief Installs the BSP pre-driver hook
- */
-
-/*
- *  COPYRIGHT (c) 2011
- *  Aeroflex Gaisler
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#include <bsp.h>
-#include <bsp/bootcard.h>
-
-#include <drvmgr/drvmgr.h>
-
-#include <rtems/sysinit.h>
-
-static void leon3_interrupt_common_init( void )
-{
-  /* Initialize shared interrupt handling, must be done after IRQ
-   * controller has been found and initialized.
-   */
-  BSP_shared_interrupt_init();
-}
-
-/*
- *  bsp_predriver_hook
- *
- *  BSP predriver hook. Called just before drivers are initialized.
- *  Is used to initialize shared interrupt handling.
- */
-void bsp_predriver_hook( void )
-{
-  bsp_spurious_initialize();
-
-#ifndef RTEMS_DRVMGR_STARTUP
-  leon3_interrupt_common_init();
-#endif
-}
-
-#ifdef RTEMS_DRVMGR_STARTUP
-/*
- * Initialize shared interrupt handling, must be done after IRQ controller has
- * been found and initialized.
- */
-RTEMS_SYSINIT_ITEM(
-  leon3_interrupt_common_init,
-  RTEMS_SYSINIT_DRVMGR_LEVEL_1,
-  RTEMS_SYSINIT_ORDER_LAST
-);
-#endif
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
index 6353ca3772..58fc7d0907 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
@@ -4,6 +4,9 @@
  *  The generic CPU dependent initialization has been performed
  *  before any of these are invoked.
  *
+ *  COPYRIGHT (c) 2011
+ *  Aeroflex Gaisler
+ *
  *  COPYRIGHT (c) 1989-2013.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -19,6 +22,7 @@
 #include <bsp.h>
 #include <leon.h>
 #include <bsp/bootcard.h>
+#include <drvmgr/drvmgr.h>
 #include <rtems/sysinit.h>
 
 #if defined(RTEMS_SMP) || defined(RTEMS_MULTIPROCESSING)
@@ -80,3 +84,42 @@ RTEMS_SYSINIT_ITEM(
   RTEMS_SYSINIT_BSP_START,
   RTEMS_SYSINIT_ORDER_FIRST
 );
+
+static void leon3_interrupt_common_init( void )
+{
+  /* Initialize shared interrupt handling, must be done after IRQ
+   * controller has been found and initialized.
+   */
+  BSP_shared_interrupt_init();
+}
+
+/*
+ * Called just before drivers are initialized.  Is used to initialize shared
+ * interrupt handling.
+ */
+static void leon3_pre_driver_hook( void )
+{
+  bsp_spurious_initialize();
+
+#ifndef RTEMS_DRVMGR_STARTUP
+  leon3_interrupt_common_init();
+#endif
+}
+
+RTEMS_SYSINIT_ITEM(
+  leon3_pre_driver_hook,
+  RTEMS_SYSINIT_BSP_PRE_DRIVERS,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
+
+#ifdef RTEMS_DRVMGR_STARTUP
+/*
+ * Initialize shared interrupt handling, must be done after IRQ controller has
+ * been found and initialized.
+ */
+RTEMS_SYSINIT_ITEM(
+  leon3_interrupt_common_init,
+  RTEMS_SYSINIT_DRVMGR_LEVEL_1,
+  RTEMS_SYSINIT_ORDER_LAST
+);
+#endif
diff --git a/c/src/lib/libbsp/sparc64/niagara/Makefile.am b/c/src/lib/libbsp/sparc64/niagara/Makefile.am
index ce3212d63b..f90c7ddfcd 100644
--- a/c/src/lib/libbsp/sparc64/niagara/Makefile.am
+++ b/c/src/lib/libbsp/sparc64/niagara/Makefile.am
@@ -19,7 +19,6 @@ project_lib_LIBRARIES = librtemsbsp.a
 librtemsbsp_a_SOURCES =
 librtemsbsp_a_SOURCES += startup/bspclean.c
 librtemsbsp_a_SOURCES += startup/m5op_sparc.S
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
diff --git a/c/src/lib/libbsp/sparc64/usiii/Makefile.am b/c/src/lib/libbsp/sparc64/usiii/Makefile.am
index 732408361c..3369039a8e 100644
--- a/c/src/lib/libbsp/sparc64/usiii/Makefile.am
+++ b/c/src/lib/libbsp/sparc64/usiii/Makefile.am
@@ -30,7 +30,6 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspstart-empty.c
 librtemsbsp_a_SOURCES += ../../shared/sbrk.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
 librtemsbsp_a_SOURCES += ../shared/startup/setvec.c
 librtemsbsp_a_SOURCES += ../shared/helenos/boot/genarch/balloc.c
diff --git a/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am b/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am
index f50f3a3f01..cd487fec51 100644
--- a/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am
+++ b/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am
@@ -18,7 +18,6 @@ project_lib_DATA = start.$(OBJEXT)
 project_lib_DATA += linkcmds
 
 librtemsbsp_a_SOURCES = ../../../../../../bsps/shared/start/bspfatal-default.c
-librtemsbsp_a_SOURCES += ../../shared/bsppredriverhook.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspstart-empty.c
 librtemsbsp_a_SOURCES += ../../shared/getentropy-cpucounter.c
-- 
2.12.3




More information about the devel mailing list