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