arch/parisc/kernel/time.c
Source file repositories/reference/linux-study-clean/arch/parisc/kernel/time.c
File Facts
- System
- Linux kernel
- Corpus path
arch/parisc/kernel/time.c- Extension
.c- Size
- 5466 bytes
- Lines
- 236
- Domain
- Architecture Layer
- Bucket
- arch/parisc
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clockchips.hlinux/delay.hlinux/export.hlinux/init.hlinux/interrupt.hlinux/kernel.hlinux/sched_clock.hlinux/spinlock.hlinux/rtc.hlinux/platform_device.hasm/processor.hasm/pdcpat.h
Detected Declarations
function parisc_event_handlerfunction timer_interruptfunction parisc_set_state_oneshotfunction parisc_set_state_periodicfunction parisc_set_state_shutdownfunction parisc_clockevent_initfunction parisc_find_64bit_counterfunction profile_pcfunction rtc_generic_get_timefunction rtc_generic_set_timefunction rtc_initfunction read_persistent_clock64function read_cr16_sched_clockfunction read_cr16function sched_clockmodule init rtc_initexport profile_pc
Annotated Snippet
device_initcall(rtc_init);
#endif
void read_persistent_clock64(struct timespec64 *ts)
{
static struct pdc_tod tod_data;
if (pdc_tod_read(&tod_data) == 0) {
ts->tv_sec = tod_data.tod_sec;
ts->tv_nsec = tod_data.tod_usec * 1000;
} else {
printk(KERN_ERR "Error reading tod clock\n");
ts->tv_sec = 0;
ts->tv_nsec = 0;
}
}
static u64 notrace read_cr16_sched_clock(void)
{
return get_cycles();
}
static u64 notrace read_cr16(struct clocksource *cs)
{
return get_cycles();
}
static struct clocksource clocksource_cr16 = {
.name = "cr16",
.rating = 300,
.read = read_cr16,
.mask = CLOCKSOURCE_MASK(BITS_PER_LONG),
.flags = CLOCK_SOURCE_IS_CONTINUOUS |
CLOCK_SOURCE_VALID_FOR_HRES,
};
/*
* timer interrupt and sched_clock() initialization
*/
void __init time_init(void)
{
cr16_clock_freq = 100 * PAGE0->mem_10msec; /* Hz */
clocktick = cr16_clock_freq / HZ;
/* register as sched_clock source */
sched_clock_register(read_cr16_sched_clock, BITS_PER_LONG, cr16_clock_freq);
parisc_clockevent_init();
/* check for free-running 64-bit platform counter */
parisc_find_64bit_counter();
/* register at clocksource framework */
clocksource_register_hz(&clocksource_cr16, cr16_clock_freq);
}
Annotation
- Immediate include surface: `linux/clockchips.h`, `linux/delay.h`, `linux/export.h`, `linux/init.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/sched_clock.h`, `linux/spinlock.h`.
- Detected declarations: `function parisc_event_handler`, `function timer_interrupt`, `function parisc_set_state_oneshot`, `function parisc_set_state_periodic`, `function parisc_set_state_shutdown`, `function parisc_clockevent_init`, `function parisc_find_64bit_counter`, `function profile_pc`, `function rtc_generic_get_time`, `function rtc_generic_set_time`.
- Atlas domain: Architecture Layer / arch/parisc.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.