Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\time\posix-cpu-timers.c Create Date:2022-07-28 10:48:15
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:do_cpu_nanosleep

Proto:static int do_cpu_nanosleep(const clockid_t which_clock, int flags, const struct timespec64 *rqtp)

Type:int

Parameter:

TypeParameterName
const clockid_twhich_clock
intflags
const struct timespec64 *rqtp
1230  memset( & timer, 0, sizeoftimer)
1231  Process spin lock initialization( & 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 = current process
1237  If Not error Then
1241  memset( & it, 0, size of 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  If error Then
1248  Return error
1252  If Not cpu_timer_getexpires( & cpu) Then
1267  schedule()
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  If Not error Then
1282  spin_unlock_irq( & it_lock)
1290  spin_lock_irq( & it_lock)
1295  If ( seconds | nanoseconds ) == 0 Then
1299  Return 0
1302  error = -start by calling sys_restart_syscall
1306  restart = restart_block
1307  expires = expires
1308  If type != TT_NONE Then error = nanosleep_copyout(restart, & it_value)
1312  Return error
Caller
NameDescribe
posix_cpu_nsleep
posix_cpu_nsleep_restart