types.h 1.4 KB

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