| 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 |  | 
|  | 11 | #ifndef __ASSEMBLY__ | 
|  | 12 | /* | 
|  | 13 | * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the | 
|  | 14 | * header files exported to user space | 
|  | 15 | */ | 
|  | 16 |  | 
|  | 17 | typedef __signed__ char __s8; | 
|  | 18 | typedef unsigned char __u8; | 
|  | 19 |  | 
|  | 20 | typedef __signed__ short __s16; | 
|  | 21 | typedef unsigned short __u16; | 
|  | 22 |  | 
|  | 23 | typedef __signed__ int __s32; | 
|  | 24 | typedef unsigned int __u32; | 
|  | 25 |  | 
|  | 26 | #ifdef __GNUC__ | 
|  | 27 | __extension__ typedef __signed__ long long __s64; | 
|  | 28 | __extension__ typedef unsigned long long __u64; | 
| Adrian Bunk | f16695f | 2008-07-25 01:45:36 -0700 | [diff] [blame] | 29 | #else | 
| H. Peter Anvin | d13ff31 | 2008-04-24 12:56:52 -0700 | [diff] [blame] | 30 | typedef __signed__ long long __s64; | 
|  | 31 | typedef unsigned long long __u64; | 
|  | 32 | #endif | 
|  | 33 |  | 
|  | 34 | #endif /* __ASSEMBLY__ */ | 
|  | 35 |  | 
|  | 36 | #ifdef __KERNEL__ | 
|  | 37 |  | 
|  | 38 | #ifndef __ASSEMBLY__ | 
|  | 39 |  | 
|  | 40 | typedef signed char s8; | 
|  | 41 | typedef unsigned char u8; | 
|  | 42 |  | 
|  | 43 | typedef signed short s16; | 
|  | 44 | typedef unsigned short u16; | 
|  | 45 |  | 
|  | 46 | typedef signed int s32; | 
|  | 47 | typedef unsigned int u32; | 
|  | 48 |  | 
|  | 49 | typedef signed long long s64; | 
|  | 50 | typedef unsigned long long u64; | 
|  | 51 |  | 
| H. Peter Anvin | c25bd29 | 2008-04-24 13:37:33 -0700 | [diff] [blame] | 52 | #define S8_C(x)  x | 
|  | 53 | #define U8_C(x)  x ## U | 
|  | 54 | #define S16_C(x) x | 
|  | 55 | #define U16_C(x) x ## U | 
|  | 56 | #define S32_C(x) x | 
|  | 57 | #define U32_C(x) x ## U | 
|  | 58 | #define S64_C(x) x ## LL | 
|  | 59 | #define U64_C(x) x ## ULL | 
|  | 60 |  | 
|  | 61 | #else /* __ASSEMBLY__ */ | 
|  | 62 |  | 
|  | 63 | #define S8_C(x)  x | 
|  | 64 | #define U8_C(x)  x | 
|  | 65 | #define S16_C(x) x | 
|  | 66 | #define U16_C(x) x | 
|  | 67 | #define S32_C(x) x | 
|  | 68 | #define U32_C(x) x | 
|  | 69 | #define S64_C(x) x | 
|  | 70 | #define U64_C(x) x | 
|  | 71 |  | 
| H. Peter Anvin | d13ff31 | 2008-04-24 12:56:52 -0700 | [diff] [blame] | 72 | #endif /* __ASSEMBLY__ */ | 
|  | 73 |  | 
|  | 74 | #endif /* __KERNEL__ */ | 
|  | 75 |  | 
|  | 76 | #endif /* _ASM_GENERIC_INT_LL64_H */ |