diff options
author | Christian Mauderer <Christian.Mauderer@embedded-brains.de> | 2016-12-12 13:09:09 +0100 |
---|---|---|
committer | Christian Mauderer <Christian.Mauderer@embedded-brains.de> | 2017-01-17 12:50:57 +0100 |
commit | 66eb1437f2810fab9fd4257796e8de3bd494542e (patch) | |
tree | a460351e5fc18da62b3547e63a3bfce52bb209dc | |
parent | firmware: Import from FreeBSD. (diff) | |
download | rtems-libbsd-66eb1437f2810fab9fd4257796e8de3bd494542e.tar.bz2 |
firmware: Port to RTEMS.
-rw-r--r-- | freebsd/sys/kern/subr_firmware.c | 12 | ||||
-rwxr-xr-x | libbsd.py | 2 | ||||
-rw-r--r-- | libbsd_waf.py | 1 |
3 files changed, 14 insertions, 1 deletions
diff --git a/freebsd/sys/kern/subr_firmware.c b/freebsd/sys/kern/subr_firmware.c index 9d3ec1ef..0c549bd3 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__ */ @@ -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 9849ab5e..d724de9c 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', |