1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * const.h: Macros for dealing with constants. 3*4882a593Smuzhiyun * 4*4882a593Smuzhiyun * SPDX-License-Identifier: GPL-2.0 5*4882a593Smuzhiyun */ 6*4882a593Smuzhiyun 7*4882a593Smuzhiyun #ifndef _LINUX_CONST_H 8*4882a593Smuzhiyun #define _LINUX_CONST_H 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun /* Some constant macros are used in both assembler and 11*4882a593Smuzhiyun * C code. Therefore we cannot annotate them always with 12*4882a593Smuzhiyun * 'UL' and other type specifiers unilaterally. We 13*4882a593Smuzhiyun * use the following macros to deal with this. 14*4882a593Smuzhiyun * 15*4882a593Smuzhiyun * Similarly, _AT() will cast an expression with a type in C, but 16*4882a593Smuzhiyun * leave it unchanged in asm. 17*4882a593Smuzhiyun */ 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun #ifdef __ASSEMBLY__ 20*4882a593Smuzhiyun #define _AT(T,X) X 21*4882a593Smuzhiyun #else 22*4882a593Smuzhiyun #define _AT(T,X) ((T)(X)) 23*4882a593Smuzhiyun #endif 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun #define _BITUL(x) (_AC(1,UL) << (x)) 26*4882a593Smuzhiyun #define _BITULL(x) (_AC(1,ULL) << (x)) 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun #endif /* !(_LINUX_CONST_H) */ 29