arch/mips/cavium-octeon/cpu.c
Source file repositories/reference/linux-study-clean/arch/mips/cavium-octeon/cpu.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/cavium-octeon/cpu.c- Extension
.c- Size
- 1293 bytes
- Lines
- 51
- Domain
- Architecture Layer
- Bucket
- arch/mips
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/irqflags.hlinux/notifier.hlinux/prefetch.hlinux/ptrace.hlinux/sched.hlinux/sched/task_stack.hasm/cop2.hasm/current.hasm/mipsregs.hasm/page.hasm/octeon/octeon.h
Detected Declarations
function Copyrightfunction cnmips_cu2_setup
Annotated Snippet
#include <linux/init.h>
#include <linux/irqflags.h>
#include <linux/notifier.h>
#include <linux/prefetch.h>
#include <linux/ptrace.h>
#include <linux/sched.h>
#include <linux/sched/task_stack.h>
#include <asm/cop2.h>
#include <asm/current.h>
#include <asm/mipsregs.h>
#include <asm/page.h>
#include <asm/octeon/octeon.h>
static int cnmips_cu2_call(struct notifier_block *nfb, unsigned long action,
void *data)
{
unsigned long flags;
unsigned int status;
switch (action) {
case CU2_EXCEPTION:
prefetch(¤t->thread.cp2);
local_irq_save(flags);
KSTK_STATUS(current) |= ST0_CU2;
status = read_c0_status();
write_c0_status(status | ST0_CU2);
octeon_cop2_restore(&(current->thread.cp2));
write_c0_status(status & ~ST0_CU2);
local_irq_restore(flags);
return NOTIFY_BAD; /* Don't call default notifier */
}
return NOTIFY_OK; /* Let default notifier send signals */
}
static int __init cnmips_cu2_setup(void)
{
return cu2_notifier(cnmips_cu2_call, 0);
}
early_initcall(cnmips_cu2_setup);
Annotation
- Immediate include surface: `linux/init.h`, `linux/irqflags.h`, `linux/notifier.h`, `linux/prefetch.h`, `linux/ptrace.h`, `linux/sched.h`, `linux/sched/task_stack.h`, `asm/cop2.h`.
- Detected declarations: `function Copyright`, `function cnmips_cu2_setup`.
- Atlas domain: Architecture Layer / arch/mips.
- Implementation status: source 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.