softintr(9) - NetBSD Manual Pages

SOFTINTR(9)            NetBSD Kernel Developer's Manual            SOFTINTR(9)


NAME
softintr, softintr_establish, softintr_disestablish, softintr_schedule - machine-independent software interrupt framework
SYNOPSIS
#include <machine/intr.h> void * softintr_establish(int level, void (*fun)(void *), void *arg); void softintr_disestablish(void *cookie); void softintr_schedule(void *cookie);
DESCRIPTION
The NetBSD machine-independent software interrupt framework is designed to provide a generic software interrupt mechanism which can be used any time a low-priority callback is needed. It allows dynamic registration of software interrupts for loadable drivers and protocol stacks, priori- tization and fair queueing of software interrupts, and allows machine- dependent optimizations to reduce cost and code complexity. In order to provide this framework, the machine-dependent <machine/types.h> must define the __HAVE_GENERIC_SOFT_INTERRUPTS symbol (without a value), furthermore, the machine-dependent <machine/intr.h> include file must provide prototypes for the softintr functions and must provide definitions of several constants which define software interrupt priority levels (IPLs): IPL_SOFTCLOCK The software IPL for software clock interrupts (i.e., softclock()). IPL_SOFTNET The software IPL for network callbacks. IPL_SOFTSERIAL The software IPL for serial driver callbacks. Other constants of the form IPL_SOFT* are reserved for future use by this framework. The following is a brief description of each function in the framework: softintr_establish() Register a software interrupt at level level, which will call the function fun with one argu- ment, arg. It may allocate a machine-specific data structure. If successful, softintr_establish() returns a non-NULL opaque cookie which can be used as an argument to softintr_schedule() or softintr_disestablish(). If for some reason it does not succeed, it returns NULL. softintr_disestablish() Deallocate a software interrupt previously allo- cated by a call to softintr_establish(). softintr_schedule() Schedule a software interrupt previously allo- cated by a call to softintr_establish() to be executed as soon as that software interrupt is unblocked. This function may assume that the interrupt is currently blocked, so it need not check to see if the interrupt needs to be exe- cuted immediately. softintr_schedule() can safely be called multiple times before the call- back routine is invoked.
SEE ALSO
spl(9)
HISTORY
The NetBSD machine-independent software interrupt framework was designed in 1997 and was implemented by one port in NetBSD 1.3. However, it did not gain wider implementation until NetBSD 1.5.
AUTHORS
The NetBSD machine-independent software interrupt framework was designed by Charles Hannum <mycroft@NetBSD.org>. NetBSD 2.0 May 30, 2000 NetBSD 2.0

Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.