tools/testing/selftests/rseq/rseq.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/rseq/rseq.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/rseq/rseq.h- Extension
.h- Size
- 11143 bytes
- Lines
- 399
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
assert.hstdint.hstdbool.hpthread.hsignal.hsched.herrno.hstdio.hstdlib.hstddef.hrseq-abi.hcompiler.hrseq-thread-pointer.hrseq-x86.hrseq-arm.hrseq-arm64.hrseq-ppc.hrseq-mips.hrseq-s390.hrseq-riscv.hrseq-or1k.h
Detected Declarations
enum rseq_moenum rseq_percpu_modefunction rseq_register_current_threadfunction rseq_current_cpu_rawfunction rseq_current_cpu_rawfunction rseq_current_cpufunction rseq_node_id_availablefunction rseq_current_node_idfunction rseq_mm_cid_availablefunction rseq_current_mm_cidfunction rseq_clear_rseq_csfunction rseq_prepare_unloadfunction __attribute__function __attribute__function __attribute__function __attribute__function __attribute__function __attribute__function __attribute__
Annotated Snippet
switch (percpu_mode) {
case RSEQ_PERCPU_CPU_ID:
return rseq_cmpeqv_trystorev_storev_relaxed_cpu_id(v, expect, v2, newv2, newv, cpu);
case RSEQ_PERCPU_MM_CID:
return rseq_cmpeqv_trystorev_storev_relaxed_mm_cid(v, expect, v2, newv2, newv, cpu);
}
return -1;
case RSEQ_MO_RELEASE:
switch (percpu_mode) {
case RSEQ_PERCPU_CPU_ID:
return rseq_cmpeqv_trystorev_storev_release_cpu_id(v, expect, v2, newv2, newv, cpu);
case RSEQ_PERCPU_MM_CID:
return rseq_cmpeqv_trystorev_storev_release_mm_cid(v, expect, v2, newv2, newv, cpu);
}
return -1;
default:
return -1;
}
}
static inline __attribute__((always_inline))
int rseq_cmpeqv_cmpeqv_storev(enum rseq_mo rseq_mo, enum rseq_percpu_mode percpu_mode,
intptr_t *v, intptr_t expect,
intptr_t *v2, intptr_t expect2,
intptr_t newv, int cpu)
{
if (rseq_mo != RSEQ_MO_RELAXED)
return -1;
switch (percpu_mode) {
case RSEQ_PERCPU_CPU_ID:
return rseq_cmpeqv_cmpeqv_storev_relaxed_cpu_id(v, expect, v2, expect2, newv, cpu);
case RSEQ_PERCPU_MM_CID:
return rseq_cmpeqv_cmpeqv_storev_relaxed_mm_cid(v, expect, v2, expect2, newv, cpu);
}
return -1;
}
static inline __attribute__((always_inline))
int rseq_cmpeqv_trymemcpy_storev(enum rseq_mo rseq_mo, enum rseq_percpu_mode percpu_mode,
intptr_t *v, intptr_t expect,
void *dst, void *src, size_t len,
intptr_t newv, int cpu)
{
switch (rseq_mo) {
case RSEQ_MO_RELAXED:
switch (percpu_mode) {
case RSEQ_PERCPU_CPU_ID:
return rseq_cmpeqv_trymemcpy_storev_relaxed_cpu_id(v, expect, dst, src, len, newv, cpu);
case RSEQ_PERCPU_MM_CID:
return rseq_cmpeqv_trymemcpy_storev_relaxed_mm_cid(v, expect, dst, src, len, newv, cpu);
}
return -1;
case RSEQ_MO_RELEASE:
switch (percpu_mode) {
case RSEQ_PERCPU_CPU_ID:
return rseq_cmpeqv_trymemcpy_storev_release_cpu_id(v, expect, dst, src, len, newv, cpu);
case RSEQ_PERCPU_MM_CID:
return rseq_cmpeqv_trymemcpy_storev_release_mm_cid(v, expect, dst, src, len, newv, cpu);
}
return -1;
default:
return -1;
}
}
#endif /* RSEQ_H_ */
Annotation
- Immediate include surface: `assert.h`, `stdint.h`, `stdbool.h`, `pthread.h`, `signal.h`, `sched.h`, `errno.h`, `stdio.h`.
- Detected declarations: `enum rseq_mo`, `enum rseq_percpu_mode`, `function rseq_register_current_thread`, `function rseq_current_cpu_raw`, `function rseq_current_cpu_raw`, `function rseq_current_cpu`, `function rseq_node_id_available`, `function rseq_current_node_id`, `function rseq_mm_cid_available`, `function rseq_current_mm_cid`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.