arch/arm/mach-s5pv210/pm.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-s5pv210/pm.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-s5pv210/pm.c- Extension
.c- Size
- 5004 bytes
- Lines
- 219
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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 or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/suspend.hlinux/syscore_ops.hlinux/io.hlinux/soc/samsung/s3c-pm.hasm/cacheflush.hasm/suspend.hcommon.hregs-clock.h
Detected Declarations
struct sleep_savefunction s3c_pm_do_savefunction s3c_pm_do_restore_corefunction s5pv210_read_eint_wakeup_maskfunction s5pv210_cpu_suspendfunction s5pv210_pm_preparefunction s5pv210_suspend_enterfunction s5pv210_suspend_preparefunction s5pv210_suspend_finishfunction s5pv210_pm_resumefunction s5pv210_pm_init
Annotated Snippet
struct sleep_save {
void __iomem *reg;
unsigned long val;
};
#define SAVE_ITEM(x) \
{ .reg = (x) }
/**
* s3c_pm_do_save() - save a set of registers for restoration on resume.
* @ptr: Pointer to an array of registers.
* @count: Size of the ptr array.
*
* Run through the list of registers given, saving their contents in the
* array for later restoration when we wakeup.
*/
static void s3c_pm_do_save(struct sleep_save *ptr, int count)
{
for (; count > 0; count--, ptr++) {
ptr->val = readl_relaxed(ptr->reg);
S3C_PMDBG("saved %p value %08lx\n", ptr->reg, ptr->val);
}
}
/**
* s3c_pm_do_restore_core() - restore register values from the save list.
* @ptr: Pointer to an array of registers.
* @count: Size of the ptr array.
*
* Restore the register values saved from s3c_pm_do_save().
*
* WARNING: Do not put any debug in here that may effect memory or use
* peripherals, as things may be changing!
*/
static void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count)
{
for (; count > 0; count--, ptr++)
writel_relaxed(ptr->val, ptr->reg);
}
static struct sleep_save s5pv210_core_save[] = {
/* Clock ETC */
SAVE_ITEM(S5P_MDNIE_SEL),
};
/*
* VIC wake-up support (TODO)
*/
static u32 s5pv210_irqwake_intmask = 0xffffffff;
static u32 s5pv210_read_eint_wakeup_mask(void)
{
return __raw_readl(S5P_EINT_WAKEUP_MASK);
}
/*
* Suspend helpers.
*/
static int s5pv210_cpu_suspend(unsigned long arg)
{
unsigned long tmp;
/* issue the standby signal into the pm unit. Note, we
* issue a write-buffer drain just in case */
tmp = 0;
asm("b 1f\n\t"
".align 5\n\t"
"1:\n\t"
"mcr p15, 0, %0, c7, c10, 5\n\t"
"mcr p15, 0, %0, c7, c10, 4\n\t"
"wfi" : : "r" (tmp));
pr_info("Failed to suspend the system\n");
return 1; /* Aborting suspend */
}
static void s5pv210_pm_prepare(void)
{
unsigned int tmp;
/*
* Set wake-up mask registers
* S5P_EINT_WAKEUP_MASK is set by pinctrl driver in late suspend.
*/
__raw_writel(s5pv210_irqwake_intmask, S5P_WAKEUP_MASK);
/* ensure at least INFORM0 has the resume address */
Annotation
- Immediate include surface: `linux/init.h`, `linux/suspend.h`, `linux/syscore_ops.h`, `linux/io.h`, `linux/soc/samsung/s3c-pm.h`, `asm/cacheflush.h`, `asm/suspend.h`, `common.h`.
- Detected declarations: `struct sleep_save`, `function s3c_pm_do_save`, `function s3c_pm_do_restore_core`, `function s5pv210_read_eint_wakeup_mask`, `function s5pv210_cpu_suspend`, `function s5pv210_pm_prepare`, `function s5pv210_suspend_enter`, `function s5pv210_suspend_prepare`, `function s5pv210_suspend_finish`, `function s5pv210_pm_resume`.
- Atlas domain: Architecture Layer / arch/arm.
- 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.