arch/mips/pic32/pic32mzda/time.c
Source file repositories/reference/linux-study-clean/arch/mips/pic32/pic32mzda/time.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/pic32/pic32mzda/time.c- Extension
.c- Size
- 1201 bytes
- Lines
- 64
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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/clocksource.hlinux/init.hlinux/irqdomain.hlinux/of.hlinux/of_clk.hlinux/of_irq.hasm/time.hpic32mzda.h
Detected Declarations
function pic32_xlate_core_timer_irqfunction get_c0_compare_intfunction plat_time_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Joshua Henderson <joshua.henderson@microchip.com>
* Copyright (C) 2015 Microchip Technology Inc. All rights reserved.
*/
#include <linux/clocksource.h>
#include <linux/init.h>
#include <linux/irqdomain.h>
#include <linux/of.h>
#include <linux/of_clk.h>
#include <linux/of_irq.h>
#include <asm/time.h>
#include "pic32mzda.h"
static const struct of_device_id pic32_infra_match[] = {
{ .compatible = "microchip,pic32mzda-infra", },
{ },
};
#define DEFAULT_CORE_TIMER_INTERRUPT 0
static unsigned int pic32_xlate_core_timer_irq(void)
{
struct device_node *node;
unsigned int irq;
node = of_find_matching_node(NULL, pic32_infra_match);
if (WARN_ON(!node))
goto default_map;
irq = irq_of_parse_and_map(node, 0);
of_node_put(node);
if (!irq)
goto default_map;
return irq;
default_map:
return irq_create_mapping(NULL, DEFAULT_CORE_TIMER_INTERRUPT);
}
unsigned int get_c0_compare_int(void)
{
return pic32_xlate_core_timer_irq();
}
void __init plat_time_init(void)
{
unsigned long rate = pic32_get_pbclk(7);
of_clk_init(NULL);
pr_info("CPU Clock: %ldMHz\n", rate / 1000000);
mips_hpt_frequency = rate / 2;
timer_probe();
}
Annotation
- Immediate include surface: `linux/clocksource.h`, `linux/init.h`, `linux/irqdomain.h`, `linux/of.h`, `linux/of_clk.h`, `linux/of_irq.h`, `asm/time.h`, `pic32mzda.h`.
- Detected declarations: `function pic32_xlate_core_timer_irq`, `function get_c0_compare_int`, `function plat_time_init`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.