[rtems-libbsd commit] Add ordered Nexus devices

Sebastian Huber sebh at rtems.org
Tue Feb 14 08:40:12 UTC 2017


Module:    rtems-libbsd
Branch:    master
Commit:    ea395a736d7242db72a2c8087b102b6def7b672e
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=ea395a736d7242db72a2c8087b102b6def7b672e

Author:    Kevin Kirspel <kevin-kirspel at idexx.com>
Date:      Mon Jan 30 11:58:18 2017 -0500

Add ordered Nexus devices

Add support for ordering the initialization of Nexus devices. This can
be used to make sure a device is initialized before a dependant device.

---

 freebsd/sys/sys/linker_set.h     | 6 +++++-
 rtemsbsd/include/rtems/bsd/bsd.h | 6 ++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/freebsd/sys/sys/linker_set.h b/freebsd/sys/sys/linker_set.h
old mode 100644
new mode 100755
index 918d724..a310b06
--- a/freebsd/sys/sys/linker_set.h
+++ b/freebsd/sys/sys/linker_set.h
@@ -77,7 +77,11 @@
 
 #define RTEMS_BSD_DEFINE_SET_ITEM(set, sym, type)			\
 	static type const __set_##set##_sym_##sym			\
-	__section(".rtemsroset.bsd." __STRING(set) ".content") __used
+       __section(".rtemsroset.bsd." __STRING(set) ".content.1") __used
+
+#define RTEMS_BSD_DEFINE_SET_ITEM_ORDERED(set, sym, order, type)     \
+	static type const __set_##set##_sym_##sym     \
+       __section(".rtemsroset.bsd." __STRING(set) ".content.0."  RTEMS_XSTRING( order )) __used
 
 #define __MAKE_SET(set, sym)						\
 	RTEMS_BSD_DEFINE_SET_ITEM(set, sym, const void *) = &sym
diff --git a/rtemsbsd/include/rtems/bsd/bsd.h b/rtemsbsd/include/rtems/bsd/bsd.h
old mode 100644
new mode 100755
index 0968062..2e89dce
--- a/rtemsbsd/include/rtems/bsd/bsd.h
+++ b/rtemsbsd/include/rtems/bsd/bsd.h
@@ -83,6 +83,12 @@ typedef struct {
         { #name, unit, (resource_count), (resources), \
             &SYSINIT_ENTRY_NAME(name##_nexusmodule) }
 
+#define RTEMS_BSD_DEFINE_NEXUS_DEVICE_ORDERED(name, unit, order, resource_count, resources) \
+    extern struct sysinit SYSINIT_ENTRY_NAME(name##_nexusmodule); \
+    RTEMS_BSD_DEFINE_SET_ITEM_ORDERED(nexus, name##unit, order, rtems_bsd_device) = \
+        { #name, unit, (resource_count), (resources), \
+            &SYSINIT_ENTRY_NAME(name##_nexusmodule) }
+
 rtems_status_code rtems_bsd_initialize(void);
 
 /**




More information about the vc mailing list