types.h 1.4 KB

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