arch/um/kernel/reboot.c
Source file repositories/reference/linux-study-clean/arch/um/kernel/reboot.c
File Facts
- System
- Linux kernel
- Corpus path
arch/um/kernel/reboot.c- Extension
.c- Size
- 1319 bytes
- Lines
- 77
- Domain
- Architecture Layer
- Bucket
- arch/um
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sched/signal.hlinux/sched/task.hlinux/sched/mm.hlinux/spinlock.hlinux/slab.hlinux/oom.hlinux/reboot.hkern_util.hos.hskas.h
Detected Declarations
function kill_off_processesfunction uml_cleanupfunction machine_restartfunction machine_power_offfunction machine_haltfunction sys_power_off_handlerfunction register_power_offexport pm_power_off
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
*/
#include <linux/sched/signal.h>
#include <linux/sched/task.h>
#include <linux/sched/mm.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/oom.h>
#include <linux/reboot.h>
#include <kern_util.h>
#include <os.h>
#include <skas.h>
void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off);
static void kill_off_processes(void)
{
struct task_struct *p;
int pid;
read_lock(&tasklist_lock);
for_each_process(p) {
struct task_struct *t;
t = find_lock_task_mm(p);
if (!t)
continue;
pid = t->mm->context.id.pid;
task_unlock(t);
os_kill_ptraced_process(pid, 1);
}
read_unlock(&tasklist_lock);
}
void uml_cleanup(void)
{
kmalloc_ok = 0;
do_uml_exitcalls();
kill_off_processes();
}
void machine_restart(char * __unused)
{
uml_cleanup();
reboot_skas();
}
void machine_power_off(void)
{
uml_cleanup();
halt_skas();
}
void machine_halt(void)
{
machine_power_off();
}
static int sys_power_off_handler(struct sys_off_data *data)
{
machine_power_off();
return 0;
}
static int register_power_off(void)
{
register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
SYS_OFF_PRIO_DEFAULT,
sys_power_off_handler, NULL);
return 0;
}
__initcall(register_power_off);
Annotation
- Immediate include surface: `linux/sched/signal.h`, `linux/sched/task.h`, `linux/sched/mm.h`, `linux/spinlock.h`, `linux/slab.h`, `linux/oom.h`, `linux/reboot.h`, `kern_util.h`.
- Detected declarations: `function kill_off_processes`, `function uml_cleanup`, `function machine_restart`, `function machine_power_off`, `function machine_halt`, `function sys_power_off_handler`, `function register_power_off`, `export pm_power_off`.
- Atlas domain: Architecture Layer / arch/um.
- 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.