FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/queue.h>
#include <sys/taskqueue.h>
#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/errno.h>
#include <sys/linker.h>
#include <sys/firmware.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/module.h>
#include <sys/eventhandler.h>
#include <sys/filedesc.h>
#include <sys/vnode.h>
Go to the source code of this file.
Data Structures | |
struct | priv_fw |
Macros | |
#define | FW_INUSE(p) ((p)->file != NULL || (p)->fw.name != NULL) |
#define | FW_UNLOAD 0x100 |
#define | PRIV_FW(x) |
#define | FIRMWARE_MAX 50 |
Functions | |
__FBSDID ("$BSDSUniX$") | |
MTX_SYSINIT (firmware,&firmware_mtx,"firmware table", MTX_DEF) | |
static struct priv_fw * | lookup (const char *name, struct priv_fw **empty_slot) |
const struct firmware * | firmware_register (const char *imagename, const void *data, size_t datasize, unsigned int version, const struct firmware *parent) |
int | firmware_unregister (const char *imagename) |
static void | loadimage (void *arg, int npending) |
const struct firmware * | firmware_get (const char *imagename) |
void | firmware_put (const struct firmware *p, int flags) |
static void | set_rootvnode (void *arg, int npending) |
static void | firmware_mountroot (void *arg) |
EVENTHANDLER_DEFINE (mountroot, firmware_mountroot, NULL, 0) | |
static void | unloadentry (void *unused1, int unused2) |
static int | firmware_modevent (module_t mod, int type, void *unused) |
DECLARE_MODULE (firmware, firmware_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST) | |
MODULE_VERSION (firmware, 1) | |
Variables | |
static struct priv_fw | firmware_table [FIRMWARE_MAX] |
static struct taskqueue * | firmware_tq |
static struct task | firmware_unload_task |
static struct mtx | firmware_mtx |
static moduledata_t | firmware_mod |
#define FIRMWARE_MAX 50 |
Definition at line 124 of file subr_firmware.c.
Referenced by firmware_modevent(), lookup(), and unloadentry().
#define FW_INUSE | ( | p | ) | ((p)->file != NULL || (p)->fw.name != NULL) |
Definition at line 58 of file subr_firmware.c.
Referenced by lookup().
#define FW_UNLOAD 0x100 |
Definition at line 91 of file subr_firmware.c.
Referenced by firmware_modevent(), firmware_put(), and unloadentry().
#define PRIV_FW | ( | x | ) |
Definition at line 115 of file subr_firmware.c.
Referenced by firmware_put(), and firmware_register().
__FBSDID | ( | "$BSDSUniX$" | ) |
DECLARE_MODULE | ( | firmware | , |
firmware_mod | , | ||
SI_SUB_DRIVERS | , | ||
SI_ORDER_FIRST | |||
) |
EVENTHANDLER_DEFINE | ( | mountroot | , |
firmware_mountroot | , | ||
NULL | , | ||
0 | |||
) |
const struct firmware* firmware_get | ( | const char * | imagename | ) |
Definition at line 298 of file subr_firmware.c.
References firmware_mtx, priv_fw::fw, loadimage(), lookup(), priv_fw::parent, printf(), priv_check(), priv_fw::refcnt, securelevel_gt(), and taskqueue_enqueue().
|
static |
Definition at line 476 of file subr_firmware.c.
References FIRMWARE_MAX, firmware_mountroot(), firmware_mtx, firmware_table, firmware_unload_task, priv_fw::flags, priv_fw::fw, FW_UNLOAD, printf(), priv_fw::refcnt, rootvnode, taskqueue_create(), taskqueue_drain(), taskqueue_enqueue(), taskqueue_free(), taskqueue_start_threads(), taskqueue_thread_enqueue(), and unloadentry().
|
static |
Definition at line 402 of file subr_firmware.c.
References malloc(), printf(), set_rootvnode(), and taskqueue_enqueue().
Referenced by firmware_modevent().
void firmware_put | ( | const struct firmware * | p, |
int | flags | ||
) |
Definition at line 357 of file subr_firmware.c.
References priv_fw::file, firmware_mtx, firmware_unload_task, priv_fw::flags, FW_UNLOAD, priv_fw::parent, PRIV_FW, priv_fw::refcnt, and taskqueue_enqueue().
const struct firmware* firmware_register | ( | const char * | imagename, |
const void * | data, | ||
size_t | datasize, | ||
unsigned int | version, | ||
const struct firmware * | parent | ||
) |
Definition at line 174 of file subr_firmware.c.
References bootverbose, firmware_mtx, priv_fw::fw, lookup(), priv_fw::parent, printf(), and PRIV_FW.
int firmware_unregister | ( | const char * | imagename | ) |
Definition at line 216 of file subr_firmware.c.
References priv_fw::file, firmware_mtx, lookup(), and priv_fw::refcnt.
|
static |
Definition at line 250 of file subr_firmware.c.
References priv_fw::file, firmware_mtx, linker_reference_module(), linker_release_module(), lookup(), printf(), result, and wakeup_one().
Referenced by firmware_get().
Definition at line 148 of file subr_firmware.c.
References dummy, FIRMWARE_MAX, firmware_table, priv_fw::fw, and FW_INUSE.
Referenced by firmware_get(), firmware_register(), firmware_unregister(), and loadimage().
MODULE_VERSION | ( | firmware | , |
1 | |||
) |
MTX_SYSINIT | ( | firmware | , |
& | firmware_mtx, | ||
"firmware table" | , | ||
MTX_DEF | |||
) |
|
static |
Definition at line 378 of file subr_firmware.c.
References free(), and rootvnode.
Referenced by firmware_mountroot().
|
static |
Definition at line 423 of file subr_firmware.c.
References priv_fw::file, FIRMWARE_MAX, firmware_mtx, firmware_table, priv_fw::flags, priv_fw::fw, FW_UNLOAD, linker_release_module(), and priv_fw::refcnt.
Referenced by firmware_modevent().
|
static |
Definition at line 525 of file subr_firmware.c.
|
static |
Definition at line 137 of file subr_firmware.c.
Referenced by firmware_get(), firmware_modevent(), firmware_put(), firmware_register(), firmware_unregister(), loadimage(), and unloadentry().
|
static |
Definition at line 125 of file subr_firmware.c.
Referenced by firmware_modevent(), lookup(), and unloadentry().
|
static |
Definition at line 131 of file subr_firmware.c.
|
static |
Definition at line 132 of file subr_firmware.c.
Referenced by firmware_modevent(), and firmware_put().