Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _SPARC64_PSTATE_H
0003 #define _SPARC64_PSTATE_H
0004 
0005 #include <linux/const.h>
0006 
0007 /* The V9 PSTATE Register (with SpitFire extensions).
0008  *
0009  * -----------------------------------------------------------------------
0010  * | Resv | IG | MG | CLE | TLE |  MM  | RED | PEF | AM | PRIV | IE | AG |
0011  * -----------------------------------------------------------------------
0012  *  63  12  11   10    9     8    7   6   5     4     3     2     1    0
0013  */
0014 /* IG on V9 conflicts with MCDE on M7. PSTATE_MCDE will only be used on
0015  * processors that support ADI which do not use IG, hence there is no
0016  * functional conflict
0017  */
0018 #define PSTATE_IG   _AC(0x0000000000000800,UL) /* Interrupt Globals.    */
0019 #define PSTATE_MCDE _AC(0x0000000000000800,UL) /* MCD Enable        */
0020 #define PSTATE_MG   _AC(0x0000000000000400,UL) /* MMU Globals.      */
0021 #define PSTATE_CLE  _AC(0x0000000000000200,UL) /* Current Little Endian.*/
0022 #define PSTATE_TLE  _AC(0x0000000000000100,UL) /* Trap Little Endian.   */
0023 #define PSTATE_MM   _AC(0x00000000000000c0,UL) /* Memory Model.     */
0024 #define PSTATE_TSO  _AC(0x0000000000000000,UL) /* MM: TotalStoreOrder   */
0025 #define PSTATE_PSO  _AC(0x0000000000000040,UL) /* MM: PartialStoreOrder */
0026 #define PSTATE_RMO  _AC(0x0000000000000080,UL) /* MM: RelaxedMemoryOrder*/
0027 #define PSTATE_RED  _AC(0x0000000000000020,UL) /* Reset Error Debug.    */
0028 #define PSTATE_PEF  _AC(0x0000000000000010,UL) /* Floating Point Enable.*/
0029 #define PSTATE_AM   _AC(0x0000000000000008,UL) /* Address Mask.     */
0030 #define PSTATE_PRIV _AC(0x0000000000000004,UL) /* Privilege.        */
0031 #define PSTATE_IE   _AC(0x0000000000000002,UL) /* Interrupt Enable. */
0032 #define PSTATE_AG   _AC(0x0000000000000001,UL) /* Alternate Globals.    */
0033 
0034 /* The V9 TSTATE Register (with SpitFire and Linux extensions).
0035  *
0036  * ---------------------------------------------------------------------
0037  * |  Resv |  GL  |  CCR  |  ASI  |  %pil  |  PSTATE  |  Resv  |  CWP  |
0038  * ---------------------------------------------------------------------
0039  *  63   43 42  40 39   32 31   24 23    20 19       8 7      5 4     0
0040  */
0041 #define TSTATE_GL   _AC(0x0000070000000000,UL) /* Global reg level  */
0042 #define TSTATE_CCR  _AC(0x000000ff00000000,UL) /* Condition Codes.  */
0043 #define TSTATE_XCC  _AC(0x000000f000000000,UL) /* Condition Codes.  */
0044 #define TSTATE_XNEG _AC(0x0000008000000000,UL) /* %xcc Negative.    */
0045 #define TSTATE_XZERO    _AC(0x0000004000000000,UL) /* %xcc Zero.    */
0046 #define TSTATE_XOVFL    _AC(0x0000002000000000,UL) /* %xcc Overflow.    */
0047 #define TSTATE_XCARRY   _AC(0x0000001000000000,UL) /* %xcc Carry.   */
0048 #define TSTATE_ICC  _AC(0x0000000f00000000,UL) /* Condition Codes.  */
0049 #define TSTATE_INEG _AC(0x0000000800000000,UL) /* %icc Negative.    */
0050 #define TSTATE_IZERO    _AC(0x0000000400000000,UL) /* %icc Zero.    */
0051 #define TSTATE_IOVFL    _AC(0x0000000200000000,UL) /* %icc Overflow.    */
0052 #define TSTATE_ICARRY   _AC(0x0000000100000000,UL) /* %icc Carry.   */
0053 #define TSTATE_ASI  _AC(0x00000000ff000000,UL) /* AddrSpace ID. */
0054 #define TSTATE_PIL  _AC(0x0000000000f00000,UL) /* %pil (Linux traps)*/
0055 #define TSTATE_PSTATE   _AC(0x00000000000fff00,UL) /* PSTATE.       */
0056 /* IG on V9 conflicts with MCDE on M7. TSTATE_MCDE will only be used on
0057  * processors that support ADI which do not support IG, hence there is
0058  * no functional conflict
0059  */
0060 #define TSTATE_IG   _AC(0x0000000000080000,UL) /* Interrupt Globals.*/
0061 #define TSTATE_MCDE _AC(0x0000000000080000,UL) /* MCD enable.       */
0062 #define TSTATE_MG   _AC(0x0000000000040000,UL) /* MMU Globals.  */
0063 #define TSTATE_CLE  _AC(0x0000000000020000,UL) /* CurrLittleEndian. */
0064 #define TSTATE_TLE  _AC(0x0000000000010000,UL) /* TrapLittleEndian. */
0065 #define TSTATE_MM   _AC(0x000000000000c000,UL) /* Memory Model. */
0066 #define TSTATE_TSO  _AC(0x0000000000000000,UL) /* MM: TSO       */
0067 #define TSTATE_PSO  _AC(0x0000000000004000,UL) /* MM: PSO       */
0068 #define TSTATE_RMO  _AC(0x0000000000008000,UL) /* MM: RMO       */
0069 #define TSTATE_RED  _AC(0x0000000000002000,UL) /* Reset Error Debug.*/
0070 #define TSTATE_PEF  _AC(0x0000000000001000,UL) /* FPU Enable.   */
0071 #define TSTATE_AM   _AC(0x0000000000000800,UL) /* Address Mask. */
0072 #define TSTATE_PRIV _AC(0x0000000000000400,UL) /* Privilege.    */
0073 #define TSTATE_IE   _AC(0x0000000000000200,UL) /* Interrupt Enable. */
0074 #define TSTATE_AG   _AC(0x0000000000000100,UL) /* Alternate Globals.*/
0075 #define TSTATE_SYSCALL  _AC(0x0000000000000020,UL) /* in syscall trap   */
0076 #define TSTATE_CWP  _AC(0x000000000000001f,UL) /* Curr Win-Pointer. */
0077 
0078 /* Floating-Point Registers State Register.
0079  *
0080  * --------------------------------
0081  * |  Resv  |  FEF  |  DU  |  DL  |
0082  * --------------------------------
0083  *  63     3    2       1      0
0084  */
0085 #define FPRS_FEF    _AC(0x0000000000000004,UL) /* FPU Enable.   */
0086 #define FPRS_DU     _AC(0x0000000000000002,UL) /* Dirty Upper.  */
0087 #define FPRS_DL     _AC(0x0000000000000001,UL) /* Dirty Lower.  */
0088 
0089 /* Version Register.
0090  *
0091  * ------------------------------------------------------
0092  * | MANUF | IMPL | MASK | Resv | MAXTL | Resv | MAXWIN |
0093  * ------------------------------------------------------
0094  *  63   48 47  32 31  24 23  16 15    8 7    5 4      0
0095  */
0096 #define VERS_MANUF  _AC(0xffff000000000000,UL) /* Manufacturer. */
0097 #define VERS_IMPL   _AC(0x0000ffff00000000,UL) /* Implementation.   */
0098 #define VERS_MASK   _AC(0x00000000ff000000,UL) /* Mask Set Revision.*/
0099 #define VERS_MAXTL  _AC(0x000000000000ff00,UL) /* Max Trap Level.   */
0100 #define VERS_MAXWIN _AC(0x000000000000001f,UL) /* Max RegWindow Idx.*/
0101 
0102 /* Compatibility Feature Register (%asr26), SPARC-T4 and later  */
0103 #define CFR_AES     _AC(0x0000000000000001,UL) /* Supports AES opcodes     */
0104 #define CFR_DES     _AC(0x0000000000000002,UL) /* Supports DES opcodes     */
0105 #define CFR_KASUMI  _AC(0x0000000000000004,UL) /* Supports KASUMI opcodes  */
0106 #define CFR_CAMELLIA    _AC(0x0000000000000008,UL) /* Supports CAMELLIA opcodes*/
0107 #define CFR_MD5     _AC(0x0000000000000010,UL) /* Supports MD5 opcodes     */
0108 #define CFR_SHA1    _AC(0x0000000000000020,UL) /* Supports SHA1 opcodes    */
0109 #define CFR_SHA256  _AC(0x0000000000000040,UL) /* Supports SHA256 opcodes  */
0110 #define CFR_SHA512  _AC(0x0000000000000080,UL) /* Supports SHA512 opcodes  */
0111 #define CFR_MPMUL   _AC(0x0000000000000100,UL) /* Supports MPMUL opcodes   */
0112 #define CFR_MONTMUL _AC(0x0000000000000200,UL) /* Supports MONTMUL opcodes */
0113 #define CFR_MONTSQR _AC(0x0000000000000400,UL) /* Supports MONTSQR opcodes */
0114 #define CFR_CRC32C  _AC(0x0000000000000800,UL) /* Supports CRC32C opcodes  */
0115 
0116 #endif /* !(_SPARC64_PSTATE_H) */