1 #ifndef __TYPES_H__ 2 #define __TYPES_H__ 3 4 #include <xen/stdbool.h> 5 6 #include <asm/types.h> 7 8 #define BITS_TO_LONGS(bits) \ 9 (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) 10 #define DECLARE_BITMAP(name,bits) \ 11 unsigned long name[BITS_TO_LONGS(bits)] 12 13 #ifndef NULL 14 #define NULL ((void*)0) 15 #endif 16 17 #define INT8_MIN (-127-1) 18 #define INT16_MIN (-32767-1) 19 #define INT32_MIN (-2147483647-1) 20 21 #define INT8_MAX (127) 22 #define INT16_MAX (32767) 23 #define INT32_MAX (2147483647) 24 25 #define UINT8_MAX (255) 26 #define UINT16_MAX (65535) 27 #define UINT32_MAX (4294967295U) 28 29 #define INT_MAX ((int)(~0U>>1)) 30 #define INT_MIN (-INT_MAX - 1) 31 #define UINT_MAX (~0U) 32 #define LONG_MAX ((long)(~0UL>>1)) 33 #define LONG_MIN (-LONG_MAX - 1) 34 #define ULONG_MAX (~0UL) 35 36 typedef __u8 uint8_t; 37 typedef __s8 int8_t; 38 39 typedef __u16 uint16_t; 40 typedef __s16 int16_t; 41 42 typedef __u32 uint32_t; 43 typedef __s32 int32_t; 44 45 typedef __u64 uint64_t; 46 typedef __s64 int64_t; 47 48 typedef __u16 __le16; 49 typedef __u16 __be16; 50 typedef __u32 __le32; 51 typedef __u32 __be32; 52 typedef __u64 __le64; 53 typedef __u64 __be64; 54 55 typedef unsigned int __attribute__((__mode__(__pointer__))) uintptr_t; 56 57 typedef bool bool_t; 58 #define test_and_set_bool(b) xchg(&(b), true) 59 #define test_and_clear_bool(b) xchg(&(b), false) 60 61 #endif /* __TYPES_H__ */ 62