{{Short description|Unix interrupt priority control commands}} {{lowercase}} '''spl''' (short for '''set priority level''', after the PDP-11 assembler instruction of the same name<ref name="smp">{{citation|last1=Lehey|first1=Greg|title=Improving the FreeBSD SMP implementation|url=http://www.lemis.com/grog/SMPng/USENIX/|date=2001|access-date=11 May 2018}}</ref>) is the name for a collection of Unix kernel routines or macros used to change the interrupt priority level.<ref name="man page">{{cite web|title=spl(9) - OpenBSD manual pages|url=https://man.openbsd.org/spl.9|access-date=11 May 2018}}</ref><ref name="lions p.43">{{cite book|last1=Lions|first1=John|title=Lions' Commentary on UNIX 6th Edition, with Source Code|page=43|date=1976}}</ref> This was historically needed to synchronize critical sections of kernel code that should not be interrupted.<ref>{{cite book|last1=Lions|first1=John|title=Lions' Commentary on UNIX 6th Edition, with Source Code|page=41|date=1976}}</ref> Newer Unix variants which support symmetric multiprocessing now mostly use mutexes for this purpose, which is a more general solution, so multiple processors can execute kernel code at the same time.<ref>{{cite book|last1=McKusick|first1=Marshall Kirk|collaboration=authors|title=The Design and Implementation of the FreeBSD Operating System|publisher=Addison-Wesley|page=93|date=2004}}</ref><ref name="smp" />
On older PDP-11 versions of Unix, there were eight of these routines, ranging from <code>spl0</code> to <code>spl7</code>, each corresponding to one PDP-11 interrupt priority level,<ref name="lions p.43" /> in addition to <code>splx</code>, which restores a previous priority level (returned by one of the other routines).<ref name="man page" /> On BSD Unix and its derivatives, these are called <code>splhigh</code>, <code>splserial</code>, <code>splsched</code>, <code>splclock</code>, <code>splstatclock</code>, <code>splvm</code>, <code>spltty</code>, <code>splsofttty</code>, <code>splnet</code>, <code>splbio</code>, <code>splsoftnet</code>, <code>splsoftclock</code>, <code>spllowersoftclock</code>, <code>spl0</code>, and <code>splx</code>.<ref name="man page" />
{{As of|2019|03}}, the spl family of primitives is still heavily used in OpenBSD<ref name="o/net/if"/> and NetBSD,<ref name="n/net/if"/> which is evidenced by the plentiful calls to <code>splnet()</code> within the networking code;<ref name="o/net/if"/><ref name="n/net/if"/> whereas FreeBSD and DragonFly BSD use more modern concepts; for example, in DragonFly, LWKT tokens may be used in place of spl.
==See also== * IRQL * Interrupt * Interrupt priority level * Programmable Interrupt Controller
==References== <references>
<ref name = "o/net/if" >{{cite web |url = http://bxr.su/o/sys/net/if.c |title = /sys/net/if.c |website = BSD Cross Reference |publisher = OpenBSD |quote = s = splnet(); |date = 2019-03-01 |access-date = 2019-03-05 }}</ref>
<ref name = "n/net/if" >{{cite web |url = http://bxr.su/n/sys/net/if.c |title = /sys/net/if.c |website = BSD Cross Reference |publisher = NetBSD |quote = s = splnet(); |date = 2019-03-01 |access-date = 2019-03-05 }}</ref>
</references>
{{OpenBSD}} {{NetBSD}}
Category:Interrupts Category:Unix
{{Unix-stub}}