Skip to content

Commit de6b034

Browse files
committed
[XTENSA] Add volatile keyword to asm statements accessing counter registers
The compiler get's sometimes to smart and doesn't reread the counter registers and the kernel doesn't schedule until the counter wraps around. Signed-off-by: Chris Zankel <[email protected]>
1 parent 03dfa44 commit de6b034

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/asm-xtensa/timex.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ extern cycles_t cacheflush_time;
6363
* Register access.
6464
*/
6565

66-
#define WSR_CCOUNT(r) __asm__("wsr %0,"__stringify(CCOUNT) :: "a" (r))
67-
#define RSR_CCOUNT(r) __asm__("rsr %0,"__stringify(CCOUNT) : "=a" (r))
68-
#define WSR_CCOMPARE(x,r) __asm__("wsr %0,"__stringify(CCOMPARE)"+"__stringify(x) :: "a"(r))
69-
#define RSR_CCOMPARE(x,r) __asm__("rsr %0,"__stringify(CCOMPARE)"+"__stringify(x) : "=a"(r))
66+
#define WSR_CCOUNT(r) asm volatile ("wsr %0,"__stringify(CCOUNT) :: "a" (r))
67+
#define RSR_CCOUNT(r) asm volatile ("rsr %0,"__stringify(CCOUNT) : "=a" (r))
68+
#define WSR_CCOMPARE(x,r) asm volatile ("wsr %0,"__stringify(CCOMPARE)"+"__stringify(x) :: "a"(r))
69+
#define RSR_CCOMPARE(x,r) asm volatile ("rsr %0,"__stringify(CCOMPARE)"+"__stringify(x) : "=a"(r))
7070

7171
static inline unsigned long get_ccount (void)
7272
{

0 commit comments

Comments
 (0)