hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/arch/xtensa/include/asm/timex.h
....@@ -10,7 +10,6 @@
1010 #define _XTENSA_TIMEX_H
1111
1212 #include <asm/processor.h>
13
-#include <linux/stringify.h>
1413
1514 #if XCHAL_NUM_TIMERS > 0 && \
1615 XTENSA_INT_LEVEL(XCHAL_TIMER0_INTERRUPT) <= XCHAL_EXCM_LEVEL
....@@ -30,43 +29,32 @@
3029
3130 extern unsigned long ccount_freq;
3231
33
-typedef unsigned long long cycles_t;
34
-
35
-#define get_cycles() (0)
36
-
3732 void local_timer_setup(unsigned cpu);
3833
3934 /*
4035 * Register access.
4136 */
4237
43
-#define WSR_CCOUNT(r) asm volatile ("wsr %0, ccount" :: "a" (r))
44
-#define RSR_CCOUNT(r) asm volatile ("rsr %0, ccount" : "=a" (r))
45
-#define WSR_CCOMPARE(x,r) asm volatile ("wsr %0,"__stringify(SREG_CCOMPARE)"+"__stringify(x) :: "a"(r))
46
-#define RSR_CCOMPARE(x,r) asm volatile ("rsr %0,"__stringify(SREG_CCOMPARE)"+"__stringify(x) : "=a"(r))
47
-
4838 static inline unsigned long get_ccount (void)
4939 {
50
- unsigned long ccount;
51
- RSR_CCOUNT(ccount);
52
- return ccount;
40
+ return xtensa_get_sr(ccount);
5341 }
5442
5543 static inline void set_ccount (unsigned long ccount)
5644 {
57
- WSR_CCOUNT(ccount);
45
+ xtensa_set_sr(ccount, ccount);
5846 }
5947
6048 static inline unsigned long get_linux_timer (void)
6149 {
62
- unsigned ccompare;
63
- RSR_CCOMPARE(LINUX_TIMER, ccompare);
64
- return ccompare;
50
+ return xtensa_get_sr(SREG_CCOMPARE + LINUX_TIMER);
6551 }
6652
6753 static inline void set_linux_timer (unsigned long ccompare)
6854 {
69
- WSR_CCOMPARE(LINUX_TIMER, ccompare);
55
+ xtensa_set_sr(ccompare, SREG_CCOMPARE + LINUX_TIMER);
7056 }
7157
58
+#include <asm-generic/timex.h>
59
+
7260 #endif /* _XTENSA_TIMEX_H */