函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_nanosleep

函数原型:static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mode)

返回类型:int

参数:

类型参数名称
struct hrtimer_sleeper *t
enum hrtimer_modemode
1869  循环
1870  set_current_state(睡眠态)
1871  hrtimer_sleeper_start_expires - Start a hrtimer sleeper timer*@sl: sleeper to be started*@mode: timer mode abs/rel* Wrapper around hrtimer_start_expires() for hrtimer_sleeper based timers* to allow PREEMPT_RT to tweak the delivery mode (soft/hardirq
1873  如果此条件成立可能性大(为编译器优化)(task)则freezable_schedule()
1876  hrtimer_cancel - cancel a timer and wait for the handler to finish.*@timer: the timer to be cancelled* Returns:* 0 when the timer was not active* 1 when the timer was active
1877  mode等于 Time value is absolute
1879 task且非signal_pending(当前进程)循环
1881  set_current_state() includes a barrier so that the write of current->state* is correctly serialised wrt the caller's subsequent test of whether to* actually sleep:* for (;;) {* set_current_state(TASK_UNINTERRUPTIBLE);* if (!need_sleep)* break;* (就绪态)
1883  如果非task则返回:0
1886  restart等于restart_block
1887  如果type不等于TT_NONE
1888  rem等于hrtimer_expires_remaining( & timer)
1891  如果rem小于等于0则返回:0
1893  rmt等于Map the ktime_t to timespec conversion to ns_to_timespec function (rem)
1895  返回:nanosleep_copyout(restart, & rmt)
1897  返回:负start by calling sys_restart_syscall
调用者
名称描述
hrtimer_nanosleep_restart
hrtimer_nanosleep