On Wednesday 31 January 2007 18:57, John Baldwin wrote: > On Tuesday 30 January 2007 18:54, Max Laier wrote: > > mlaier 2007-01-30 23:54:50 UTC > > > > FreeBSD src repository > > > > Modified files: (Branch: RELENG_6) > > sys/kern subr_firmware.c > > Log: > > Revert 1.1.2.2 as linker_release_module is not in RELENG_6. Will > > have to look for a better way and will compile test "trivial changes" > > in the future. > > Probably trivial to backport the function.
Do you plan to? Otherwise, I'd just solve it locally like attached. Your addition of linker_release module is a bit interlocked with the locking changes and I'd rather not get into that, atm. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News
Index: subr_firmware.c
===================================================================
RCS file: /usr/store/mlaier/fcvs/src/sys/kern/subr_firmware.c,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 subr_firmware.c
--- subr_firmware.c 30 Jan 2007 23:54:49 -0000 1.1.2.3
+++ subr_firmware.c 2 Feb 2007 19:23:46 -0000
@@ -169,7 +169,7 @@
struct thread *td;
struct firmware *fp;
linker_file_t result;
- int requested_load = 0;
+ int error, requested_load = 0;
again:
mtx_lock(&firmware_mtx);
@@ -189,6 +189,9 @@
if (requested_load) {
printf("%s: failed to load firmware image %s\n",
__func__, imagename);
+ mtx_lock(&Giant); /* XXX */
+ (void) linker_file_unload(result, LINKER_UNLOAD_NORMAL);
+ mtx_unlock(&Giant); /* XXX */
return NULL;
}
td = curthread;
@@ -198,8 +201,13 @@
return NULL;
}
mtx_lock(&Giant); /* XXX */
- (void) linker_reference_module(imagename, NULL, &result);
+ error = linker_reference_module(imagename, NULL, &result)
mtx_unlock(&Giant); /* XXX */
+ if (error != 0) {
+ printf("%s: failed to load firmware image %s\n",
+ __func__, imagename);
+ return NULL;
+ }
requested_load = 1;
goto again; /* sort of an Algol-style for loop */
}
pgp1dp6qPsABK.pgp
Description: PGP signature
