函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_cpu_nanosleep

函数原型:static int do_cpu_nanosleep(const clockid_t which_clock, int flags, const struct timespec64 *rqtp)

返回类型:int

参数:

类型参数名称
const clockid_twhich_clock
intflags
const struct timespec64 *rqtp
1230  memset( & timer, 0, sizeoftimer)
1231  spin_lock_init( & it_lock)
1232  it_clock等于which_clock
1233  it_overrun等于负1
1234  error等于Validate the clockid_t for a new CPU-clock timer, and initialize the timer.* This is called from sys_timer_create() and do_cpu_nanosleep() with the* new timer already all-zeros initialized.
1235  it_process等于当前进程
1237  如果非error
1241  memset( & it, 0, it的长度)
1242  it_value等于rqtp
1244  spin_lock_irq( & it_lock)
1245  error等于Guts of sys_timer_settime for CPU timers.* This is called with the timer locked and interrupts disabled.* If we return TIMER_RETRY, it's necessary to release the timer's lock* and try again. (This happens when the timer is in the middle of firing.)
1246  如果error
1248  返回:error
1252  如果非cpu_timer_getexpires( & cpu)则
1267  进程调度
1268  spin_lock_irq( & it_lock)
1274  expires等于cpu_timer_getexpires( & cpu)
1275  error等于Guts of sys_timer_settime for CPU timers.* This is called with the timer locked and interrupts disabled.* If we return TIMER_RETRY, it's necessary to release the timer's lock* and try again. (This happens when the timer is in the middle of firing.)
1276  如果非error
1282  spin_unlock_irq( & it_lock)
1290  spin_lock_irq( & it_lock)
1295  如果 seconds 按位或 nanoseconds 的值恒等于0则
1299  返回:0
1302  error等于负start by calling sys_restart_syscall
1306  restart等于restart_block
1307  expires等于expires
1308  如果type不等于TT_NONEerror等于nanosleep_copyout(restart, & it_value)
1312  返回:error
调用者
名称描述
posix_cpu_nsleep
posix_cpu_nsleep_restart