arch/powerpc/kernel/process.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/process.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/process.c- Extension
.c- Size
- 62613 bytes
- Lines
- 2412
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.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/slab.hlinux/user.hlinux/elf.hlinux/prctl.hlinux/init_task.hlinux/export.hlinux/kallsyms.hlinux/mqueue.hlinux/hardirq.hlinux/utsname.hlinux/ftrace.hlinux/kernel_stat.hlinux/personality.hlinux/hw_breakpoint.hlinux/uaccess.hlinux/pkeys.hlinux/seq_buf.hasm/interrupt.hasm/io.hasm/processor.hasm/mmu.h
Detected Declarations
struct regbitfunction check_if_tm_restore_requiredfunction check_if_tm_restore_requiredfunction enable_strict_msr_controlfunction msr_check_and_setfunction __msr_check_and_clearfunction __giveup_fpufunction giveup_fpufunction flush_fp_to_threadfunction enable_kernel_fpfunction __giveup_fpufunction giveup_altivecfunction enable_kernel_altivecfunction flush_altivec_to_threadfunction __giveup_vsxfunction giveup_vsxfunction enable_kernel_vsxfunction flush_vsx_to_threadfunction giveup_spefunction enable_kernel_spefunction flush_spe_to_threadfunction init_msr_all_availablefunction giveup_allfunction should_restore_fpfunction do_restore_fpfunction should_restore_fpfunction do_restore_fpfunction do_restore_altivecfunction should_restore_altivecfunction do_restore_altivecfunction do_restore_vsxfunction do_restore_vsxfunction save_allfunction flush_all_to_threadfunction do_send_trapfunction do_break_handlerfunction set_debug_reg_defaultsfunction prime_debug_regsfunction switch_booke_debug_regsfunction set_breakpointfunction set_debug_reg_defaultsfunction hw_brk_matchfunction switch_hw_breakpointfunction set_dabrfunction set_breakpoint_8xxfunction set_hw_breakpointfunction __set_breakpointfunction ppc_breakpoint_available
Annotated Snippet
struct regbit {
unsigned long bit;
const char *name;
};
static struct regbit msr_bits[] = {
#if defined(CONFIG_PPC64) && !defined(CONFIG_BOOKE)
{MSR_SF, "SF"},
{MSR_HV, "HV"},
#endif
{MSR_VEC, "VEC"},
{MSR_VSX, "VSX"},
#ifdef CONFIG_BOOKE
{MSR_CE, "CE"},
#endif
{MSR_EE, "EE"},
{MSR_PR, "PR"},
{MSR_FP, "FP"},
{MSR_ME, "ME"},
#ifdef CONFIG_BOOKE
{MSR_DE, "DE"},
#else
{MSR_SE, "SE"},
{MSR_BE, "BE"},
#endif
{MSR_IR, "IR"},
{MSR_DR, "DR"},
{MSR_PMM, "PMM"},
#ifndef CONFIG_BOOKE
{MSR_RI, "RI"},
{MSR_LE, "LE"},
#endif
{0, NULL}
};
static void print_bits(unsigned long val, struct regbit *bits, const char *sep)
{
const char *s = "";
for (; bits->bit; ++bits)
if (val & bits->bit) {
pr_cont("%s%s", s, bits->name);
s = sep;
}
}
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
static struct regbit msr_tm_bits[] = {
{MSR_TS_T, "T"},
{MSR_TS_S, "S"},
{MSR_TM, "E"},
{0, NULL}
};
static void print_tm_bits(unsigned long val)
{
/*
* This only prints something if at least one of the TM bit is set.
* Inside the TM[], the output means:
* E: Enabled (bit 32)
* S: Suspended (bit 33)
* T: Transactional (bit 34)
*/
if (val & (MSR_TM | MSR_TS_S | MSR_TS_T)) {
pr_cont(",TM[");
print_bits(val, msr_tm_bits, "");
pr_cont("]");
}
}
#else
static void print_tm_bits(unsigned long val) {}
#endif
static void print_msr_bits(unsigned long val)
{
pr_cont("<");
print_bits(val, msr_bits, ",");
print_tm_bits(val);
pr_cont(">");
}
#ifdef CONFIG_PPC64
#define REG "%016lx"
#define REGS_PER_LINE 4
#else
#define REG "%08lx"
#define REGS_PER_LINE 8
#endif
static void __show_regs(struct pt_regs *regs)
Annotation
- Immediate include surface: `linux/errno.h`, `linux/sched.h`, `linux/sched/debug.h`, `linux/sched/task.h`, `linux/sched/task_stack.h`, `linux/kernel.h`, `linux/mm.h`, `linux/smp.h`.
- Detected declarations: `struct regbit`, `function check_if_tm_restore_required`, `function check_if_tm_restore_required`, `function enable_strict_msr_control`, `function msr_check_and_set`, `function __msr_check_and_clear`, `function __giveup_fpu`, `function giveup_fpu`, `function flush_fp_to_thread`, `function enable_kernel_fp`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.