Skip to content

Commit dedfe25

Browse files
committed
xtensa: add xtensa_xsr macro
xtensa_xsr does the XSR instruction for the specified special register. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
1 parent 0b549f8 commit dedfe25

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

arch/xtensa/include/asm/processor.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,13 @@ extern unsigned long __get_wchan(struct task_struct *p);
246246
v; \
247247
})
248248

249+
#define xtensa_xsr(x, sr) \
250+
({ \
251+
unsigned int __v__ = (unsigned int)(x); \
252+
__asm__ __volatile__ ("xsr %0, " __stringify(sr) : "+a"(__v__)); \
253+
__v__; \
254+
})
255+
249256
#if XCHAL_HAVE_EXTERN_REGS
250257

251258
static inline void set_er(unsigned long value, unsigned long addr)

0 commit comments

Comments
 (0)