arch/powerpc/platforms/pseries/suspend.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pseries/suspend.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/pseries/suspend.c- Extension
.c- Size
- 4101 bytes
- Lines
- 192
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cpu.hlinux/delay.hlinux/suspend.hlinux/stat.hlinux/sysfs.hasm/firmware.hasm/hvcall.hasm/machdep.hasm/mmu.hasm/rtas.hasm/topology.hpseries.h
Detected Declarations
function pseries_suspend_beginfunction pseries_suspend_enterfunction store_hibernatefunction show_hibernatefunction pseries_suspend_sysfs_registerfunction pseries_suspend_init
Annotated Snippet
static const struct bus_type suspend_subsys = {
.name = "power",
.dev_name = "power",
};
static const struct platform_suspend_ops pseries_suspend_ops = {
.valid = suspend_valid_only_mem,
.enter = pseries_suspend_enter,
};
/**
* pseries_suspend_sysfs_register - Register with sysfs
*
* Return value:
* 0 on success / other on failure
**/
static int pseries_suspend_sysfs_register(struct device *dev)
{
struct device *dev_root;
int rc;
if ((rc = subsys_system_register(&suspend_subsys, NULL)))
return rc;
dev->id = 0;
dev->bus = &suspend_subsys;
dev_root = bus_get_dev_root(&suspend_subsys);
if (dev_root) {
rc = device_create_file(dev_root, &dev_attr_hibernate);
put_device(dev_root);
if (rc)
goto subsys_unregister;
}
return 0;
subsys_unregister:
bus_unregister(&suspend_subsys);
return rc;
}
/**
* pseries_suspend_init - initcall for pSeries suspend
*
* Return value:
* 0 on success / other on failure
**/
static int __init pseries_suspend_init(void)
{
int rc;
if (!firmware_has_feature(FW_FEATURE_LPAR))
return 0;
if ((rc = pseries_suspend_sysfs_register(&suspend_dev)))
return rc;
suspend_set_ops(&pseries_suspend_ops);
return 0;
}
machine_device_initcall(pseries, pseries_suspend_init);
Annotation
- Immediate include surface: `linux/cpu.h`, `linux/delay.h`, `linux/suspend.h`, `linux/stat.h`, `linux/sysfs.h`, `asm/firmware.h`, `asm/hvcall.h`, `asm/machdep.h`.
- Detected declarations: `function pseries_suspend_begin`, `function pseries_suspend_enter`, `function store_hibernate`, `function show_hibernate`, `function pseries_suspend_sysfs_register`, `function pseries_suspend_init`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: pattern 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.