函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\futex.c Create Date:2022-07-27 11:54:37
Last Modify:2020-03-17 15:28:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:futex_wait

函数原型:static int futex_wait(unsigned int __user *uaddr, unsigned int flags, unsigned int val, ktime_t *abs_time, unsigned int bitset)

返回类型:int

参数:

类型参数名称
unsigned int __user *uaddr
unsigned intflags
unsigned intval
ktime_t *abs_time
unsigned intbitset
2792  q等于futex_q_init
2795  如果非bitset则返回:负EINVAL
2797  bitset等于bitset
2799  to等于ex_setup_timer - set up the sleeping hrtimer
2801  retry :
2806  ret等于ex_wait_setup() - Prepare to wait on a futex*@uaddr: the futex userspace address*@val: the expected value*@flags: futex flags (FLAGS_SHARED, etc.)*@q: the associated futex_q*@hb: storage for hash_bucket pointer to be returned to caller
2807  如果ret则转到:out
2811  ex_wait_queue_me() - queue_me() and wait for wakeup, timeout, or signal*@hb: the futex hash bucket, must be locked by the caller*@q: the futex_q to queue up on*@timeout: the prepared hrtimer_sleeper, or null for no timeout
2814  ret等于0
2816  如果非queue_me() - Remove the futex_q from its futex_hash_bucket*@q: The futex_q to unqueue* The q->lock_ptr must not be held by the caller则转到:out
2818  ret等于负ETIMEDOUT
2819  如果to且非task则转到:out
2826  如果非signal_pending(当前进程)则转到:retry
2829  ret等于负These should never be seen by user programs. To return one of ERESTART** codes, signal_pending() MUST be set. Note that ptrace can observe these* at syscall exit tracing, but they will never be left for the debugged user* process to see.
2830  如果非abs_time则转到:out
2833  restart等于restart_block
2834  fn等于futex_wait_restart
2835  uaddr等于uaddr
2836  val等于val
2837  time等于abs_time
2838  bitset等于bitset
2839  flags等于flags按位或FLAGS_HAS_TIMEOUT
2841  ret等于负start by calling sys_restart_syscall
2843  out :
2844  如果to
2845  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
2846  destroy_hrtimer_on_stack( & timer)
2848  返回:ret
调用者
名称描述
futex_wait_restart
do_futex