Fix a problem introduced by the last commit.
[dragonfly.git] / share / man / man9 / SPLASSERT.9
1 .\" Copyright (c) 2000 Jonathan M. Bresler
2 .\"
3 .\" All rights reserved.
4 .\"
5 .\" This program is free software.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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 .\" $FreeBSD: src/share/man/man9/SPLASSERT.9,v 1.1.2.4 2001/07/21 09:16:54 schweikh Exp $
28 .\" $DragonFly: src/share/man/man9/Attic/SPLASSERT.9,v 1.3 2004/06/01 11:36:53 hmp Exp $
29 .\"
30 .Dd January 14, 2000
31 .Os
32 .Dt SPLASSERT 9
33 .Sh NAME
34 .Nm SPLASSERT
35 .Nd kernel spl level verification macro
36 .Sh SYNOPSIS
37 .Cd options INVARIANTS
38 .Cd options INVARIANT_SUPPORT
39 .Fn SPLASSERT "char *level" "char *msg"
40 .Sh DESCRIPTION
41 In a kernel compiled with both "options INVARIANTS"
42 and "options INVARIANT_SUPPORT",
43 the
44 .Fn SPLASSERT
45 macro compares the current spl level of the kernel with the spl
46 .Fa level
47 specified in the macro
48 .Fn SPLASSERT .
49 If the specified
50 .Fa level
51 is not active
52 .Fn SPLASSERT
53 calls the
54 .Fn KASSERT
55 macro with the
56 .Fa msg ,
57 terminating the running system.
58 .Pp
59 In a kernel that does not have both "options INVARIANTS"
60 and "options INVARIANT_SUPPORT",
61 the
62 .Fn SPLASSERT
63 macro is defined to be a no-op.
64 .Sh EXAMPLES
65 The kernel function
66 .Fn rtalloc
67 must be called at
68 .Fn splnet :
69 .Bd -literal -offset indent
70 void
71 rtalloc(ro)
72         register struct route *ro;
73 {
74         SPLASSERT(net, "rtalloc()");
75         rtalloc_ign(ro, 0UL);
76 }
77 .Ed
78 .Sh SEE ALSO
79 .Xr config 8 ,
80 .Xr KASSERT 9 ,
81 .Xr panic 9
82 .Sh AUTHORS
83 This manual page was written by
84 .An Jonathan M. Bresler
85 .Aq jmb@FreeBSD.org .