arch/arm/mach-shmobile/timer.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-shmobile/timer.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-shmobile/timer.c- Extension
.c- Size
- 853 bytes
- Lines
- 42
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/platform_device.hlinux/clocksource.hlinux/delay.hlinux/of_address.hcommon.h
Detected Declarations
function Copyrightfunction for_each_of_cpu_node
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* SH-Mobile Timer
*
* Copyright (C) 2010 Magnus Damm
* Copyright (C) 2002 - 2009 Paul Mundt
*/
#include <linux/platform_device.h>
#include <linux/clocksource.h>
#include <linux/delay.h>
#include <linux/of_address.h>
#include "common.h"
void __init shmobile_init_delay(void)
{
struct device_node *np;
u32 max_freq = 0;
for_each_of_cpu_node(np) {
u32 freq;
if (!of_property_read_u32(np, "clock-frequency", &freq))
max_freq = max(max_freq, freq);
}
if (!max_freq)
return;
/*
* Calculate a worst-case loops-per-jiffy value
* based on maximum cpu core hz setting and the
* __delay() implementation in arch/arm/lib/delay.S.
*
* This will result in a longer delay than expected
* when the cpu core runs on lower frequencies.
*/
if (!preset_lpj)
preset_lpj = max_freq / HZ;
}
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/clocksource.h`, `linux/delay.h`, `linux/of_address.h`, `common.h`.
- Detected declarations: `function Copyright`, `function for_each_of_cpu_node`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source 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.