1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * psr.h: This file holds the macros for masking off various parts of 4*4882a593Smuzhiyun * the processor status register on the Sparc. This is valid 5*4882a593Smuzhiyun * for Version 8. On the V9 this is renamed to the PSTATE 6*4882a593Smuzhiyun * register and its members are accessed as fields like 7*4882a593Smuzhiyun * PSTATE.PRIV for the current CPU privilege level. 8*4882a593Smuzhiyun * 9*4882a593Smuzhiyun * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) 10*4882a593Smuzhiyun */ 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun #ifndef _UAPI__LINUX_SPARC_PSR_H 13*4882a593Smuzhiyun #define _UAPI__LINUX_SPARC_PSR_H 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun /* The Sparc PSR fields are laid out as the following: 16*4882a593Smuzhiyun * 17*4882a593Smuzhiyun * ------------------------------------------------------------------------ 18*4882a593Smuzhiyun * | impl | vers | icc | resv | EC | EF | PIL | S | PS | ET | CWP | 19*4882a593Smuzhiyun * | 31-28 | 27-24 | 23-20 | 19-14 | 13 | 12 | 11-8 | 7 | 6 | 5 | 4-0 | 20*4882a593Smuzhiyun * ------------------------------------------------------------------------ 21*4882a593Smuzhiyun */ 22*4882a593Smuzhiyun #define PSR_CWP 0x0000001f /* current window pointer */ 23*4882a593Smuzhiyun #define PSR_ET 0x00000020 /* enable traps field */ 24*4882a593Smuzhiyun #define PSR_PS 0x00000040 /* previous privilege level */ 25*4882a593Smuzhiyun #define PSR_S 0x00000080 /* current privilege level */ 26*4882a593Smuzhiyun #define PSR_PIL 0x00000f00 /* processor interrupt level */ 27*4882a593Smuzhiyun #define PSR_EF 0x00001000 /* enable floating point */ 28*4882a593Smuzhiyun #define PSR_EC 0x00002000 /* enable co-processor */ 29*4882a593Smuzhiyun #define PSR_SYSCALL 0x00004000 /* inside of a syscall */ 30*4882a593Smuzhiyun #define PSR_LE 0x00008000 /* SuperSparcII little-endian */ 31*4882a593Smuzhiyun #define PSR_ICC 0x00f00000 /* integer condition codes */ 32*4882a593Smuzhiyun #define PSR_C 0x00100000 /* carry bit */ 33*4882a593Smuzhiyun #define PSR_V 0x00200000 /* overflow bit */ 34*4882a593Smuzhiyun #define PSR_Z 0x00400000 /* zero bit */ 35*4882a593Smuzhiyun #define PSR_N 0x00800000 /* negative bit */ 36*4882a593Smuzhiyun #define PSR_VERS 0x0f000000 /* cpu-version field */ 37*4882a593Smuzhiyun #define PSR_IMPL 0xf0000000 /* cpu-implementation field */ 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun #define PSR_VERS_SHIFT 24 40*4882a593Smuzhiyun #define PSR_IMPL_SHIFT 28 41*4882a593Smuzhiyun #define PSR_VERS_SHIFTED_MASK 0xf 42*4882a593Smuzhiyun #define PSR_IMPL_SHIFTED_MASK 0xf 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun #define PSR_IMPL_TI 0x4 45*4882a593Smuzhiyun #define PSR_IMPL_LEON 0xf 46*4882a593Smuzhiyun 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun #endif /* _UAPI__LINUX_SPARC_PSR_H */ 49