Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / tools / include / linux / types.h
blob8519386acd2391e6a1cfbb7c731515d10c997c0e
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _TOOLS_LINUX_TYPES_H_
3 #define _TOOLS_LINUX_TYPES_H_
5 #include <stdbool.h>
6 #include <stddef.h>
7 #include <stdint.h>
9 #ifndef __SANE_USERSPACE_TYPES__
10 #define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */
11 #endif
13 #include <asm/types.h>
14 #include <asm/posix_types.h>
16 struct page;
17 struct kmem_cache;
19 typedef enum {
20 GFP_KERNEL,
21 GFP_ATOMIC,
22 __GFP_HIGHMEM,
23 __GFP_HIGH
24 } gfp_t;
27 * We define u64 as uint64_t for every architecture
28 * so that we can print it with "%"PRIx64 without getting warnings.
30 * typedef __u64 u64;
31 * typedef __s64 s64;
33 typedef uint64_t u64;
34 typedef int64_t s64;
36 typedef __u32 u32;
37 typedef __s32 s32;
39 typedef __u16 u16;
40 typedef __s16 s16;
42 typedef __u8 u8;
43 typedef __s8 s8;
45 #ifdef __CHECKER__
46 #define __bitwise __attribute__((bitwise))
47 #else
48 #define __bitwise
49 #endif
51 #define __force
52 /* This is defined in linux/compiler_types.h and is left for backward
53 * compatibility.
55 #ifndef __user
56 #define __user
57 #endif
58 #define __must_check
59 #define __cold
61 typedef __u16 __bitwise __le16;
62 typedef __u16 __bitwise __be16;
63 typedef __u32 __bitwise __le32;
64 typedef __u32 __bitwise __be32;
65 typedef __u64 __bitwise __le64;
66 typedef __u64 __bitwise __be64;
68 typedef __u16 __bitwise __sum16;
69 typedef __u32 __bitwise __wsum;
71 #ifdef CONFIG_PHYS_ADDR_T_64BIT
72 typedef u64 phys_addr_t;
73 #else
74 typedef u32 phys_addr_t;
75 #endif
77 typedef struct {
78 int counter;
79 } atomic_t;
81 typedef struct {
82 long counter;
83 } atomic_long_t;
85 #ifndef __aligned_u64
86 # define __aligned_u64 __u64 __attribute__((aligned(8)))
87 #endif
89 struct list_head {
90 struct list_head *next, *prev;
93 struct hlist_head {
94 struct hlist_node *first;
97 struct hlist_node {
98 struct hlist_node *next, **pprev;
101 #endif /* _TOOLS_LINUX_TYPES_H_ */