One callout_stop() is enough.
[dragonfly.git] / share / man / man9 / intro.9
1 .\" Copyright (c) 1983, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\" $FreeBSD: src/share/man/man9/intro.9,v 1.10.2.5 2001/08/17 13:08:54 ru Exp $
33 .\" $DragonFly: src/share/man/man9/intro.9,v 1.2 2003/06/17 04:37:01 dillon Exp $
34 .\"
35 .Dd December 13, 1995
36 .Dt INTRO 9
37 .Os
38 .Sh NAME
39 .Nm intro
40 .Nd "introduction to system kernel interfaces"
41 .Sh DESCRIPTION
42 This section contains information about the interfaces and
43 subroutines in the kernel.
44 .Sh PROTOTYPES ANSI-C AND ALL THAT
45 Yes please.
46 .Pp
47 We would like all code to be fully prototyped.
48 .Pp
49 If your code compiles cleanly with
50 .Nm cc
51 .Ar -Wall
52 we would feel happy about it.
53 It is important to understand that this isn't a question of just shutting up
54 .Nm cc ,
55 it is a question about avoiding the things it complains about.
56 To put it bluntly, don't hide the problem by casting and other
57 obfuscating practices, solve the problem.
58 .Sh INDENTATION AND STYLE
59 Believe it or not, there actually exists a guide for indentation and style.
60 It isn't generally applied though.
61 .Pp
62 We would appreciate if people would pay attention to it, and at least not
63 violate it blatantly.
64 .Pp
65 We don't mind it too badly if you have your own style, but please make
66 sure we can read it too.
67 .Pp
68 Please take time to read
69 .Xr style 9
70 for more information.
71 .Sh NAMING THINGS
72 Some general rules exist:
73 .Bl -enum
74 .It
75 If a function is meant as a debugging aid in DDB, it should be enclosed
76 in
77 .Bd -literal -offset indent
78 #ifdef DDB
79
80 #endif /* DDB */
81 .Ed
82 .Pp
83 And the name of the procedure should start with the prefix
84 .Li DDB_
85 to clearly identify the procedure as a debugger routine.
86 .El
87 .Sh SCOPE OF SYMBOLS
88 It is important to carefully consider the scope of symbols in the kernel.
89 The default is to make everything static, unless some reason requires
90 the opposite.
91 .Pp
92 There are several reasons for this policy,
93 the main one is that the kernel is one monolithic name-space,
94 and pollution is not a good idea here either.
95 .Pp
96 For device drivers and other modules that don't add new internal interfaces
97 to the kernel, the entire source should be in one file if possible.
98 That way all symbols can be made static.
99 .Pp
100 If for some reason a module is split over multiple source files, then try
101 to split the module along some major fault-line and consider using the
102 number of global symbols as your guide.
103 The fewer the better.
104 .Sh SEE ALSO
105 .Xr style 9
106 .Sh HISTORY
107 The
108 .Nm
109 section manual page appeared in
110 .Fx 2.2 .