arch/powerpc/platforms/pseries/papr-sysparm.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pseries/papr-sysparm.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/pseries/papr-sysparm.c- Extension
.c- Size
- 8691 bytes
- Lines
- 353
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/anon_inodes.hlinux/bug.hlinux/file.hlinux/fs.hlinux/init.hlinux/kernel.hlinux/miscdevice.hlinux/printk.hlinux/slab.hlinux/uaccess.hasm/machdep.hasm/papr-sysparm.hasm/rtas-work-area.hasm/rtas.h
Detected Declarations
function papr_sysparm_buf_freefunction papr_sysparm_buf_get_lengthfunction papr_sysparm_buf_set_lengthfunction papr_sysparm_buf_clamp_lengthfunction papr_sysparm_buf_can_submitfunction papr_sysparm_getfunction papr_sysparm_setfunction papr_sysparm_buf_from_userfunction papr_sysparm_buf_to_userfunction papr_sysparm_ioctl_getfunction papr_sysparm_ioctl_setfunction papr_sysparm_ioctlfunction papr_sysparm_init
Annotated Snippet
static const struct file_operations papr_sysparm_ops = {
.unlocked_ioctl = papr_sysparm_ioctl,
};
static struct miscdevice papr_sysparm_dev = {
.minor = MISC_DYNAMIC_MINOR,
.name = "papr-sysparm",
.fops = &papr_sysparm_ops,
};
static __init int papr_sysparm_init(void)
{
if (!rtas_function_implemented(RTAS_FN_IBM_GET_SYSTEM_PARAMETER))
return -ENODEV;
return misc_register(&papr_sysparm_dev);
}
machine_device_initcall(pseries, papr_sysparm_init);
Annotation
- Immediate include surface: `linux/anon_inodes.h`, `linux/bug.h`, `linux/file.h`, `linux/fs.h`, `linux/init.h`, `linux/kernel.h`, `linux/miscdevice.h`, `linux/printk.h`.
- Detected declarations: `function papr_sysparm_buf_free`, `function papr_sysparm_buf_get_length`, `function papr_sysparm_buf_set_length`, `function papr_sysparm_buf_clamp_length`, `function papr_sysparm_buf_can_submit`, `function papr_sysparm_get`, `function papr_sysparm_set`, `function papr_sysparm_buf_from_user`, `function papr_sysparm_buf_to_user`, `function papr_sysparm_ioctl_get`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.