1====================
2The Linux Kernel API
3====================
4
5
6List Management Functions
7=========================
8
9.. kernel-doc:: include/linux/list.h
10   :internal:
11
12Basic C Library Functions
13=========================
14
15When writing drivers, you cannot in general use routines which are from
16the C Library. Some of the functions have been found generally useful
17and they are listed below. The behaviour of these functions may vary
18slightly from those defined by ANSI, and these deviations are noted in
19the text.
20
21String Conversions
22------------------
23
24.. kernel-doc:: lib/vsprintf.c
25   :export:
26
27.. kernel-doc:: include/linux/kernel.h
28   :functions: kstrtol
29
30.. kernel-doc:: include/linux/kernel.h
31   :functions: kstrtoul
32
33.. kernel-doc:: lib/kstrtox.c
34   :export:
35
36String Manipulation
37-------------------
38
39.. kernel-doc:: lib/string.c
40   :export:
41
42Bit Operations
43--------------
44
45.. kernel-doc:: arch/x86/include/asm/bitops.h
46   :internal:
47
48Basic Kernel Library Functions
49==============================
50
51The Linux kernel provides more basic utility functions.
52
53Bitmap Operations
54-----------------
55
56.. kernel-doc:: lib/bitmap.c
57   :doc: bitmap introduction
58
59.. kernel-doc:: include/linux/bitmap.h
60   :doc: declare bitmap
61
62.. kernel-doc:: include/linux/bitmap.h
63   :doc: bitmap overview
64
65.. kernel-doc:: include/linux/bitmap.h
66   :doc: bitmap bitops
67
68.. kernel-doc:: lib/bitmap.c
69   :export:
70
71.. kernel-doc:: lib/bitmap.c
72   :internal:
73
74.. kernel-doc:: include/linux/bitmap.h
75   :internal:
76
77Command-line Parsing
78--------------------
79
80.. kernel-doc:: lib/cmdline.c
81   :export:
82
83CRC Functions
84-------------
85
86.. kernel-doc:: lib/crc4.c
87   :export:
88
89.. kernel-doc:: lib/crc7.c
90   :export:
91
92.. kernel-doc:: lib/crc8.c
93   :export:
94
95.. kernel-doc:: lib/crc16.c
96   :export:
97
98.. kernel-doc:: lib/crc32.c
99
100.. kernel-doc:: lib/crc-ccitt.c
101   :export:
102
103.. kernel-doc:: lib/crc-itu-t.c
104   :export:
105
106idr/ida Functions
107-----------------
108
109.. kernel-doc:: include/linux/idr.h
110   :doc: idr sync
111
112.. kernel-doc:: lib/idr.c
113   :doc: IDA description
114
115.. kernel-doc:: lib/idr.c
116   :export:
117
118Math Functions in Linux
119=======================
120
121Base 2 log and power Functions
122------------------------------
123
124.. kernel-doc:: include/linux/log2.h
125   :internal:
126
127Division Functions
128------------------
129
130.. kernel-doc:: include/asm-generic/div64.h
131   :functions: do_div
132
133.. kernel-doc:: include/linux/math64.h
134   :internal:
135
136.. kernel-doc:: lib/div64.c
137   :functions: div_s64_rem div64_u64_rem div64_u64 div64_s64
138
139.. kernel-doc:: lib/gcd.c
140   :export:
141
142Sorting
143-------
144
145.. kernel-doc:: lib/sort.c
146   :export:
147
148.. kernel-doc:: lib/list_sort.c
149   :export:
150
151UUID/GUID
152---------
153
154.. kernel-doc:: lib/uuid.c
155   :export:
156
157Memory Management in Linux
158==========================
159
160The Slab Cache
161--------------
162
163.. kernel-doc:: include/linux/slab.h
164   :internal:
165
166.. kernel-doc:: mm/slab.c
167   :export:
168
169.. kernel-doc:: mm/util.c
170   :export:
171
172User Space Memory Access
173------------------------
174
175.. kernel-doc:: arch/x86/include/asm/uaccess.h
176   :internal:
177
178.. kernel-doc:: arch/x86/lib/usercopy_32.c
179   :export:
180
181More Memory Management Functions
182--------------------------------
183
184.. kernel-doc:: mm/readahead.c
185   :export:
186
187.. kernel-doc:: mm/filemap.c
188   :export:
189
190.. kernel-doc:: mm/memory.c
191   :export:
192
193.. kernel-doc:: mm/vmalloc.c
194   :export:
195
196.. kernel-doc:: mm/page_alloc.c
197   :internal:
198
199.. kernel-doc:: mm/mempool.c
200   :export:
201
202.. kernel-doc:: mm/dmapool.c
203   :export:
204
205.. kernel-doc:: mm/page-writeback.c
206   :export:
207
208.. kernel-doc:: mm/truncate.c
209   :export:
210
211Kernel IPC facilities
212=====================
213
214IPC utilities
215-------------
216
217.. kernel-doc:: ipc/util.c
218   :internal:
219
220FIFO Buffer
221===========
222
223kfifo interface
224---------------
225
226.. kernel-doc:: include/linux/kfifo.h
227   :internal:
228
229relay interface support
230=======================
231
232Relay interface support is designed to provide an efficient mechanism
233for tools and facilities to relay large amounts of data from kernel
234space to user space.
235
236relay interface
237---------------
238
239.. kernel-doc:: kernel/relay.c
240   :export:
241
242.. kernel-doc:: kernel/relay.c
243   :internal:
244
245Module Support
246==============
247
248Module Loading
249--------------
250
251.. kernel-doc:: kernel/kmod.c
252   :export:
253
254Inter Module support
255--------------------
256
257Refer to the file kernel/module.c for more information.
258
259Hardware Interfaces
260===================
261
262Interrupt Handling
263------------------
264
265.. kernel-doc:: kernel/irq/manage.c
266   :export:
267
268DMA Channels
269------------
270
271.. kernel-doc:: kernel/dma.c
272   :export:
273
274Resources Management
275--------------------
276
277.. kernel-doc:: kernel/resource.c
278   :internal:
279
280.. kernel-doc:: kernel/resource.c
281   :export:
282
283MTRR Handling
284-------------
285
286.. kernel-doc:: arch/x86/kernel/cpu/mtrr/main.c
287   :export:
288
289Security Framework
290==================
291
292.. kernel-doc:: security/security.c
293   :internal:
294
295.. kernel-doc:: security/inode.c
296   :export:
297
298Audit Interfaces
299================
300
301.. kernel-doc:: kernel/audit.c
302   :export:
303
304.. kernel-doc:: kernel/auditsc.c
305   :internal:
306
307.. kernel-doc:: kernel/auditfilter.c
308   :internal:
309
310Accounting Framework
311====================
312
313.. kernel-doc:: kernel/acct.c
314   :internal:
315
316Block Devices
317=============
318
319.. kernel-doc:: block/blk-core.c
320   :export:
321
322.. kernel-doc:: block/blk-core.c
323   :internal:
324
325.. kernel-doc:: block/blk-map.c
326   :export:
327
328.. kernel-doc:: block/blk-sysfs.c
329   :internal:
330
331.. kernel-doc:: block/blk-settings.c
332   :export:
333
334.. kernel-doc:: block/blk-exec.c
335   :export:
336
337.. kernel-doc:: block/blk-flush.c
338   :export:
339
340.. kernel-doc:: block/blk-lib.c
341   :export:
342
343.. kernel-doc:: block/blk-tag.c
344   :export:
345
346.. kernel-doc:: block/blk-tag.c
347   :internal:
348
349.. kernel-doc:: block/blk-integrity.c
350   :export:
351
352.. kernel-doc:: kernel/trace/blktrace.c
353   :internal:
354
355.. kernel-doc:: block/genhd.c
356   :internal:
357
358.. kernel-doc:: block/genhd.c
359   :export:
360
361Char devices
362============
363
364.. kernel-doc:: fs/char_dev.c
365   :export:
366
367Clock Framework
368===============
369
370The clock framework defines programming interfaces to support software
371management of the system clock tree. This framework is widely used with
372System-On-Chip (SOC) platforms to support power management and various
373devices which may need custom clock rates. Note that these "clocks"
374don't relate to timekeeping or real time clocks (RTCs), each of which
375have separate frameworks. These :c:type:`struct clk <clk>`
376instances may be used to manage for example a 96 MHz signal that is used
377to shift bits into and out of peripherals or busses, or otherwise
378trigger synchronous state machine transitions in system hardware.
379
380Power management is supported by explicit software clock gating: unused
381clocks are disabled, so the system doesn't waste power changing the
382state of transistors that aren't in active use. On some systems this may
383be backed by hardware clock gating, where clocks are gated without being
384disabled in software. Sections of chips that are powered but not clocked
385may be able to retain their last state. This low power state is often
386called a *retention mode*. This mode still incurs leakage currents,
387especially with finer circuit geometries, but for CMOS circuits power is
388mostly used by clocked state changes.
389
390Power-aware drivers only enable their clocks when the device they manage
391is in active use. Also, system sleep states often differ according to
392which clock domains are active: while a "standby" state may allow wakeup
393from several active domains, a "mem" (suspend-to-RAM) state may require
394a more wholesale shutdown of clocks derived from higher speed PLLs and
395oscillators, limiting the number of possible wakeup event sources. A
396driver's suspend method may need to be aware of system-specific clock
397constraints on the target sleep state.
398
399Some platforms support programmable clock generators. These can be used
400by external chips of various kinds, such as other CPUs, multimedia
401codecs, and devices with strict requirements for interface clocking.
402
403.. kernel-doc:: include/linux/clk.h
404   :internal:
405
406Synchronization Primitives
407==========================
408
409Read-Copy Update (RCU)
410----------------------
411
412.. kernel-doc:: include/linux/rcupdate.h
413
414.. kernel-doc:: include/linux/rcupdate_wait.h
415
416.. kernel-doc:: include/linux/rcutree.h
417
418.. kernel-doc:: kernel/rcu/tree.c
419
420.. kernel-doc:: kernel/rcu/tree_plugin.h
421
422.. kernel-doc:: kernel/rcu/tree_exp.h
423
424.. kernel-doc:: kernel/rcu/update.c
425
426.. kernel-doc:: include/linux/srcu.h
427
428.. kernel-doc:: kernel/rcu/srcutree.c
429
430.. kernel-doc:: include/linux/rculist_bl.h
431
432.. kernel-doc:: include/linux/rculist.h
433
434.. kernel-doc:: include/linux/rculist_nulls.h
435
436.. kernel-doc:: include/linux/rcu_sync.h
437
438.. kernel-doc:: kernel/rcu/sync.c
439
440