1#ifndef _TOOLS_LINUX_TYPES_H_ 2#define _TOOLS_LINUX_TYPES_H_ 3 4#include <stdbool.h> 5#include <stddef.h> 6#include <stdint.h> 7 8#define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */ 9#include <asm/types.h> 10#include <asm/posix_types.h> 11 12struct page; 13struct kmem_cache; 14 15typedef enum { 16 GFP_KERNEL, 17 GFP_ATOMIC, 18 __GFP_HIGHMEM, 19 __GFP_HIGH 20} gfp_t; 21 22/* 23 * We define u64 as uint64_t for every architecture 24 * so that we can print it with "%"PRIx64 without getting warnings. 25 * 26 * typedef __u64 u64; 27 * typedef __s64 s64; 28 */ 29typedef uint64_t u64; 30typedef int64_t s64; 31 32typedef __u32 u32; 33typedef __s32 s32; 34 35typedef __u16 u16; 36typedef __s16 s16; 37 38typedef __u8 u8; 39typedef __s8 s8; 40 41#ifdef __CHECKER__ 42#define __bitwise__ __attribute__((bitwise)) 43#else 44#define __bitwise__ 45#endif 46#define __bitwise __bitwise__ 47 48#define __force 49#define __user 50#define __must_check 51#define __cold 52 53typedef __u16 __bitwise __le16; 54typedef __u16 __bitwise __be16; 55typedef __u32 __bitwise __le32; 56typedef __u32 __bitwise __be32; 57typedef __u64 __bitwise __le64; 58typedef __u64 __bitwise __be64; 59 60typedef struct { 61 int counter; 62} atomic_t; 63 64#ifndef __aligned_u64 65# define __aligned_u64 __u64 __attribute__((aligned(8))) 66#endif 67 68struct list_head { 69 struct list_head *next, *prev; 70}; 71 72struct hlist_head { 73 struct hlist_node *first; 74}; 75 76struct hlist_node { 77 struct hlist_node *next, **pprev; 78}; 79 80#endif /* _TOOLS_LINUX_TYPES_H_ */ 81