arch/arm/mach-s3c/pm.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-s3c/pm.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-s3c/pm.c- Extension
.c- Size
- 4175 bytes
- Lines
- 197
- 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/errno.hlinux/delay.hlinux/of.hlinux/serial_s3c.hlinux/io.hasm/cacheflush.hasm/suspend.hmap.hregs-clock.hregs-irq.hirqs.hasm/irq.hcpu.hpm.hpm-core.h
Detected Declarations
function s3c_irqext_wakefunction s3c_pm_enterfunction wakeupfunction s3c_pm_preparefunction s3c_pm_finishfunction s3c_pm_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
//
// Copyright 2008 Openmoko, Inc.
// Copyright 2004-2008 Simtec Electronics
// Ben Dooks <ben@simtec.co.uk>
// http://armlinux.simtec.co.uk/
//
// S3C common power management (suspend to ram) support.
#include <linux/init.h>
#include <linux/suspend.h>
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/of.h>
#include <linux/serial_s3c.h>
#include <linux/io.h>
#include <asm/cacheflush.h>
#include <asm/suspend.h>
#include "map.h"
#include "regs-clock.h"
#include "regs-irq.h"
#include "irqs.h"
#include <asm/irq.h>
#include "cpu.h"
#include "pm.h"
#include "pm-core.h"
/* for external use */
unsigned long s3c_pm_flags;
/* The IRQ ext-int code goes here, it is too small to currently bother
* with its own file. */
unsigned long s3c_irqwake_intmask = 0xffffffffL;
unsigned long s3c_irqwake_eintmask = 0xffffffffL;
int s3c_irqext_wake(struct irq_data *data, unsigned int state)
{
unsigned long bit = 1L << IRQ_EINT_BIT(data->irq);
if (!(s3c_irqwake_eintallow & bit))
return -ENOENT;
printk(KERN_INFO "wake %s for irq %d\n",
state ? "enabled" : "disabled", data->irq);
if (!state)
s3c_irqwake_eintmask |= bit;
else
s3c_irqwake_eintmask &= ~bit;
return 0;
}
void (*pm_cpu_prep)(void);
int (*pm_cpu_sleep)(unsigned long);
#define any_allowed(mask, allow) (((mask) & (allow)) != (allow))
/* s3c_pm_enter
*
* central control for sleep/resume process
*/
static int s3c_pm_enter(suspend_state_t state)
{
int ret;
/* ensure the debug is initialised (if enabled) */
s3c_pm_debug_init_uart();
S3C_PMDBG("%s(%d)\n", __func__, state);
if (pm_cpu_prep == NULL || pm_cpu_sleep == NULL) {
printk(KERN_ERR "%s: error: no cpu sleep function\n", __func__);
return -EINVAL;
}
/* check if we have anything to wake-up with... bad things seem
* to happen if you suspend with no wakeup (system will often
* require a full power-cycle)
*/
if (!of_have_populated_dt() &&
!any_allowed(s3c_irqwake_intmask, s3c_irqwake_intallow) &&
!any_allowed(s3c_irqwake_eintmask, s3c_irqwake_eintallow)) {
Annotation
- Immediate include surface: `linux/init.h`, `linux/suspend.h`, `linux/errno.h`, `linux/delay.h`, `linux/of.h`, `linux/serial_s3c.h`, `linux/io.h`, `asm/cacheflush.h`.
- Detected declarations: `function s3c_irqext_wake`, `function s3c_pm_enter`, `function wakeup`, `function s3c_pm_prepare`, `function s3c_pm_finish`, `function s3c_pm_init`.
- 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.