函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型: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)

返回类型:int

参数:

类型参数名称
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  如果非IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_FUTEX_PI)则返回:负ENOSYS
3310  如果uaddr恒等于uaddr2则返回:负EINVAL
3313  如果非bitset则返回:负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  如果此条件成立可能性小(为编译器优化)(ret != 0)则转到: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  如果ret则转到:out_key2
3345  如果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.
3346  queue_unlock(hb)
3347  ret等于负EINVAL
3348  转到: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  加自旋锁
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  自旋锁解锁
3357  如果ret则转到:out_put_keys
3370  如果非rt_waiter
3375  如果pi_stateowner不等于当前进程
3376  加自旋锁
3378  如果retrt_mutex_owner( & The PI object:)恒等于当前进程
3379  pi_state等于pi_state
3389  否则
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  加自旋锁
3402  如果ret且非_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()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  如果resret等于如果res小于0则res否则0
3423  如果retrt_mutex_owner( & The PI object:)恒等于当前进程
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  如果pi_state
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  如果ret恒等于负EINTR
3445  ret等于负EWOULDBLOCK
3448  out_put_keys :
3449  put_futex_key( & key)
3450  out_key2 :
3451  put_futex_key( & key2)
3453  out :
3454  如果to
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  返回:ret
调用者
名称描述
do_futex