Release 4.9 arch/arm/kernel/time.c
/*
* linux/arch/arm/kernel/time.c
*
* Copyright (C) 1991, 1992, 1995 Linus Torvalds
* Modifications for ARM (C) 1994-2001 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This file contains the ARM-specific time handling details:
* reading the RTC at bootup, etc...
*/
#include <linux/clk-provider.h>
#include <linux/clocksource.h>
#include <linux/errno.h>
#include <linux/export.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/profile.h>
#include <linux/sched.h>
#include <linux/sched_clock.h>
#include <linux/smp.h>
#include <linux/time.h>
#include <linux/timex.h>
#include <linux/timer.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/stacktrace.h>
#include <asm/thread_info.h>
#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \
defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE)
/* this needs a better home */
DEFINE_SPINLOCK(rtc_lock);
EXPORT_SYMBOL(rtc_lock);
#endif /* pc-style 'CMOS' RTC support */
/* change this if you have some constant time drift */
#define USECS_PER_JIFFY (1000000/HZ)
#ifdef CONFIG_SMP
unsigned long profile_pc(struct pt_regs *regs)
{
struct stackframe frame;
if (!in_lock_functions(regs->ARM_pc))
return regs->ARM_pc;
arm_get_current_stackframe(regs, &frame);
do {
int ret = unwind_frame(&frame);
if (ret < 0)
return 0;
} while (in_lock_functions(frame.pc));
return frame.pc;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
catalin marinas | catalin marinas | 46 | 62.16% | 1 | 25.00% |
zwane mwaikambo | zwane mwaikambo | 20 | 27.03% | 1 | 25.00% |
nikolay borisov | nikolay borisov | 5 | 6.76% | 1 | 25.00% |
anton blanchard | anton blanchard | 3 | 4.05% | 1 | 25.00% |
| Total | 74 | 100.00% | 4 | 100.00% |
EXPORT_SYMBOL(profile_pc);
#endif
#ifndef CONFIG_GENERIC_CLOCKEVENTS
/*
* Kernel system timer support.
*/
void timer_tick(void)
{
profile_tick(CPU_PROFILING);
xtime_update(1);
#ifndef CONFIG_SMP
update_process_times(user_mode(get_irq_regs()));
#endif
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 12 | 38.71% | 1 | 14.29% |
deepak saxena | deepak saxena | 10 | 32.26% | 1 | 14.29% |
linus torvalds | linus torvalds | 3 | 9.68% | 1 | 14.29% |
william lee irwin iii | william lee irwin iii | 2 | 6.45% | 1 | 14.29% |
russell king | russell king | 2 | 6.45% | 1 | 14.29% |
atsushi nemoto | atsushi nemoto | 1 | 3.23% | 1 | 14.29% |
torben hohn | torben hohn | 1 | 3.23% | 1 | 14.29% |
| Total | 31 | 100.00% | 7 | 100.00% |
#endif
static void dummy_clock_access(struct timespec64 *ts)
{
ts->tv_sec = 0;
ts->tv_nsec = 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marc zyngier | marc zyngier | 22 | 95.65% | 1 | 50.00% |
pang xunlei | pang xunlei | 1 | 4.35% | 1 | 50.00% |
| Total | 23 | 100.00% | 2 | 100.00% |
static clock_access_fn __read_persistent_clock = dummy_clock_access;
static clock_access_fn __read_boot_clock = dummy_clock_access;
;
void read_persistent_clock64(struct timespec64 *ts)
{
__read_persistent_clock(ts);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marc zyngier | marc zyngier | 13 | 86.67% | 1 | 50.00% |
pang xunlei | pang xunlei | 2 | 13.33% | 1 | 50.00% |
| Total | 15 | 100.00% | 2 | 100.00% |
void read_boot_clock64(struct timespec64 *ts)
{
__read_boot_clock(ts);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marc zyngier | marc zyngier | 13 | 86.67% | 1 | 50.00% |
pang xunlei | pang xunlei | 2 | 13.33% | 1 | 50.00% |
| Total | 15 | 100.00% | 2 | 100.00% |
int __init register_persistent_clock(clock_access_fn read_boot,
clock_access_fn read_persistent)
{
/* Only allow the clockaccess functions to be registered once */
if (__read_persistent_clock == dummy_clock_access &&
__read_boot_clock == dummy_clock_access) {
if (read_boot)
__read_boot_clock = read_boot;
if (read_persistent)
__read_persistent_clock = read_persistent;
return 0;
}
return -EINVAL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marc zyngier | marc zyngier | 48 | 100.00% | 1 | 100.00% |
| Total | 48 | 100.00% | 1 | 100.00% |
void __init time_init(void)
{
if (machine_desc->init_time) {
machine_desc->init_time();
} else {
#ifdef CONFIG_COMMON_CLK
of_clk_init(NULL);
#endif
clocksource_probe();
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
sebastian hesselbarth | sebastian hesselbarth | 14 | 37.84% | 1 | 14.29% |
arnd bergmann | arnd bergmann | 9 | 24.32% | 1 | 14.29% |
deepak saxena | deepak saxena | 9 | 24.32% | 1 | 14.29% |
russell king | russell king | 2 | 5.41% | 1 | 14.29% |
stephen warren | stephen warren | 1 | 2.70% | 1 | 14.29% |
marc zyngier | marc zyngier | 1 | 2.70% | 1 | 14.29% |
pre-git | pre-git | 1 | 2.70% | 1 | 14.29% |
| Total | 37 | 100.00% | 7 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marc zyngier | marc zyngier | 110 | 29.65% | 2 | 5.71% |
catalin marinas | catalin marinas | 48 | 12.94% | 1 | 2.86% |
sebastian hesselbarth | sebastian hesselbarth | 34 | 9.16% | 1 | 2.86% |
zwane mwaikambo | zwane mwaikambo | 32 | 8.63% | 1 | 2.86% |
russell king | russell king | 23 | 6.20% | 8 | 22.86% |
pre-git | pre-git | 23 | 6.20% | 3 | 8.57% |
arnd bergmann | arnd bergmann | 22 | 5.93% | 2 | 5.71% |
deepak saxena | deepak saxena | 21 | 5.66% | 2 | 5.71% |
david brownell | david brownell | 12 | 3.23% | 1 | 2.86% |
martin schwidefsky | martin schwidefsky | 12 | 3.23% | 1 | 2.86% |
pang xunlei | pang xunlei | 5 | 1.35% | 1 | 2.86% |
nikolay borisov | nikolay borisov | 5 | 1.35% | 1 | 2.86% |
kevin hilman | kevin hilman | 5 | 1.35% | 2 | 5.71% |
thomas gleixner | thomas gleixner | 4 | 1.08% | 1 | 2.86% |
linus torvalds | linus torvalds | 3 | 0.81% | 1 | 2.86% |
anton blanchard | anton blanchard | 3 | 0.81% | 1 | 2.86% |
alexey dobriyan | alexey dobriyan | 2 | 0.54% | 1 | 2.86% |
frederik deweerdt | frederik deweerdt | 2 | 0.54% | 1 | 2.86% |
william lee irwin iii | william lee irwin iii | 2 | 0.54% | 1 | 2.86% |
stephen warren | stephen warren | 1 | 0.27% | 1 | 2.86% |
atsushi nemoto | atsushi nemoto | 1 | 0.27% | 1 | 2.86% |
torben hohn | torben hohn | 1 | 0.27% | 1 | 2.86% |
| Total | 371 | 100.00% | 35 | 100.00% |