Skip to content

Commit 8102f47

Browse files
baruchsiachczankel
authored andcommitted
xtensa: consolidate ccount access routines
Use get_ccount everywhere; remove xtensa_get_ccount. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Chris Zankel <chris@zankel.net>
1 parent e504c4b commit 8102f47

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

arch/xtensa/include/asm/delay.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#ifndef _XTENSA_DELAY_H
1313
#define _XTENSA_DELAY_H
1414

15-
#include <asm/processor.h>
15+
#include <asm/timex.h>
1616
#include <asm/param.h>
1717

1818
extern unsigned long loops_per_jiffy;
@@ -24,24 +24,17 @@ static inline void __delay(unsigned long loops)
2424
: "=r" (loops) : "0" (loops));
2525
}
2626

27-
static __inline__ u32 xtensa_get_ccount(void)
28-
{
29-
u32 ccount;
30-
asm volatile ("rsr %0, ccount\n" : "=r" (ccount));
31-
return ccount;
32-
}
33-
3427
/* For SMP/NUMA systems, change boot_cpu_data to something like
3528
* local_cpu_data->... where local_cpu_data points to the current
3629
* cpu. */
3730

3831
static __inline__ void udelay (unsigned long usecs)
3932
{
40-
unsigned long start = xtensa_get_ccount();
33+
unsigned long start = get_ccount();
4134
unsigned long cycles = usecs * (loops_per_jiffy / (1000000UL / HZ));
4235

4336
/* Note: all variables are unsigned (can wrap around)! */
44-
while (((unsigned long)xtensa_get_ccount()) - start < cycles)
37+
while (((unsigned long)get_ccount()) - start < cycles)
4538
;
4639
}
4740

arch/xtensa/variants/s6000/delay.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include <asm/delay.h>
21
#include <asm/timex.h>
32
#include <asm/io.h>
43
#include <variant/hardware.h>
@@ -17,7 +16,7 @@ void platform_calibrate_ccount(void)
1716
"1: l32i %0, %2, 0 ;"
1817
" beq %0, %1, 1b ;"
1918
: "=&a"(u) : "a"(t), "a"(tstamp));
20-
b = xtensa_get_ccount();
19+
b = get_ccount();
2120
if (i == LOOPS)
2221
a = b;
2322
} while (--i >= 0);

0 commit comments

Comments
 (0)