arch/sparc/kernel/reboot.c
Source file repositories/reference/linux-study-clean/arch/sparc/kernel/reboot.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/kernel/reboot.c- Extension
.c- Size
- 1077 bytes
- Lines
- 56
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
Dependency Surface
linux/kernel.hlinux/reboot.hlinux/export.hlinux/pm.hlinux/of.hasm/oplib.hasm/prom.hasm/setup.h
Detected Declarations
function machine_power_offfunction machine_haltfunction machine_restartexport pm_power_off
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/* reboot.c: reboot/shutdown/halt/poweroff handling
*
* Copyright (C) 2008 David S. Miller <davem@davemloft.net>
*/
#include <linux/kernel.h>
#include <linux/reboot.h>
#include <linux/export.h>
#include <linux/pm.h>
#include <linux/of.h>
#include <asm/oplib.h>
#include <asm/prom.h>
#include <asm/setup.h>
/* sysctl - toggle power-off restriction for serial console
* systems in machine_power_off()
*/
int scons_pwroff = 1;
/* This isn't actually used, it exists merely to satisfy the
* reference in kernel/sys.c
*/
void (*pm_power_off)(void) = machine_power_off;
EXPORT_SYMBOL(pm_power_off);
void machine_power_off(void)
{
if (!of_node_is_type(of_console_device, "serial") || scons_pwroff)
prom_halt_power_off();
prom_halt();
}
void machine_halt(void)
{
prom_halt();
panic("Halt failed!");
}
void machine_restart(char *cmd)
{
char *p;
p = strchr(reboot_command, '\n');
if (p)
*p = 0;
if (cmd)
prom_reboot(cmd);
if (*reboot_command)
prom_reboot(reboot_command);
prom_reboot("");
panic("Reboot failed!");
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/reboot.h`, `linux/export.h`, `linux/pm.h`, `linux/of.h`, `asm/oplib.h`, `asm/prom.h`, `asm/setup.h`.
- Detected declarations: `function machine_power_off`, `function machine_halt`, `function machine_restart`, `export pm_power_off`.
- Atlas domain: Architecture Layer / arch/sparc.
- Implementation status: integration 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.