arch/nios2/kernel/process.c
Source file repositories/reference/linux-study-clean/arch/nios2/kernel/process.c
File Facts
- System
- Linux kernel
- Corpus path
arch/nios2/kernel/process.c- Extension
.c- Size
- 7100 bytes
- Lines
- 269
- Domain
- Architecture Layer
- Bucket
- arch/nios2
- 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/export.hlinux/sched.hlinux/sched/debug.hlinux/sched/task.hlinux/sched/task_stack.hlinux/mm_types.hlinux/tick.hlinux/uaccess.hasm/unistd.hasm/traps.hasm/cpuinfo.h
Detected Declarations
function arch_cpu_idlefunction machine_haltfunction machine_power_offfunction show_regsfunction flush_threadfunction dumpfunction __get_wchanfunction modefunction nios2_cloneexport pm_power_off
Annotated Snippet
#include <linux/export.h>
#include <linux/sched.h>
#include <linux/sched/debug.h>
#include <linux/sched/task.h>
#include <linux/sched/task_stack.h>
#include <linux/mm_types.h>
#include <linux/tick.h>
#include <linux/uaccess.h>
#include <asm/unistd.h>
#include <asm/traps.h>
#include <asm/cpuinfo.h>
asmlinkage void ret_from_fork(void);
asmlinkage void ret_from_kernel_thread(void);
void (*pm_power_off)(void) = NULL;
EXPORT_SYMBOL(pm_power_off);
void arch_cpu_idle(void)
{
}
/*
* The development boards have no way to pull a board reset. Just jump to the
* cpu reset address and let the boot loader or the code in head.S take care of
* resetting peripherals.
*/
void machine_restart(char *__unused)
{
pr_notice("Machine restart (%08x)...\n", cpuinfo.reset_addr);
local_irq_disable();
__asm__ __volatile__ (
"jmp %0\n\t"
:
: "r" (cpuinfo.reset_addr)
: "r4");
}
void machine_halt(void)
{
pr_notice("Machine halt...\n");
local_irq_disable();
for (;;)
;
}
/*
* There is no way to power off the development boards. So just spin for now. If
* we ever have a way of resetting a board using a GPIO we should add that here.
*/
void machine_power_off(void)
{
pr_notice("Machine power off...\n");
local_irq_disable();
for (;;)
;
}
void show_regs(struct pt_regs *regs)
{
pr_notice("\n");
show_regs_print_info(KERN_DEFAULT);
pr_notice("r1: %08lx r2: %08lx r3: %08lx r4: %08lx\n",
regs->r1, regs->r2, regs->r3, regs->r4);
pr_notice("r5: %08lx r6: %08lx r7: %08lx r8: %08lx\n",
regs->r5, regs->r6, regs->r7, regs->r8);
pr_notice("r9: %08lx r10: %08lx r11: %08lx r12: %08lx\n",
regs->r9, regs->r10, regs->r11, regs->r12);
pr_notice("r13: %08lx r14: %08lx r15: %08lx\n",
regs->r13, regs->r14, regs->r15);
pr_notice("ra: %08lx fp: %08lx sp: %08lx gp: %08lx\n",
regs->ra, regs->fp, regs->sp, regs->gp);
pr_notice("ea: %08lx estatus: %08lx\n",
regs->ea, regs->estatus);
}
void flush_thread(void)
{
}
int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
{
u64 clone_flags = args->flags;
Annotation
- Immediate include surface: `linux/export.h`, `linux/sched.h`, `linux/sched/debug.h`, `linux/sched/task.h`, `linux/sched/task_stack.h`, `linux/mm_types.h`, `linux/tick.h`, `linux/uaccess.h`.
- Detected declarations: `function arch_cpu_idle`, `function machine_halt`, `function machine_power_off`, `function show_regs`, `function flush_thread`, `function dump`, `function __get_wchan`, `function mode`, `function nios2_clone`, `export pm_power_off`.
- Atlas domain: Architecture Layer / arch/nios2.
- 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.