PageRenderTime 15ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/ia64/sn/kernel/sn2/timer.c

https://bitbucket.org/evzijst/gittest
C | 36 lines | 23 code | 6 blank | 7 comment | 0 complexity | 28498b7b77f3c7e2496924ae7b5bbc7b MD5 | raw file
 1/*
 2 * linux/arch/ia64/sn/kernel/sn2/timer.c
 3 *
 4 * Copyright (C) 2003 Silicon Graphics, Inc.
 5 * Copyright (C) 2003 Hewlett-Packard Co
 6 *	David Mosberger <davidm@hpl.hp.com>: updated for new timer-interpolation infrastructure
 7 */
 8
 9#include <linux/init.h>
10#include <linux/kernel.h>
11#include <linux/sched.h>
12#include <linux/time.h>
13#include <linux/interrupt.h>
14
15#include <asm/hw_irq.h>
16#include <asm/system.h>
17
18#include <asm/sn/leds.h>
19#include <asm/sn/shub_mmr.h>
20#include <asm/sn/clksupport.h>
21
22extern unsigned long sn_rtc_cycles_per_second;
23
24static struct time_interpolator sn2_interpolator = {
25	.drift = -1,
26	.shift = 10,
27	.mask = (1LL << 55) - 1,
28	.source = TIME_SOURCE_MMIO64
29};
30
31void __init sn_timer_init(void)
32{
33	sn2_interpolator.frequency = sn_rtc_cycles_per_second;
34	sn2_interpolator.addr = RTC_COUNTER_ADDR;
35	register_time_interpolator(&sn2_interpolator);
36}