| H. Peter Anvin | d13ff31 | 2008-04-24 12:56:52 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * asm-generic/int-ll64.h | 
|  | 3 | * | 
|  | 4 | * Integer declarations for architectures which use "long long" | 
|  | 5 | * for 64-bit types. | 
|  | 6 | */ | 
|  | 7 |  | 
|  | 8 | #ifndef _ASM_GENERIC_INT_LL64_H | 
|  | 9 | #define _ASM_GENERIC_INT_LL64_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 | #ifdef __GNUC__ | 
|  | 29 | __extension__ typedef __signed__ long long __s64; | 
|  | 30 | __extension__ typedef unsigned long long __u64; | 
| Adrian Bunk | f16695f | 2008-07-25 01:45:36 -0700 | [diff] [blame] | 31 | #else | 
| H. Peter Anvin | d13ff31 | 2008-04-24 12:56:52 -0700 | [diff] [blame] | 32 | typedef __signed__ long long __s64; | 
|  | 33 | typedef unsigned long long __u64; | 
|  | 34 | #endif | 
|  | 35 |  | 
|  | 36 | #endif /* __ASSEMBLY__ */ | 
|  | 37 |  | 
|  | 38 | #ifdef __KERNEL__ | 
|  | 39 |  | 
|  | 40 | #ifndef __ASSEMBLY__ | 
|  | 41 |  | 
|  | 42 | typedef signed char s8; | 
|  | 43 | typedef unsigned char u8; | 
|  | 44 |  | 
|  | 45 | typedef signed short s16; | 
|  | 46 | typedef unsigned short u16; | 
|  | 47 |  | 
|  | 48 | typedef signed int s32; | 
|  | 49 | typedef unsigned int u32; | 
|  | 50 |  | 
|  | 51 | typedef signed long long s64; | 
|  | 52 | typedef unsigned long long u64; | 
|  | 53 |  | 
| H. Peter Anvin | c25bd29 | 2008-04-24 13:37:33 -0700 | [diff] [blame] | 54 | #define S8_C(x)  x | 
|  | 55 | #define U8_C(x)  x ## U | 
|  | 56 | #define S16_C(x) x | 
|  | 57 | #define U16_C(x) x ## U | 
|  | 58 | #define S32_C(x) x | 
|  | 59 | #define U32_C(x) x ## U | 
|  | 60 | #define S64_C(x) x ## LL | 
|  | 61 | #define U64_C(x) x ## ULL | 
|  | 62 |  | 
|  | 63 | #else /* __ASSEMBLY__ */ | 
|  | 64 |  | 
|  | 65 | #define S8_C(x)  x | 
|  | 66 | #define U8_C(x)  x | 
|  | 67 | #define S16_C(x) x | 
|  | 68 | #define U16_C(x) x | 
|  | 69 | #define S32_C(x) x | 
|  | 70 | #define U32_C(x) x | 
|  | 71 | #define S64_C(x) x | 
|  | 72 | #define U64_C(x) x | 
|  | 73 |  | 
| H. Peter Anvin | d13ff31 | 2008-04-24 12:56:52 -0700 | [diff] [blame] | 74 | #endif /* __ASSEMBLY__ */ | 
|  | 75 |  | 
|  | 76 | #endif /* __KERNEL__ */ | 
|  | 77 |  | 
|  | 78 | #endif /* _ASM_GENERIC_INT_LL64_H */ |