Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 1 | ==================== |
| 2 | The Linux Kernel API |
| 3 | ==================== |
| 4 | |
Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 5 | |
Randy Dunlap | 416c751 | 2017-09-17 15:19:10 -0700 | [diff] [blame] | 6 | List Management Functions |
| 7 | ========================= |
Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 8 | |
| 9 | .. kernel-doc:: include/linux/list.h |
| 10 | :internal: |
| 11 | |
| 12 | Basic C Library Functions |
| 13 | ========================= |
| 14 | |
| 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 |
| 19 | the text. |
| 20 | |
| 21 | String 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 | |
| 36 | String Manipulation |
| 37 | ------------------- |
| 38 | |
| 39 | .. kernel-doc:: lib/string.c |
| 40 | :export: |
| 41 | |
| 42 | Bit Operations |
| 43 | -------------- |
| 44 | |
| 45 | .. kernel-doc:: arch/x86/include/asm/bitops.h |
| 46 | :internal: |
| 47 | |
| 48 | Basic Kernel Library Functions |
| 49 | ============================== |
| 50 | |
| 51 | The Linux kernel provides more basic utility functions. |
| 52 | |
| 53 | Bitmap Operations |
| 54 | ----------------- |
| 55 | |
| 56 | .. kernel-doc:: lib/bitmap.c |
| 57 | :export: |
| 58 | |
| 59 | .. kernel-doc:: lib/bitmap.c |
| 60 | :internal: |
| 61 | |
Randy Dunlap | 404376a | 2017-09-17 19:07:10 -0700 | [diff] [blame] | 62 | .. kernel-doc:: include/linux/bitmap.h |
| 63 | :internal: |
| 64 | |
Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 65 | Command-line Parsing |
| 66 | -------------------- |
| 67 | |
| 68 | .. kernel-doc:: lib/cmdline.c |
| 69 | :export: |
| 70 | |
| 71 | CRC Functions |
| 72 | ------------- |
| 73 | |
Randy Dunlap | 8a29896 | 2017-09-08 16:35:55 -0700 | [diff] [blame^] | 74 | .. kernel-doc:: lib/crc4.c |
| 75 | :export: |
| 76 | |
Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 77 | .. kernel-doc:: lib/crc7.c |
| 78 | :export: |
| 79 | |
Randy Dunlap | 8a29896 | 2017-09-08 16:35:55 -0700 | [diff] [blame^] | 80 | .. kernel-doc:: lib/crc8.c |
| 81 | :export: |
| 82 | |
Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 83 | .. kernel-doc:: lib/crc16.c |
| 84 | :export: |
| 85 | |
Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 86 | .. kernel-doc:: lib/crc32.c |
Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 87 | |
| 88 | .. kernel-doc:: lib/crc-ccitt.c |
| 89 | :export: |
| 90 | |
Randy Dunlap | 8a29896 | 2017-09-08 16:35:55 -0700 | [diff] [blame^] | 91 | .. kernel-doc:: lib/crc-itu-t.c |
| 92 | :export: |
| 93 | |
Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 94 | idr/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 | |
| 106 | Memory Management in Linux |
| 107 | ========================== |
| 108 | |
| 109 | The 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 | |
| 121 | User Space Memory Access |
| 122 | ------------------------ |
| 123 | |
Jonathan Corbet | 7d2b39a | 2017-07-12 16:39:31 -0600 | [diff] [blame] | 124 | .. kernel-doc:: arch/x86/include/asm/uaccess.h |
Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 125 | :internal: |
| 126 | |
| 127 | .. kernel-doc:: arch/x86/lib/usercopy_32.c |
| 128 | :export: |
| 129 | |
| 130 | More 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 | |
| 160 | Kernel IPC facilities |
| 161 | ===================== |
| 162 | |
| 163 | IPC utilities |
| 164 | ------------- |
| 165 | |
| 166 | .. kernel-doc:: ipc/util.c |
| 167 | :internal: |
| 168 | |
| 169 | FIFO Buffer |
| 170 | =========== |
| 171 | |
| 172 | kfifo interface |
| 173 | --------------- |
| 174 | |
| 175 | .. kernel-doc:: include/linux/kfifo.h |
| 176 | :internal: |
| 177 | |
| 178 | relay interface support |
| 179 | ======================= |
| 180 | |
| 181 | Relay interface support is designed to provide an efficient mechanism |
| 182 | for tools and facilities to relay large amounts of data from kernel |
| 183 | space to user space. |
| 184 | |
| 185 | relay interface |
| 186 | --------------- |
| 187 | |
| 188 | .. kernel-doc:: kernel/relay.c |
| 189 | :export: |
| 190 | |
| 191 | .. kernel-doc:: kernel/relay.c |
| 192 | :internal: |
| 193 | |
| 194 | Module Support |
| 195 | ============== |
| 196 | |
| 197 | Module Loading |
| 198 | -------------- |
| 199 | |
| 200 | .. kernel-doc:: kernel/kmod.c |
| 201 | :export: |
| 202 | |
| 203 | Inter Module support |
| 204 | -------------------- |
| 205 | |
| 206 | Refer to the file kernel/module.c for more information. |
| 207 | |
| 208 | Hardware Interfaces |
| 209 | =================== |
| 210 | |
| 211 | Interrupt Handling |
| 212 | ------------------ |
| 213 | |
| 214 | .. kernel-doc:: kernel/irq/manage.c |
| 215 | :export: |
| 216 | |
| 217 | DMA Channels |
| 218 | ------------ |
| 219 | |
| 220 | .. kernel-doc:: kernel/dma.c |
| 221 | :export: |
| 222 | |
| 223 | Resources Management |
| 224 | -------------------- |
| 225 | |
| 226 | .. kernel-doc:: kernel/resource.c |
| 227 | :internal: |
| 228 | |
| 229 | .. kernel-doc:: kernel/resource.c |
| 230 | :export: |
| 231 | |
| 232 | MTRR Handling |
| 233 | ------------- |
| 234 | |
| 235 | .. kernel-doc:: arch/x86/kernel/cpu/mtrr/main.c |
| 236 | :export: |
| 237 | |
Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 238 | Security Framework |
| 239 | ================== |
| 240 | |
| 241 | .. kernel-doc:: security/security.c |
| 242 | :internal: |
| 243 | |
| 244 | .. kernel-doc:: security/inode.c |
| 245 | :export: |
| 246 | |
| 247 | Audit 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 | |
| 259 | Accounting Framework |
| 260 | ==================== |
| 261 | |
| 262 | .. kernel-doc:: kernel/acct.c |
| 263 | :internal: |
| 264 | |
| 265 | Block 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 | |
| 310 | Char devices |
| 311 | ============ |
| 312 | |
| 313 | .. kernel-doc:: fs/char_dev.c |
| 314 | :export: |
| 315 | |
Mauro Carvalho Chehab | baca8a0 | 2017-03-30 17:11:32 -0300 | [diff] [blame] | 316 | Clock Framework |
| 317 | =============== |
| 318 | |
| 319 | The clock framework defines programming interfaces to support software |
| 320 | management of the system clock tree. This framework is widely used with |
| 321 | System-On-Chip (SOC) platforms to support power management and various |
| 322 | devices which may need custom clock rates. Note that these "clocks" |
| 323 | don't relate to timekeeping or real time clocks (RTCs), each of which |
| 324 | have separate frameworks. These :c:type:`struct clk <clk>` |
| 325 | instances may be used to manage for example a 96 MHz signal that is used |
| 326 | to shift bits into and out of peripherals or busses, or otherwise |
| 327 | trigger synchronous state machine transitions in system hardware. |
| 328 | |
| 329 | Power management is supported by explicit software clock gating: unused |
| 330 | clocks are disabled, so the system doesn't waste power changing the |
| 331 | state of transistors that aren't in active use. On some systems this may |
| 332 | be backed by hardware clock gating, where clocks are gated without being |
| 333 | disabled in software. Sections of chips that are powered but not clocked |
| 334 | may be able to retain their last state. This low power state is often |
| 335 | called a *retention mode*. This mode still incurs leakage currents, |
| 336 | especially with finer circuit geometries, but for CMOS circuits power is |
| 337 | mostly used by clocked state changes. |
| 338 | |
| 339 | Power-aware drivers only enable their clocks when the device they manage |
| 340 | is in active use. Also, system sleep states often differ according to |
| 341 | which clock domains are active: while a "standby" state may allow wakeup |
| 342 | from several active domains, a "mem" (suspend-to-RAM) state may require |
| 343 | a more wholesale shutdown of clocks derived from higher speed PLLs and |
| 344 | oscillators, limiting the number of possible wakeup event sources. A |
| 345 | driver's suspend method may need to be aware of system-specific clock |
| 346 | constraints on the target sleep state. |
| 347 | |
| 348 | Some platforms support programmable clock generators. These can be used |
| 349 | by external chips of various kinds, such as other CPUs, multimedia |
| 350 | codecs, and devices with strict requirements for interface clocking. |
| 351 | |
| 352 | .. kernel-doc:: include/linux/clk.h |
| 353 | :internal: |
Paul E. McKenney | 764f807 | 2017-07-04 14:42:20 -0700 | [diff] [blame] | 354 | |
| 355 | Synchronization Primitives |
| 356 | ========================== |
| 357 | |
| 358 | Read-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 | |