Kernel utility functions
Prev
Chapter 1. Driver Basics
Next
Kernel utility functions
upper_32_bits
— return bits 32-63 of a number
lower_32_bits
— return bits 0-31 of a number
might_sleep
— annotation for functions that can sleep
abs
— return absolute value of an argument
reciprocal_scale
— "scale" a value into range [0, ep_ro)
kstrtoul
— convert a string to an unsigned long
kstrtol
— convert a string to a long
trace_printk
— printf formatting in the ftrace buffer
trace_puts
— write a string into the ftrace buffer
min_not_zero
— return the minimum that is _not_ zero, unless both are zero
clamp
— return a value clamped to a given range with strict typechecking
clamp_t
— return a value clamped to a given range using a given type
clamp_val
— return a value clamped to a given range using val's type
container_of
— cast a member of a structure out to the containing structure
printk
— print a kernel message
console_lock
— lock the console system for exclusive use.
console_trylock
— try to lock the console system for exclusive use.
console_unlock
— unlock the console system
console_conditional_schedule
— yield the CPU if required
printk_timed_ratelimit
— caller-controlled printk ratelimiting
kmsg_dump_register
— register a kernel log dumper.
kmsg_dump_unregister
— unregister a kmsg dumper.
kmsg_dump_get_line
— retrieve one kmsg log line
kmsg_dump_get_buffer
— copy kmsg log lines
kmsg_dump_rewind
— reset the interator
panic
— halt the system
add_taint
—
kernel/sys.c
— Document generation inconsistency
init_srcu_struct
— initialize a sleep-RCU structure
cleanup_srcu_struct
— deconstruct a sleep-RCU structure
synchronize_srcu
— wait for prior SRCU read-side critical-section completion
synchronize_srcu_expedited
— Brute-force SRCU grace period
srcu_barrier
— Wait until all in-flight
call_srcu
callbacks complete.
srcu_batches_completed
— return batches completed.
rcu_idle_enter
— inform RCU that current CPU is entering idle
rcu_idle_exit
— inform RCU that current CPU is leaving idle
rcu_is_watching
— see if RCU thinks that the current CPU is idle
synchronize_sched
— wait until an rcu-sched grace period has elapsed.
synchronize_rcu_bh
— wait until an rcu_bh grace period has elapsed.
get_state_synchronize_rcu
— Snapshot current RCU state
cond_synchronize_rcu
— Conditionally wait for an RCU grace period
get_state_synchronize_sched
— Snapshot current RCU-sched state
cond_synchronize_sched
— Conditionally wait for an RCU-sched grace period
synchronize_sched_expedited
— Brute-force RCU-sched grace period
rcu_barrier_bh
— Wait until all in-flight
call_rcu_bh
callbacks complete.
rcu_barrier_sched
— Wait for in-flight
call_rcu_sched
callbacks.
synchronize_rcu
— wait until a grace period has elapsed.
synchronize_rcu_expedited
— Brute-force RCU grace period
rcu_barrier
— Wait until all in-flight
call_rcu
callbacks complete.
rcu_read_lock_sched_held
— might we be in RCU-sched read-side critical section?
rcu_expedite_gp
— Expedite future RCU grace periods
rcu_unexpedite_gp
Cancel prior rcu_expedite_gp invocation
rcu_read_lock_held
— might we be in RCU read-side critical section?
rcu_read_lock_bh_held
— might we be in RCU-bh read-side critical section?
wakeme_after_rcu
— Callback function to awaken a task after grace period
init_rcu_head_on_stack
— initialize on-stack rcu_head for debugobjects
destroy_rcu_head_on_stack
— destroy on-stack rcu_head for debugobjects
synchronize_rcu_tasks
— wait until an rcu-tasks grace period has elapsed.
rcu_barrier_tasks
— Wait for in-flight
call_rcu_tasks
callbacks.