PERFORCE change 100162 for review
John Baldwin
jhb at FreeBSD.org
Tue Jun 27 18:45:09 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=100162
Change 100162 by jhb at jhb_mutex on 2006/06/27 18:44:32
- Grab Giant around sysinit's as we don't know if they are all
safe yet.
- Actually remove Giant from the kernel linker (grrrr).
Affected files ...
.. //depot/projects/smpng/sys/kern/kern_linker.c#77 edit
Differences ...
==== //depot/projects/smpng/sys/kern/kern_linker.c#77 (text+ko) ====
@@ -62,10 +62,13 @@
int kld_debug = 0;
#endif
-#define KLD_LOCK() do { sx_xlock(&kld_sx); mtx_lock(&Giant); } while (0)
-#define KLD_UNLOCK() do { mtx_unlock(&Giant); sx_xunlock(&kld_sx); } while (0)
+#define KLD_LOCK() sx_xlock(&kld_sx)
+#define KLD_UNLOCK() sx_xunlock(&kld_sx)
#define KLD_LOCKED() sx_xlocked(&kld_sx)
-#define KLD_LOCK_ASSERT() do { if (!cold) sx_assert(&kld_sx, SX_XLOCKED); } while (0)
+#define KLD_LOCK_ASSERT() do { \
+ if (!cold) \
+ sx_assert(&kld_sx, SX_XLOCKED); \
+} while (0)
/*
* static char *linker_search_path(const char *name, struct mod_depend
@@ -212,6 +215,7 @@
* Traverse the (now) ordered list of system initialization tasks.
* Perform each task, and continue on to the next task.
*/
+ mtx_lock(&Giant);
for (sipp = start; sipp < stop; sipp++) {
if ((*sipp)->subsystem == SI_SUB_DUMMY)
continue; /* skip dummy task(s) */
@@ -219,6 +223,7 @@
/* Call function */
(*((*sipp)->func)) ((*sipp)->udata);
}
+ mtx_unlock(&Giant);
}
static void
@@ -256,6 +261,7 @@
* Traverse the (now) ordered list of system initialization tasks.
* Perform each task, and continue on to the next task.
*/
+ mtx_lock(&Giant);
for (sipp = start; sipp < stop; sipp++) {
if ((*sipp)->subsystem == SI_SUB_DUMMY)
continue; /* skip dummy task(s) */
@@ -263,6 +269,7 @@
/* Call function */
(*((*sipp)->func)) ((*sipp)->udata);
}
+ mtx_unlock(&Giant);
}
static void
More information about the p4-projects
mailing list