arch/mips/kernel/cpu-r3k-probe.c
Source file repositories/reference/linux-study-clean/arch/mips/kernel/cpu-r3k-probe.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/kernel/cpu-r3k-probe.c- Extension
.c- Size
- 3632 bytes
- Lines
- 154
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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/init.hlinux/kernel.hlinux/ptrace.hlinux/smp.hlinux/stddef.hlinux/export.hasm/bugs.hasm/cpu.hasm/cpu-features.hasm/cpu-type.hasm/fpu.hasm/mipsregs.hasm/elf.hasm/traps.hfpu-probe.h
Detected Declarations
function check_bugs32function set_elf_platformfunction cpu_probefunction cpu_reportexport elf_hwcap
Annotated Snippet
if ((c->processor_id & PRID_REV_MASK) == PRID_REV_R3000A) {
if (cpu_has_confreg()) {
c->cputype = CPU_R3081E;
__cpu_name[cpu] = "R3081";
} else {
c->cputype = CPU_R3000A;
__cpu_name[cpu] = "R3000A";
}
} else {
c->cputype = CPU_R3000;
__cpu_name[cpu] = "R3000";
}
c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE |
MIPS_CPU_NOFPUEX;
if (__cpu_has_fpu())
c->options |= MIPS_CPU_FPU;
c->tlbsize = 64;
break;
}
BUG_ON(!__cpu_name[cpu]);
BUG_ON(c->cputype == CPU_UNKNOWN);
/*
* Platform code can force the cpu type to optimize code
* generation. In that case be sure the cpu type is correctly
* manually setup otherwise it could trigger some nasty bugs.
*/
BUG_ON(current_cpu_type() != c->cputype);
if (mips_fpu_disabled)
c->options &= ~MIPS_CPU_FPU;
if (c->options & MIPS_CPU_FPU)
cpu_set_fpu_opts(c);
else
cpu_set_nofpu_opts(c);
c->vmbits = 31;
reserve_exception_space(0, 0x400);
}
void cpu_report(void)
{
struct cpuinfo_mips *c = ¤t_cpu_data;
pr_info("CPU%d revision is: %08x (%s)\n",
smp_processor_id(), c->processor_id, cpu_name_string());
if (c->options & MIPS_CPU_FPU)
pr_info("FPU revision is: %08x\n", c->fpu_id);
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/kernel.h`, `linux/ptrace.h`, `linux/smp.h`, `linux/stddef.h`, `linux/export.h`, `asm/bugs.h`, `asm/cpu.h`.
- Detected declarations: `function check_bugs32`, `function set_elf_platform`, `function cpu_probe`, `function cpu_report`, `export elf_hwcap`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.