diff options
Diffstat (limited to 'include/asm-sparc64/psrcompat.h')
-rw-r--r-- | include/asm-sparc64/psrcompat.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/asm-sparc64/psrcompat.h b/include/asm-sparc64/psrcompat.h index 22e9da3d6..12fa4871a 100644 --- a/include/asm-sparc64/psrcompat.h +++ b/include/asm-sparc64/psrcompat.h @@ -1,4 +1,4 @@ -/* $Id: psrcompat.h,v 1.4 1997/06/20 11:54:39 davem Exp $ */ +/* $Id: psrcompat.h,v 1.5 1998/10/06 09:28:39 jj Exp $ */ #ifndef _SPARC64_PSRCOMPAT_H #define _SPARC64_PSRCOMPAT_H @@ -21,21 +21,24 @@ #define PSR_VERS 0x0f000000 /* cpu-version field */ #define PSR_IMPL 0xf0000000 /* cpu-implementation field */ +#define PSR_V8PLUS 0xff000000 /* fake impl/ver, meaning a 64bit CPU is present */ +#define PSR_XCC 0x000f0000 /* if PSR_V8PLUS, this is %xcc */ + extern inline unsigned int tstate_to_psr(unsigned long tstate) { - unsigned long vers; - - __asm__ __volatile__("rdpr %%ver, %0" : "=r" (vers)); return ((tstate & TSTATE_CWP) | PSR_S | ((tstate & TSTATE_ICC) >> 12) | - (((vers << 8) >> 32) & PSR_IMPL) | - (((vers << 24) >> 36) & PSR_VERS)); + ((tstate & TSTATE_XCC) >> 20) | + PSR_V8PLUS); } extern inline unsigned long psr_to_tstate_icc(unsigned int psr) { - return ((unsigned long)(psr & PSR_ICC)) << 12; + unsigned long tstate = ((unsigned long)(psr & PSR_ICC)) << 12; + if ((psr & (PSR_VERS|PSR_IMPL)) == PSR_V8PLUS) + tstate |= ((unsigned long)(psr & PSR_XCC)) << 20; + return tstate; } #endif /* !(_SPARC64_PSRCOMPAT_H) */ |