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
trace_printk
— printf formatting in 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
BUILD_BUG_ON
— break compile if a condition is true.
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.
panic
— halt the system
emergency_restart
— reboot the system
kernel_restart
— reboot the system
kernel_halt
— halt the system
kernel_power_off
— power_off the system
orderly_poweroff
— Trigger an orderly system poweroff
rcu_read_lock_bh_held
— might we be in RCU-bh read-side critical section?
init_rcu_head_on_stack
— initialize on-stack rcu_head for debugobjects
destroy_rcu_head_on_stack
— destroy on-stack rcu_head for debugobjects