Page MenuHomeFreeBSD

Add config_intrhook_oneshot(): schedule an intrhook function and automatically unregister it after it runs.
ClosedPublic

Authored by ian on Aug 10 2017, 6:31 PM.
Tags
None
Referenced Files
F81677523: D11963.diff
Fri, Apr 19, 7:26 PM
Unknown Object (File)
Mar 17 2024, 2:42 AM
Unknown Object (File)
Jan 25 2024, 9:29 PM
Unknown Object (File)
Dec 28 2023, 10:52 AM
Unknown Object (File)
Dec 23 2023, 2:16 AM
Unknown Object (File)
Dec 21 2023, 8:16 AM
Unknown Object (File)
Oct 25 2023, 7:37 AM
Unknown Object (File)
Sep 25 2023, 1:27 AM
Subscribers

Details

Summary

The config_intrhook mechanism allows a driver to stall the boot process until device(s) required for booting are available, by not allowing system inits to proceed until all intrhook functions have been unregistered. Virtually all existing code simply unregisters from within the hook function when it gets called.

This new function makes that common usage more convenient. Instead of allocating and filling in a struct, passing it to a function that might (in theory) fail, and checking the return code, now a driver can simply call this cannot-fail routine, passing just the intrhook function to call and its arg.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 11007

Event Timeline

bcr added a subscriber: bcr.

OK from manpages. Don't forget to bump the .Dd when committing.

This revision is now accepted and ready to land.Aug 12 2017, 10:33 AM

Implementation and doc looks good to me.

I think some of the doc people lean away from use of semicolons, and instead prefer to use relatively simple sentences, but I don't care particularly.

sys/kern/subr_autoconf.c
70–73

The whitespace here looks really messed up in phabricator, but that may just be phabricator.

sys/sys/kernel.h
403

the typedef could have the argument name omitted

This revision was automatically updated to reflect the committed changes.