From 221ca9968d6ebc2f83e56a84b54464e9e3e137c7 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 21 Oct 2008 14:06:35 +0100 Subject: [PATCH] --- yaml --- r: 123831 b: refs/heads/master c: 9bc1aaeac0118611c30edf84995ebad5adfd6822 h: refs/heads/master i: 123829: b835dbd1a75bbf8737d1ee2336c053b3b6ceaad8 123827: e54c0957950ed1f2123b7ba3434e6e8dab0a914e 123823: 5248f17026bb78204b350c612e673406bbc11eab v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-s3c2410/include/mach/tick.h | 15 +++++++++++++++ trunk/arch/arm/mach-s3c24a0/include/mach/tick.h | 15 +++++++++++++++ trunk/arch/arm/plat-s3c/time.c | 7 ++----- 4 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 trunk/arch/arm/mach-s3c2410/include/mach/tick.h create mode 100644 trunk/arch/arm/mach-s3c24a0/include/mach/tick.h diff --git a/[refs] b/[refs] index 5d64ce9060d7..ff0b9211bd82 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bcae8aeb320dfe8dde4b3512237a5b76737b0120 +refs/heads/master: 9bc1aaeac0118611c30edf84995ebad5adfd6822 diff --git a/trunk/arch/arm/mach-s3c2410/include/mach/tick.h b/trunk/arch/arm/mach-s3c2410/include/mach/tick.h new file mode 100644 index 000000000000..544da41979db --- /dev/null +++ b/trunk/arch/arm/mach-s3c2410/include/mach/tick.h @@ -0,0 +1,15 @@ +/* linux/arch/arm/mach-s3c2410/include/mach/tick.h + * + * Copyright 2008 Simtec Electronics + * Ben Dooks + * http://armlinux.simtec.co.uk/ + * + * S3C2410 - timer tick support + */ + +#define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0)) + +static inline int s3c24xx_ostimer_pending(void) +{ + return __raw_readl(S3C2410_SRCPND) & SRCPND_TIMER4; +} diff --git a/trunk/arch/arm/mach-s3c24a0/include/mach/tick.h b/trunk/arch/arm/mach-s3c24a0/include/mach/tick.h new file mode 100644 index 000000000000..9dea8ba6fb72 --- /dev/null +++ b/trunk/arch/arm/mach-s3c24a0/include/mach/tick.h @@ -0,0 +1,15 @@ +/* linux/arch/arm/mach-s3c24a0/include/mach/tick.h + * + * Copyright 2008 Simtec Electronics + * Ben Dooks + * http://armlinux.simtec.co.uk/ + * + * S3C24A0 - timer tick support + */ + +#define SUBSRC_TIMER4 (1 << (IRQ_TIMER4 - IRQ_S3CUART_RX0)) + +static inline int s3c24xx_ostimer_pending(void) +{ + return __raw_readl(S3C2410_SUBSRCPND) & SUBSRC_TIMER4; +} diff --git a/trunk/arch/arm/plat-s3c/time.c b/trunk/arch/arm/plat-s3c/time.c index c6861a05a291..d35e149f4ebf 100644 --- a/trunk/arch/arm/plat-s3c/time.c +++ b/trunk/arch/arm/plat-s3c/time.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -91,12 +92,9 @@ static inline unsigned long timer_ticks_to_usec(unsigned long ticks) * IRQs are disabled before entering here from do_gettimeofday() */ -#define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0)) - static unsigned long s3c2410_gettimeoffset (void) { unsigned long tdone; - unsigned long irqpend; unsigned long tval; /* work out how many ticks have gone since last timer interrupt */ @@ -106,8 +104,7 @@ static unsigned long s3c2410_gettimeoffset (void) /* check to see if there is an interrupt pending */ - irqpend = __raw_readl(S3C2410_SRCPND); - if (irqpend & SRCPND_TIMER4) { + if (s3c24xx_ostimer_pending()) { /* re-read the timer, and try and fix up for the missed * interrupt. Note, the interrupt may go off before the * timer has re-loaded from wrapping.