diff options
Diffstat (limited to 'arch/xtensa/include/asm/processor.h')
-rw-r--r-- | arch/xtensa/include/asm/processor.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h index 7e409a5b0ec5..abb59708a3b7 100644 --- a/arch/xtensa/include/asm/processor.h +++ b/arch/xtensa/include/asm/processor.h | |||
@@ -191,5 +191,25 @@ extern unsigned long get_wchan(struct task_struct *p); | |||
191 | #define set_sr(x,sr) ({unsigned int v=(unsigned int)x; WSR(v,sr);}) | 191 | #define set_sr(x,sr) ({unsigned int v=(unsigned int)x; WSR(v,sr);}) |
192 | #define get_sr(sr) ({unsigned int v; RSR(v,sr); v; }) | 192 | #define get_sr(sr) ({unsigned int v; RSR(v,sr); v; }) |
193 | 193 | ||
194 | #ifndef XCHAL_HAVE_EXTERN_REGS | ||
195 | #define XCHAL_HAVE_EXTERN_REGS 0 | ||
196 | #endif | ||
197 | |||
198 | #if XCHAL_HAVE_EXTERN_REGS | ||
199 | |||
200 | static inline void set_er(unsigned long value, unsigned long addr) | ||
201 | { | ||
202 | asm volatile ("wer %0, %1" : : "a" (value), "a" (addr) : "memory"); | ||
203 | } | ||
204 | |||
205 | static inline unsigned long get_er(unsigned long addr) | ||
206 | { | ||
207 | register unsigned long value; | ||
208 | asm volatile ("rer %0, %1" : "=a" (value) : "a" (addr) : "memory"); | ||
209 | return value; | ||
210 | } | ||
211 | |||
212 | #endif /* XCHAL_HAVE_EXTERN_REGS */ | ||
213 | |||
194 | #endif /* __ASSEMBLY__ */ | 214 | #endif /* __ASSEMBLY__ */ |
195 | #endif /* _XTENSA_PROCESSOR_H */ | 215 | #endif /* _XTENSA_PROCESSOR_H */ |