| H. Peter Anvin | d13ff31 | 2008-04-24 12:56:52 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * asm-generic/int-l64.h | 
|  | 3 | * | 
|  | 4 | * Integer declarations for architectures which use "long" | 
|  | 5 | * for 64-bit types. | 
|  | 6 | */ | 
|  | 7 |  | 
|  | 8 | #ifndef _ASM_GENERIC_INT_L64_H | 
|  | 9 | #define _ASM_GENERIC_INT_L64_H | 
|  | 10 |  | 
| Arnd Bergmann | c31ae4b | 2009-05-13 22:56:25 +0000 | [diff] [blame] | 11 | #include <asm/bitsperlong.h> | 
|  | 12 |  | 
| H. Peter Anvin | d13ff31 | 2008-04-24 12:56:52 -0700 | [diff] [blame] | 13 | #ifndef __ASSEMBLY__ | 
|  | 14 | /* | 
|  | 15 | * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the | 
|  | 16 | * header files exported to user space | 
|  | 17 | */ | 
|  | 18 |  | 
|  | 19 | typedef __signed__ char __s8; | 
|  | 20 | typedef unsigned char __u8; | 
|  | 21 |  | 
|  | 22 | typedef __signed__ short __s16; | 
|  | 23 | typedef unsigned short __u16; | 
|  | 24 |  | 
|  | 25 | typedef __signed__ int __s32; | 
|  | 26 | typedef unsigned int __u32; | 
|  | 27 |  | 
|  | 28 | typedef __signed__ long __s64; | 
|  | 29 | typedef unsigned long __u64; | 
|  | 30 |  | 
|  | 31 | #endif /* __ASSEMBLY__ */ | 
|  | 32 |  | 
|  | 33 | #ifdef __KERNEL__ | 
|  | 34 |  | 
|  | 35 | #ifndef __ASSEMBLY__ | 
|  | 36 |  | 
|  | 37 | typedef signed char s8; | 
|  | 38 | typedef unsigned char u8; | 
|  | 39 |  | 
|  | 40 | typedef signed short s16; | 
|  | 41 | typedef unsigned short u16; | 
|  | 42 |  | 
|  | 43 | typedef signed int s32; | 
|  | 44 | typedef unsigned int u32; | 
|  | 45 |  | 
|  | 46 | typedef signed long s64; | 
|  | 47 | typedef unsigned long u64; | 
|  | 48 |  | 
| H. Peter Anvin | c25bd29 | 2008-04-24 13:37:33 -0700 | [diff] [blame] | 49 | #define S8_C(x)  x | 
|  | 50 | #define U8_C(x)  x ## U | 
|  | 51 | #define S16_C(x) x | 
|  | 52 | #define U16_C(x) x ## U | 
|  | 53 | #define S32_C(x) x | 
|  | 54 | #define U32_C(x) x ## U | 
|  | 55 | #define S64_C(x) x ## L | 
|  | 56 | #define U64_C(x) x ## UL | 
|  | 57 |  | 
|  | 58 | #else /* __ASSEMBLY__ */ | 
|  | 59 |  | 
|  | 60 | #define S8_C(x)  x | 
|  | 61 | #define U8_C(x)  x | 
|  | 62 | #define S16_C(x) x | 
|  | 63 | #define U16_C(x) x | 
|  | 64 | #define S32_C(x) x | 
|  | 65 | #define U32_C(x) x | 
|  | 66 | #define S64_C(x) x | 
|  | 67 | #define U64_C(x) x | 
|  | 68 |  | 
| H. Peter Anvin | d13ff31 | 2008-04-24 12:56:52 -0700 | [diff] [blame] | 69 | #endif /* __ASSEMBLY__ */ | 
|  | 70 |  | 
|  | 71 | #endif /* __KERNEL__ */ | 
|  | 72 |  | 
|  | 73 | #endif /* _ASM_GENERIC_INT_L64_H */ |