xref: /netbsd/share/man/man9/man9.i386/splraise.9 (revision 6550d01e)
1.\"	$NetBSD: splraise.9,v 1.1 2010/02/06 22:32:08 dyoung Exp $
2.\"
3.\" Copyright (c) 2010 David Young.  All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\" 3. The name of the author may not be used to endorse or promote products
14.\"    derived from this software without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd February 5, 2010
28.Dt SPLRAISE 9
29.Os
30.Sh NAME
31.Nm spllower ,
32.Nm splraise
33.Nd modify system interrupt priority level
34.Sh SYNOPSIS
35.In machine/intr.h
36.Ft void
37.Fn spllower "int s"
38.Ft int
39.Fn splraise "int s"
40.Sh DESCRIPTION
41These functions raise and lower the interrupt priority level
42on i386.
43They are used by machine-dependent kernel code to implement
44the machine-independent
45.Xr spl 9
46interface.
47.Pp
48In a multi-CPU system, these functions change the interrupt
49priority level on the local CPU only.
50In general, device drivers should not make use of these functions.
51.Pp
52The
53.Fn spllower
54function sets the system priority level to the one encoded in
55.Fa s ,
56if
57.Fa s
58is lower than the current level.
59Otherwise, it does not change the level.
60Use
61.Fn splx
62instead
63of
64.Fn spllower ,
65except in extraordinary circumstances.
66.Pp
67The
68.Fn splraise
69function sets the system priority level to the one encoded in
70.Fa s ,
71if
72.Fa s
73is greater than the current level, and returns the previous level.
74Otherwise, it does not change the level, and it returns the current level.
75Except in extraordinary circumstances,
76do not use
77.Fn splraise .
78Use one of the priority-raising functions defined in
79.Xr spl 9 ,
80instead.
81.Sh SEE ALSO
82.Xr condvar 9 ,
83.Xr mutex 9 ,
84.Xr rwlock 9 ,
85.Xr spl 9
86