X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Farm%2Fmach-imx%2Ftime.c;h=11f1e56c36bc041154e995b00650c0fcb34c4eb0;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=ac7cab9b00cfd5252e6b00b801eb4e5a11af5b2f;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c index ac7cab9b0..11f1e56c3 100644 --- a/arch/arm/mach-imx/time.c +++ b/arch/arm/mach-imx/time.c @@ -28,8 +28,7 @@ * Returns number of us since last clock interrupt. Note that interrupts * will have been disabled by do_gettimeoffset() */ -static unsigned long -imx_gettimeoffset(void) +static unsigned long imx_gettimeoffset(void) { unsigned long ticks; @@ -59,11 +58,15 @@ imx_gettimeoffset(void) static irqreturn_t imx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); + /* clear the interrupt */ if (IMX_TSTAT(TIMER_BASE)) IMX_TSTAT(TIMER_BASE) = 0; timer_tick(regs); + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } @@ -76,8 +79,7 @@ static struct irqaction imx_timer_irq = { /* * Set up timer interrupt, and return the current time in seconds. */ -void __init -imx_init_time(void) +static void __init imx_timer_init(void) { /* * Initialise to a known state (all timers off, and timing reset) @@ -91,5 +93,9 @@ imx_init_time(void) * Make irqs happen for the system timer */ setup_irq(TIM1_INT, &imx_timer_irq); - gettimeoffset = imx_gettimeoffset; } + +struct sys_timer imx_timer = { + .init = imx_timer_init, + .offset = imx_gettimeoffset, +};