arch/mips/kernel/csrc-r4k.c
Source file repositories/reference/linux-study-clean/arch/mips/kernel/csrc-r4k.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/kernel/csrc-r4k.c- Extension
.c- Size
- 3259 bytes
- Lines
- 145
- 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/clocksource.hlinux/cpufreq.hlinux/init.hlinux/sched_clock.hasm/time.h
Detected Declarations
function Copyrightfunction r4k_read_sched_clockfunction rdhwr_countfunction rdhwr_count_usablefunction count_can_be_sched_clockfunction r4k_clocksource_unstablefunction r4k_cpufreq_callbackfunction r4k_register_cpufreq_notifierfunction init_r4k_clocksourcemodule init r4k_register_cpufreq_notifier
Annotated Snippet
core_initcall(r4k_register_cpufreq_notifier);
#endif /* !CONFIG_CPU_FREQ */
int __init init_r4k_clocksource(void)
{
if (!cpu_has_counter || !mips_hpt_frequency)
return -ENXIO;
/* Calculate a somewhat reasonable rating value */
clocksource_mips.rating = 200;
clocksource_mips.rating += clamp(mips_hpt_frequency / 10000000, 0, 99);
#ifdef CONFIG_GENERIC_GETTIMEOFDAY
/*
* R2 onwards makes the count accessible to user mode so it can be used
* by the VDSO (HWREna is configured by configure_hwrena()).
*/
if (cpu_has_mips_r2_r6 && rdhwr_count_usable())
clocksource_mips.vdso_clock_mode = VDSO_CLOCKMODE_R4K;
#endif
clocksource_register_hz(&clocksource_mips, mips_hpt_frequency);
if (count_can_be_sched_clock())
sched_clock_register(r4k_read_sched_clock, 32, mips_hpt_frequency);
return 0;
}
Annotation
- Immediate include surface: `linux/clocksource.h`, `linux/cpufreq.h`, `linux/init.h`, `linux/sched_clock.h`, `asm/time.h`.
- Detected declarations: `function Copyright`, `function r4k_read_sched_clock`, `function rdhwr_count`, `function rdhwr_count_usable`, `function count_can_be_sched_clock`, `function r4k_clocksource_unstable`, `function r4k_cpufreq_callback`, `function r4k_register_cpufreq_notifier`, `function init_r4k_clocksource`, `module init r4k_register_cpufreq_notifier`.
- 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.