0001
0002 #ifndef _TOOLS_LINUX_TYPES_H_
0003 #define _TOOLS_LINUX_TYPES_H_
0004
0005 #include <stdbool.h>
0006 #include <stddef.h>
0007 #include <stdint.h>
0008
0009 #ifndef __SANE_USERSPACE_TYPES__
0010 #define __SANE_USERSPACE_TYPES__
0011 #endif
0012
0013 #include <asm/types.h>
0014 #include <asm/posix_types.h>
0015
0016 struct page;
0017 struct kmem_cache;
0018
0019 typedef enum {
0020 GFP_KERNEL,
0021 GFP_ATOMIC,
0022 __GFP_HIGHMEM,
0023 __GFP_HIGH
0024 } gfp_t;
0025
0026
0027
0028
0029
0030
0031
0032
0033 typedef uint64_t u64;
0034 typedef int64_t s64;
0035
0036 typedef __u32 u32;
0037 typedef __s32 s32;
0038
0039 typedef __u16 u16;
0040 typedef __s16 s16;
0041
0042 typedef __u8 u8;
0043 typedef __s8 s8;
0044
0045 #ifdef __CHECKER__
0046 #define __bitwise __attribute__((bitwise))
0047 #else
0048 #define __bitwise
0049 #endif
0050
0051 #define __force
0052 #define __user
0053 #define __must_check
0054 #define __cold
0055
0056 typedef __u16 __bitwise __le16;
0057 typedef __u16 __bitwise __be16;
0058 typedef __u32 __bitwise __le32;
0059 typedef __u32 __bitwise __be32;
0060 typedef __u64 __bitwise __le64;
0061 typedef __u64 __bitwise __be64;
0062
0063 typedef __u16 __bitwise __sum16;
0064 typedef __u32 __bitwise __wsum;
0065
0066 #ifdef CONFIG_PHYS_ADDR_T_64BIT
0067 typedef u64 phys_addr_t;
0068 #else
0069 typedef u32 phys_addr_t;
0070 #endif
0071
0072 typedef struct {
0073 int counter;
0074 } atomic_t;
0075
0076 typedef struct {
0077 long counter;
0078 } atomic_long_t;
0079
0080 #ifndef __aligned_u64
0081 # define __aligned_u64 __u64 __attribute__((aligned(8)))
0082 #endif
0083
0084 struct list_head {
0085 struct list_head *next, *prev;
0086 };
0087
0088 struct hlist_head {
0089 struct hlist_node *first;
0090 };
0091
0092 struct hlist_node {
0093 struct hlist_node *next, **pprev;
0094 };
0095
0096 #endif