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:: lib/string.c
42 .. kernel-doc:: include/linux/string.h
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
49 Basic Kernel Library Functions
50 ==============================
52 The Linux kernel provides more basic utility functions.
57 .. kernel-doc:: include/asm-generic/bitops/instrumented-atomic.h
60 .. kernel-doc:: include/asm-generic/bitops/instrumented-non-atomic.h
63 .. kernel-doc:: include/asm-generic/bitops/instrumented-lock.h
69 .. kernel-doc:: lib/bitmap.c
70 :doc: bitmap introduction
72 .. kernel-doc:: include/linux/bitmap.h
75 .. kernel-doc:: include/linux/bitmap.h
78 .. kernel-doc:: include/linux/bitmap.h
81 .. kernel-doc:: lib/bitmap.c
84 .. kernel-doc:: lib/bitmap.c
87 .. kernel-doc:: include/linux/bitmap.h
93 .. kernel-doc:: lib/cmdline.c
99 .. kernel-doc:: lib/sort.c
102 .. kernel-doc:: lib/list_sort.c
108 .. kernel-doc:: lib/textsearch.c
111 .. kernel-doc:: lib/textsearch.c
114 .. kernel-doc:: include/linux/textsearch.h
115 :functions: textsearch_find textsearch_next \
116 textsearch_get_pattern textsearch_get_pattern_len
118 CRC and Math Functions in Linux
119 ===============================
121 Arithmetic Overflow Checking
122 ----------------------------
124 .. kernel-doc:: include/linux/overflow.h
130 .. kernel-doc:: lib/crc4.c
133 .. kernel-doc:: lib/crc7.c
136 .. kernel-doc:: lib/crc8.c
139 .. kernel-doc:: lib/crc16.c
142 .. kernel-doc:: lib/crc32.c
144 .. kernel-doc:: lib/crc-ccitt.c
147 .. kernel-doc:: lib/crc-itu-t.c
150 Base 2 log and power Functions
151 ------------------------------
153 .. kernel-doc:: include/linux/log2.h
156 Integer power Functions
157 -----------------------
159 .. kernel-doc:: lib/math/int_pow.c
162 .. kernel-doc:: lib/math/int_sqrt.c
168 .. kernel-doc:: include/asm-generic/div64.h
171 .. kernel-doc:: include/linux/math64.h
174 .. kernel-doc:: lib/math/div64.c
175 :functions: div_s64_rem div64_u64_rem div64_u64 div64_s64
177 .. kernel-doc:: lib/math/gcd.c
183 .. kernel-doc:: lib/uuid.c
186 Kernel IPC facilities
187 =====================
192 .. kernel-doc:: ipc/util.c
201 .. kernel-doc:: include/linux/kfifo.h
204 relay interface support
205 =======================
207 Relay interface support is designed to provide an efficient mechanism
208 for tools and facilities to relay large amounts of data from kernel
214 .. kernel-doc:: kernel/relay.c
217 .. kernel-doc:: kernel/relay.c
226 .. kernel-doc:: kernel/kmod.c
232 Refer to the files in kernel/module/ for more information.
240 .. kernel-doc:: kernel/dma.c
246 .. kernel-doc:: kernel/resource.c
249 .. kernel-doc:: kernel/resource.c
255 .. kernel-doc:: arch/x86/kernel/cpu/mtrr/mtrr.c
261 .. kernel-doc:: security/security.c
264 .. kernel-doc:: security/inode.c
270 .. kernel-doc:: kernel/audit.c
273 .. kernel-doc:: kernel/auditsc.c
276 .. kernel-doc:: kernel/auditfilter.c
282 .. kernel-doc:: kernel/acct.c
288 .. kernel-doc:: include/linux/bio.h
289 .. kernel-doc:: block/blk-core.c
292 .. kernel-doc:: block/blk-core.c
295 .. kernel-doc:: block/blk-map.c
298 .. kernel-doc:: block/blk-sysfs.c
301 .. kernel-doc:: block/blk-settings.c
304 .. kernel-doc:: block/blk-flush.c
307 .. kernel-doc:: block/blk-lib.c
310 .. kernel-doc:: block/blk-integrity.c
313 .. kernel-doc:: kernel/trace/blktrace.c
316 .. kernel-doc:: block/genhd.c
319 .. kernel-doc:: block/genhd.c
322 .. kernel-doc:: block/bdev.c
328 .. kernel-doc:: fs/char_dev.c
334 The clock framework defines programming interfaces to support software
335 management of the system clock tree. This framework is widely used with
336 System-On-Chip (SOC) platforms to support power management and various
337 devices which may need custom clock rates. Note that these "clocks"
338 don't relate to timekeeping or real time clocks (RTCs), each of which
339 have separate frameworks. These :c:type:`struct clk <clk>`
340 instances may be used to manage for example a 96 MHz signal that is used
341 to shift bits into and out of peripherals or busses, or otherwise
342 trigger synchronous state machine transitions in system hardware.
344 Power management is supported by explicit software clock gating: unused
345 clocks are disabled, so the system doesn't waste power changing the
346 state of transistors that aren't in active use. On some systems this may
347 be backed by hardware clock gating, where clocks are gated without being
348 disabled in software. Sections of chips that are powered but not clocked
349 may be able to retain their last state. This low power state is often
350 called a *retention mode*. This mode still incurs leakage currents,
351 especially with finer circuit geometries, but for CMOS circuits power is
352 mostly used by clocked state changes.
354 Power-aware drivers only enable their clocks when the device they manage
355 is in active use. Also, system sleep states often differ according to
356 which clock domains are active: while a "standby" state may allow wakeup
357 from several active domains, a "mem" (suspend-to-RAM) state may require
358 a more wholesale shutdown of clocks derived from higher speed PLLs and
359 oscillators, limiting the number of possible wakeup event sources. A
360 driver's suspend method may need to be aware of system-specific clock
361 constraints on the target sleep state.
363 Some platforms support programmable clock generators. These can be used
364 by external chips of various kinds, such as other CPUs, multimedia
365 codecs, and devices with strict requirements for interface clocking.
367 .. kernel-doc:: include/linux/clk.h
370 Synchronization Primitives
371 ==========================
373 Read-Copy Update (RCU)
374 ----------------------
376 .. kernel-doc:: include/linux/rcupdate.h
378 .. kernel-doc:: kernel/rcu/tree.c
380 .. kernel-doc:: kernel/rcu/tree_exp.h
382 .. kernel-doc:: kernel/rcu/update.c
384 .. kernel-doc:: include/linux/srcu.h
386 .. kernel-doc:: kernel/rcu/srcutree.c
388 .. kernel-doc:: include/linux/rculist_bl.h
390 .. kernel-doc:: include/linux/rculist.h
392 .. kernel-doc:: include/linux/rculist_nulls.h
394 .. kernel-doc:: include/linux/rcu_sync.h
396 .. kernel-doc:: kernel/rcu/sync.c