DocBook: Avoid building man pages repeatedly and inconsistently
[cascardo/linux.git] / Documentation / DocBook / kernel-api.tmpl
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="adt">
42      <title>Data Types</title>
43      <sect1><title>Doubly Linked Lists</title>
44 !Iinclude/linux/list.h
45      </sect1>
46   </chapter>
47
48   <chapter id="libc">
49      <title>Basic C Library Functions</title>
50
51      <para>
52        When writing drivers, you cannot in general use routines which are
53        from the C Library.  Some of the functions have been found generally
54        useful and they are listed below.  The behaviour of these functions
55        may vary slightly from those defined by ANSI, and these deviations
56        are noted in the text.
57      </para>
58
59      <sect1><title>String Conversions</title>
60 !Elib/vsprintf.c
61 <?xmlif if excludeextra='1'?>
62 <?xmlif else?>
63 !Finclude/linux/kernel.h kstrtol
64 !Finclude/linux/kernel.h kstrtoul
65 <?xmlif fi?>
66 !Elib/kstrtox.c
67      </sect1>
68      <sect1><title>String Manipulation</title>
69 <!-- All functions are exported at now
70 X!Ilib/string.c
71  -->
72 !Elib/string.c
73      </sect1>
74      <sect1><title>Bit Operations</title>
75 !Iarch/x86/include/asm/bitops.h
76      </sect1>
77   </chapter>
78
79   <chapter id="kernel-lib">
80      <title>Basic Kernel Library Functions</title>
81
82      <para>
83        The Linux kernel provides more basic utility functions.
84      </para>
85
86      <sect1><title>Bitmap Operations</title>
87 !Elib/bitmap.c
88 !Ilib/bitmap.c
89      </sect1>
90
91      <sect1><title>Command-line Parsing</title>
92 !Elib/cmdline.c
93      </sect1>
94
95      <sect1 id="crc"><title>CRC Functions</title>
96 !Elib/crc7.c
97 !Elib/crc16.c
98 !Elib/crc-itu-t.c
99 !Elib/crc32.c
100 !Elib/crc-ccitt.c
101      </sect1>
102
103      <sect1 id="idr"><title>idr/ida Functions</title>
104 !Pinclude/linux/idr.h idr sync
105 !Plib/idr.c IDA description
106 !Elib/idr.c
107      </sect1>
108   </chapter>
109
110   <chapter id="mm">
111      <title>Memory Management in Linux</title>
112      <sect1><title>The Slab Cache</title>
113 !Iinclude/linux/slab.h
114 !Emm/slab.c
115 !Emm/util.c
116      </sect1>
117      <sect1><title>User Space Memory Access</title>
118 !Iarch/x86/include/asm/uaccess_32.h
119 !Earch/x86/lib/usercopy_32.c
120      </sect1>
121      <sect1><title>More Memory Management Functions</title>
122 !Emm/readahead.c
123 !Emm/filemap.c
124 !Emm/memory.c
125 !Emm/vmalloc.c
126 !Imm/page_alloc.c
127 !Emm/mempool.c
128 !Emm/dmapool.c
129 !Emm/page-writeback.c
130 !Emm/truncate.c
131      </sect1>
132   </chapter>
133
134
135   <chapter id="ipc">
136      <title>Kernel IPC facilities</title>
137
138      <sect1><title>IPC utilities</title>
139 !Iipc/util.c
140      </sect1>
141   </chapter>
142
143   <chapter id="kfifo">
144      <title>FIFO Buffer</title>
145      <sect1><title>kfifo interface</title>
146 !Iinclude/linux/kfifo.h
147      </sect1>
148   </chapter>
149
150   <chapter id="relayfs">
151      <title>relay interface support</title>
152
153      <para>
154         Relay interface support
155         is designed to provide an efficient mechanism for tools and
156         facilities to relay large amounts of data from kernel space to
157         user space.
158      </para>
159
160      <sect1><title>relay interface</title>
161 !Ekernel/relay.c
162 !Ikernel/relay.c
163      </sect1>
164   </chapter>
165
166   <chapter id="modload">
167      <title>Module Support</title>
168      <sect1><title>Module Loading</title>
169 !Ekernel/kmod.c
170      </sect1>
171      <sect1><title>Inter Module support</title>
172         <para>
173            Refer to the file kernel/module.c for more information.
174         </para>
175 <!-- FIXME: Removed for now since no structured comments in source
176 X!Ekernel/module.c
177 -->
178      </sect1>
179   </chapter>
180
181   <chapter id="hardware">
182      <title>Hardware Interfaces</title>
183      <sect1><title>Interrupt Handling</title>
184 <?xmlif if excludeextra='1'?>
185 <?xmlif else?>
186 !Ekernel/irq/manage.c
187 <?xmlif fi?>
188      </sect1>
189
190      <sect1><title>DMA Channels</title>
191 !Ekernel/dma.c
192      </sect1>
193
194      <sect1><title>Resources Management</title>
195 !Ikernel/resource.c
196 !Ekernel/resource.c
197      </sect1>
198
199      <sect1><title>MTRR Handling</title>
200 !Earch/x86/kernel/cpu/mtrr/main.c
201      </sect1>
202
203      <sect1><title>PCI Support Library</title>
204 !Edrivers/pci/pci.c
205 !Edrivers/pci/pci-driver.c
206 !Edrivers/pci/remove.c
207 !Edrivers/pci/search.c
208 !Edrivers/pci/msi.c
209 !Edrivers/pci/bus.c
210 !Edrivers/pci/access.c
211 !Edrivers/pci/irq.c
212 !Edrivers/pci/htirq.c
213 <!-- FIXME: Removed for now since no structured comments in source
214 X!Edrivers/pci/hotplug.c
215 -->
216 !Edrivers/pci/probe.c
217 !Edrivers/pci/slot.c
218 !Edrivers/pci/rom.c
219 !Edrivers/pci/iov.c
220 !Idrivers/pci/pci-sysfs.c
221      </sect1>
222      <sect1><title>PCI Hotplug Support Library</title>
223 !Edrivers/pci/hotplug/pci_hotplug_core.c
224      </sect1>
225   </chapter>
226
227   <chapter id="firmware">
228      <title>Firmware Interfaces</title>
229      <sect1><title>DMI Interfaces</title>
230 !Edrivers/firmware/dmi_scan.c
231      </sect1>
232      <sect1><title>EDD Interfaces</title>
233 !Idrivers/firmware/edd.c
234      </sect1>
235   </chapter>
236
237   <chapter id="security">
238      <title>Security Framework</title>
239 !Isecurity/security.c
240 !Esecurity/inode.c
241   </chapter>
242
243   <chapter id="audit">
244      <title>Audit Interfaces</title>
245 !Ekernel/audit.c
246 !Ikernel/auditsc.c
247 !Ikernel/auditfilter.c
248   </chapter>
249
250   <chapter id="accounting">
251      <title>Accounting Framework</title>
252 !Ikernel/acct.c
253   </chapter>
254
255   <chapter id="blkdev">
256      <title>Block Devices</title>
257 !Eblock/blk-core.c
258 !Iblock/blk-core.c
259 !Eblock/blk-map.c
260 !Iblock/blk-sysfs.c
261 !Eblock/blk-settings.c
262 !Eblock/blk-exec.c
263 !Eblock/blk-flush.c
264 !Eblock/blk-lib.c
265 !Eblock/blk-tag.c
266 !Iblock/blk-tag.c
267 !Eblock/blk-integrity.c
268 !Ikernel/trace/blktrace.c
269 !Iblock/genhd.c
270 !Eblock/genhd.c
271   </chapter>
272
273   <chapter id="chrdev">
274         <title>Char devices</title>
275 !Efs/char_dev.c
276   </chapter>
277
278   <chapter id="miscdev">
279      <title>Miscellaneous Devices</title>
280 !Edrivers/char/misc.c
281   </chapter>
282
283   <chapter id="clk">
284      <title>Clock Framework</title>
285
286      <para>
287         The clock framework defines programming interfaces to support
288         software management of the system clock tree.
289         This framework is widely used with System-On-Chip (SOC) platforms
290         to support power management and various devices which may need
291         custom clock rates.
292         Note that these "clocks" don't relate to timekeeping or real
293         time clocks (RTCs), each of which have separate frameworks.
294         These <structname>struct clk</structname> instances may be used
295         to manage for example a 96 MHz signal that is used to shift bits
296         into and out of peripherals or busses, or otherwise trigger
297         synchronous state machine transitions in system hardware.
298      </para>
299
300      <para>
301         Power management is supported by explicit software clock gating:
302         unused clocks are disabled, so the system doesn't waste power
303         changing the state of transistors that aren't in active use.
304         On some systems this may be backed by hardware clock gating,
305         where clocks are gated without being disabled in software.
306         Sections of chips that are powered but not clocked may be able
307         to retain their last state.
308         This low power state is often called a <emphasis>retention
309         mode</emphasis>.
310         This mode still incurs leakage currents, especially with finer
311         circuit geometries, but for CMOS circuits power is mostly used
312         by clocked state changes.
313      </para>
314
315      <para>
316         Power-aware drivers only enable their clocks when the device
317         they manage is in active use.  Also, system sleep states often
318         differ according to which clock domains are active:  while a
319         "standby" state may allow wakeup from several active domains, a
320         "mem" (suspend-to-RAM) state may require a more wholesale shutdown
321         of clocks derived from higher speed PLLs and oscillators, limiting
322         the number of possible wakeup event sources.  A driver's suspend
323         method may need to be aware of system-specific clock constraints
324         on the target sleep state.
325      </para>
326
327      <para>
328         Some platforms support programmable clock generators.  These
329         can be used by external chips of various kinds, such as other
330         CPUs, multimedia codecs, and devices with strict requirements
331         for interface clocking.
332      </para>
333
334 !Iinclude/linux/clk.h
335   </chapter>
336
337 </book>