arch/alpha/kernel/process.c
Source file repositories/reference/linux-study-clean/arch/alpha/kernel/process.c
File Facts
- System
- Linux kernel
- Corpus path
arch/alpha/kernel/process.c- Extension
.c- Size
- 9982 bytes
- Lines
- 397
- Domain
- Architecture Layer
- Bucket
- arch/alpha
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cpu.hlinux/errno.hlinux/module.hlinux/sched.hlinux/sched/debug.hlinux/sched/task.hlinux/sched/task_stack.hlinux/kernel.hlinux/mm.hlinux/smp.hlinux/stddef.hlinux/unistd.hlinux/ptrace.hlinux/user.hlinux/time.hlinux/major.hlinux/stat.hlinux/vt.hlinux/mman.hlinux/elfcore.hlinux/reboot.hlinux/tty.hlinux/console.hlinux/slab.hlinux/rcupdate.hasm/reg.hlinux/uaccess.hasm/io.hasm/hwrpb.hasm/fpu.hproto.hpci_impl.h
Detected Declarations
struct halt_infofunction arch_cpu_idlefunction arch_cpu_idle_deadfunction common_shutdown_1function common_shutdownfunction machine_restartfunction machine_haltfunction machine_power_offfunction show_regsfunction start_threadfunction flush_threadfunction copy_threadfunction dump_elf_threadfunction dump_elf_taskfunction elf_core_copy_task_fpregsfunction schedulefunction __get_wchanexport pm_power_offexport start_threadexport dump_elf_threadexport dump_elf_task
Annotated Snippet
struct halt_info {
int mode;
char *restart_cmd;
};
static void
common_shutdown_1(void *generic_ptr)
{
struct halt_info *how = generic_ptr;
struct percpu_struct *cpup;
unsigned long *pflags, flags;
int cpuid = smp_processor_id();
/* No point in taking interrupts anymore. */
local_irq_disable();
cpup = (struct percpu_struct *)
((unsigned long)hwrpb + hwrpb->processor_offset
+ hwrpb->processor_size * cpuid);
pflags = &cpup->flags;
flags = *pflags;
/* Clear reason to "default"; clear "bootstrap in progress". */
flags &= ~0x00ff0001UL;
#ifdef CONFIG_SMP
/* Secondaries halt here. */
if (cpuid != boot_cpuid) {
flags |= 0x00040000UL; /* "remain halted" */
*pflags = flags;
set_cpu_present(cpuid, false);
set_cpu_possible(cpuid, false);
halt();
}
#endif
if (how->mode == LINUX_REBOOT_CMD_RESTART) {
if (!how->restart_cmd) {
flags |= 0x00020000UL; /* "cold bootstrap" */
} else {
/* For SRM, we could probably set environment
variables to get this to work. We'd have to
delay this until after srm_paging_stop unless
we ever got srm_fixup working.
At the moment, SRM will use the last boot device,
but the file and flags will be the defaults, when
doing a "warm" bootstrap. */
flags |= 0x00030000UL; /* "warm bootstrap" */
}
} else {
flags |= 0x00040000UL; /* "remain halted" */
}
*pflags = flags;
#ifdef CONFIG_SMP
/* Wait for the secondaries to halt. */
set_cpu_present(boot_cpuid, false);
set_cpu_possible(boot_cpuid, false);
while (!cpumask_empty(cpu_present_mask))
barrier();
#endif
/* If booted from SRM, reset some of the original environment. */
if (alpha_using_srm) {
#ifdef CONFIG_DUMMY_CONSOLE
/* If we've gotten here after SysRq-b, leave interrupt
context before taking over the console. */
if (in_hardirq())
irq_exit();
/* This has the effect of resetting the VGA video origin. */
console_lock();
do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES-1, 1);
console_unlock();
#endif
pci_restore_srm_config();
set_hae(srm_hae);
}
if (alpha_mv.kill_arch)
alpha_mv.kill_arch(how->mode);
if (! alpha_using_srm && how->mode != LINUX_REBOOT_CMD_RESTART) {
/* Unfortunately, since MILO doesn't currently understand
the hwrpb bits above, we can't reliably halt the
processor and keep it halted. So just loop. */
return;
}
if (alpha_using_srm)
Annotation
- Immediate include surface: `linux/cpu.h`, `linux/errno.h`, `linux/module.h`, `linux/sched.h`, `linux/sched/debug.h`, `linux/sched/task.h`, `linux/sched/task_stack.h`, `linux/kernel.h`.
- Detected declarations: `struct halt_info`, `function arch_cpu_idle`, `function arch_cpu_idle_dead`, `function common_shutdown_1`, `function common_shutdown`, `function machine_restart`, `function machine_halt`, `function machine_power_off`, `function show_regs`, `function start_thread`.
- Atlas domain: Architecture Layer / arch/alpha.
- 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.