[rtems commit] Revert "drvmgr: Move bsp_driver_level_hook() calls"

Sebastian Huber sebh at rtems.org
Tue Jan 26 15:24:33 UTC 2016


Module:    rtems
Branch:    master
Commit:    297aa075dcdd7f767d6bbeb19f50f57dbbb883ab
Changeset: http://git.rtems.org/rtems/commit/?id=297aa075dcdd7f767d6bbeb19f50f57dbbb883ab

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Jan 26 16:22:46 2016 +0100

Revert "drvmgr: Move bsp_driver_level_hook() calls"

The --enable-drvmgr configure option controls the driver manager startup
and not if the driver manager is present or not.  Presence of the driver
manager is determined by the architecture (only available on sparc so
far).

This reverts commit 61bbf9194ff4bdbc1b48e6ac9919c02b358e5701.

---

 cpukit/libdrvmgr/drvmgr.c | 13 ++++++-------
 cpukit/sapi/src/exinit.c  |  4 ++++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/cpukit/libdrvmgr/drvmgr.c b/cpukit/libdrvmgr/drvmgr.c
index 66d6cfa..7c37afd 100644
--- a/cpukit/libdrvmgr/drvmgr.c
+++ b/cpukit/libdrvmgr/drvmgr.c
@@ -68,15 +68,14 @@ void _DRV_Manager_init_level(int level)
 {
 	struct drvmgr *mgr = &drvmgr;
 
-	if (mgr->level < level) {
-		/* Set new Level */
-		mgr->level = level;
+	if (mgr->level >= level)
+		return;
 
-		/* Initialize buses and devices into this new level */
-		drvmgr_init_update();
-	}
+	/* Set new Level */
+	mgr->level = level;
 
-	bsp_driver_level_hook(level);
+	/* Initialize buses and devices into this new level */
+	drvmgr_init_update();
 }
 
 /* Initialize Data structures of the driver manager and call driver
diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c
index 13154ce..1eaf24f 100644
--- a/cpukit/sapi/src/exinit.c
+++ b/cpukit/sapi/src/exinit.c
@@ -190,6 +190,7 @@ static void rtems_initialize_device_drivers(void)
    *   - Install extra memory.
    */
   _DRV_Manager_init_level(1);
+  bsp_driver_level_hook(1);
   #endif
 
   /* Initialize I/O drivers. 
@@ -210,6 +211,7 @@ static void rtems_initialize_device_drivers(void)
    * for the first time.
    */
   _DRV_Manager_init_level(2);
+  bsp_driver_level_hook(2);
 
   /* Init Drivers to Level 3 
    * 
@@ -218,11 +220,13 @@ static void rtems_initialize_device_drivers(void)
    * API inited in level 2
    */
   _DRV_Manager_init_level(3);
+  bsp_driver_level_hook(3);
 
   /* Init Drivers to Level 4,
    * Init drivers that depend on services initialized in Level 3
    */
   _DRV_Manager_init_level(4);
+  bsp_driver_level_hook(4);
   #endif
 
   #if defined(RTEMS_MULTIPROCESSING)



More information about the vc mailing list