[rtems-libbsd commit] firmware: Port to RTEMS.

Sebastian Huber sebh at rtems.org
Mon Jan 30 08:44:54 UTC 2017


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

Author:    Christian Mauderer <Christian.Mauderer at embedded-brains.de>
Date:      Mon Dec 12 13:09:09 2016 +0100

firmware: Port to RTEMS.

---

 freebsd/sys/kern/subr_firmware.c | 12 +++++++++++-
 libbsd.py                        |  2 ++
 libbsd_waf.py                    |  1 +
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/freebsd/sys/kern/subr_firmware.c b/freebsd/sys/kern/subr_firmware.c
index 9d3ec1e..0c549bd 100644
--- a/freebsd/sys/kern/subr_firmware.c
+++ b/freebsd/sys/kern/subr_firmware.c
@@ -231,7 +231,7 @@ firmware_unregister(const char *imagename)
 		/*
 		 * It is ok for the lookup to fail; this can happen
 		 * when a module is unloaded on last reference and the
-		 * module unload handler unregister's each of its
+		 * module unload handler unregister's each of it's
 		 * firmware images.
 		 */
 		err = 0;
@@ -254,6 +254,7 @@ firmware_unregister(const char *imagename)
 	return err;
 }
 
+#ifndef __rtems__
 static void
 loadimage(void *arg, int npending)
 {
@@ -294,6 +295,7 @@ loadimage(void *arg, int npending)
 done:
 	wakeup_one(imagename);		/* we're done */
 }
+#endif /* __rtems__ */
 
 /*
  * Lookup and potentially load the specified firmware image.
@@ -305,14 +307,17 @@ done:
 const struct firmware *
 firmware_get(const char *imagename)
 {
+#ifndef __rtems__
 	struct task fwload_task;
 	struct thread *td;
+#endif /* __rtems__ */
 	struct priv_fw *fp;
 
 	mtx_lock(&firmware_mtx);
 	fp = lookup(imagename, NULL);
 	if (fp != NULL)
 		goto found;
+#ifndef __rtems__
 	/*
 	 * Image not present, try to load the module holding it.
 	 */
@@ -344,6 +349,9 @@ firmware_get(const char *imagename)
 		mtx_unlock(&firmware_mtx);
 		return NULL;
 	}
+#else /* __rtems__ */
+	return NULL;
+#endif /* __rtems__ */
 found:				/* common exit point on success */
 	if (fp->refcnt == 0 && fp->parent != NULL)
 		fp->parent->refcnt++;
@@ -379,6 +387,7 @@ firmware_put(const struct firmware *p, int flags)
 	mtx_unlock(&firmware_mtx);
 }
 
+#ifndef __rtems__
 /*
  * Setup directory state for the firmware_tq thread so we can do i/o.
  */
@@ -526,3 +535,4 @@ static moduledata_t firmware_mod = {
 };
 DECLARE_MODULE(firmware, firmware_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
 MODULE_VERSION(firmware, 1);
+#endif /* __rtems__ */
diff --git a/libbsd.py b/libbsd.py
index b00e573..9707f7b 100755
--- a/libbsd.py
+++ b/libbsd.py
@@ -237,6 +237,7 @@ def base(mm):
             'sys/sys/fail.h',
             'sys/sys/filedesc.h',
             'sys/sys/file.h',
+            'sys/sys/firmware.h',
             'sys/sys/fnv_hash.h',
             'sys/sys/gpio.h',
             'sys/sys/hash.h',
@@ -355,6 +356,7 @@ def base(mm):
             'sys/kern/subr_bus.c',
             'sys/kern/subr_counter.c',
             'sys/kern/subr_eventhandler.c',
+            'sys/kern/subr_firmware.c',
             'sys/kern/subr_hash.c',
             'sys/kern/subr_hints.c',
             'sys/kern/subr_kobj.c',
diff --git a/libbsd_waf.py b/libbsd_waf.py
index 9849ab5..d724de9 100644
--- a/libbsd_waf.py
+++ b/libbsd_waf.py
@@ -816,6 +816,7 @@ def build(bld):
               'freebsd/sys/kern/subr_bus.c',
               'freebsd/sys/kern/subr_counter.c',
               'freebsd/sys/kern/subr_eventhandler.c',
+              'freebsd/sys/kern/subr_firmware.c',
               'freebsd/sys/kern/subr_hash.c',
               'freebsd/sys/kern/subr_hints.c',
               'freebsd/sys/kern/subr_kobj.c',




More information about the vc mailing list