Add lock.9 man page, it is also symlinked to: lockcount.9, lockinit.9,
[dragonfly.git] / share / man / man9 / SPLASSERT.9
1 .\" -*- nroff -*-
2 .\"
3 .\" Copyright (c) 2000 Jonathan M. Bresler
4 .\"
5 .\" All rights reserved.
6 .\"
7 .\" This program is free software.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
19 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 .\"
29 .\" $FreeBSD: src/share/man/man9/SPLASSERT.9,v 1.1.2.4 2001/07/21 09:16:54 schweikh Exp $
30 .\" $DragonFly: src/share/man/man9/Attic/SPLASSERT.9,v 1.2 2003/06/17 04:37:01 dillon Exp $
31 .\"
32 .Dd January 14, 2000
33 .Os
34 .Dt SPLASSERT 9
35 .Sh NAME
36 .Nm SPLASSERT
37 .Nd kernel spl level verification macro
38 .Sh SYNOPSIS
39 .Cd options INVARIANTS
40 .Cd options INVARIANT_SUPPORT
41 .Fn SPLASSERT "char *level" "char *msg"
42 .Sh DESCRIPTION
43 In a kernel compiled with both "options INVARIANTS"
44 and "options INVARIANT_SUPPORT",
45 the
46 .Fn SPLASSERT
47 macro compares the current spl level of the kernel with the spl
48 .Fa level
49 specified in the macro
50 .Fn SPLASSERT .
51 If the specified
52 .Fa level
53 is not active
54 .Fn SPLASSERT
55 calls the
56 .Fn KASSERT
57 macro with the
58 .Fa msg ,
59 terminating the running system.
60 .Pp
61 In a kernel that does not have both "options INVARIANTS"
62 and "options INVARIANT_SUPPORT",
63 the
64 .Fn SPLASSERT
65 macro is defined to be a no-op.
66 .Sh EXAMPLES
67 The kernel function
68 .Fn rtalloc
69 must be called at
70 .Fn splnet :
71 .Bd -literal -offset indent
72 void
73 rtalloc(ro)
74         register struct route *ro;
75 {
76         SPLASSERT(net, "rtalloc()");
77         rtalloc_ign(ro, 0UL);
78 }
79 .Ed
80 .Sh SEE ALSO
81 .Xr config 8 ,
82 .Xr KASSERT 9 ,
83 .Xr panic 9
84 .Sh AUTHORS
85 This manual page was written by
86 .An Jonathan M. Bresler
87 .Aq jmb@FreeBSD.org .