tools/testing/selftests/arm64/mte/check_prctl.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/arm64/mte/check_prctl.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/arm64/mte/check_prctl.c- Extension
.c- Size
- 3162 bytes
- Lines
- 133
- 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
stdbool.hstdio.hstring.hsys/auxv.hsys/prctl.hasm/hwcap.hkselftest.h
Detected Declarations
struct mte_modefunction set_tagged_addr_ctrlfunction get_tagged_addr_ctrlfunction check_basic_readfunction set_mode_testfunction main
Annotated Snippet
struct mte_mode {
int mask;
int hwcap2;
int hwcap3;
const char *name;
} mte_modes[] = {
{ PR_MTE_TCF_NONE, 0, 0, "NONE" },
{ PR_MTE_TCF_SYNC, HWCAP2_MTE, 0, "SYNC" },
{ PR_MTE_TCF_ASYNC, HWCAP2_MTE, 0, "ASYNC" },
{ PR_MTE_TCF_SYNC | PR_MTE_TCF_ASYNC, HWCAP2_MTE, 0, "SYNC+ASYNC" },
{ PR_MTE_TCF_SYNC | PR_MTE_STORE_ONLY, HWCAP2_MTE, HWCAP3_MTE_STORE_ONLY, "SYNC+STONLY" },
{ PR_MTE_TCF_ASYNC | PR_MTE_STORE_ONLY, HWCAP2_MTE, HWCAP3_MTE_STORE_ONLY, "ASYNC+STONLY" },
{ PR_MTE_TCF_SYNC | PR_MTE_TCF_ASYNC | PR_MTE_STORE_ONLY, HWCAP2_MTE, HWCAP3_MTE_STORE_ONLY, "SYNC+ASYNC+STONLY" },
};
int main(void)
{
int i;
ksft_print_header();
ksft_set_plan(ARRAY_SIZE(mte_modes));
check_basic_read();
for (i = 0; i < ARRAY_SIZE(mte_modes); i++)
set_mode_test(mte_modes[i].name, mte_modes[i].hwcap2, mte_modes[i].hwcap3,
mte_modes[i].mask);
ksft_print_cnts();
return 0;
}
Annotation
- Immediate include surface: `stdbool.h`, `stdio.h`, `string.h`, `sys/auxv.h`, `sys/prctl.h`, `asm/hwcap.h`, `kselftest.h`.
- Detected declarations: `struct mte_mode`, `function set_tagged_addr_ctrl`, `function get_tagged_addr_ctrl`, `function check_basic_read`, `function set_mode_test`, `function main`.
- 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.