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/kernel.h
30 .. kernel-doc:: include/linux/kernel.h
33 .. kernel-doc:: lib/kstrtox.c
36 .. kernel-doc:: lib/string_helpers.c
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:: lib/sort.c
105 .. kernel-doc:: lib/list_sort.c
111 .. kernel-doc:: lib/textsearch.c
114 .. kernel-doc:: lib/textsearch.c
117 .. kernel-doc:: include/linux/textsearch.h
118 :functions: textsearch_find textsearch_next \
119 textsearch_get_pattern textsearch_get_pattern_len
121 CRC and Math Functions in Linux
122 ===============================
127 .. kernel-doc:: lib/crc4.c
130 .. kernel-doc:: lib/crc7.c
133 .. kernel-doc:: lib/crc8.c
136 .. kernel-doc:: lib/crc16.c
139 .. kernel-doc:: lib/crc32.c
141 .. kernel-doc:: lib/crc-ccitt.c
144 .. kernel-doc:: lib/crc-itu-t.c
147 Base 2 log and power Functions
148 ------------------------------
150 .. kernel-doc:: include/linux/log2.h
153 Integer power Functions
154 -----------------------
156 .. kernel-doc:: lib/math/int_pow.c
159 .. kernel-doc:: lib/math/int_sqrt.c
165 .. kernel-doc:: include/asm-generic/div64.h
168 .. kernel-doc:: include/linux/math64.h
171 .. kernel-doc:: lib/math/div64.c
172 :functions: div_s64_rem div64_u64_rem div64_u64 div64_s64
174 .. kernel-doc:: lib/math/gcd.c
180 .. kernel-doc:: lib/uuid.c
183 Kernel IPC facilities
184 =====================
189 .. kernel-doc:: ipc/util.c
198 .. kernel-doc:: include/linux/kfifo.h
201 relay interface support
202 =======================
204 Relay interface support is designed to provide an efficient mechanism
205 for tools and facilities to relay large amounts of data from kernel
211 .. kernel-doc:: kernel/relay.c
214 .. kernel-doc:: kernel/relay.c
223 .. kernel-doc:: kernel/kmod.c
229 Refer to the file kernel/module.c for more information.
237 .. kernel-doc:: kernel/irq/manage.c
243 .. kernel-doc:: kernel/dma.c
249 .. kernel-doc:: kernel/resource.c
252 .. kernel-doc:: kernel/resource.c
258 .. kernel-doc:: arch/x86/kernel/cpu/mtrr/mtrr.c
264 .. kernel-doc:: security/security.c
267 .. kernel-doc:: security/inode.c
273 .. kernel-doc:: kernel/audit.c
276 .. kernel-doc:: kernel/auditsc.c
279 .. kernel-doc:: kernel/auditfilter.c
285 .. kernel-doc:: kernel/acct.c
291 .. kernel-doc:: block/blk-core.c
294 .. kernel-doc:: block/blk-core.c
297 .. kernel-doc:: block/blk-map.c
300 .. kernel-doc:: block/blk-sysfs.c
303 .. kernel-doc:: block/blk-settings.c
306 .. kernel-doc:: block/blk-exec.c
309 .. kernel-doc:: block/blk-flush.c
312 .. kernel-doc:: block/blk-lib.c
315 .. kernel-doc:: block/blk-integrity.c
318 .. kernel-doc:: kernel/trace/blktrace.c
321 .. kernel-doc:: block/genhd.c
324 .. kernel-doc:: block/genhd.c
330 .. kernel-doc:: fs/char_dev.c
336 The clock framework defines programming interfaces to support software
337 management of the system clock tree. This framework is widely used with
338 System-On-Chip (SOC) platforms to support power management and various
339 devices which may need custom clock rates. Note that these "clocks"
340 don't relate to timekeeping or real time clocks (RTCs), each of which
341 have separate frameworks. These :c:type:`struct clk <clk>`
342 instances may be used to manage for example a 96 MHz signal that is used
343 to shift bits into and out of peripherals or busses, or otherwise
344 trigger synchronous state machine transitions in system hardware.
346 Power management is supported by explicit software clock gating: unused
347 clocks are disabled, so the system doesn't waste power changing the
348 state of transistors that aren't in active use. On some systems this may
349 be backed by hardware clock gating, where clocks are gated without being
350 disabled in software. Sections of chips that are powered but not clocked
351 may be able to retain their last state. This low power state is often
352 called a *retention mode*. This mode still incurs leakage currents,
353 especially with finer circuit geometries, but for CMOS circuits power is
354 mostly used by clocked state changes.
356 Power-aware drivers only enable their clocks when the device they manage
357 is in active use. Also, system sleep states often differ according to
358 which clock domains are active: while a "standby" state may allow wakeup
359 from several active domains, a "mem" (suspend-to-RAM) state may require
360 a more wholesale shutdown of clocks derived from higher speed PLLs and
361 oscillators, limiting the number of possible wakeup event sources. A
362 driver's suspend method may need to be aware of system-specific clock
363 constraints on the target sleep state.
365 Some platforms support programmable clock generators. These can be used
366 by external chips of various kinds, such as other CPUs, multimedia
367 codecs, and devices with strict requirements for interface clocking.
369 .. kernel-doc:: include/linux/clk.h
372 Synchronization Primitives
373 ==========================
375 Read-Copy Update (RCU)
376 ----------------------
378 .. kernel-doc:: include/linux/rcupdate.h
380 .. kernel-doc:: kernel/rcu/tree.c
382 .. kernel-doc:: kernel/rcu/tree_exp.h
384 .. kernel-doc:: kernel/rcu/update.c
386 .. kernel-doc:: include/linux/srcu.h
388 .. kernel-doc:: kernel/rcu/srcutree.c
390 .. kernel-doc:: include/linux/rculist_bl.h
392 .. kernel-doc:: include/linux/rculist.h
394 .. kernel-doc:: include/linux/rculist_nulls.h
396 .. kernel-doc:: include/linux/rcu_sync.h
398 .. kernel-doc:: kernel/rcu/sync.c