types.h 1.4 KB

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