aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/include/asm/processor.h
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2019-01-04 22:07:47 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2019-01-04 22:07:47 +1100
commitd538d94f0ca86cfedc892cc427169219acb3c2f7 (patch)
tree8363c4ff35907edb5245da737d7f6982bf22b945 /arch/xtensa/include/asm/processor.h
parentKVM: PPC: Book3S HV: radix: Fix uninitialized var build error (diff)
parentRemove 'type' argument from access_ok() function (diff)
downloadlinux-dev-d538d94f0ca86cfedc892cc427169219acb3c2f7.tar.xz
linux-dev-d538d94f0ca86cfedc892cc427169219acb3c2f7.zip
Merge branch 'master' into fixes
We have a fix to apply on top of commit 96d4f267e40f ("Remove 'type' argument from access_ok() function"), so merge master to get it.
Diffstat (limited to 'arch/xtensa/include/asm/processor.h')
-rw-r--r--arch/xtensa/include/asm/processor.h18
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