435 lines · plain
1====================2The Linux Kernel API3====================4 5 6List Management Functions7=========================8 9.. kernel-doc:: include/linux/list.h10 :internal:11 12Basic C Library Functions13=========================14 15When writing drivers, you cannot in general use routines which are from16the C Library. Some of the functions have been found generally useful17and they are listed below. The behaviour of these functions may vary18slightly from those defined by ANSI, and these deviations are noted in19the text.20 21String Conversions22------------------23 24.. kernel-doc:: lib/vsprintf.c25 :export:26 27.. kernel-doc:: include/linux/kstrtox.h28 :functions: kstrtol kstrtoul29 30.. kernel-doc:: lib/kstrtox.c31 :export:32 33.. kernel-doc:: lib/string_helpers.c34 :export:35 36String Manipulation37-------------------38 39.. kernel-doc:: include/linux/fortify-string.h40 :internal:41 42.. kernel-doc:: lib/string.c43 :export:44 45.. kernel-doc:: include/linux/string.h46 :internal:47 48.. kernel-doc:: mm/util.c49 :functions: kstrdup kstrdup_const kstrndup kmemdup kmemdup_nul memdup_user50 vmemdup_user strndup_user memdup_user_nul51 52Basic Kernel Library Functions53==============================54 55The Linux kernel provides more basic utility functions.56 57Bit Operations58--------------59 60.. kernel-doc:: include/asm-generic/bitops/instrumented-atomic.h61 :internal:62 63.. kernel-doc:: include/asm-generic/bitops/instrumented-non-atomic.h64 :internal:65 66.. kernel-doc:: include/asm-generic/bitops/instrumented-lock.h67 :internal:68 69Bitmap Operations70-----------------71 72.. kernel-doc:: lib/bitmap.c73 :doc: bitmap introduction74 75.. kernel-doc:: include/linux/bitmap.h76 :doc: declare bitmap77 78.. kernel-doc:: include/linux/bitmap.h79 :doc: bitmap overview80 81.. kernel-doc:: include/linux/bitmap.h82 :doc: bitmap bitops83 84.. kernel-doc:: lib/bitmap.c85 :export:86 87.. kernel-doc:: lib/bitmap.c88 :internal:89 90.. kernel-doc:: include/linux/bitmap.h91 :internal:92 93Command-line Parsing94--------------------95 96.. kernel-doc:: lib/cmdline.c97 :export:98 99Error Pointers100--------------101 102.. kernel-doc:: include/linux/err.h103 :internal:104 105Sorting106-------107 108.. kernel-doc:: lib/sort.c109 :export:110 111.. kernel-doc:: lib/list_sort.c112 :export:113 114Text Searching115--------------116 117.. kernel-doc:: lib/textsearch.c118 :doc: ts_intro119 120.. kernel-doc:: lib/textsearch.c121 :export:122 123.. kernel-doc:: include/linux/textsearch.h124 :functions: textsearch_find textsearch_next \125 textsearch_get_pattern textsearch_get_pattern_len126 127CRC and Math Functions in Linux128===============================129 130Arithmetic Overflow Checking131----------------------------132 133.. kernel-doc:: include/linux/overflow.h134 :internal:135 136CRC Functions137-------------138 139.. kernel-doc:: lib/crc4.c140 :export:141 142.. kernel-doc:: lib/crc7.c143 :export:144 145.. kernel-doc:: lib/crc8.c146 :export:147 148.. kernel-doc:: lib/crc16.c149 :export:150 151.. kernel-doc:: lib/crc32.c152 153.. kernel-doc:: lib/crc-ccitt.c154 :export:155 156.. kernel-doc:: lib/crc-itu-t.c157 :export:158 159Base 2 log and power Functions160------------------------------161 162.. kernel-doc:: include/linux/log2.h163 :internal:164 165Integer log and power Functions166-------------------------------167 168.. kernel-doc:: include/linux/int_log.h169 170.. kernel-doc:: lib/math/int_pow.c171 :export:172 173.. kernel-doc:: lib/math/int_sqrt.c174 :export:175 176Division Functions177------------------178 179.. kernel-doc:: include/asm-generic/div64.h180 :functions: do_div181 182.. kernel-doc:: include/linux/math64.h183 :internal:184 185.. kernel-doc:: lib/math/gcd.c186 :export:187 188UUID/GUID189---------190 191.. kernel-doc:: lib/uuid.c192 :export:193 194Kernel IPC facilities195=====================196 197IPC utilities198-------------199 200.. kernel-doc:: ipc/util.c201 :internal:202 203FIFO Buffer204===========205 206kfifo interface207---------------208 209.. kernel-doc:: include/linux/kfifo.h210 :internal:211 212relay interface support213=======================214 215Relay interface support is designed to provide an efficient mechanism216for tools and facilities to relay large amounts of data from kernel217space to user space.218 219relay interface220---------------221 222.. kernel-doc:: kernel/relay.c223 :export:224 225.. kernel-doc:: kernel/relay.c226 :internal:227 228Module Support229==============230 231Kernel module auto-loading232--------------------------233 234.. kernel-doc:: kernel/module/kmod.c235 :export:236 237Module debugging238----------------239 240.. kernel-doc:: kernel/module/stats.c241 :doc: module debugging statistics overview242 243dup_failed_modules - tracks duplicate failed modules244****************************************************245 246.. kernel-doc:: kernel/module/stats.c247 :doc: dup_failed_modules - tracks duplicate failed modules248 249module statistics debugfs counters250**********************************251 252.. kernel-doc:: kernel/module/stats.c253 :doc: module statistics debugfs counters254 255Inter Module support256--------------------257 258Refer to the files in kernel/module/ for more information.259 260Hardware Interfaces261===================262 263DMA Channels264------------265 266.. kernel-doc:: kernel/dma.c267 :export:268 269Resources Management270--------------------271 272.. kernel-doc:: kernel/resource.c273 :internal:274 275.. kernel-doc:: kernel/resource.c276 :export:277 278MTRR Handling279-------------280 281.. kernel-doc:: arch/x86/kernel/cpu/mtrr/mtrr.c282 :export:283 284Security Framework285==================286 287.. kernel-doc:: security/security.c288 :internal:289 290.. kernel-doc:: security/inode.c291 :export:292 293Audit Interfaces294================295 296.. kernel-doc:: kernel/audit.c297 :export:298 299.. kernel-doc:: kernel/auditsc.c300 :internal:301 302.. kernel-doc:: kernel/auditfilter.c303 :internal:304 305Accounting Framework306====================307 308.. kernel-doc:: kernel/acct.c309 :internal:310 311Block Devices312=============313 314.. kernel-doc:: include/linux/bio.h315.. kernel-doc:: block/blk-core.c316 :export:317 318.. kernel-doc:: block/blk-core.c319 :internal:320 321.. kernel-doc:: block/blk-map.c322 :export:323 324.. kernel-doc:: block/blk-sysfs.c325 :internal:326 327.. kernel-doc:: block/blk-settings.c328 :export:329 330.. kernel-doc:: block/blk-flush.c331 :export:332 333.. kernel-doc:: block/blk-lib.c334 :export:335 336.. kernel-doc:: block/blk-integrity.c337 :export:338 339.. kernel-doc:: kernel/trace/blktrace.c340 :internal:341 342.. kernel-doc:: block/genhd.c343 :internal:344 345.. kernel-doc:: block/genhd.c346 :export:347 348.. kernel-doc:: block/bdev.c349 :export:350 351Char devices352============353 354.. kernel-doc:: fs/char_dev.c355 :export:356 357Clock Framework358===============359 360The clock framework defines programming interfaces to support software361management of the system clock tree. This framework is widely used with362System-On-Chip (SOC) platforms to support power management and various363devices which may need custom clock rates. Note that these "clocks"364don't relate to timekeeping or real time clocks (RTCs), each of which365have separate frameworks. These :c:type:`struct clk <clk>`366instances may be used to manage for example a 96 MHz signal that is used367to shift bits into and out of peripherals or busses, or otherwise368trigger synchronous state machine transitions in system hardware.369 370Power management is supported by explicit software clock gating: unused371clocks are disabled, so the system doesn't waste power changing the372state of transistors that aren't in active use. On some systems this may373be backed by hardware clock gating, where clocks are gated without being374disabled in software. Sections of chips that are powered but not clocked375may be able to retain their last state. This low power state is often376called a *retention mode*. This mode still incurs leakage currents,377especially with finer circuit geometries, but for CMOS circuits power is378mostly used by clocked state changes.379 380Power-aware drivers only enable their clocks when the device they manage381is in active use. Also, system sleep states often differ according to382which clock domains are active: while a "standby" state may allow wakeup383from several active domains, a "mem" (suspend-to-RAM) state may require384a more wholesale shutdown of clocks derived from higher speed PLLs and385oscillators, limiting the number of possible wakeup event sources. A386driver's suspend method may need to be aware of system-specific clock387constraints on the target sleep state.388 389Some platforms support programmable clock generators. These can be used390by external chips of various kinds, such as other CPUs, multimedia391codecs, and devices with strict requirements for interface clocking.392 393.. kernel-doc:: include/linux/clk.h394 :internal:395 396Synchronization Primitives397==========================398 399Read-Copy Update (RCU)400----------------------401 402.. kernel-doc:: include/linux/rcupdate.h403 404.. kernel-doc:: kernel/rcu/tree.c405 406.. kernel-doc:: kernel/rcu/tree_exp.h407 408.. kernel-doc:: kernel/rcu/update.c409 410.. kernel-doc:: include/linux/srcu.h411 412.. kernel-doc:: kernel/rcu/srcutree.c413 414.. kernel-doc:: include/linux/rculist_bl.h415 416.. kernel-doc:: include/linux/rculist.h417 418.. kernel-doc:: include/linux/rculist_nulls.h419 420.. kernel-doc:: include/linux/rcu_sync.h421 422.. kernel-doc:: kernel/rcu/sync.c423 424.. kernel-doc:: kernel/rcu/tasks.h425 426.. kernel-doc:: kernel/rcu/tree_stall.h427 428.. kernel-doc:: include/linux/rcupdate_trace.h429 430.. kernel-doc:: include/linux/rcupdate_wait.h431 432.. kernel-doc:: include/linux/rcuref.h433 434.. kernel-doc:: include/linux/rcutree.h435