Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de6b0345 authored by Chris Zankel's avatar Chris Zankel
Browse files

[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: default avatarChris Zankel <chris@zankel.net>
parent 03dfa442
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -63,10 +63,10 @@ extern cycles_t cacheflush_time;
 * Register access.
 * Register access.
 */
 */


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


static inline unsigned long get_ccount (void)
static inline unsigned long get_ccount (void)
{
{