Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ex_wait_requeue_pi() - Wait on uaddr and take uaddr2*@uaddr: the futex we initially wait on (non-pi)*@flags: futex flags (FLAGS_SHARED, FLAGS_CLOCKRT, etc

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

Type:int

Parameter:

TypeParameterName
unsigned int __user *uaddr
unsigned intflags
unsigned intval
ktime_t *abs_time
unsigned intbitset
unsigned int __user *uaddr2
3300  struct futex_pi_state * pi_state = NULL
3303  key2 = FUTEX_KEY_INIT
3304  q = futex_q_init
3307  If Not IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_FUTEX_PI) Then Return -ENOSYS
3310  If uaddr == uaddr2 Then Return -EINVAL
3313  If Not bitset Then Return -EINVAL
3316  to = ex_setup_timer - set up the sleeping hrtimer
3323  rt_mutex_init_waiter( & rt_waiter)
3325  ret = get_futex_key() - Get parameters which are the keys for a futex*@uaddr: virtual address of the futex*@fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED*@key: address where result is stored
3326  If Value for the false possibility is greater at compile time(ret != 0) Then Go to out
3329  bitset = bitset
3330  rt_waiter = rt_waiter
3331  requeue_pi_key = key2
3337  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
3338  If ret Then Go to out_key2
3345  If match_futex - Check whether two futex keys are equal*@key1: Pointer to key1*@key2: Pointer to key2* Return 1 if two futex_keys are equal, 0 otherwise. Then
3346  queue_unlock(hb)
3347  ret = -EINVAL
3348  Go to out_put_keys
3352  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
3354  spin_lock( & lock)
3355  ret = handle_early_requeue_pi_wakeup() - Detect early wakeup on the initial futex*@hb: the hash_bucket futex_q was original enqueued on*@q: the futex_q woken while waiting to be requeued*@key2: the futex_key of the requeue target futex*@timeout: the timeout
3356  spin_unlock( & lock)
3357  If ret Then Go to out_put_keys
3370  If Not rt_waiter Then
3375  If pi_state && owner != current process Then
3389  Else
3397  WARN_ON(!pi_state)
3398  pi_mutex = The PI object:
3399  ret = _mutex_wait_proxy_lock() - Wait for lock acquisition*@lock: the rt_mutex we were woken on*@to: the timeout, null if none
3401  spin_lock(lock_ptr)
3402  If ret && Not _mutex_cleanup_proxy_lock() - Cleanup failed lock acquisition*@lock: the rt_mutex we were woken on*@waiter: the pre-initialized rt_mutex_waiter* Attempt to clean up after a failed __rt_mutex_start_proxy_lock() or* rt_mutex_wait_proxy_lock() Then ret = 0
3405  debug_rt_mutex_free_waiter( & rt_waiter)
3410  res = xup_owner() - Post lock pi_state and corner case management*@uaddr: user address of the futex*@q: futex_q (contains pi_state and access to the rt_mutex)*@locked: if the attempt to take the rt_mutex succeeded (1) or not (0)* After attempting to lock an
3415  If res Then ret = If res < 0 Then res Else 0
3424  pi_state = pi_state
3429  PI futexes can not be requeued and must remove themself from the* hash bucket. The hash bucket lock (i.e. lock_ptr) is held on entry* and dropped here.
3432  If pi_state Then
3433  rt_mutex_futex_unlock( & The PI object:)
3434  Drops a reference to the pi_state object and frees or caches it* when the last reference is gone.
3437  If ret == -EINTR Then
3445  ret = -EWOULDBLOCK
3448  out_put_keys :
3449  put_futex_key( & key)
3450  out_key2 :
3451  put_futex_key( & key2)
3453  out :
3454  If to Then
3455  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
3456  destroy_hrtimer_on_stack( & timer)
3458  Return ret
Caller
NameDescribe
do_futex