diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2018-11-28 03:27:47 +0300 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2018-12-05 01:08:11 +0300 |
commit | cad6fade6e78030e60188da3f18090577daa9243 (patch) | |
tree | 4e2a429c4ba70161706227a3b195832201617ffd /arch/xtensa/include/asm/processor.h | |
parent | c066cc8af9de8f749d29f75ad8c1c37d565f32b7 (diff) | |
download | linux-cad6fade6e78030e60188da3f18090577daa9243.tar.xz |
xtensa: clean up WSR*/RSR*/get_sr/set_sr
WSR and RSR are too generic and collide with other macro definitions in
the kernel causing warnings in allmodconfig builds. Drop WSR and RSR
macros and WSR_* and RSR_* variants. Change get_sr and set_sr to
xtensa_get_sr and xtensa_set_sr. Fix up users.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/include/asm/processor.h')
-rw-r--r-- | arch/xtensa/include/asm/processor.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h index 34a23016dd14..f7dd895b2353 100644 --- a/arch/xtensa/include/asm/processor.h +++ b/arch/xtensa/include/asm/processor.h @@ -13,6 +13,7 @@ #include <variant/core.h> #include <linux/compiler.h> +#include <linux/stringify.h> #include <asm/ptrace.h> #include <asm/types.h> #include <asm/regs.h> @@ -212,11 +213,18 @@ extern unsigned long get_wchan(struct task_struct *p); /* Special register access. */ -#define WSR(v,sr) __asm__ __volatile__ ("wsr %0,"__stringify(sr) :: "a"(v)); -#define RSR(v,sr) __asm__ __volatile__ ("rsr %0,"__stringify(sr) : "=a"(v)); - -#define set_sr(x,sr) ({unsigned int v=(unsigned int)x; WSR(v,sr);}) -#define get_sr(sr) ({unsigned int v; RSR(v,sr); v; }) +#define xtensa_set_sr(x, sr) \ + ({ \ + unsigned int v = (unsigned int)(x); \ + __asm__ __volatile__ ("wsr %0, "__stringify(sr) :: "a"(v)); \ + }) + +#define xtensa_get_sr(sr) \ + ({ \ + unsigned int v; \ + __asm__ __volatile__ ("rsr %0, "__stringify(sr) : "=a"(v)); \ + v; \ + }) #ifndef XCHAL_HAVE_EXTERN_REGS #define XCHAL_HAVE_EXTERN_REGS 0 |