blob: 657a89a219b2963d7c640e0a824605912206bfae [file] [log] [blame]
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -03001====================
2The Linux Kernel API
3====================
4
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -03005
Randy Dunlap416c7512017-09-17 15:19:10 -07006List Management Functions
7=========================
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -03008
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 :export:
58
59.. kernel-doc:: lib/bitmap.c
60 :internal:
61
Randy Dunlap404376a2017-09-17 19:07:10 -070062.. kernel-doc:: include/linux/bitmap.h
63 :internal:
64
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -030065Command-line Parsing
66--------------------
67
68.. kernel-doc:: lib/cmdline.c
69 :export:
70
71CRC Functions
72-------------
73
Randy Dunlap8a298962017-09-08 16:35:55 -070074.. kernel-doc:: lib/crc4.c
75 :export:
76
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -030077.. kernel-doc:: lib/crc7.c
78 :export:
79
Randy Dunlap8a298962017-09-08 16:35:55 -070080.. kernel-doc:: lib/crc8.c
81 :export:
82
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -030083.. kernel-doc:: lib/crc16.c
84 :export:
85
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -030086.. kernel-doc:: lib/crc32.c
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -030087
88.. kernel-doc:: lib/crc-ccitt.c
89 :export:
90
Randy Dunlap8a298962017-09-08 16:35:55 -070091.. kernel-doc:: lib/crc-itu-t.c
92 :export:
93
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -030094idr/ida Functions
95-----------------
96
97.. kernel-doc:: include/linux/idr.h
98 :doc: idr sync
99
100.. kernel-doc:: lib/idr.c
101 :doc: IDA description
102
103.. kernel-doc:: lib/idr.c
104 :export:
105
106Memory Management in Linux
107==========================
108
109The Slab Cache
110--------------
111
112.. kernel-doc:: include/linux/slab.h
113 :internal:
114
115.. kernel-doc:: mm/slab.c
116 :export:
117
118.. kernel-doc:: mm/util.c
119 :export:
120
121User Space Memory Access
122------------------------
123
Jonathan Corbet7d2b39a2017-07-12 16:39:31 -0600124.. kernel-doc:: arch/x86/include/asm/uaccess.h
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -0300125 :internal:
126
127.. kernel-doc:: arch/x86/lib/usercopy_32.c
128 :export:
129
130More Memory Management Functions
131--------------------------------
132
133.. kernel-doc:: mm/readahead.c
134 :export:
135
136.. kernel-doc:: mm/filemap.c
137 :export:
138
139.. kernel-doc:: mm/memory.c
140 :export:
141
142.. kernel-doc:: mm/vmalloc.c
143 :export:
144
145.. kernel-doc:: mm/page_alloc.c
146 :internal:
147
148.. kernel-doc:: mm/mempool.c
149 :export:
150
151.. kernel-doc:: mm/dmapool.c
152 :export:
153
154.. kernel-doc:: mm/page-writeback.c
155 :export:
156
157.. kernel-doc:: mm/truncate.c
158 :export:
159
160Kernel IPC facilities
161=====================
162
163IPC utilities
164-------------
165
166.. kernel-doc:: ipc/util.c
167 :internal:
168
169FIFO Buffer
170===========
171
172kfifo interface
173---------------
174
175.. kernel-doc:: include/linux/kfifo.h
176 :internal:
177
178relay interface support
179=======================
180
181Relay interface support is designed to provide an efficient mechanism
182for tools and facilities to relay large amounts of data from kernel
183space to user space.
184
185relay interface
186---------------
187
188.. kernel-doc:: kernel/relay.c
189 :export:
190
191.. kernel-doc:: kernel/relay.c
192 :internal:
193
194Module Support
195==============
196
197Module Loading
198--------------
199
200.. kernel-doc:: kernel/kmod.c
201 :export:
202
203Inter Module support
204--------------------
205
206Refer to the file kernel/module.c for more information.
207
208Hardware Interfaces
209===================
210
211Interrupt Handling
212------------------
213
214.. kernel-doc:: kernel/irq/manage.c
215 :export:
216
217DMA Channels
218------------
219
220.. kernel-doc:: kernel/dma.c
221 :export:
222
223Resources Management
224--------------------
225
226.. kernel-doc:: kernel/resource.c
227 :internal:
228
229.. kernel-doc:: kernel/resource.c
230 :export:
231
232MTRR Handling
233-------------
234
235.. kernel-doc:: arch/x86/kernel/cpu/mtrr/main.c
236 :export:
237
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -0300238Security Framework
239==================
240
241.. kernel-doc:: security/security.c
242 :internal:
243
244.. kernel-doc:: security/inode.c
245 :export:
246
247Audit Interfaces
248================
249
250.. kernel-doc:: kernel/audit.c
251 :export:
252
253.. kernel-doc:: kernel/auditsc.c
254 :internal:
255
256.. kernel-doc:: kernel/auditfilter.c
257 :internal:
258
259Accounting Framework
260====================
261
262.. kernel-doc:: kernel/acct.c
263 :internal:
264
265Block Devices
266=============
267
268.. kernel-doc:: block/blk-core.c
269 :export:
270
271.. kernel-doc:: block/blk-core.c
272 :internal:
273
274.. kernel-doc:: block/blk-map.c
275 :export:
276
277.. kernel-doc:: block/blk-sysfs.c
278 :internal:
279
280.. kernel-doc:: block/blk-settings.c
281 :export:
282
283.. kernel-doc:: block/blk-exec.c
284 :export:
285
286.. kernel-doc:: block/blk-flush.c
287 :export:
288
289.. kernel-doc:: block/blk-lib.c
290 :export:
291
292.. kernel-doc:: block/blk-tag.c
293 :export:
294
295.. kernel-doc:: block/blk-tag.c
296 :internal:
297
298.. kernel-doc:: block/blk-integrity.c
299 :export:
300
301.. kernel-doc:: kernel/trace/blktrace.c
302 :internal:
303
304.. kernel-doc:: block/genhd.c
305 :internal:
306
307.. kernel-doc:: block/genhd.c
308 :export:
309
310Char devices
311============
312
313.. kernel-doc:: fs/char_dev.c
314 :export:
315
Mauro Carvalho Chehabbaca8a02017-03-30 17:11:32 -0300316Clock Framework
317===============
318
319The clock framework defines programming interfaces to support software
320management of the system clock tree. This framework is widely used with
321System-On-Chip (SOC) platforms to support power management and various
322devices which may need custom clock rates. Note that these "clocks"
323don't relate to timekeeping or real time clocks (RTCs), each of which
324have separate frameworks. These :c:type:`struct clk <clk>`
325instances may be used to manage for example a 96 MHz signal that is used
326to shift bits into and out of peripherals or busses, or otherwise
327trigger synchronous state machine transitions in system hardware.
328
329Power management is supported by explicit software clock gating: unused
330clocks are disabled, so the system doesn't waste power changing the
331state of transistors that aren't in active use. On some systems this may
332be backed by hardware clock gating, where clocks are gated without being
333disabled in software. Sections of chips that are powered but not clocked
334may be able to retain their last state. This low power state is often
335called a *retention mode*. This mode still incurs leakage currents,
336especially with finer circuit geometries, but for CMOS circuits power is
337mostly used by clocked state changes.
338
339Power-aware drivers only enable their clocks when the device they manage
340is in active use. Also, system sleep states often differ according to
341which clock domains are active: while a "standby" state may allow wakeup
342from several active domains, a "mem" (suspend-to-RAM) state may require
343a more wholesale shutdown of clocks derived from higher speed PLLs and
344oscillators, limiting the number of possible wakeup event sources. A
345driver's suspend method may need to be aware of system-specific clock
346constraints on the target sleep state.
347
348Some platforms support programmable clock generators. These can be used
349by external chips of various kinds, such as other CPUs, multimedia
350codecs, and devices with strict requirements for interface clocking.
351
352.. kernel-doc:: include/linux/clk.h
353 :internal:
Paul E. McKenney764f8072017-07-04 14:42:20 -0700354
355Synchronization Primitives
356==========================
357
358Read-Copy Update (RCU)
359----------------------
360
361.. kernel-doc:: include/linux/rcupdate.h
362 :external:
363
364.. kernel-doc:: include/linux/rcupdate_wait.h
365 :external:
366
367.. kernel-doc:: include/linux/rcutree.h
368 :external:
369
370.. kernel-doc:: kernel/rcu/tree.c
371 :external:
372
373.. kernel-doc:: kernel/rcu/tree_plugin.h
374 :external:
375
376.. kernel-doc:: kernel/rcu/tree_exp.h
377 :external:
378
379.. kernel-doc:: kernel/rcu/update.c
380 :external:
381
382.. kernel-doc:: include/linux/srcu.h
383 :external:
384
385.. kernel-doc:: kernel/rcu/srcutree.c
386 :external:
387
388.. kernel-doc:: include/linux/rculist_bl.h
389 :external:
390
391.. kernel-doc:: include/linux/rculist.h
392 :external:
393
394.. kernel-doc:: include/linux/rculist_nulls.h
395 :external:
396
397.. kernel-doc:: include/linux/rcu_sync.h
398 :external:
399
400.. kernel-doc:: kernel/rcu/sync.c
401 :external:
402