Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/config_intrhook.9
Show All 20 Lines | ||||||||||||||
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||||||||||||
.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |||||||||||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |||||||||||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | |||||||||||||
.\" DAMAGE. | .\" DAMAGE. | |||||||||||||
.\" | .\" | |||||||||||||
.\" $FreeBSD$ | .\" $FreeBSD$ | |||||||||||||
.\" | .\" | |||||||||||||
.Dd August 10, 2017 | .Dd March 8, 2021 | |||||||||||||
.Dt CONFIG_INTRHOOK 9 | .Dt CONFIG_INTRHOOK 9 | |||||||||||||
.Os | .Os | |||||||||||||
.Sh NAME | .Sh NAME | |||||||||||||
.Nm config_intrhook | .Nm config_intrhook | |||||||||||||
.Nd schedule a function to be run after interrupts have been enabled, | .Nd schedule a function to be run after interrupts have been enabled, | |||||||||||||
but before root is mounted | but before root is mounted | |||||||||||||
.Sh SYNOPSIS | .Sh SYNOPSIS | |||||||||||||
.In sys/kernel.h | .In sys/kernel.h | |||||||||||||
.Vt typedef void (*ich_func_t)(void *arg); | .Vt typedef void (*ich_func_t)(void *arg); | |||||||||||||
.Ft int | .Ft int | |||||||||||||
.Fn config_intrhook_establish "struct intr_config_hook *hook" | .Fn config_intrhook_establish "struct intr_config_hook *hook" | |||||||||||||
.Ft void | .Ft void | |||||||||||||
.Fn config_intrhook_disestablish "struct intr_config_hook *hook" | .Fn config_intrhook_disestablish "struct intr_config_hook *hook" | |||||||||||||
.Ft int | ||||||||||||||
.Fn config_intrhook_drain "struct intr_config_hook *hook" | ||||||||||||||
.Ft void | .Ft void | |||||||||||||
.Fn config_intrhook_oneshot "ich_func_t func" "void *arg" | .Fn config_intrhook_oneshot "ich_func_t func" "void *arg" | |||||||||||||
.Sh DESCRIPTION | .Sh DESCRIPTION | |||||||||||||
The | The | |||||||||||||
.Fn config_intrhook_establish | .Fn config_intrhook_establish | |||||||||||||
function schedules a function to be run after interrupts have been | function schedules a function to be run after interrupts have been | |||||||||||||
enabled, but before root is mounted. | enabled, but before root is mounted. | |||||||||||||
If the system has already passed this point in its initialization, | If the system has already passed this point in its initialization, | |||||||||||||
the function is called immediately. | the function is called immediately. | |||||||||||||
.Pp | .Pp | |||||||||||||
The | The | |||||||||||||
.Fn config_intrhook_disestablish | .Fn config_intrhook_disestablish | |||||||||||||
function removes the entry from the hook queue. | function removes the entry from the hook queue. | |||||||||||||
.Pp | ||||||||||||||
The | ||||||||||||||
.Fn config_intrhook_drain | ||||||||||||||
function removes the entry from the hook queue in a safe way. | ||||||||||||||
If the hook is not currently active it removes | ||||||||||||||
.Fa hook | ||||||||||||||
from the hook queue and returns | ||||||||||||||
jhbUnsubmitted Done Inline Actions
jhb: | ||||||||||||||
.Vt ICHS_QUEUED . | ||||||||||||||
If the hook is active, it waits for the hook to complete before returning | ||||||||||||||
.Vt ICHS_RUNNING . | ||||||||||||||
Done Inline Actions
jhb: | ||||||||||||||
If the hook has previously completed, it returns | ||||||||||||||
.Vt ICHS_DONE . | ||||||||||||||
Because a | ||||||||||||||
Done Inline Actions
jhb: | ||||||||||||||
.Vt config_intrhook | ||||||||||||||
is undefined prior to | ||||||||||||||
.Fn config_intrhook_establish , | ||||||||||||||
this function may only be called after that function has returned. | ||||||||||||||
.Pp | .Pp | |||||||||||||
The | The | |||||||||||||
.Fn config_intrhook_oneshot | .Fn config_intrhook_oneshot | |||||||||||||
function schedules a function to be run as described for | function schedules a function to be run as described for | |||||||||||||
.Fn config_intrhook_establish ; | .Fn config_intrhook_establish ; | |||||||||||||
the entry is automatically removed from the hook queue | the entry is automatically removed from the hook queue | |||||||||||||
after that function runs. | after that function runs. | |||||||||||||
This is appropriate when additional device configuration must be done | This is appropriate when additional device configuration must be done | |||||||||||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |