Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/subr_firmware.c
Show First 20 Lines • Show All 251 Lines • ▼ Show 20 Lines | firmware_unregister(const char *imagename) | ||||
} | } | ||||
mtx_unlock(&firmware_mtx); | mtx_unlock(&firmware_mtx); | ||||
return err; | return err; | ||||
} | } | ||||
static void | static void | ||||
loadimage(void *arg, int npending) | loadimage(void *arg, int npending) | ||||
{ | { | ||||
struct thread *td = curthread; | |||||
char *imagename = arg; | char *imagename = arg; | ||||
struct priv_fw *fp; | struct priv_fw *fp; | ||||
linker_file_t result; | linker_file_t result; | ||||
int error; | int error; | ||||
/* synchronize with the thread that dispatched us */ | /* synchronize with the thread that dispatched us */ | ||||
mtx_lock(&firmware_mtx); | mtx_lock(&firmware_mtx); | ||||
mtx_unlock(&firmware_mtx); | mtx_unlock(&firmware_mtx); | ||||
if (td->td_proc->p_fd->fd_rdir == NULL) { | |||||
printf("%s: root not mounted yet, no way to load image\n", | |||||
imagename); | |||||
goto done; | |||||
} | |||||
error = linker_reference_module(imagename, NULL, &result); | error = linker_reference_module(imagename, NULL, &result); | ||||
if (error != 0) { | if (error != 0) { | ||||
printf("%s: could not load firmware image, error %d\n", | printf("%s: could not load firmware image, error %d\n", | ||||
imagename, error); | imagename, error); | ||||
goto done; | goto done; | ||||
} | } | ||||
mtx_lock(&firmware_mtx); | mtx_lock(&firmware_mtx); | ||||
▲ Show 20 Lines • Show All 246 Lines • Show Last 20 Lines |