Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\futex.c Create Date:2022-07-28 10:54:33
Last Modify:2020-03-17 15:28:32 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:futex_wait

Proto:static int futex_wait(unsigned int __user *uaddr, unsigned int flags, unsigned int val, ktime_t *abs_time, unsigned int bitset)

Type:int

Parameter:

TypeParameterName
unsigned int __user *uaddr
unsigned intflags
unsigned intval
ktime_t *abs_time
unsigned intbitset
2792  q = futex_q_init
2795  If Not bitset Then Return -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  If ret Then Go to 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  If Not 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 Then Go to out
2818  ret = -ETIMEDOUT
2819  If to && Not task Then Go to out
2826  If Not signal_pending(current process) Then Go to 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  If Not abs_time Then Go to 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  If to Then
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  Return ret
Caller
NameDescribe
futex_wait_restart
do_futex