tools/testing/selftests/powerpc/papr_sysparm/papr_sysparm.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/papr_sysparm/papr_sysparm.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/powerpc/papr_sysparm/papr_sysparm.c- Extension
.c- Size
- 4265 bytes
- Lines
- 197
- 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
errno.hfcntl.hstdlib.hsys/ioctl.hunistd.hasm/papr-sysparm.hutils.h
Detected Declarations
struct sysparm_testfunction open_closefunction get_splparfunction get_bad_parameterfunction check_efault_commonfunction check_efault_getfunction check_efault_setfunction set_hmc0function set_with_ro_fdfunction main
Annotated Snippet
struct sysparm_test {
int (*function)(void);
const char *description;
};
static const struct sysparm_test sysparm_tests[] = {
{
.function = open_close,
.description = "open and close " DEVPATH " without issuing commands",
},
{
.function = get_splpar,
.description = "retrieve SPLPAR characteristics",
},
{
.function = get_bad_parameter,
.description = "verify EOPNOTSUPP for known-bad parameter",
},
{
.function = check_efault_get,
.description = "PAPR_SYSPARM_IOC_GET returns EFAULT on bad address",
},
{
.function = check_efault_set,
.description = "PAPR_SYSPARM_IOC_SET returns EFAULT on bad address",
},
{
.function = set_hmc0,
.description = "ensure EPERM on attempt to update HMC0",
},
{
.function = set_with_ro_fd,
.description = "PAPR_IOC_SYSPARM_SET returns EACCES on read-only fd",
},
};
int main(void)
{
size_t fails = 0;
for (size_t i = 0; i < ARRAY_SIZE(sysparm_tests); ++i) {
const struct sysparm_test *t = &sysparm_tests[i];
if (test_harness(t->function, t->description))
++fails;
}
return fails == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
Annotation
- Immediate include surface: `errno.h`, `fcntl.h`, `stdlib.h`, `sys/ioctl.h`, `unistd.h`, `asm/papr-sysparm.h`, `utils.h`.
- Detected declarations: `struct sysparm_test`, `function open_close`, `function get_splpar`, `function get_bad_parameter`, `function check_efault_common`, `function check_efault_get`, `function check_efault_set`, `function set_hmc0`, `function set_with_ro_fd`, `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.