Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Lookup the task for the TID provided from user space and attach to* it after doing proper sanity checks.

Proto:static int attach_to_pi_owner(unsigned int __user *uaddr, unsigned int uval, union futex_key *key, struct futex_pi_state **ps, struct task_struct **exiting)

Type:int

Parameter:

TypeParameterName
unsigned int __user *uaddr
unsigned intuval
union futex_key *key
struct futex_pi_state **ps
struct task_struct **exiting
1274  pid = uval & The rest of the robust-futex field is for the TID:
1285  If Not pid Then Return -EAGAIN
1287  p = find_get_task_by_vpid(pid)
1288  If Not p Then Return handle_exit_race(uaddr, uval, NULL)
1291  If Value for the false possibility is greater at compile time( Per task flags (PF_*), defined further below: & I am a kernel thread ) Then
1292  put_task_struct(p)
1293  Return -EPERM
1301  raw_spin_lock_irq( & Protection of the PI data structures: )
1302  If Value for the false possibility is greater at compile time(futex_state != FUTEX_STATE_OK) Then
1308  ret = handle_exit_race(uaddr, uval, p)
1310  raw_spin_unlock_irq( & Protection of the PI data structures: )
1320  If ret == -EBUSY Then exiting = p
1322  Else put_task_struct(p)
1324  Return ret
1333  pi_state = alloc_pi_state()
1339  _mutex_init_proxy_locked - initialize and lock a rt_mutex on behalf of a* proxy owner*@lock: the rt_mutex to be locked*@proxy_owner:the task to set as owner* No locking. Caller has to do serializing itself* Special API call for PI-futex support
1342  key = key
1344  WARN_ON(!list_empty - tests whether a list is empty*@head: the list to test.)
1345  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
1350  owner = p
1351  raw_spin_unlock_irq( & Protection of the PI data structures: )
1353  put_task_struct(p)
1355  ps = pi_state
1357  Return 0
Caller
NameDescribe
lookup_pi_state
futex_lock_pi_atomicex_lock_pi_atomic() - Atomic work required to acquire a pi aware futex*@uaddr: the pi futex user address*@hb: the pi futex hash bucket*@key: the futex key associated with uaddr and hb*@ps: the pi_state pointer where we store the result of the* lookup