Deleted Added
full compact
kern_linker.c (286094) kern_linker.c (287835)
1/*-
2 * Copyright (c) 1997-2000 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997-2000 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/kern/kern_linker.c 286094 2015-07-30 19:52:43Z mjg $");
28__FBSDID("$FreeBSD: head/sys/kern/kern_linker.c 287835 2015-09-15 23:06:56Z mjg $");
29
30#include "opt_ddb.h"
31#include "opt_kld.h"
32#include "opt_hwpmc_hooks.h"
33
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/systm.h>

--- 250 unchanged lines hidden (view full) ---

287 lf->filename));
288
289 sx_assert(&kld_sx, SA_XLOCKED);
290
291 if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0)
292 return;
293
294 sx_xunlock(&kld_sx);
29
30#include "opt_ddb.h"
31#include "opt_kld.h"
32#include "opt_hwpmc_hooks.h"
33
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/systm.h>

--- 250 unchanged lines hidden (view full) ---

287 lf->filename));
288
289 sx_assert(&kld_sx, SA_XLOCKED);
290
291 if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0)
292 return;
293
294 sx_xunlock(&kld_sx);
295 sysctl_xlock();
295 sysctl_wlock();
296 for (oidp = start; oidp < stop; oidp++)
297 sysctl_register_oid(*oidp);
296 for (oidp = start; oidp < stop; oidp++)
297 sysctl_register_oid(*oidp);
298 sysctl_xunlock();
298 sysctl_wunlock();
299 sx_xlock(&kld_sx);
300}
301
302static void
303linker_file_unregister_sysctls(linker_file_t lf)
304{
305 struct sysctl_oid **start, **stop, **oidp;
306
307 KLD_DPF(FILE, ("linker_file_unregister_sysctls: unregistering SYSCTLs"
308 " for %s\n", lf->filename));
309
310 sx_assert(&kld_sx, SA_XLOCKED);
311
312 if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0)
313 return;
314
315 sx_xunlock(&kld_sx);
299 sx_xlock(&kld_sx);
300}
301
302static void
303linker_file_unregister_sysctls(linker_file_t lf)
304{
305 struct sysctl_oid **start, **stop, **oidp;
306
307 KLD_DPF(FILE, ("linker_file_unregister_sysctls: unregistering SYSCTLs"
308 " for %s\n", lf->filename));
309
310 sx_assert(&kld_sx, SA_XLOCKED);
311
312 if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0)
313 return;
314
315 sx_xunlock(&kld_sx);
316 sysctl_xlock();
316 sysctl_wlock();
317 for (oidp = start; oidp < stop; oidp++)
318 sysctl_unregister_oid(*oidp);
317 for (oidp = start; oidp < stop; oidp++)
318 sysctl_unregister_oid(*oidp);
319 sysctl_xunlock();
319 sysctl_wunlock();
320 sx_xlock(&kld_sx);
321}
322
323static int
324linker_file_register_modules(linker_file_t lf)
325{
326 struct mod_metadata **start, **stop, **mdp;
327 const moduledata_t *moddata;

--- 1817 unchanged lines hidden ---
320 sx_xlock(&kld_sx);
321}
322
323static int
324linker_file_register_modules(linker_file_t lf)
325{
326 struct mod_metadata **start, **stop, **mdp;
327 const moduledata_t *moddata;

--- 1817 unchanged lines hidden ---