Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:futex_atomic_op_inuser

Proto:static int futex_atomic_op_inuser(unsigned int encoded_op, unsigned int __user *uaddr)

Type:int

Parameter:

TypeParameterName
unsigned intencoded_op
unsigned int __user *uaddr
1706  op = (encoded_op & 0x70000000) >> 28
1707  cmp = (encoded_op & 0x0f000000) >> 24
1708  oparg = sign_extend32 - sign extend a 32-bit value using specified bit as sign-bit*@value: value to sign extend*@index: 0 based bit index (0<=index<32) to sign bit* This is safe to use for 16- and 8-bit types as well.
1709  cmparg = sign_extend32 - sign extend a 32-bit value using specified bit as sign-bit*@value: value to sign extend*@index: 0 based bit index (0<=index<32) to sign bit* This is safe to use for 16- and 8-bit types as well.
1712  If encoded_op & Use (1 << OPARG) instead of OPARG. << 28 Then
1713  If oparg < 0 || oparg > 31 Then
1719  pr_info_ratelimited("futex_wake_op: %s tries to shift op by %d; fix this program\n", get_task_comm(comm, current process), oparg)
1721  oparg &= 31
1723  oparg = 1 << oparg
1726  If Not access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(uaddr, sizeof(u32)) Then Return -EFAULT
1729  ret = arch_futex_atomic_op_inuser(op, oparg, & oldval, uaddr)
1730  If ret Then Return ret
1734  Case cmp == (oldval == CMPARG) wake
1735  Return oldval == cmparg
1736  Case cmp == (oldval != CMPARG) wake
1737  Return oldval != cmparg
1738  Case cmp == (oldval < CMPARG) wake
1739  Return oldval < cmparg
1740  Case cmp == (oldval >= CMPARG) wake
1741  Return oldval >= cmparg
1742  Case cmp == (oldval <= CMPARG) wake
1743  Return oldval <= cmparg
1744  Case cmp == (oldval > CMPARG) wake
1745  Return oldval > cmparg
1746  Default
1747  Return -ENOSYS
Caller
NameDescribe
futex_wake_opWake up all waiters hashed on the physical page that is mapped* to this virtual address: