Deleted Added
full compact
intro.9 (17760) intro.9 (20243)
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.

--- 23 unchanged lines hidden (view full) ---

32.Dt INTRO 9
33.Os FreeBSD 2.2
34.Sh NAME
35.Nm intro
36.Nd "introduction to system kernel interfaces"
37.Sh DESCRIPTION
38This section contains information about the interfaces and
39subroutines in the kernel.
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.

--- 23 unchanged lines hidden (view full) ---

32.Dt INTRO 9
33.Os FreeBSD 2.2
34.Sh NAME
35.Nm intro
36.Nd "introduction to system kernel interfaces"
37.Sh DESCRIPTION
38This section contains information about the interfaces and
39subroutines in the kernel.
40
41.Sh PROTOTYPES ANSI-C AND ALL THAT
42Yes please.
40.Sh PROTOTYPES ANSI-C AND ALL THAT
41Yes please.
43
42.Pp
44We would like all code to be fully prototyped.
43We would like all code to be fully prototyped.
45
44.Pp
46If your code compiles cleanly with
47.Nm cc
48.Ar -Wall
49we would feel happy about it.
50It is important to understand that this isn't a question of just shutting up
51.Nm cc ,
52it is a question about avoiding the things it complains about.
53To put it bluntly, don't hide the problem by casting and other
54obfuscating practices, solve the problem.
45If your code compiles cleanly with
46.Nm cc
47.Ar -Wall
48we would feel happy about it.
49It is important to understand that this isn't a question of just shutting up
50.Nm cc ,
51it is a question about avoiding the things it complains about.
52To put it bluntly, don't hide the problem by casting and other
53obfuscating practices, solve the problem.
55
56.Sh INDENTATION AND STYLE
57Belive it or not, there actually exists a guide for indentation and style.
58It isn't generally applied though.
54.Sh INDENTATION AND STYLE
55Belive it or not, there actually exists a guide for indentation and style.
56It isn't generally applied though.
59
57.Pp
60We would appreciate if people would pay attention to it, and at least not
61violate it blatantly.
58We would appreciate if people would pay attention to it, and at least not
59violate it blatantly.
62
60.Pp
63We don't mind it too badly if you have your own style, but please make
64sure we can read it too.
61We don't mind it too badly if you have your own style, but please make
62sure we can read it too.
65
63.Pp
66Please take time to read
67.Xr style 9
68for more information.
64Please take time to read
65.Xr style 9
66for more information.
69
70.Sh NAMING THINGS
71Some general rules exist:
72.Bl -enum
73.It
74If a function is meant as a debugging aid in DDB, it should be enclosed
75in
76.Bd -literal -offset indent
77#ifdef DDB
78
79#endif /* DDB */
80.Ed
81
82And the name of the procedure should start with the prefix
83.Li DDB_
84to clearly identify the procedure as a debugger routine.
85.El
67.Sh NAMING THINGS
68Some general rules exist:
69.Bl -enum
70.It
71If a function is meant as a debugging aid in DDB, it should be enclosed
72in
73.Bd -literal -offset indent
74#ifdef DDB
75
76#endif /* DDB */
77.Ed
78
79And the name of the procedure should start with the prefix
80.Li DDB_
81to clearly identify the procedure as a debugger routine.
82.El
86
87
88.Sh SCOPE OF SYMBOLS
89It is important to carefully consider the scope of symbols in the kernel.
90The default is to make everything static, unless some reason requires
91the opposite.
83.Sh SCOPE OF SYMBOLS
84It is important to carefully consider the scope of symbols in the kernel.
85The default is to make everything static, unless some reason requires
86the opposite.
92
87.Pp
93There are several reasons for this policy,
94the main one is that the kernel is one monolithic name-space,
95and pollution is not a good idea here either.
88There are several reasons for this policy,
89the main one is that the kernel is one monolithic name-space,
90and pollution is not a good idea here either.
96
91.Pp
97For device drivers and other modules that don't add new internal interfaces
98to the kernel, the entire source should be in one file it possible.
99That way all symbols can be made static.
92For device drivers and other modules that don't add new internal interfaces
93to the kernel, the entire source should be in one file it possible.
94That way all symbols can be made static.
100
95.Pp
101If for some reason a module is split over multiple source files, then try
102to split the module along some major fault-line and consider using the
103number of global symbols as your guide.
104The fewer the better.
96If for some reason a module is split over multiple source files, then try
97to split the module along some major fault-line and consider using the
98number of global symbols as your guide.
99The fewer the better.
105
106.Sh HISTORY
107The
108.Nm intro
109section manual page appeared in
110.Fx 2.2 .
100.Sh HISTORY
101The
102.Nm intro
103section manual page appeared in
104.Fx 2.2 .