arch/parisc/kernel/process.c
Source file repositories/reference/linux-study-clean/arch/parisc/kernel/process.c
File Facts
- System
- Linux kernel
- Corpus path
arch/parisc/kernel/process.c- Extension
.c- Size
- 7713 bytes
- Lines
- 284
- Domain
- Architecture Layer
- Bucket
- arch/parisc
- 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/elf.hlinux/errno.hlinux/kernel.hlinux/mm.hlinux/fs.hlinux/cpu.hlinux/module.hlinux/personality.hlinux/ptrace.hlinux/reboot.hlinux/sched.hlinux/sched/debug.hlinux/sched/task.hlinux/sched/task_stack.hlinux/slab.hlinux/stddef.hlinux/unistd.hlinux/kallsyms.hlinux/uaccess.hlinux/rcupdate.hlinux/random.hlinux/nmi.hlinux/sched/hotplug.hasm/io.hasm/asm-offsets.hasm/assembly.hasm/pdc.hasm/pdc_chassis.hasm/unwind.hasm/sections.hasm/cacheflush.h
Detected Declarations
function Copyrightfunction machine_power_offfunction machine_haltfunction flush_threadfunction arch_cpu_idle_deadfunction arch_cpu_idlefunction parisc_idle_initfunction copy_threadfunction __get_wchanexport pm_power_offexport running_on_qemu
Annotated Snippet
if (pdc_iodc_getc() == 13) {
printk("Rebooting...\n");
machine_restart(NULL);
}
}
}
void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off);
void machine_halt(void)
{
machine_power_off();
}
void flush_thread(void)
{
/* Only needs to handle fpu stuff or perf monitors.
** REVISIT: several arches implement a "lazy fpu state".
*/
}
/*
* Idle thread support
*
* Detect when running on QEMU with SeaBIOS PDC Firmware and let
* QEMU idle the host too.
*/
int running_on_qemu __ro_after_init;
EXPORT_SYMBOL(running_on_qemu);
/*
* Called from the idle thread for the CPU which has been shutdown.
*/
void __noreturn arch_cpu_idle_dead(void)
{
#ifdef CONFIG_HOTPLUG_CPU
idle_task_exit();
local_irq_disable();
/* Tell the core that this CPU is now safe to dispose of. */
cpuhp_ap_report_dead();
/* Ensure that the cache lines are written out. */
flush_cache_all_local();
flush_tlb_all_local(NULL);
/* Let PDC firmware put CPU into firmware idle loop. */
__pdc_cpu_rendezvous();
pr_warn("PDC does not provide rendezvous function.\n");
#endif
while (1);
}
void __cpuidle arch_cpu_idle(void)
{
/* nop on real hardware, qemu will idle sleep. */
asm volatile("or %%r10,%%r10,%%r10\n":::);
}
static int __init parisc_idle_init(void)
{
if (!running_on_qemu)
cpu_idle_poll_ctrl(1);
return 0;
}
arch_initcall(parisc_idle_init);
/*
* Copy architecture-specific thread state
*/
int
copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
{
u64 clone_flags = args->flags;
unsigned long usp = args->stack;
unsigned long tls = args->tls;
struct pt_regs *cregs = &(p->thread.regs);
void *stack = task_stack_page(p);
/* We have to use void * instead of a function pointer, because
* function pointers aren't a pointer to the function on 64-bit.
* Make them const so the compiler knows they live in .text */
extern void * const ret_from_kernel_thread;
extern void * const child_return;
Annotation
- Immediate include surface: `linux/elf.h`, `linux/errno.h`, `linux/kernel.h`, `linux/mm.h`, `linux/fs.h`, `linux/cpu.h`, `linux/module.h`, `linux/personality.h`.
- Detected declarations: `function Copyright`, `function machine_power_off`, `function machine_halt`, `function flush_thread`, `function arch_cpu_idle_dead`, `function arch_cpu_idle`, `function parisc_idle_init`, `function copy_thread`, `function __get_wchan`, `export pm_power_off`.
- Atlas domain: Architecture Layer / arch/parisc.
- 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.