time.c (dca3a783400a18e2bf4503b1d4a85c4d0ca1a7e4) | time.c (0583fe478a7d93be2c814b7e50d6e81c287edfe8) |
---|---|
1/* 2 * Based on arch/arm/kernel/time.c 3 * 4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds 5 * Modifications for ARM (C) 1994-2001 Russell King 6 * Copyright (C) 2012 ARM Ltd. 7 * 8 * This program is free software; you can redistribute it and/or modify --- 18 unchanged lines hidden (view full) --- 27#include <linux/smp.h> 28#include <linux/timex.h> 29#include <linux/errno.h> 30#include <linux/profile.h> 31#include <linux/syscore_ops.h> 32#include <linux/timer.h> 33#include <linux/irq.h> 34#include <linux/delay.h> | 1/* 2 * Based on arch/arm/kernel/time.c 3 * 4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds 5 * Modifications for ARM (C) 1994-2001 Russell King 6 * Copyright (C) 2012 ARM Ltd. 7 * 8 * This program is free software; you can redistribute it and/or modify --- 18 unchanged lines hidden (view full) --- 27#include <linux/smp.h> 28#include <linux/timex.h> 29#include <linux/errno.h> 30#include <linux/profile.h> 31#include <linux/syscore_ops.h> 32#include <linux/timer.h> 33#include <linux/irq.h> 34#include <linux/delay.h> |
35#include <linux/clocksource.h> |
|
35 36#include <clocksource/arm_arch_timer.h> 37 38#include <asm/thread_info.h> 39#include <asm/stacktrace.h> 40 41#ifdef CONFIG_SMP 42unsigned long profile_pc(struct pt_regs *regs) --- 29 unchanged lines hidden (view full) --- 72 *timer_value = arch_timer_read_counter(); 73 return 0; 74} 75 76void __init time_init(void) 77{ 78 u32 arch_timer_rate; 79 | 36 37#include <clocksource/arm_arch_timer.h> 38 39#include <asm/thread_info.h> 40#include <asm/stacktrace.h> 41 42#ifdef CONFIG_SMP 43unsigned long profile_pc(struct pt_regs *regs) --- 29 unchanged lines hidden (view full) --- 73 *timer_value = arch_timer_read_counter(); 74 return 0; 75} 76 77void __init time_init(void) 78{ 79 u32 arch_timer_rate; 80 |
80 if (arch_timer_init()) 81 panic("Unable to initialise architected timer.\n"); | 81 clocksource_of_init(); |
82 83 arch_timer_rate = arch_timer_get_rate(); | 82 83 arch_timer_rate = arch_timer_get_rate(); |
84 if (!arch_timer_rate) 85 panic("Unable to initialise architected timer.\n"); |
|
84 85 /* Cache the sched_clock multiplier to save a divide in the hot path. */ 86 sched_clock_mult = NSEC_PER_SEC / arch_timer_rate; 87 88 /* Calibrate the delay loop directly */ 89 lpj_fine = arch_timer_rate / HZ; 90} | 86 87 /* Cache the sched_clock multiplier to save a divide in the hot path. */ 88 sched_clock_mult = NSEC_PER_SEC / arch_timer_rate; 89 90 /* Calibrate the delay loop directly */ 91 lpj_fine = arch_timer_rate / HZ; 92} |