splraiseipl(9) - NetBSD Manual Pages

Command: Section: Arch: Collection:  
SPLRAISEIPL(9)         NetBSD Kernel Developer's Manual         SPLRAISEIPL(9)

splraiseipl -- raise the system priority level
#include <sys/intr.h> int splraiseipl(ipl_cookie_t icookie);
splraiseipl() raises the system priority level to the level specified by icookie. icookie should be a value returned by makeiplcookie(). In general, device drivers should not make use of this interface. To ensure correct synchronization, device drivers should use the condvar(9), mutex(9), and rwlock(9) interfaces. See the spl(9) manual page for a description of interrupt priority lev- els.
splraiseipl() returns saved priority level which can be used for splx().
The following two lines are functional equivalents. s = splraiseipl(makeiplcookie(IPL_VM)); s = splvm(); Because makeiplcookie() can be slow and is not expected to be used in a performance critical path, it's better to do it beforehand. initialization_code(ipl_t ipl) { ourcookie = makeiplcookie(ipl); } performance_critical_code() { int s; s = splraiseipl(ourcookie); do_something(); splx(s); }
condvar(9), makeiplcookie(9), mutex(9), rwlock(9), spl(9) NetBSD 10.99 July 9, 2015 NetBSD 10.99
Powered by man-cgi (2024-03-20). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.