函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Create a POSIX.1b interval timer.

函数原型:static int do_timer_create(clockid_t which_clock, struct sigevent *event, timer_t __user *created_timer_id)

返回类型:int

参数:

类型参数名称
clockid_twhich_clock
struct sigevent *event
timer_t __user *created_timer_id
475  kc等于clockid_to_kclock(which_clock)
478  it_id_set等于IT_ID_NOT_SET
480  如果非kc则返回:负EINVAL
482  如果非timer_create则返回:负EOPNOTSUPP
485  new_timer等于alloc_posix_timer()
486  如果此条件成立可能性小(为编译器优化)(!new_timer)则返回:负EAGAIN
489  spin_lock_init( & it_lock)
490  new_timer_id等于posix_timer_add(new_timer)
491  如果new_timer_id小于0则
492  error等于new_timer_id
493  转到:out
496  it_id_set等于IT_ID_SET
497  it_id等于new_timer_id
498  it_clock等于which_clock
499  kclock等于kc
500  it_overrun等于负1LL
502  如果event
503  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
504  it_pid等于get_pid(good_sigevent(event))
505  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
506  如果非it_pid
507  error等于负EINVAL
508  转到:out
510  it_sigev_notify等于sigev_notify
511  si_signo等于sigev_signo
512  si_value等于sigev_value
513  否则
514  it_sigev_notify等于ify via signal
515  si_signo等于SIGALRM
516  memset( & si_value, 0, sizeof(sigval_t))
517  sival_int等于it_id
518  it_pid等于get_pid(task_tgid(当前进程))
521  si_tid等于it_id
522  si_code等于sent by timer expiration
524  如果copy_to_user(created_timer_id, & new_timer_id, new_timer_id的长度)则
526  error等于负EFAULT
527  转到:out
530  error等于timer_create(new_timer)
531  如果error则转到:out
534  spin_lock_irq( & siglock)
535  it_signal等于signal
536  添加链表项
537  spin_unlock_irq( & siglock)
539  返回:0
546  out :
547  release_posix_timer(new_timer, it_id_set)
548  返回:error
调用者
名称描述
SYSCALL_DEFINE3
COMPAT_SYSCALL_DEFINE3