X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Farm%2Fmach-h720x%2Fcpu-h7201.c;h=13f76bdb3d9d6ebacd029eb53d69dd8989de835a;hb=refs%2Fheads%2Fvserver;hp=30f4d61184b9a8b926430d777c5a9d4a143126a3;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/arch/arm/mach-h720x/cpu-h7201.c b/arch/arm/mach-h720x/cpu-h7201.c index 30f4d6118..13f76bdb3 100644 --- a/arch/arm/mach-h720x/cpu-h7201.c +++ b/arch/arm/mach-h720x/cpu-h7201.c @@ -22,25 +22,27 @@ #include #include #include - -extern unsigned long h720x_gettimeoffset(void); -extern void __init h720x_init_irq (void); - +#include "common.h" /* * Timer interrupt handler */ static irqreturn_t -h7201_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +h7201_timer_interrupt(int irq, void *dev_id) { + write_seqlock(&xtime_lock); + CPU_REG (TIMER_VIRT, TIMER_TOPSTAT); - timer_tick(regs); + timer_tick(); + + write_sequnlock(&xtime_lock); + return IRQ_HANDLED; } static struct irqaction h7201_timer_irq = { .name = "h7201 Timer Tick", - .flags = SA_INTERRUPT, - .handler = h7201_timer_interrupt + .flags = IRQF_DISABLED | IRQF_TIMER, + .handler = h7201_timer_interrupt, }; /* @@ -48,8 +50,6 @@ static struct irqaction h7201_timer_irq = { */ void __init h7201_init_time(void) { - gettimeoffset = h720x_gettimeoffset; - CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; @@ -57,3 +57,8 @@ void __init h7201_init_time(void) setup_irq(IRQ_TIMER0, &h7201_timer_irq); } + +struct sys_timer h7201_timer = { + .init = h7201_init_time, + .offset = h720x_gettimeoffset, +};