| 289 | } |
| 290 | |
| 291 | static void |
| 292 | linker_file_register_sysctls(linker_file_t lf, bool enable) |
| 293 | { |
| 294 | struct sysctl_oid **start, **stop, **oidp; |
| 295 | |
| 296 | KLD_DPF(FILE, |
| 297 | ("linker_file_register_sysctls: registering SYSCTLs for %s\n", |
| 298 | lf->filename)); |
| 299 | |
| 300 | sx_assert(&kld_sx, SA_XLOCKED); |
| 301 | |
| 302 | if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0) |
| 303 | return; |
| 304 | |
| 305 | sx_xunlock(&kld_sx); |
| 306 | sysctl_wlock(); |
| 307 | for (oidp = start; oidp < stop; oidp++) { |
| 308 | if (enable) |
| 309 | sysctl_register_oid(*oidp); |
| 310 | else |
| 311 | sysctl_register_disabled_oid(*oidp); |
| 312 | } |
| 313 | sysctl_wunlock(); |
| 314 | sx_xlock(&kld_sx); |
| 315 | } |
| 316 | |
| 317 | static void |
| 318 | linker_file_enable_sysctls(linker_file_t lf) |
no test coverage detected