]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - Documentation/DocBook/kernel-api.tmpl
[PATCH] Make RCU API inaccessible to non-GPL Linux kernel modules
[mirror_ubuntu-bionic-kernel.git] / Documentation / DocBook / kernel-api.tmpl
CommitLineData
1da177e4
LT
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
4
5<book id="LinuxKernelAPI">
6 <bookinfo>
7 <title>The Linux Kernel API</title>
8
9 <legalnotice>
10 <para>
11 This documentation is free software; you can redistribute
12 it and/or modify it under the terms of the GNU General Public
13 License as published by the Free Software Foundation; either
14 version 2 of the License, or (at your option) any later
15 version.
16 </para>
17
18 <para>
19 This program is distributed in the hope that it will be
20 useful, but WITHOUT ANY WARRANTY; without even the implied
21 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 See the GNU General Public License for more details.
23 </para>
24
25 <para>
26 You should have received a copy of the GNU General Public
27 License along with this program; if not, write to the Free
28 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 MA 02111-1307 USA
30 </para>
31
32 <para>
33 For more details see the file COPYING in the source
34 distribution of Linux.
35 </para>
36 </legalnotice>
37 </bookinfo>
38
39<toc></toc>
40
41 <chapter id="Basics">
42 <title>Driver Basics</title>
43 <sect1><title>Driver Entry and Exit points</title>
44!Iinclude/linux/init.h
45 </sect1>
46
47 <sect1><title>Atomic and pointer manipulation</title>
48!Iinclude/asm-i386/atomic.h
49!Iinclude/asm-i386/unaligned.h
50 </sect1>
51
1da177e4 52 <sect1><title>Delaying, scheduling, and timer routines</title>
4dc3b16b
PP
53!Iinclude/linux/sched.h
54!Ekernel/sched.c
55!Ekernel/timer.c
df78488d
TG
56 </sect1>
57 <sect1><title>High-resolution timers</title>
58!Iinclude/linux/ktime.h
59!Iinclude/linux/hrtimer.h
60!Ekernel/hrtimer.c
1da177e4 61 </sect1>
4dc3b16b
PP
62 <sect1><title>Internal Functions</title>
63!Ikernel/exit.c
64!Ikernel/signal.c
65 </sect1>
66
67 <sect1><title>Kernel objects manipulation</title>
68<!--
69X!Iinclude/linux/kobject.h
70-->
71!Elib/kobject.c
72 </sect1>
73
74 <sect1><title>Kernel utility functions</title>
75!Iinclude/linux/kernel.h
ddad86c2 76!Ekernel/printk.c
4dc3b16b
PP
77!Ekernel/panic.c
78!Ekernel/sys.c
79!Ekernel/rcupdate.c
80 </sect1>
81
1da177e4
LT
82 </chapter>
83
84 <chapter id="adt">
85 <title>Data Types</title>
86 <sect1><title>Doubly Linked Lists</title>
87!Iinclude/linux/list.h
88 </sect1>
89 </chapter>
90
91 <chapter id="libc">
92 <title>Basic C Library Functions</title>
93
94 <para>
95 When writing drivers, you cannot in general use routines which are
96 from the C Library. Some of the functions have been found generally
97 useful and they are listed below. The behaviour of these functions
98 may vary slightly from those defined by ANSI, and these deviations
99 are noted in the text.
100 </para>
101
102 <sect1><title>String Conversions</title>
103!Ilib/vsprintf.c
104!Elib/vsprintf.c
105 </sect1>
106 <sect1><title>String Manipulation</title>
4dc3b16b
PP
107<!-- All functions are exported at now
108X!Ilib/string.c
109 -->
1da177e4
LT
110!Elib/string.c
111 </sect1>
112 <sect1><title>Bit Operations</title>
113!Iinclude/asm-i386/bitops.h
114 </sect1>
115 </chapter>
116
117 <chapter id="mm">
118 <title>Memory Management in Linux</title>
119 <sect1><title>The Slab Cache</title>
800590f5 120!Iinclude/linux/slab.h
1da177e4
LT
121!Emm/slab.c
122 </sect1>
123 <sect1><title>User Space Memory Access</title>
124!Iinclude/asm-i386/uaccess.h
8f2709b5 125!Earch/i386/lib/usercopy.c
1da177e4 126 </sect1>
4dc3b16b
PP
127 <sect1><title>More Memory Management Functions</title>
128!Iinclude/linux/rmap.h
129!Emm/readahead.c
130!Emm/filemap.c
131!Emm/memory.c
132!Emm/vmalloc.c
133!Emm/mempool.c
134!Emm/page-writeback.c
135!Emm/truncate.c
136 </sect1>
137 </chapter>
138
139
140 <chapter id="ipc">
141 <title>Kernel IPC facilities</title>
142
143 <sect1><title>IPC utilities</title>
144!Iipc/util.c
145 </sect1>
1da177e4
LT
146 </chapter>
147
148 <chapter id="kfifo">
149 <title>FIFO Buffer</title>
150 <sect1><title>kfifo interface</title>
151!Iinclude/linux/kfifo.h
152!Ekernel/kfifo.c
153 </sect1>
154 </chapter>
155
156 <chapter id="proc">
157 <title>The proc filesystem</title>
158
159 <sect1><title>sysctl interface</title>
160!Ekernel/sysctl.c
161 </sect1>
4dc3b16b
PP
162
163 <sect1><title>proc filesystem interface</title>
164!Ifs/proc/base.c
165 </sect1>
1da177e4
LT
166 </chapter>
167
168 <chapter id="debugfs">
169 <title>The debugfs filesystem</title>
170
171 <sect1><title>debugfs interface</title>
172!Efs/debugfs/inode.c
173!Efs/debugfs/file.c
174 </sect1>
175 </chapter>
176
177 <chapter id="vfs">
178 <title>The Linux VFS</title>
4dc3b16b
PP
179 <sect1><title>The Filesystem types</title>
180!Iinclude/linux/fs.h
4dc3b16b 181 </sect1>
1da177e4
LT
182 <sect1><title>The Directory Cache</title>
183!Efs/dcache.c
184!Iinclude/linux/dcache.h
185 </sect1>
186 <sect1><title>Inode Handling</title>
187!Efs/inode.c
188!Efs/bad_inode.c
189 </sect1>
190 <sect1><title>Registration and Superblocks</title>
191!Efs/super.c
192 </sect1>
193 <sect1><title>File Locks</title>
194!Efs/locks.c
195!Ifs/locks.c
196 </sect1>
4dc3b16b
PP
197 <sect1><title>Other Functions</title>
198!Efs/mpage.c
199!Efs/namei.c
200!Efs/buffer.c
201!Efs/bio.c
202!Efs/seq_file.c
203!Efs/filesystems.c
204!Efs/fs-writeback.c
205!Efs/block_dev.c
206 </sect1>
1da177e4
LT
207 </chapter>
208
209 <chapter id="netcore">
210 <title>Linux Networking</title>
4dc3b16b
PP
211 <sect1><title>Networking Base Types</title>
212!Iinclude/linux/net.h
213 </sect1>
1da177e4
LT
214 <sect1><title>Socket Buffer Functions</title>
215!Iinclude/linux/skbuff.h
4dc3b16b
PP
216!Iinclude/net/sock.h
217!Enet/socket.c
1da177e4 218!Enet/core/skbuff.c
4dc3b16b
PP
219!Enet/core/sock.c
220!Enet/core/datagram.c
221!Enet/core/stream.c
1da177e4
LT
222 </sect1>
223 <sect1><title>Socket Filter</title>
224!Enet/core/filter.c
225 </sect1>
226 <sect1><title>Generic Network Statistics</title>
227!Iinclude/linux/gen_stats.h
228!Enet/core/gen_stats.c
229!Enet/core/gen_estimator.c
230 </sect1>
4dc3b16b
PP
231 <sect1><title>SUN RPC subsystem</title>
232<!-- The !D functionality is not perfect, garbage has to be protected by comments
233!Dnet/sunrpc/sunrpc_syms.c
234-->
235!Enet/sunrpc/xdr.c
236!Enet/sunrpc/svcsock.c
237!Enet/sunrpc/sched.c
238 </sect1>
1da177e4
LT
239 </chapter>
240
241 <chapter id="netdev">
242 <title>Network device support</title>
243 <sect1><title>Driver Support</title>
244!Enet/core/dev.c
c2da8aca 245!Enet/ethernet/eth.c
461ddf3b
RD
246!Iinclude/linux/etherdevice.h
247<!-- FIXME: Removed for now since no structured comments in source
248X!Enet/core/wireless.c
249-->
1da177e4
LT
250 </sect1>
251 <sect1><title>Synchronous PPP</title>
252!Edrivers/net/wan/syncppp.c
253 </sect1>
254 </chapter>
255
256 <chapter id="modload">
257 <title>Module Support</title>
258 <sect1><title>Module Loading</title>
259!Ekernel/kmod.c
260 </sect1>
261 <sect1><title>Inter Module support</title>
262 <para>
263 Refer to the file kernel/module.c for more information.
264 </para>
265<!-- FIXME: Removed for now since no structured comments in source
266X!Ekernel/module.c
267-->
268 </sect1>
269 </chapter>
270
271 <chapter id="hardware">
272 <title>Hardware Interfaces</title>
273 <sect1><title>Interrupt Handling</title>
8f2709b5 274!Ekernel/irq/manage.c
1da177e4
LT
275 </sect1>
276
4dc3b16b
PP
277 <sect1><title>Resources Management</title>
278!Ekernel/resource.c
279 </sect1>
280
1da177e4
LT
281 <sect1><title>MTRR Handling</title>
282!Earch/i386/kernel/cpu/mtrr/main.c
283 </sect1>
284 <sect1><title>PCI Support Library</title>
285!Edrivers/pci/pci.c
4dc3b16b
PP
286!Edrivers/pci/pci-driver.c
287!Edrivers/pci/remove.c
288!Edrivers/pci/pci-acpi.c
289<!-- kerneldoc does not understand to __devinit
290X!Edrivers/pci/search.c
291 -->
292!Edrivers/pci/msi.c
293!Edrivers/pci/bus.c
f05aab8e
RD
294<!-- FIXME: Removed for now since no structured comments in source
295X!Edrivers/pci/hotplug.c
296-->
4dc3b16b
PP
297!Edrivers/pci/probe.c
298!Edrivers/pci/rom.c
1da177e4
LT
299 </sect1>
300 <sect1><title>PCI Hotplug Support Library</title>
301!Edrivers/pci/hotplug/pci_hotplug_core.c
302 </sect1>
303 <sect1><title>MCA Architecture</title>
304 <sect2><title>MCA Device Functions</title>
305 <para>
306 Refer to the file arch/i386/kernel/mca.c for more information.
307 </para>
308<!-- FIXME: Removed for now since no structured comments in source
309X!Earch/i386/kernel/mca.c
310-->
311 </sect2>
312 <sect2><title>MCA Bus DMA</title>
313!Iinclude/asm-i386/mca_dma.h
314 </sect2>
315 </sect1>
316 </chapter>
317
318 <chapter id="devfs">
319 <title>The Device File System</title>
320!Efs/devfs/base.c
321 </chapter>
322
4dc3b16b
PP
323 <chapter id="sysfs">
324 <title>The Filesystem for Exporting Kernel Objects</title>
325!Efs/sysfs/file.c
4dc3b16b
PP
326!Efs/sysfs/symlink.c
327!Efs/sysfs/bin.c
328 </chapter>
329
1da177e4
LT
330 <chapter id="security">
331 <title>Security Framework</title>
332!Esecurity/security.c
333 </chapter>
334
335 <chapter id="pmfuncs">
336 <title>Power Management</title>
337!Ekernel/power/pm.c
338 </chapter>
339
4dc3b16b
PP
340 <chapter id="devdrivers">
341 <title>Device drivers infrastructure</title>
342 <sect1><title>Device Drivers Base</title>
343<!--
344X!Iinclude/linux/device.h
345-->
346!Edrivers/base/driver.c
4dc3b16b
PP
347!Edrivers/base/core.c
348!Edrivers/base/firmware_class.c
349!Edrivers/base/transport_class.c
350!Edrivers/base/dmapool.c
351<!-- Cannot be included, because
352 attribute_container_add_class_device_adapter
353 and attribute_container_classdev_to_container
354 exceed allowed 44 characters maximum
355X!Edrivers/base/attribute_container.c
356-->
357!Edrivers/base/sys.c
358<!--
359X!Edrivers/base/interface.c
360-->
361!Edrivers/base/platform.c
362!Edrivers/base/bus.c
363 </sect1>
364 <sect1><title>Device Drivers Power Management</title>
365!Edrivers/base/power/main.c
366!Edrivers/base/power/resume.c
367!Edrivers/base/power/suspend.c
368 </sect1>
369 <sect1><title>Device Drivers ACPI Support</title>
370<!-- Internal functions only
371X!Edrivers/acpi/sleep/main.c
372X!Edrivers/acpi/sleep/wakeup.c
373X!Edrivers/acpi/motherboard.c
374X!Edrivers/acpi/bus.c
375-->
376!Edrivers/acpi/scan.c
d758a8fa 377!Idrivers/acpi/scan.c
4dc3b16b
PP
378<!-- No correct structured comments
379X!Edrivers/acpi/pci_bind.c
380-->
381 </sect1>
382 <sect1><title>Device drivers PnP support</title>
383!Edrivers/pnp/core.c
384<!-- No correct structured comments
385X!Edrivers/pnp/system.c
386 -->
387!Edrivers/pnp/card.c
388!Edrivers/pnp/driver.c
389!Edrivers/pnp/manager.c
390!Edrivers/pnp/support.c
391 </sect1>
392 </chapter>
393
394
1da177e4
LT
395 <chapter id="blkdev">
396 <title>Block Devices</title>
1d193f4f 397!Eblock/ll_rw_blk.c
1da177e4
LT
398 </chapter>
399
400 <chapter id="miscdev">
401 <title>Miscellaneous Devices</title>
402!Edrivers/char/misc.c
403 </chapter>
404
405 <chapter id="viddev">
406 <title>Video4Linux</title>
407!Edrivers/media/video/videodev.c
408 </chapter>
409
410 <chapter id="snddev">
411 <title>Sound Devices</title>
4dc3b16b 412!Iinclude/sound/core.h
1da177e4 413!Esound/sound_core.c
4dc3b16b
PP
414!Iinclude/sound/pcm.h
415!Esound/core/pcm.c
416!Esound/core/device.c
417!Esound/core/info.c
418!Esound/core/rawmidi.c
419!Esound/core/sound.c
420!Esound/core/memory.c
421!Esound/core/pcm_memory.c
422!Esound/core/init.c
423!Esound/core/isadma.c
424!Esound/core/control.c
425!Esound/core/pcm_lib.c
426!Esound/core/hwdep.c
427!Esound/core/pcm_native.c
428!Esound/core/memalloc.c
1da177e4
LT
429<!-- FIXME: Removed for now since no structured comments in source
430X!Isound/sound_firmware.c
431-->
432 </chapter>
433
434 <chapter id="uart16x50">
435 <title>16x50 UART Driver</title>
4dc3b16b 436!Iinclude/linux/serial_core.h
1da177e4
LT
437!Edrivers/serial/serial_core.c
438!Edrivers/serial/8250.c
439 </chapter>
440
441 <chapter id="z85230">
442 <title>Z85230 Support Library</title>
443!Edrivers/net/wan/z85230.c
444 </chapter>
445
446 <chapter id="fbdev">
447 <title>Frame Buffer Library</title>
448
449 <para>
450 The frame buffer drivers depend heavily on four data structures.
451 These structures are declared in include/linux/fb.h. They are
452 fb_info, fb_var_screeninfo, fb_fix_screeninfo and fb_monospecs.
453 The last three can be made available to and from userland.
454 </para>
455
456 <para>
457 fb_info defines the current state of a particular video card.
458 Inside fb_info, there exists a fb_ops structure which is a
459 collection of needed functions to make fbdev and fbcon work.
460 fb_info is only visible to the kernel.
461 </para>
462
463 <para>
464 fb_var_screeninfo is used to describe the features of a video card
465 that are user defined. With fb_var_screeninfo, things such as
466 depth and the resolution may be defined.
467 </para>
468
469 <para>
470 The next structure is fb_fix_screeninfo. This defines the
471 properties of a card that are created when a mode is set and can't
472 be changed otherwise. A good example of this is the start of the
473 frame buffer memory. This "locks" the address of the frame buffer
474 memory, so that it cannot be changed or moved.
475 </para>
476
477 <para>
478 The last structure is fb_monospecs. In the old API, there was
479 little importance for fb_monospecs. This allowed for forbidden things
480 such as setting a mode of 800x600 on a fix frequency monitor. With
481 the new API, fb_monospecs prevents such things, and if used
482 correctly, can prevent a monitor from being cooked. fb_monospecs
483 will not be useful until kernels 2.5.x.
484 </para>
485
486 <sect1><title>Frame Buffer Memory</title>
487!Edrivers/video/fbmem.c
488 </sect1>
4dc3b16b 489<!--
1da177e4 490 <sect1><title>Frame Buffer Console</title>
4dc3b16b 491X!Edrivers/video/console/fbcon.c
1da177e4 492 </sect1>
4dc3b16b 493-->
1da177e4
LT
494 <sect1><title>Frame Buffer Colormap</title>
495!Edrivers/video/fbcmap.c
496 </sect1>
497<!-- FIXME:
498 drivers/video/fbgen.c has no docs, which stuffs up the sgml. Comment
499 out until somebody adds docs. KAO
500 <sect1><title>Frame Buffer Generic Functions</title>
501X!Idrivers/video/fbgen.c
502 </sect1>
503KAO -->
504 <sect1><title>Frame Buffer Video Mode Database</title>
505!Idrivers/video/modedb.c
506!Edrivers/video/modedb.c
507 </sect1>
508 <sect1><title>Frame Buffer Macintosh Video Mode Database</title>
8f2709b5 509!Edrivers/video/macmodes.c
1da177e4
LT
510 </sect1>
511 <sect1><title>Frame Buffer Fonts</title>
512 <para>
513 Refer to the file drivers/video/console/fonts.c for more information.
514 </para>
515<!-- FIXME: Removed for now since no structured comments in source
516X!Idrivers/video/console/fonts.c
517-->
518 </sect1>
519 </chapter>
520</book>