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