Skip to contentSkip to conversation

clocksource: import CLOCKSOURCE_MASK from the kernel

PATCH New Jean-Christophe PLAGNIOL-VILLARD 1 participant 2 messages Nov 26, 2010 – Nov 29, 2010

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource: import CLOCKSOURCE_MASK from the kernel

---
 include/clock.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/clock.h +2 -0
index 278f6e8..b9acdb9 100644
@@ -3,6 +3,8 @@
 #ifndef CLOCK_H
 #define CLOCK_H
 
+#define CLOCKSOURCE_MASK(bits) (uint64_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
+
 struct clocksource {
 	uint32_t	shift;
 	uint32_t	mult;
Signature · 7 lines
1.7.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 1/1 clocksource: switch mask to CLOCKSOURCE_MASK

---
 arch/arm/mach-at91/at91sam926x_time.c |    2 +-
 arch/arm/mach-ep93xx/clocksource.c    |    2 +-
 arch/arm/mach-imx/clocksource.c       |    2 +-
 arch/arm/mach-netx/clocksource.c      |    2 +-
 arch/arm/mach-nomadik/timer.c         |    2 +-
 arch/arm/mach-omap/s32k_clksource.c   |    2 +-
 arch/arm/mach-s3c24xx/generic.c       |    2 +-
 arch/arm/mach-stm/clocksource-imx23.c |    2 +-
 arch/blackfin/lib/clock.c             |    2 +-
 arch/ppc/lib/time.c                   |    2 +-
 arch/sandbox/board/clock.c            |    2 +-
 arch/x86/mach-i386/pit_timer.c        |    2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)
arch/arm/mach-at91/at91sam926x_time.c +1 -1
index c1b42f9..7a1d6dd 100644
@@ -46,7 +46,7 @@ uint64_t at91sam9_clocksource_read(void)
 
 static struct clocksource cs = {
 	.read	= at91sam9_clocksource_read,
-	.mask	= 0xffffffff,
+	.mask	= CLOCKSOURCE_MASK(32),
 	.shift	= 10,
 };
 
arch/arm/mach-ep93xx/clocksource.c +1 -1
index a1e315d..b500948 100644
@@ -41,7 +41,7 @@ static uint64_t ep93xx_clocksource_read(void)
 
 static struct clocksource cs = {
 	.read	= ep93xx_clocksource_read,
-	.mask	= 0xffffffff,
+	.mask	= CLOCKSOURCE_MASK(32),
 	.shift	= 10,
 };
 
arch/arm/mach-imx/clocksource.c +1 -1
index 5b1bad5..5397da0 100644
@@ -47,7 +47,7 @@ static uint64_t imx_clocksource_read(void)
 
 static struct clocksource cs = {
 	.read	= imx_clocksource_read,
-	.mask	= 0xffffffff,
+	.mask	= CLOCKSOURCE_MASK(32),
 	.shift	= 10,
 };
 
arch/arm/mach-netx/clocksource.c +1 -1
index 818709d..853eab7 100644
@@ -34,7 +34,7 @@ uint64_t netx_clocksource_read(void)
 
 static struct clocksource cs = {
 	.read	= netx_clocksource_read,
-	.mask	= 0xffffffff,
+	.mask	= CLOCKSOURCE_MASK(32),
 	.shift	= 10,
 };
 
arch/arm/mach-nomadik/timer.c +1 -1
index 12e56f0..7de1f39 100644
@@ -35,7 +35,7 @@ static uint64_t nmdk_read_timer(void)
 static struct clocksource nmdk_clksrc = {
 	.read	= nmdk_read_timer,
 	.shift	= 20,
-	.mask	= 0xffffffff,
+	.mask	= CLOCKSOURCE_MASK(32),
 };
 
 static void nmdk_timer_reset(void)
arch/arm/mach-omap/s32k_clksource.c +1 -1
index 353670c..094b76d 100644
@@ -56,7 +56,7 @@ static uint64_t s32k_clocksource_read(void)
 /* A bit obvious isn't it? */
 static struct clocksource s32k_cs = {
 	.read = s32k_clocksource_read,
-	.mask = 0xffffffff,
+	.mask	= CLOCKSOURCE_MASK(32),
 	.shift = 10,
 };
 
arch/arm/mach-s3c24xx/generic.c +1 -1
index 46b5c50..c04e0b6 100644
@@ -196,7 +196,7 @@ static uint64_t s3c24xx_clocksource_read(void)
 
 static struct clocksource cs = {
 	.read	= s3c24xx_clocksource_read,
-	.mask	= 0x0000ffff,
+	.mask	= CLOCKSOURCE_MASK(16),
 	.shift	= 10,
 };
 
arch/arm/mach-stm/clocksource-imx23.c +1 -1
index 7c0268c..f7c94c1 100644
@@ -48,7 +48,7 @@ static uint64_t imx23_clocksource_read(void)
 
 static struct clocksource cs = {
 	.read	= imx23_clocksource_read,
-	.mask	= 0x0000ffff,
+	.mask	= CLOCKSOURCE_MASK(16),
 	.shift	= 10,
 };
 
arch/blackfin/lib/clock.c +1 -1
index dc2ab5f..7a5673f 100644
@@ -55,7 +55,7 @@ static uint64_t blackfin_clocksource_read(void)
 
 static struct clocksource cs = {
 	.read	= blackfin_clocksource_read,
-	.mask	= 0xffffffff,
+	.mask	= CLOCKSOURCE_MASK(32),
 	.shift	= 10,
 };
 
arch/ppc/lib/time.c +1 -1
index ee6cbdf..04c71df 100644
@@ -56,7 +56,7 @@ uint64_t ppc_clocksource_read(void)
 
 static struct clocksource cs = {
 	.read	= ppc_clocksource_read,
-	.mask	= 0xffffffff,
+	.mask	= CLOCKSOURCE_MASK(32),
 	.shift	= 15,
 };
 
arch/sandbox/board/clock.c +1 -1
index b150864..3afbc8d 100644
@@ -32,7 +32,7 @@ static uint64_t linux_clocksource_read(void)
 
 static struct clocksource cs = {
 	.read	= linux_clocksource_read,
-	.mask	= 0xffffffff,
+	.mask	= CLOCKSOURCE_MASK(32),
 	.shift	= 10,
 };
 
arch/x86/mach-i386/pit_timer.c +1 -1
index b9f805e..ec97cee 100644
@@ -56,7 +56,7 @@ static uint64_t pit_clocksource_read(void)
 
 static struct clocksource cs = {
 	.read	= pit_clocksource_read,
-	.mask	= 0x0000ffff,
+	.mask	= CLOCKSOURCE_MASK(16),
 	.shift	= 10,
 };
 
Signature · 7 lines
1.7.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox