6 List Management Functions
7 =========================
9 .. kernel-doc:: include/linux/list.h
12 Basic C Library Functions
13 =========================
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
24 .. kernel-doc:: lib/vsprintf.c
27 .. kernel-doc:: include/linux/kstrtox.h
28 :functions: kstrtol kstrtoul
30 .. kernel-doc:: lib/kstrtox.c
33 .. kernel-doc:: lib/string_helpers.c
39 .. kernel-doc:: include/linux/fortify-string.h
42 .. kernel-doc:: lib/string.c
45 .. kernel-doc:: include/linux/string.h
48 .. kernel-doc:: mm/util.c
49 :functions: kstrdup kstrdup_const kstrndup kmemdup kmemdup_nul memdup_user
50 vmemdup_user strndup_user memdup_user_nul
52 Basic Kernel Library Functions
53 ==============================
55 The Linux kernel provides more basic utility functions.
60 .. kernel-doc:: include/asm-generic/bitops/instrumented-atomic.h
63 .. kernel-doc:: include/asm-generic/bitops/instrumented-non-atomic.h
66 .. kernel-doc:: include/asm-generic/bitops/instrumented-lock.h
72 .. kernel-doc:: lib/bitmap.c
73 :doc: bitmap introduction
75 .. kernel-doc:: include/linux/bitmap.h
78 .. kernel-doc:: include/linux/bitmap.h
81 .. kernel-doc:: include/linux/bitmap.h
84 .. kernel-doc:: lib/bitmap.c
87 .. kernel-doc:: lib/bitmap.c
90 .. kernel-doc:: include/linux/bitmap.h
96 .. kernel-doc:: lib/cmdline.c
102 .. kernel-doc:: include/linux/err.h
108 .. kernel-doc:: lib/sort.c
111 .. kernel-doc:: lib/list_sort.c
117 .. kernel-doc:: lib/textsearch.c
120 .. kernel-doc:: lib/textsearch.c
123 .. kernel-doc:: include/linux/textsearch.h
124 :functions: textsearch_find textsearch_next \
125 textsearch_get_pattern textsearch_get_pattern_len
127 CRC and Math Functions in Linux
128 ===============================
130 Arithmetic Overflow Checking
131 ----------------------------
133 .. kernel-doc:: include/linux/overflow.h
139 .. kernel-doc:: lib/crc4.c
142 .. kernel-doc:: lib/crc7.c
145 .. kernel-doc:: lib/crc8.c
148 .. kernel-doc:: lib/crc16.c
151 .. kernel-doc:: lib/crc32.c
153 .. kernel-doc:: lib/crc-ccitt.c
156 .. kernel-doc:: lib/crc-itu-t.c
159 Base 2 log and power Functions
160 ------------------------------
162 .. kernel-doc:: include/linux/log2.h
165 Integer log and power Functions
166 -------------------------------
168 .. kernel-doc:: include/linux/int_log.h
170 .. kernel-doc:: lib/math/int_pow.c
173 .. kernel-doc:: lib/math/int_sqrt.c
179 .. kernel-doc:: include/asm-generic/div64.h
182 .. kernel-doc:: include/linux/math64.h
185 .. kernel-doc:: lib/math/gcd.c
191 .. kernel-doc:: lib/uuid.c
194 Kernel IPC facilities
195 =====================
200 .. kernel-doc:: ipc/util.c
209 .. kernel-doc:: include/linux/kfifo.h
212 relay interface support
213 =======================
215 Relay interface support is designed to provide an efficient mechanism
216 for tools and facilities to relay large amounts of data from kernel
222 .. kernel-doc:: kernel/relay.c
225 .. kernel-doc:: kernel/relay.c
231 Kernel module auto-loading
232 --------------------------
234 .. kernel-doc:: kernel/module/kmod.c
240 .. kernel-doc:: kernel/module/stats.c
241 :doc: module debugging statistics overview
243 dup_failed_modules - tracks duplicate failed modules
244 ****************************************************
246 .. kernel-doc:: kernel/module/stats.c
247 :doc: dup_failed_modules - tracks duplicate failed modules
249 module statistics debugfs counters
250 **********************************
252 .. kernel-doc:: kernel/module/stats.c
253 :doc: module statistics debugfs counters
258 Refer to the files in kernel/module/ for more information.
266 .. kernel-doc:: kernel/dma.c
272 .. kernel-doc:: kernel/resource.c
275 .. kernel-doc:: kernel/resource.c
281 .. kernel-doc:: arch/x86/kernel/cpu/mtrr/mtrr.c
287 .. kernel-doc:: security/security.c
290 .. kernel-doc:: security/inode.c
296 .. kernel-doc:: kernel/audit.c
299 .. kernel-doc:: kernel/auditsc.c
302 .. kernel-doc:: kernel/auditfilter.c
308 .. kernel-doc:: kernel/acct.c
314 .. kernel-doc:: include/linux/bio.h
315 .. kernel-doc:: block/blk-core.c
318 .. kernel-doc:: block/blk-core.c
321 .. kernel-doc:: block/blk-map.c
324 .. kernel-doc:: block/blk-sysfs.c
327 .. kernel-doc:: block/blk-settings.c
330 .. kernel-doc:: block/blk-flush.c
333 .. kernel-doc:: block/blk-lib.c
336 .. kernel-doc:: block/blk-integrity.c
339 .. kernel-doc:: kernel/trace/blktrace.c
342 .. kernel-doc:: block/genhd.c
345 .. kernel-doc:: block/genhd.c
348 .. kernel-doc:: block/bdev.c
354 .. kernel-doc:: fs/char_dev.c
360 The clock framework defines programming interfaces to support software
361 management of the system clock tree. This framework is widely used with
362 System-On-Chip (SOC) platforms to support power management and various
363 devices which may need custom clock rates. Note that these "clocks"
364 don't relate to timekeeping or real time clocks (RTCs), each of which
365 have separate frameworks. These :c:type:`struct clk <clk>`
366 instances may be used to manage for example a 96 MHz signal that is used
367 to shift bits into and out of peripherals or busses, or otherwise
368 trigger synchronous state machine transitions in system hardware.
370 Power management is supported by explicit software clock gating: unused
371 clocks are disabled, so the system doesn't waste power changing the
372 state of transistors that aren't in active use. On some systems this may
373 be backed by hardware clock gating, where clocks are gated without being
374 disabled in software. Sections of chips that are powered but not clocked
375 may be able to retain their last state. This low power state is often
376 called a *retention mode*. This mode still incurs leakage currents,
377 especially with finer circuit geometries, but for CMOS circuits power is
378 mostly used by clocked state changes.
380 Power-aware drivers only enable their clocks when the device they manage
381 is in active use. Also, system sleep states often differ according to
382 which clock domains are active: while a "standby" state may allow wakeup
383 from several active domains, a "mem" (suspend-to-RAM) state may require
384 a more wholesale shutdown of clocks derived from higher speed PLLs and
385 oscillators, limiting the number of possible wakeup event sources. A
386 driver's suspend method may need to be aware of system-specific clock
387 constraints on the target sleep state.
389 Some platforms support programmable clock generators. These can be used
390 by external chips of various kinds, such as other CPUs, multimedia
391 codecs, and devices with strict requirements for interface clocking.
393 .. kernel-doc:: include/linux/clk.h
396 Synchronization Primitives
397 ==========================
399 Read-Copy Update (RCU)
400 ----------------------
402 .. kernel-doc:: include/linux/rcupdate.h
404 .. kernel-doc:: kernel/rcu/tree.c
406 .. kernel-doc:: kernel/rcu/tree_exp.h
408 .. kernel-doc:: kernel/rcu/update.c
410 .. kernel-doc:: include/linux/srcu.h
412 .. kernel-doc:: kernel/rcu/srcutree.c
414 .. kernel-doc:: include/linux/rculist_bl.h
416 .. kernel-doc:: include/linux/rculist.h
418 .. kernel-doc:: include/linux/rculist_nulls.h
420 .. kernel-doc:: include/linux/rcu_sync.h
422 .. kernel-doc:: kernel/rcu/sync.c
424 .. kernel-doc:: kernel/rcu/tasks.h
426 .. kernel-doc:: kernel/rcu/tree_stall.h
428 .. kernel-doc:: include/linux/rcupdate_trace.h
430 .. kernel-doc:: include/linux/rcupdate_wait.h
432 .. kernel-doc:: include/linux/rcuref.h
434 .. kernel-doc:: include/linux/rcutree.h