summaryrefslogtreecommitdiff
path: root/arch/alpha/include/asm/special_insns.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-03-28 21:11:12 +0400
committerDavid Howells <dhowells@redhat.com>2012-03-28 21:11:12 +0400
commitec2212088c42ff7d1362629ec26dda4f3e8bdad3 (patch)
tree0e99963f6818ef9c07fe8f2fb1f9851ef9641313 /arch/alpha/include/asm/special_insns.h
parentf05e798ad4c09255f590f5b2c00a7ca6c172f983 (diff)
downloadlinux-ec2212088c42ff7d1362629ec26dda4f3e8bdad3.tar.xz
Disintegrate asm/system.h for Alpha
Disintegrate asm/system.h for Alpha. Signed-off-by: David Howells <dhowells@redhat.com> cc: linux-alpha@vger.kernel.org
Diffstat (limited to 'arch/alpha/include/asm/special_insns.h')
-rw-r--r--arch/alpha/include/asm/special_insns.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/special_insns.h b/arch/alpha/include/asm/special_insns.h
new file mode 100644
index 000000000000..88d3452b21f0
--- /dev/null
+++ b/arch/alpha/include/asm/special_insns.h
@@ -0,0 +1,41 @@
+#ifndef __ALPHA_SPECIAL_INSNS_H
+#define __ALPHA_SPECIAL_INSNS_H
+
+enum implver_enum {
+ IMPLVER_EV4,
+ IMPLVER_EV5,
+ IMPLVER_EV6
+};
+
+#ifdef CONFIG_ALPHA_GENERIC
+#define implver() \
+({ unsigned long __implver; \
+ __asm__ ("implver %0" : "=r"(__implver)); \
+ (enum implver_enum) __implver; })
+#else
+/* Try to eliminate some dead code. */
+#ifdef CONFIG_ALPHA_EV4
+#define implver() IMPLVER_EV4
+#endif
+#ifdef CONFIG_ALPHA_EV5
+#define implver() IMPLVER_EV5
+#endif
+#if defined(CONFIG_ALPHA_EV6)
+#define implver() IMPLVER_EV6
+#endif
+#endif
+
+enum amask_enum {
+ AMASK_BWX = (1UL << 0),
+ AMASK_FIX = (1UL << 1),
+ AMASK_CIX = (1UL << 2),
+ AMASK_MAX = (1UL << 8),
+ AMASK_PRECISE_TRAP = (1UL << 9),
+};
+
+#define amask(mask) \
+({ unsigned long __amask, __input = (mask); \
+ __asm__ ("amask %1,%0" : "=r"(__amask) : "rI"(__input)); \
+ __amask; })
+
+#endif /* __ALPHA_SPECIAL_INSNS_H */