18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * psr.h: This file holds the macros for masking off various parts of
48c2ecf20Sopenharmony_ci *        the processor status register on the Sparc. This is valid
58c2ecf20Sopenharmony_ci *        for Version 8. On the V9 this is renamed to the PSTATE
68c2ecf20Sopenharmony_ci *        register and its members are accessed as fields like
78c2ecf20Sopenharmony_ci *        PSTATE.PRIV for the current CPU privilege level.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#ifndef _UAPI__LINUX_SPARC_PSR_H
138c2ecf20Sopenharmony_ci#define _UAPI__LINUX_SPARC_PSR_H
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/* The Sparc PSR fields are laid out as the following:
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci *  ------------------------------------------------------------------------
188c2ecf20Sopenharmony_ci *  | impl  | vers  | icc   | resv  | EC | EF | PIL  | S | PS | ET |  CWP  |
198c2ecf20Sopenharmony_ci *  | 31-28 | 27-24 | 23-20 | 19-14 | 13 | 12 | 11-8 | 7 | 6  | 5  |  4-0  |
208c2ecf20Sopenharmony_ci *  ------------------------------------------------------------------------
218c2ecf20Sopenharmony_ci */
228c2ecf20Sopenharmony_ci#define PSR_CWP     0x0000001f         /* current window pointer     */
238c2ecf20Sopenharmony_ci#define PSR_ET      0x00000020         /* enable traps field         */
248c2ecf20Sopenharmony_ci#define PSR_PS      0x00000040         /* previous privilege level   */
258c2ecf20Sopenharmony_ci#define PSR_S       0x00000080         /* current privilege level    */
268c2ecf20Sopenharmony_ci#define PSR_PIL     0x00000f00         /* processor interrupt level  */
278c2ecf20Sopenharmony_ci#define PSR_EF      0x00001000         /* enable floating point      */
288c2ecf20Sopenharmony_ci#define PSR_EC      0x00002000         /* enable co-processor        */
298c2ecf20Sopenharmony_ci#define PSR_SYSCALL 0x00004000         /* inside of a syscall        */
308c2ecf20Sopenharmony_ci#define PSR_LE      0x00008000         /* SuperSparcII little-endian */
318c2ecf20Sopenharmony_ci#define PSR_ICC     0x00f00000         /* integer condition codes    */
328c2ecf20Sopenharmony_ci#define PSR_C       0x00100000         /* carry bit                  */
338c2ecf20Sopenharmony_ci#define PSR_V       0x00200000         /* overflow bit               */
348c2ecf20Sopenharmony_ci#define PSR_Z       0x00400000         /* zero bit                   */
358c2ecf20Sopenharmony_ci#define PSR_N       0x00800000         /* negative bit               */
368c2ecf20Sopenharmony_ci#define PSR_VERS    0x0f000000         /* cpu-version field          */
378c2ecf20Sopenharmony_ci#define PSR_IMPL    0xf0000000         /* cpu-implementation field   */
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#define PSR_VERS_SHIFT		24
408c2ecf20Sopenharmony_ci#define PSR_IMPL_SHIFT		28
418c2ecf20Sopenharmony_ci#define PSR_VERS_SHIFTED_MASK	0xf
428c2ecf20Sopenharmony_ci#define PSR_IMPL_SHIFTED_MASK	0xf
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define PSR_IMPL_TI		0x4
458c2ecf20Sopenharmony_ci#define PSR_IMPL_LEON		0xf
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#endif /* _UAPI__LINUX_SPARC_PSR_H */
49