blob: ecfd0ea406619b0a2c76071b2024c7219b9c7a6a [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"" []>
<book id="LinuxKernelAPI">
<title>The Linux Kernel API</title>
This documentation is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
For more details see the file COPYING in the source
distribution of Linux.
<chapter id="adt">
<title>Data Types</title>
<sect1><title>Doubly Linked Lists</title>
<chapter id="libc">
<title>Basic C Library Functions</title>
When writing drivers, you cannot in general use routines which are
from the C Library. Some of the functions have been found generally
useful and they are listed below. The behaviour of these functions
may vary slightly from those defined by ANSI, and these deviations
are noted in the text.
<sect1><title>String Conversions</title>
!Finclude/linux/kernel.h kstrtol
!Finclude/linux/kernel.h kstrtoul
<sect1><title>String Manipulation</title>
<!-- All functions are exported at now
<sect1><title>Bit Operations</title>
<chapter id="kernel-lib">
<title>Basic Kernel Library Functions</title>
The Linux kernel provides more basic utility functions.
<sect1><title>Bitmap Operations</title>
<sect1><title>Command-line Parsing</title>
<sect1 id="crc"><title>CRC Functions</title>
<sect1 id="idr"><title>idr/ida Functions</title>
!Pinclude/linux/idr.h idr sync
!Plib/idr.c IDA description
<chapter id="mm">
<title>Memory Management in Linux</title>
<sect1><title>The Slab Cache</title>
<sect1><title>User Space Memory Access</title>
<sect1><title>More Memory Management Functions</title>
<chapter id="ipc">
<title>Kernel IPC facilities</title>
<sect1><title>IPC utilities</title>
<chapter id="kfifo">
<title>FIFO Buffer</title>
<sect1><title>kfifo interface</title>
<chapter id="relayfs">
<title>relay interface support</title>
Relay interface support
is designed to provide an efficient mechanism for tools and
facilities to relay large amounts of data from kernel space to
user space.
<sect1><title>relay interface</title>
<chapter id="modload">
<title>Module Support</title>
<sect1><title>Module Loading</title>
<sect1><title>Inter Module support</title>
Refer to the file kernel/module.c for more information.
<!-- FIXME: Removed for now since no structured comments in source
<chapter id="hardware">
<title>Hardware Interfaces</title>
<sect1><title>Interrupt Handling</title>
<sect1><title>DMA Channels</title>
<sect1><title>Resources Management</title>
<sect1><title>MTRR Handling</title>
<sect1><title>PCI Support Library</title>
<!-- FIXME: Removed for now since no structured comments in source
<sect1><title>PCI Hotplug Support Library</title>
<chapter id="firmware">
<title>Firmware Interfaces</title>
<sect1><title>DMI Interfaces</title>
<sect1><title>EDD Interfaces</title>
<chapter id="security">
<title>Security Framework</title>
<chapter id="audit">
<title>Audit Interfaces</title>
<chapter id="accounting">
<title>Accounting Framework</title>
<chapter id="blkdev">
<title>Block Devices</title>
<chapter id="chrdev">
<title>Char devices</title>
<chapter id="miscdev">
<title>Miscellaneous Devices</title>
<chapter id="clk">
<title>Clock Framework</title>
The clock framework defines programming interfaces to support
software management of the system clock tree.
This framework is widely used with System-On-Chip (SOC) platforms
to support power management and various devices which may need
custom clock rates.
Note that these "clocks" don't relate to timekeeping or real
time clocks (RTCs), each of which have separate frameworks.
These <structname>struct clk</structname> instances may be used
to manage for example a 96 MHz signal that is used to shift bits
into and out of peripherals or busses, or otherwise trigger
synchronous state machine transitions in system hardware.
Power management is supported by explicit software clock gating:
unused clocks are disabled, so the system doesn't waste power
changing the state of transistors that aren't in active use.
On some systems this may be backed by hardware clock gating,
where clocks are gated without being disabled in software.
Sections of chips that are powered but not clocked may be able
to retain their last state.
This low power state is often called a <emphasis>retention
This mode still incurs leakage currents, especially with finer
circuit geometries, but for CMOS circuits power is mostly used
by clocked state changes.
Power-aware drivers only enable their clocks when the device
they manage is in active use. Also, system sleep states often
differ according to which clock domains are active: while a
"standby" state may allow wakeup from several active domains, a
"mem" (suspend-to-RAM) state may require a more wholesale shutdown
of clocks derived from higher speed PLLs and oscillators, limiting
the number of possible wakeup event sources. A driver's suspend
method may need to be aware of system-specific clock constraints
on the target sleep state.
Some platforms support programmable clock generators. These
can be used by external chips of various kinds, such as other
CPUs, multimedia codecs, and devices with strict requirements
for interface clocking.