arch/sh/kernel/idle.c
Source file repositories/reference/linux-study-clean/arch/sh/kernel/idle.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sh/kernel/idle.c- Extension
.c- Size
- 1050 bytes
- Lines
- 61
- Domain
- Architecture Layer
- Bucket
- arch/sh
- 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.
Dependency Surface
linux/cpu.hlinux/module.hlinux/init.hlinux/mm.hlinux/pm.hlinux/tick.hlinux/preempt.hlinux/thread_info.hlinux/irqflags.hlinux/smp.hlinux/atomic.hasm/processor.hasm/smp.hasm/bl_bit.h
Detected Declarations
function default_idlefunction arch_cpu_idle_deadfunction arch_cpu_idlefunction select_idle_routinefunction stop_this_cpu
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* The idle loop for all SuperH platforms.
*
* Copyright (C) 2002 - 2009 Paul Mundt
*/
#include <linux/cpu.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/pm.h>
#include <linux/tick.h>
#include <linux/preempt.h>
#include <linux/thread_info.h>
#include <linux/irqflags.h>
#include <linux/smp.h>
#include <linux/atomic.h>
#include <asm/processor.h>
#include <asm/smp.h>
#include <asm/bl_bit.h>
static void (*sh_idle)(void);
void default_idle(void)
{
set_bl_bit();
raw_local_irq_enable();
/* Isn't this racy ? */
cpu_sleep();
raw_local_irq_disable();
clear_bl_bit();
}
void __noreturn arch_cpu_idle_dead(void)
{
play_dead();
}
void arch_cpu_idle(void)
{
sh_idle();
}
void __init select_idle_routine(void)
{
/*
* If a platform has set its own idle routine, leave it alone.
*/
if (!sh_idle)
sh_idle = default_idle;
}
void stop_this_cpu(void *unused)
{
local_irq_disable();
set_cpu_online(smp_processor_id(), false);
for (;;)
cpu_sleep();
}
Annotation
- Immediate include surface: `linux/cpu.h`, `linux/module.h`, `linux/init.h`, `linux/mm.h`, `linux/pm.h`, `linux/tick.h`, `linux/preempt.h`, `linux/thread_info.h`.
- Detected declarations: `function default_idle`, `function arch_cpu_idle_dead`, `function arch_cpu_idle`, `function select_idle_routine`, `function stop_this_cpu`.
- Atlas domain: Architecture Layer / arch/sh.
- 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.