Spl (Unix)

From Wikipedia, the free encyclopedia
Jump to: navigation, search

spl is the name for a collection of Unix interrupt priority control functions. SPL is short for "Set Priority Level". The functions include splhigh, splserial, splsched, splclock, splstatclock, splvm, spltty, splsofttty, splnet, splbio, splsoftnet, splsoftclock, spllowersoftclock, spl0, splx.

"The naming goes back to the early days of UNIX on the PDP-11. The PDP-11 had a relatively simplistic level-based interrupt structure. When running at a specific level, only higher priority interrupts were allowed. UNIX named functions for setting the interrupt priority level after the PDP-11 SPL instruction, so initially the functions had names like spl4 and spl7. Later machines came out with interrupt masks, and BSD changed the names to more descriptive names such as splbio (for block I/O) and splhigh (block out all interrupts)."
-- Greg Lehey, Improving the FreeBSD SMP implementation, 2001 USENIX Annual Technical Conference - FREENIX

This function would set the interrupt masks, while returning their previous contents. The splx routine could then be used to change the masks back.

External links[edit]