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
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
acquire_console_sem
- lock the console system for exclusive use.
release_console_sem
- unlock the console system
console_conditional_schedule
- yield the CPU if required
printk_timed_ratelimit
- caller-controlled printk ratelimiting
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
synchronize_rcu
- wait until a grace period has elapsed.
synchronize_sched
- wait until an rcu-sched grace period has elapsed.
synchronize_rcu_bh
- wait until an rcu_bh grace period has elapsed.