12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SPL (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> SPL (9)In order of highest to lowest priority, the priority-raising functions along with their counterpart symbolic tagsare:splhigh(), IPL_HIGHBlocks all hard and soft interrupts, including the highest level I/O interrupts, such as interruptsfrom serial interfaces and the statistics clock (if any). It is also used for code that cannot tolerateany interrupts.Code running at this level may not (in general) directly access machine independent kernel services.For example, it is illegal tocall the kernel printf() function or to try and allocate memory.The methods of synchronization available are: spin mutexes and scheduling a soft interrupt.Generally, all code run at this level must schedule additional processing to run in a software interrupt.Code with thread context running at this level must not use a kernel interface that may cause thecurrent LWP to sleep, such as the condvar interfaces.Interrupt handlers at this level cannot acquire the global kernel_lock and so must be coded toensure correct synchronization on multiprocessor systems.splsched(), IPL_SCHEDsplvm(), IPL_VMBlocks all medium priority hardware interrupts, such as interrupts from audio devices, and theclock interrupt.Interrupt handlers running at this level endure the same restrictions as at IPL_HIGH, but mayaccess scheduler interfaces, and so may awaken LWPs (light weight processes) using thecondvar(9) interfaces, and may schedule callouts using the callout(9) interfaces.Code with thread context running at this level may sleep via the condvar interfaces, and mayuse other kernel facilities that could cause the current LWP to sleep.Blocks hard interrupts from ’low’ priority hardware interrupts, such as interrupts from network,block I/O and tty devices.Code running at this level endures the same restrictions as at IPL_SCHED, but may use the deprecatedmalloc(9) or endorsed pool_cache(9) interfaces to allocate memory.At the time of writing, the global kernel_lock is automatically acquired for interrupts at thislevel, in order to support device drivers that do not provide their own multiprocessor synchronization.A future release of the system may allow the automatic acquisition of kernel_lock tobe disabled for individual interrupt handlers.splsoftserial(), IPL_SOFTSERIALBlocks soft interrupts at the IPL_SOFTSERIAL symbolic level.This is the first of the software levels. Soft interrupts at this level and lower may acquirereader/writer locks or adaptive mutexes.splsoftnet(), IPL_SOFTNETBlocks soft interrupts at the IPL_SOFTNET symbolic level.splsoftbio(), IPL_SOFTBIOBlocks soft interrupts at the IPL_SOFTBIO symbolic level.<strong>NetBSD</strong> 3.0 February 13, 2008 2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!