arch/sparc/kernel/time_64.c
Source file repositories/reference/linux-study-clean/arch/sparc/kernel/time_64.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/kernel/time_64.c- Extension
.c- Size
- 21466 bytes
- Lines
- 902
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- 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/errno.hlinux/export.hlinux/sched.hlinux/kernel.hlinux/param.hlinux/string.hlinux/mm.hlinux/interrupt.hlinux/time.hlinux/timex.hlinux/init.hlinux/ioport.hlinux/mc146818rtc.hlinux/delay.hlinux/profile.hlinux/bcd.hlinux/jiffies.hlinux/cpufreq.hlinux/percpu.hlinux/rtc/m48t59.hlinux/kernel_stat.hlinux/clockchips.hlinux/clocksource.hlinux/platform_device.hlinux/sched/clock.hlinux/ftrace.hasm/oplib.hasm/timer.hasm/irq.hasm/io.hasm/prom.hasm/starfire.h
Detected Declarations
struct freq_tablefunction profile_pcfunction tick_disable_protectionfunction tick_disable_irqfunction tick_init_tickfunction tick_get_tickfunction tick_add_comparefunction tick_add_tickfunction cpuid_to_freqfunction tick_get_frequencyfunction stick_disable_irqfunction stick_init_tickfunction stick_get_tickfunction stick_add_tickfunction stick_add_comparefunction stick_get_frequencyfunction __hbird_read_stickfunction __hbird_write_stickfunction __hbird_write_comparefunction hbtick_disable_irqfunction hbtick_init_tickfunction hbtick_get_tickfunction hbtick_add_tickfunction hbtick_add_comparefunction hbtick_get_frequencyfunction rtc_probefunction bq4802_probefunction mostek_read_bytefunction mostek_write_bytefunction mostek_probefunction clock_initfunction is_hummingbirdfunction sparc64_get_clock_tickfunction sparc64_cpufreq_notifierfunction for_each_cpufunction register_sparc64_cpufreq_notifierfunction sparc64_next_eventfunction sparc64_timer_shutdownfunction timer_interruptfunction setup_sparc64_timerfunction __delayfunction udelayfunction clocksource_tick_readfunction get_tick_patchfunction init_tick_opsfunction time_init_earlyfunction time_initfunction sched_clock
Annotated Snippet
/* Must be after subsys_initcall() so that busses are probed. Must
* be before device_initcall() because things like the RTC driver
* need to see the clock registers.
*/
fs_initcall(clock_init);
/* Return true if this is Hummingbird, aka Ultra-IIe */
static bool is_hummingbird(void)
{
unsigned long ver, manuf, impl;
__asm__ __volatile__ ("rdpr %%ver, %0"
: "=&r" (ver));
manuf = ((ver >> 48) & 0xffff);
impl = ((ver >> 32) & 0xffff);
return (manuf == 0x17 && impl == 0x13);
}
struct freq_table {
unsigned long clock_tick_ref;
unsigned int ref_freq;
};
static DEFINE_PER_CPU(struct freq_table, sparc64_freq_table) = { 0, 0 };
unsigned long sparc64_get_clock_tick(unsigned int cpu)
{
struct freq_table *ft = &per_cpu(sparc64_freq_table, cpu);
if (ft->clock_tick_ref)
return ft->clock_tick_ref;
return cpu_data(cpu).clock_tick;
}
EXPORT_SYMBOL(sparc64_get_clock_tick);
#ifdef CONFIG_CPU_FREQ
static int sparc64_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
void *data)
{
struct cpufreq_freqs *freq = data;
unsigned int cpu;
struct freq_table *ft;
for_each_cpu(cpu, freq->policy->cpus) {
ft = &per_cpu(sparc64_freq_table, cpu);
if (!ft->ref_freq) {
ft->ref_freq = freq->old;
ft->clock_tick_ref = cpu_data(cpu).clock_tick;
}
if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
(val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
cpu_data(cpu).clock_tick =
cpufreq_scale(ft->clock_tick_ref, ft->ref_freq,
freq->new);
}
}
return 0;
}
static struct notifier_block sparc64_cpufreq_notifier_block = {
.notifier_call = sparc64_cpufreq_notifier
};
static int __init register_sparc64_cpufreq_notifier(void)
{
cpufreq_register_notifier(&sparc64_cpufreq_notifier_block,
CPUFREQ_TRANSITION_NOTIFIER);
return 0;
}
core_initcall(register_sparc64_cpufreq_notifier);
#endif /* CONFIG_CPU_FREQ */
static int sparc64_next_event(unsigned long delta,
struct clock_event_device *evt)
{
return tick_operations.add_compare(delta) ? -ETIME : 0;
}
static int sparc64_timer_shutdown(struct clock_event_device *evt)
{
tick_operations.disable_irq();
return 0;
}
Annotation
- Immediate include surface: `linux/errno.h`, `linux/export.h`, `linux/sched.h`, `linux/kernel.h`, `linux/param.h`, `linux/string.h`, `linux/mm.h`, `linux/interrupt.h`.
- Detected declarations: `struct freq_table`, `function profile_pc`, `function tick_disable_protection`, `function tick_disable_irq`, `function tick_init_tick`, `function tick_get_tick`, `function tick_add_compare`, `function tick_add_tick`, `function cpuid_to_freq`, `function tick_get_frequency`.
- Atlas domain: Architecture Layer / arch/sparc.
- 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.