Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/linux
File: rseq.h
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
[0] Fix | Delete
#ifndef _LINUX_RSEQ_H
[1] Fix | Delete
#define _LINUX_RSEQ_H
[2] Fix | Delete
[3] Fix | Delete
/*
[4] Fix | Delete
* linux/rseq.h
[5] Fix | Delete
*
[6] Fix | Delete
* Restartable sequences system call API
[7] Fix | Delete
*
[8] Fix | Delete
* Copyright (c) 2015-2018 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
[9] Fix | Delete
*/
[10] Fix | Delete
[11] Fix | Delete
#include <linux/types.h>
[12] Fix | Delete
#include <asm/byteorder.h>
[13] Fix | Delete
[14] Fix | Delete
enum rseq_cpu_id_state {
[15] Fix | Delete
RSEQ_CPU_ID_UNINITIALIZED = -1,
[16] Fix | Delete
RSEQ_CPU_ID_REGISTRATION_FAILED = -2,
[17] Fix | Delete
};
[18] Fix | Delete
[19] Fix | Delete
enum rseq_flags {
[20] Fix | Delete
RSEQ_FLAG_UNREGISTER = (1 << 0),
[21] Fix | Delete
};
[22] Fix | Delete
[23] Fix | Delete
enum rseq_cs_flags_bit {
[24] Fix | Delete
RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT = 0,
[25] Fix | Delete
RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT = 1,
[26] Fix | Delete
RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT = 2,
[27] Fix | Delete
};
[28] Fix | Delete
[29] Fix | Delete
enum rseq_cs_flags {
[30] Fix | Delete
RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT =
[31] Fix | Delete
(1U << RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT),
[32] Fix | Delete
RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL =
[33] Fix | Delete
(1U << RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT),
[34] Fix | Delete
RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE =
[35] Fix | Delete
(1U << RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT),
[36] Fix | Delete
};
[37] Fix | Delete
[38] Fix | Delete
/*
[39] Fix | Delete
* struct rseq_cs is aligned on 4 * 8 bytes to ensure it is always
[40] Fix | Delete
* contained within a single cache-line. It is usually declared as
[41] Fix | Delete
* link-time constant data.
[42] Fix | Delete
*/
[43] Fix | Delete
struct rseq_cs {
[44] Fix | Delete
/* Version of this structure. */
[45] Fix | Delete
__u32 version;
[46] Fix | Delete
/* enum rseq_cs_flags */
[47] Fix | Delete
__u32 flags;
[48] Fix | Delete
__u64 start_ip;
[49] Fix | Delete
/* Offset from start_ip. */
[50] Fix | Delete
__u64 post_commit_offset;
[51] Fix | Delete
__u64 abort_ip;
[52] Fix | Delete
} __attribute__((aligned(4 * sizeof(__u64))));
[53] Fix | Delete
[54] Fix | Delete
/*
[55] Fix | Delete
* struct rseq is aligned on 4 * 8 bytes to ensure it is always
[56] Fix | Delete
* contained within a single cache-line.
[57] Fix | Delete
*
[58] Fix | Delete
* A single struct rseq per thread is allowed.
[59] Fix | Delete
*/
[60] Fix | Delete
struct rseq {
[61] Fix | Delete
/*
[62] Fix | Delete
* Restartable sequences cpu_id_start field. Updated by the
[63] Fix | Delete
* kernel. Read by user-space with single-copy atomicity
[64] Fix | Delete
* semantics. This field should only be read by the thread which
[65] Fix | Delete
* registered this data structure. Aligned on 32-bit. Always
[66] Fix | Delete
* contains a value in the range of possible CPUs, although the
[67] Fix | Delete
* value may not be the actual current CPU (e.g. if rseq is not
[68] Fix | Delete
* initialized). This CPU number value should always be compared
[69] Fix | Delete
* against the value of the cpu_id field before performing a rseq
[70] Fix | Delete
* commit or returning a value read from a data structure indexed
[71] Fix | Delete
* using the cpu_id_start value.
[72] Fix | Delete
*/
[73] Fix | Delete
__u32 cpu_id_start;
[74] Fix | Delete
/*
[75] Fix | Delete
* Restartable sequences cpu_id field. Updated by the kernel.
[76] Fix | Delete
* Read by user-space with single-copy atomicity semantics. This
[77] Fix | Delete
* field should only be read by the thread which registered this
[78] Fix | Delete
* data structure. Aligned on 32-bit. Values
[79] Fix | Delete
* RSEQ_CPU_ID_UNINITIALIZED and RSEQ_CPU_ID_REGISTRATION_FAILED
[80] Fix | Delete
* have a special semantic: the former means "rseq uninitialized",
[81] Fix | Delete
* and latter means "rseq initialization failed". This value is
[82] Fix | Delete
* meant to be read within rseq critical sections and compared
[83] Fix | Delete
* with the cpu_id_start value previously read, before performing
[84] Fix | Delete
* the commit instruction, or read and compared with the
[85] Fix | Delete
* cpu_id_start value before returning a value loaded from a data
[86] Fix | Delete
* structure indexed using the cpu_id_start value.
[87] Fix | Delete
*/
[88] Fix | Delete
__u32 cpu_id;
[89] Fix | Delete
/*
[90] Fix | Delete
* Restartable sequences rseq_cs field.
[91] Fix | Delete
*
[92] Fix | Delete
* Contains NULL when no critical section is active for the current
[93] Fix | Delete
* thread, or holds a pointer to the currently active struct rseq_cs.
[94] Fix | Delete
*
[95] Fix | Delete
* Updated by user-space, which sets the address of the currently
[96] Fix | Delete
* active rseq_cs at the beginning of assembly instruction sequence
[97] Fix | Delete
* block, and set to NULL by the kernel when it restarts an assembly
[98] Fix | Delete
* instruction sequence block, as well as when the kernel detects that
[99] Fix | Delete
* it is preempting or delivering a signal outside of the range
[100] Fix | Delete
* targeted by the rseq_cs. Also needs to be set to NULL by user-space
[101] Fix | Delete
* before reclaiming memory that contains the targeted struct rseq_cs.
[102] Fix | Delete
*
[103] Fix | Delete
* Read and set by the kernel. Set by user-space with single-copy
[104] Fix | Delete
* atomicity semantics. This field should only be updated by the
[105] Fix | Delete
* thread which registered this data structure. Aligned on 64-bit.
[106] Fix | Delete
*/
[107] Fix | Delete
union {
[108] Fix | Delete
__u64 ptr64;
[109] Fix | Delete
#ifdef __LP64__
[110] Fix | Delete
__u64 ptr;
[111] Fix | Delete
#else
[112] Fix | Delete
struct {
[113] Fix | Delete
#if (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || defined(__BIG_ENDIAN)
[114] Fix | Delete
__u32 padding; /* Initialized to zero. */
[115] Fix | Delete
__u32 ptr32;
[116] Fix | Delete
#else /* LITTLE */
[117] Fix | Delete
__u32 ptr32;
[118] Fix | Delete
__u32 padding; /* Initialized to zero. */
[119] Fix | Delete
#endif /* ENDIAN */
[120] Fix | Delete
} ptr;
[121] Fix | Delete
#endif
[122] Fix | Delete
} rseq_cs;
[123] Fix | Delete
[124] Fix | Delete
/*
[125] Fix | Delete
* Restartable sequences flags field.
[126] Fix | Delete
*
[127] Fix | Delete
* This field should only be updated by the thread which
[128] Fix | Delete
* registered this data structure. Read by the kernel.
[129] Fix | Delete
* Mainly used for single-stepping through rseq critical sections
[130] Fix | Delete
* with debuggers.
[131] Fix | Delete
*
[132] Fix | Delete
* - RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT
[133] Fix | Delete
* Inhibit instruction sequence block restart on preemption
[134] Fix | Delete
* for this thread.
[135] Fix | Delete
* - RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL
[136] Fix | Delete
* Inhibit instruction sequence block restart on signal
[137] Fix | Delete
* delivery for this thread.
[138] Fix | Delete
* - RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE
[139] Fix | Delete
* Inhibit instruction sequence block restart on migration for
[140] Fix | Delete
* this thread.
[141] Fix | Delete
*/
[142] Fix | Delete
__u32 flags;
[143] Fix | Delete
} __attribute__((aligned(4 * sizeof(__u64))));
[144] Fix | Delete
[145] Fix | Delete
#endif /* _LINUX_RSEQ_H */
[146] Fix | Delete
[147] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function