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" []
>
5 <book id=
"LinuxKernelAPI">
7 <title>The Linux Kernel API
</title>
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
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.
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,
33 For more details see the file COPYING in the source
34 distribution of Linux.
42 <title>Data Types
</title>
43 <sect1><title>Doubly Linked Lists
</title>
44 !Iinclude/linux/list.h
49 <title>Basic C Library Functions
</title>
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.
59 <sect1><title>String Conversions
</title>
62 <sect1><title>String Manipulation
</title>
63 <!-- All functions are exported at now
68 <sect1><title>Bit Operations
</title>
69 !Iarch/x86/include/asm/bitops.h
73 <chapter id=
"kernel-lib">
74 <title>Basic Kernel Library Functions
</title>
77 The Linux kernel provides more basic utility functions.
80 <sect1><title>Bitmap Operations
</title>
85 <sect1><title>Command-line Parsing
</title>
89 <sect1 id=
"crc"><title>CRC Functions
</title>
99 <title>Memory Management in Linux
</title>
100 <sect1><title>The Slab Cache
</title>
101 !Iinclude/linux/slab.h
104 <sect1><title>User Space Memory Access
</title>
105 !Iarch/x86/include/asm/uaccess_32.h
106 !Earch/x86/lib/usercopy_32.c
108 <sect1><title>More Memory Management Functions
</title>
116 !Emm/page-writeback.c
123 <title>Kernel IPC facilities
</title>
125 <sect1><title>IPC utilities
</title>
131 <title>FIFO Buffer
</title>
132 <sect1><title>kfifo interface
</title>
133 !Iinclude/linux/kfifo.h
137 <chapter id=
"relayfs">
138 <title>relay interface support
</title>
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
147 <sect1><title>relay interface
</title>
153 <chapter id=
"modload">
154 <title>Module Support
</title>
155 <sect1><title>Module Loading
</title>
158 <sect1><title>Inter Module support
</title>
160 Refer to the file kernel/module.c for more information.
162 <!-- FIXME: Removed for now since no structured comments in source
168 <chapter id=
"hardware">
169 <title>Hardware Interfaces
</title>
170 <sect1><title>Interrupt Handling
</title>
171 !Ekernel/irq/manage.c
174 <sect1><title>DMA Channels
</title>
178 <sect1><title>Resources Management
</title>
183 <sect1><title>MTRR Handling
</title>
184 !Earch/x86/kernel/cpu/mtrr/main.c
187 <sect1><title>PCI Support Library
</title>
189 !Edrivers/pci/pci-driver.c
190 !Edrivers/pci/remove.c
191 !Edrivers/pci/search.c
194 !Edrivers/pci/access.c
196 !Edrivers/pci/htirq.c
197 <!-- FIXME: Removed for now since no structured comments in source
198 X!Edrivers/pci/hotplug.c
200 !Edrivers/pci/probe.c
204 !Idrivers/pci/pci-sysfs.c
206 <sect1><title>PCI Hotplug Support Library
</title>
207 !Edrivers/pci/hotplug/pci_hotplug_core.c
209 <sect1><title>MCA Architecture
</title>
210 <sect2><title>MCA Device Functions
</title>
212 Refer to the file arch/x86/kernel/mca_32.c for more information.
214 <!-- FIXME: Removed for now since no structured comments in source
215 X!Earch/x86/kernel/mca_32.c
218 <sect2><title>MCA Bus DMA
</title>
219 !Iarch/x86/include/asm/mca_dma.h
224 <chapter id=
"firmware">
225 <title>Firmware Interfaces
</title>
226 <sect1><title>DMI Interfaces
</title>
227 !Edrivers/firmware/dmi_scan.c
229 <sect1><title>EDD Interfaces
</title>
230 !Idrivers/firmware/edd.c
234 <chapter id=
"security">
235 <title>Security Framework
</title>
236 !Isecurity/security.c
241 <title>Audit Interfaces
</title>
244 !Ikernel/auditfilter.c
247 <chapter id=
"accounting">
248 <title>Accounting Framework
</title>
252 <chapter id=
"blkdev">
253 <title>Block Devices
</title>
258 !Eblock/blk-settings.c
264 !Eblock/blk-integrity.c
265 !Ikernel/trace/blktrace.c
270 <chapter id=
"chrdev">
271 <title>Char devices
</title>
275 <chapter id=
"miscdev">
276 <title>Miscellaneous Devices
</title>
277 !Edrivers/char/misc.c
281 <title>Clock Framework
</title>
284 The clock framework defines programming interfaces to support
285 software management of the system clock tree.
286 This framework is widely used with System-On-Chip (SOC) platforms
287 to support power management and various devices which may need
289 Note that these
"clocks" don't relate to timekeeping or real
290 time clocks (RTCs), each of which have separate frameworks.
291 These
<structname>struct clk
</structname> instances may be used
292 to manage for example a
96 MHz signal that is used to shift bits
293 into and out of peripherals or busses, or otherwise trigger
294 synchronous state machine transitions in system hardware.
298 Power management is supported by explicit software clock gating:
299 unused clocks are disabled, so the system doesn't waste power
300 changing the state of transistors that aren't in active use.
301 On some systems this may be backed by hardware clock gating,
302 where clocks are gated without being disabled in software.
303 Sections of chips that are powered but not clocked may be able
304 to retain their last state.
305 This low power state is often called a
<emphasis>retention
307 This mode still incurs leakage currents, especially with finer
308 circuit geometries, but for CMOS circuits power is mostly used
309 by clocked state changes.
313 Power-aware drivers only enable their clocks when the device
314 they manage is in active use. Also, system sleep states often
315 differ according to which clock domains are active: while a
316 "standby" state may allow wakeup from several active domains, a
317 "mem" (suspend-to-RAM) state may require a more wholesale shutdown
318 of clocks derived from higher speed PLLs and oscillators, limiting
319 the number of possible wakeup event sources. A driver's suspend
320 method may need to be aware of system-specific clock constraints
321 on the target sleep state.
325 Some platforms support programmable clock generators. These
326 can be used by external chips of various kinds, such as other
327 CPUs, multimedia codecs, and devices with strict requirements
328 for interface clocking.
331 !Iinclude/linux/clk.h