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.

Dependency Surface

Detected Declarations

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

Implementation Notes