summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/pstate.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sparc64/pstate.h')
-rw-r--r--include/asm-sparc64/pstate.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/include/asm-sparc64/pstate.h b/include/asm-sparc64/pstate.h
index 490d837a8..2233ee7f0 100644
--- a/include/asm-sparc64/pstate.h
+++ b/include/asm-sparc64/pstate.h
@@ -1,4 +1,4 @@
-/* $Id: pstate.h,v 1.3 1997/03/25 03:58:31 davem Exp $ */
+/* $Id: pstate.h,v 1.4 1997/05/29 12:45:02 jj Exp $ */
#ifndef _SPARC64_PSTATE_H
#define _SPARC64_PSTATE_H
@@ -79,4 +79,32 @@
#define VERS_MAXTL 0x000000000000ff00 /* Maximum Trap Level. */
#define VERS_MAXWIN 0x000000000000001f /* Maximum Reg Window Index. */
+#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+#define set_pstate(bits) \
+ __asm__ __volatile__( \
+ "rdpr %%pstate, %%g1\n\t" \
+ "or %%g1, %0, %%g1\n\t" \
+ "wrpr %%g1, 0x0, %%pstate\n\t" \
+ : /* no outputs */ \
+ : "i" (bits) \
+ : "g1")
+
+#define clear_pstate(bits) \
+ __asm__ __volatile__( \
+ "rdpr %%pstate, %%g1\n\t" \
+ "andn %%g1, %0, %%g1\n\t" \
+ "wrpr %%g1, 0x0, %%pstate\n\t" \
+ : /* no outputs */ \
+ : "i" (bits) \
+ : "g1")
+
+#define change_pstate(bits) \
+ __asm__ __volatile__( \
+ "rdpr %%pstate, %%g1\n\t" \
+ "wrpr %%g1, %0, %%pstate\n\t" \
+ : /* no outputs */ \
+ : "i" (bits) \
+ : "g1")
+#endif
+
#endif /* !(_SPARC64_PSTATE_H) */