summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/psrcompat.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-07-20 14:56:40 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-07-20 14:56:40 +0000
commite308faf24f68e262d92d294a01ddca7a17e76762 (patch)
tree22c47cb315811834861f013067878ff664e95abd /include/asm-sparc64/psrcompat.h
parent30c6397ce63178fcb3e7963ac247f0a03132aca9 (diff)
Sync with Linux 2.1.46.
Diffstat (limited to 'include/asm-sparc64/psrcompat.h')
-rw-r--r--include/asm-sparc64/psrcompat.h28
1 files changed, 7 insertions, 21 deletions
diff --git a/include/asm-sparc64/psrcompat.h b/include/asm-sparc64/psrcompat.h
index b971514d6..22e9da3d6 100644
--- a/include/asm-sparc64/psrcompat.h
+++ b/include/asm-sparc64/psrcompat.h
@@ -1,4 +1,4 @@
-/* $Id: psrcompat.h,v 1.3 1997/06/05 06:22:54 davem Exp $ */
+/* $Id: psrcompat.h,v 1.4 1997/06/20 11:54:39 davem Exp $ */
#ifndef _SPARC64_PSRCOMPAT_H
#define _SPARC64_PSRCOMPAT_H
@@ -23,33 +23,19 @@
extern inline unsigned int tstate_to_psr(unsigned long tstate)
{
- unsigned int psr;
unsigned long vers;
- /* These fields are in the same place. */
- psr = (tstate & (TSTATE_CWP | TSTATE_PEF));
-
- /* This is what the user would have always seen. */
- psr |= PSR_S;
-
- /* Slam in the 32-bit condition codes. */
- psr |= ((tstate & TSTATE_ICC) >> 12);
-
- /* This is completely arbitrary. */
__asm__ __volatile__("rdpr %%ver, %0" : "=r" (vers));
- psr |= ((vers << 8) >> 32) & PSR_IMPL;
- psr |= ((vers << 24) >> 36) & PSR_VERS;
-
- return psr;
+ return ((tstate & TSTATE_CWP) |
+ PSR_S |
+ ((tstate & TSTATE_ICC) >> 12) |
+ (((vers << 8) >> 32) & PSR_IMPL) |
+ (((vers << 24) >> 36) & PSR_VERS));
}
extern inline unsigned long psr_to_tstate_icc(unsigned int psr)
{
- unsigned long tstate;
-
- tstate = ((unsigned long)(psr & PSR_ICC)) << 12;
-
- return tstate;
+ return ((unsigned long)(psr & PSR_ICC)) << 12;
}
#endif /* !(_SPARC64_PSRCOMPAT_H) */