函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\time\timer.c Create Date:2022-07-27 11:39:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__mod_timer

函数原型:static inline int __mod_timer(struct timer_list *timer, unsigned long expires, unsigned int options)

返回类型:int

参数:

类型参数名称
struct timer_list *timer
unsigned longexpires
unsigned intoptions
952  idx等于UINT_MAX
953  clk等于0
954  ret等于0
956  BUG_ON(!function)
963  如果mer_pending - is a timer pending?*@timer: the timer in question* timer_pending will tell whether a given timer is currently pending,* or not. Callers must ensure serialization wrt. other operations done* to this timer, eg
969  diff等于expiresexpires
971  如果非diff则返回:1
973  如果options按位与MOD_TIMER_REDUCEdiff小于等于0则返回:1
982  base等于We are using hashed locking: Holding per_cpu(timer_bases[x]).lock means* that all timers which are tied to this base are locked, and the base itself* is locked too.* So __run_timers/migrate_timers can safely modify all timers which could
983  forward_timer_base(base)
987  ret等于1
988  转到:out_unlock
991  clk等于clk
992  idx等于calc_wheel_index(expires, clk)
999  如果idx恒等于timer_get_idx(timer)则
1000  如果非options按位与MOD_TIMER_REDUCE的值则expires等于expires
1004  ret等于1
1005  转到:out_unlock
1007  否则
1008  base等于We are using hashed locking: Holding per_cpu(timer_bases[x]).lock means* that all timers which are tied to this base are locked, and the base itself* is locked too.* So __run_timers/migrate_timers can safely modify all timers which could
1009  forward_timer_base(base)
1012  ret等于detach_if_pending(timer, base, false)
1013  如果非retoptions按位与MOD_TIMER_PENDING_ONLY则转到:out_unlock
1016  new_base等于get_target_base(base, flags)
1018  如果base不等于new_base
1028  flags或等于TIMER_MIGRATING
1030  raw_spin_unlock( & lock)
1031  base等于new_base
1032  raw_spin_lock( & lock)
1039  debug_timer_activate(timer)
1041  expires等于expires
1049  如果idx不等于UINT_MAXclk恒等于clk
1050  Enqueue the timer into the hash bucket, mark it pending in* the bitmap and store the index in the timer flags.
1051  trigger_dyntick_cpu(base, timer)
1052  否则
1053  internal_add_timer(base, timer)
1056  out_unlock :
1057  raw_spin_unlock_irqrestore( & lock, flags)
1059  返回:ret
调用者
名称描述
mod_timer_pendingmod_timer_pending - modify a pending timer's timeout*@timer: the pending timer to be modified*@expires: new timeout in jiffies* mod_timer_pending() is the same for pending timers as mod_timer(),* but will not re-activate and modify already deleted timers.
mod_timermod_timer - modify a timer's timeout*@timer: the timer to be modified*@expires: new timeout in jiffies* mod_timer() is a more efficient way to update the expire field of an* active timer (if the timer is inactive it will be activated)* mod_timer(timer,
timer_reducemer_reduce - Modify a timer's timeout if it would reduce the timeout*@timer: The timer to be modified*@expires: New timeout in jiffies* timer_reduce() is very similar to mod_timer(), except that it will only* modify a running timer if that would reduce
schedule_timeoutschedule_timeout - sleep until timeout*@timeout: timeout value in jiffies* Make the current task sleep until @timeout jiffies have* elapsed