MCPcopy Create free account
hub / github.com/F-Stack/f-stack / loadimage

Function loadimage

freebsd/kern/subr_firmware.c:246–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244};
245
246static void
247loadimage(void *arg, int npending __unused)
248{
249 struct fw_loadimage *fwli = arg;
250 struct priv_fw *fp;
251 linker_file_t result;
252 int error;
253
254 error = linker_reference_module(fwli->imagename, NULL, &result);
255 if (error != 0) {
256 if (bootverbose || (fwli->flags & FIRMWARE_GET_NOWARN) == 0)
257 printf("%s: could not load firmware image, error %d\n",
258 fwli->imagename, error);
259 mtx_lock(&firmware_mtx);
260 goto done;
261 }
262
263 mtx_lock(&firmware_mtx);
264 fp = lookup(fwli->imagename);
265 if (fp == NULL || fp->file != NULL) {
266 mtx_unlock(&firmware_mtx);
267 if (fp == NULL)
268 printf("%s: firmware image loaded, "
269 "but did not register\n", fwli->imagename);
270 (void) linker_release_module(fwli->imagename, NULL, NULL);
271 mtx_lock(&firmware_mtx);
272 goto done;
273 }
274 fp->file = result; /* record the module identity */
275done:
276 wakeup_one(arg);
277 mtx_unlock(&firmware_mtx);
278}
279
280/*
281 * Lookup and potentially load the specified firmware image.

Callers

nothing calls this directly

Calls 7

linker_reference_moduleFunction · 0.85
linker_release_moduleFunction · 0.85
printfFunction · 0.70
mtx_lockFunction · 0.70
lookupFunction · 0.70
mtx_unlockFunction · 0.70
wakeup_oneFunction · 0.70

Tested by

no test coverage detected