1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux 1 2 /* Copyright (C) 2017-2018 ARM Limited */ 3 4 /* 5 * For use by other UAPI headers only. 6 * Do not make direct use of header or its def 7 */ 8 9 #ifndef _UAPI__ASM_SVE_CONTEXT_H 10 #define _UAPI__ASM_SVE_CONTEXT_H 11 12 #include <linux/types.h> 13 14 #define __SVE_VQ_BYTES 16 /* num 15 16 /* 17 * Yes, __SVE_VQ_MAX is 512 QUADWORDS. 18 * 19 * To help ensure forward portability, this is 20 * current maximum value defined by the SVE ar 21 * or static allocations can be sized based on 22 * It will waste a surprisingly large amount o 23 * 24 * Dynamic sizing based on the actual runtime 25 * be preferable for most purposes. 26 */ 27 #define __SVE_VQ_MIN 1 28 #define __SVE_VQ_MAX 512 29 30 #define __SVE_VL_MIN (__SVE_VQ_MIN 31 #define __SVE_VL_MAX (__SVE_VQ_MAX 32 33 #define __SVE_NUM_ZREGS 32 34 #define __SVE_NUM_PREGS 16 35 36 #define __sve_vl_valid(vl) 37 ((vl) % __SVE_VQ_BYTES == 0 && 38 (vl) >= __SVE_VL_MIN && 39 (vl) <= __SVE_VL_MAX) 40 41 #define __sve_vq_from_vl(vl) ((vl) / __SVE_ 42 #define __sve_vl_from_vq(vq) ((vq) * __SVE_ 43 44 #define __SVE_ZREG_SIZE(vq) ((__u32)(vq) * 45 #define __SVE_PREG_SIZE(vq) ((__u32)(vq) * 46 #define __SVE_FFR_SIZE(vq) __SVE_PREG_SIZ 47 48 #define __SVE_ZREGS_OFFSET 0 49 #define __SVE_ZREG_OFFSET(vq, n) \ 50 (__SVE_ZREGS_OFFSET + __SVE_ZREG_SIZE( 51 #define __SVE_ZREGS_SIZE(vq) \ 52 (__SVE_ZREG_OFFSET(vq, __SVE_NUM_ZREGS 53 54 #define __SVE_PREGS_OFFSET(vq) \ 55 (__SVE_ZREGS_OFFSET + __SVE_ZREGS_SIZE 56 #define __SVE_PREG_OFFSET(vq, n) \ 57 (__SVE_PREGS_OFFSET(vq) + __SVE_PREG_S 58 #define __SVE_PREGS_SIZE(vq) \ 59 (__SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS 60 61 #define __SVE_FFR_OFFSET(vq) \ 62 (__SVE_PREGS_OFFSET(vq) + __SVE_PREGS_ 63 64 #endif /* ! _UAPI__ASM_SVE_CONTEXT_H */ 65
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.