Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/linux
File: futex.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
[0] Fix | Delete
#ifndef _LINUX_FUTEX_H
[1] Fix | Delete
#define _LINUX_FUTEX_H
[2] Fix | Delete
[3] Fix | Delete
[4] Fix | Delete
#include <linux/types.h>
[5] Fix | Delete
[6] Fix | Delete
/* Second argument to futex syscall */
[7] Fix | Delete
[8] Fix | Delete
[9] Fix | Delete
#define FUTEX_WAIT 0
[10] Fix | Delete
#define FUTEX_WAKE 1
[11] Fix | Delete
#define FUTEX_FD 2
[12] Fix | Delete
#define FUTEX_REQUEUE 3
[13] Fix | Delete
#define FUTEX_CMP_REQUEUE 4
[14] Fix | Delete
#define FUTEX_WAKE_OP 5
[15] Fix | Delete
#define FUTEX_LOCK_PI 6
[16] Fix | Delete
#define FUTEX_UNLOCK_PI 7
[17] Fix | Delete
#define FUTEX_TRYLOCK_PI 8
[18] Fix | Delete
#define FUTEX_WAIT_BITSET 9
[19] Fix | Delete
#define FUTEX_WAKE_BITSET 10
[20] Fix | Delete
#define FUTEX_WAIT_REQUEUE_PI 11
[21] Fix | Delete
#define FUTEX_CMP_REQUEUE_PI 12
[22] Fix | Delete
[23] Fix | Delete
#define FUTEX_PRIVATE_FLAG 128
[24] Fix | Delete
#define FUTEX_CLOCK_REALTIME 256
[25] Fix | Delete
#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
[26] Fix | Delete
[27] Fix | Delete
#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
[28] Fix | Delete
#define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
[29] Fix | Delete
#define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
[30] Fix | Delete
#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
[31] Fix | Delete
#define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
[32] Fix | Delete
#define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
[33] Fix | Delete
#define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
[34] Fix | Delete
#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
[35] Fix | Delete
#define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)
[36] Fix | Delete
#define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)
[37] Fix | Delete
#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \
[38] Fix | Delete
FUTEX_PRIVATE_FLAG)
[39] Fix | Delete
#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \
[40] Fix | Delete
FUTEX_PRIVATE_FLAG)
[41] Fix | Delete
[42] Fix | Delete
/*
[43] Fix | Delete
* Support for robust futexes: the kernel cleans up held futexes at
[44] Fix | Delete
* thread exit time.
[45] Fix | Delete
*/
[46] Fix | Delete
[47] Fix | Delete
/*
[48] Fix | Delete
* Per-lock list entry - embedded in user-space locks, somewhere close
[49] Fix | Delete
* to the futex field. (Note: user-space uses a double-linked list to
[50] Fix | Delete
* achieve O(1) list add and remove, but the kernel only needs to know
[51] Fix | Delete
* about the forward link)
[52] Fix | Delete
*
[53] Fix | Delete
* NOTE: this structure is part of the syscall ABI, and must not be
[54] Fix | Delete
* changed.
[55] Fix | Delete
*/
[56] Fix | Delete
struct robust_list {
[57] Fix | Delete
struct robust_list *next;
[58] Fix | Delete
};
[59] Fix | Delete
[60] Fix | Delete
/*
[61] Fix | Delete
* Per-thread list head:
[62] Fix | Delete
*
[63] Fix | Delete
* NOTE: this structure is part of the syscall ABI, and must only be
[64] Fix | Delete
* changed if the change is first communicated with the glibc folks.
[65] Fix | Delete
* (When an incompatible change is done, we'll increase the structure
[66] Fix | Delete
* size, which glibc will detect)
[67] Fix | Delete
*/
[68] Fix | Delete
struct robust_list_head {
[69] Fix | Delete
/*
[70] Fix | Delete
* The head of the list. Points back to itself if empty:
[71] Fix | Delete
*/
[72] Fix | Delete
struct robust_list list;
[73] Fix | Delete
[74] Fix | Delete
/*
[75] Fix | Delete
* This relative offset is set by user-space, it gives the kernel
[76] Fix | Delete
* the relative position of the futex field to examine. This way
[77] Fix | Delete
* we keep userspace flexible, to freely shape its data-structure,
[78] Fix | Delete
* without hardcoding any particular offset into the kernel:
[79] Fix | Delete
*/
[80] Fix | Delete
long futex_offset;
[81] Fix | Delete
[82] Fix | Delete
/*
[83] Fix | Delete
* The death of the thread may race with userspace setting
[84] Fix | Delete
* up a lock's links. So to handle this race, userspace first
[85] Fix | Delete
* sets this field to the address of the to-be-taken lock,
[86] Fix | Delete
* then does the lock acquire, and then adds itself to the
[87] Fix | Delete
* list, and then clears this field. Hence the kernel will
[88] Fix | Delete
* always have full knowledge of all locks that the thread
[89] Fix | Delete
* _might_ have taken. We check the owner TID in any case,
[90] Fix | Delete
* so only truly owned locks will be handled.
[91] Fix | Delete
*/
[92] Fix | Delete
struct robust_list *list_op_pending;
[93] Fix | Delete
};
[94] Fix | Delete
[95] Fix | Delete
/*
[96] Fix | Delete
* Are there any waiters for this robust futex:
[97] Fix | Delete
*/
[98] Fix | Delete
#define FUTEX_WAITERS 0x80000000
[99] Fix | Delete
[100] Fix | Delete
/*
[101] Fix | Delete
* The kernel signals via this bit that a thread holding a futex
[102] Fix | Delete
* has exited without unlocking the futex. The kernel also does
[103] Fix | Delete
* a FUTEX_WAKE on such futexes, after setting the bit, to wake
[104] Fix | Delete
* up any possible waiters:
[105] Fix | Delete
*/
[106] Fix | Delete
#define FUTEX_OWNER_DIED 0x40000000
[107] Fix | Delete
[108] Fix | Delete
/*
[109] Fix | Delete
* The rest of the robust-futex field is for the TID:
[110] Fix | Delete
*/
[111] Fix | Delete
#define FUTEX_TID_MASK 0x3fffffff
[112] Fix | Delete
[113] Fix | Delete
/*
[114] Fix | Delete
* This limit protects against a deliberately circular list.
[115] Fix | Delete
* (Not worth introducing an rlimit for it)
[116] Fix | Delete
*/
[117] Fix | Delete
#define ROBUST_LIST_LIMIT 2048
[118] Fix | Delete
[119] Fix | Delete
/*
[120] Fix | Delete
* bitset with all bits set for the FUTEX_xxx_BITSET OPs to request a
[121] Fix | Delete
* match of any bit.
[122] Fix | Delete
*/
[123] Fix | Delete
#define FUTEX_BITSET_MATCH_ANY 0xffffffff
[124] Fix | Delete
[125] Fix | Delete
[126] Fix | Delete
#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
[127] Fix | Delete
#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
[128] Fix | Delete
#define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */
[129] Fix | Delete
#define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */
[130] Fix | Delete
#define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */
[131] Fix | Delete
[132] Fix | Delete
#define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */
[133] Fix | Delete
[134] Fix | Delete
#define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */
[135] Fix | Delete
#define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */
[136] Fix | Delete
#define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */
[137] Fix | Delete
#define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */
[138] Fix | Delete
#define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */
[139] Fix | Delete
#define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */
[140] Fix | Delete
[141] Fix | Delete
/* FUTEX_WAKE_OP will perform atomically
[142] Fix | Delete
int oldval = *(int *)UADDR2;
[143] Fix | Delete
*(int *)UADDR2 = oldval OP OPARG;
[144] Fix | Delete
if (oldval CMP CMPARG)
[145] Fix | Delete
wake UADDR2; */
[146] Fix | Delete
[147] Fix | Delete
#define FUTEX_OP(op, oparg, cmp, cmparg) \
[148] Fix | Delete
(((op & 0xf) << 28) | ((cmp & 0xf) << 24) \
[149] Fix | Delete
| ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
[150] Fix | Delete
[151] Fix | Delete
#endif /* _LINUX_FUTEX_H */
[152] Fix | Delete
[153] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function