|
| ||||||||||||||||||||||||
| splnet | |
| Software part of the network interface drivers. | |
| splimp | |
| All network interface drivers. | |
| splbio | |
| All buffered IO (i.e., disk and the like) drivers. | |
| spltty | |
| Basically, all non-network communications devices, but effectively used for all drivers that are neither network nor disks. | |
All functions except splx and spl0 return the previous priority value.
This is a typical example demonstrating the usage:
struct foo_softc {
...
int flags;
#define FOO_ASLEEP 1
#define FOO_READY 2
} foo_softc[NFOO];
int
foowrite(...)
{
struct foo_softc *sc;
int s, error;
...
s = spltty();
if (!(sc->flags & FOO_READY)) {
/* Not ready, must sleep on resource. */
sc->flags |= FOO_ASLEEP;
error = tsleep(sc, PZERO, "foordy", 0);
sc->flags &= ~FOO_ASLEEP;
}
sc->flags &= ~FOO_READY;
splx(s);
...
}
void
foointr(...)
{
struct foo_softc *sc;
...
sc->flags |= FOO_READY;
if (sc->flags & FOO_ASLEEP)
/* Somebody was waiting for us, awake him. */
wakeup(sc);
...
}
Note that the interrupt handler should
never
reduce the priority level.
It is automatically called as it had
raised the interrupt priority to its own level, i.e., further interrupts
of the same group are being blocked.
The interrupt priority levels appeared in a very early version of Unix . They have been traditionally known by number instead of by names, and were inclusive up to higher priority levels (i.e., priority 5 has been blocking everything up to level 5). This is no longer the case in
.Fx . The traditional name level for them is still reflected in the letter l of the respective functions and variables, although they are not really levels anymore, but rather different (partially inclusive) sets of functions to be blocked during some periods of the life of the system. The historical number scheme can be considered as a simple linearly ordered set of interrupt priority groups.
This manual page was written by
.An Jrg Wunsch .
| July 21, 1996 | SPL (9) |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.