2 * This header has been modifies to remove definitions of types that
3 * are defined in standard userspace headers or are problematic for some
10 #define __EXPORTED_HEADERS__
11 #include <uapi/linux/types.h>
15 #define DECLARE_BITMAP(name, bits) \
16 unsigned long name[BITS_TO_LONGS(bits)]
18 typedef __u32 __kernel_dev_t;
21 typedef unsigned char u_char;
22 typedef unsigned short u_short;
23 typedef unsigned int u_int;
24 typedef unsigned long u_long;
27 typedef unsigned char unchar;
28 typedef unsigned short ushort;
29 typedef unsigned int uint;
30 typedef unsigned long ulong;
32 #ifndef __BIT_TYPES_DEFINED__
33 #define __BIT_TYPES_DEFINED__
35 typedef __u8 u_int8_t;
37 typedef __u16 u_int16_t;
38 typedef __s16 int16_t;
39 typedef __u32 u_int32_t;
40 typedef __s32 int32_t;
42 #endif /* !(__BIT_TYPES_DEFINED__) */
45 typedef __u16 uint16_t;
46 typedef __u32 uint32_t;
48 /* this is a special 64bit data type that is 8-byte aligned */
49 #define aligned_u64 __u64 __attribute__((aligned(8)))
50 #define aligned_be64 __be64 __attribute__((aligned(8)))
51 #define aligned_le64 __le64 __attribute__((aligned(8)))
54 * The type used for indexing onto a disc or disc partition.
56 * Linux always considers sectors to be 512 bytes long independently
57 * of the devices real block size.
59 * blkcnt_t is the type of the inode's block count.
64 typedef unsigned long sector_t;
68 * The type of an index into the pagecache.
70 #define pgoff_t unsigned long
73 * A dma_addr_t can hold any valid DMA address, i.e., any address returned
76 * If the DMA API only uses 32-bit addresses, dma_addr_t need only be 32
77 * bits wide. Bus addresses, e.g., PCI BARs, may be wider than 32 bits,
78 * but drivers do memory-mapped I/O to ioremapped kernel virtual addresses,
79 * so they don't care about the size of the actual bus addresses.
81 #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
82 typedef u64 dma_addr_t;
84 typedef u32 dma_addr_t;
87 #ifdef CONFIG_PHYS_ADDR_T_64BIT
88 typedef u64 phys_addr_t;
90 typedef u32 phys_addr_t;
93 typedef phys_addr_t resource_size_t;
96 * This type is the placeholder for a hardware interrupt number. It has to be
97 * big enough to enclose whatever representation is used by a given platform.
99 typedef unsigned long irq_hw_number_t;
112 struct list_head *next, *prev;
116 struct hlist_node *first;
120 struct hlist_node *next, **pprev;
124 * struct callback_head - callback structure for use with RCU and task_work
125 * @next: next update requests in a list
126 * @func: actual update function to call after the grace period.
128 * The struct is aligned to size of pointer. On most architectures it happens
129 * naturally due ABI requirements, but some architectures (like CRIS) have
130 * weird ABI and we need to ask it explicitly.
132 * The alignment is required to guarantee that bits 0 and 1 of @next will be
133 * clear under normal conditions -- as long as we use call_rcu(),
134 * call_rcu_bh(), call_rcu_sched(), or call_srcu() to queue callback.
136 * This guarantee is important for few reasons:
137 * - future call_rcu_lazy() will make use of lower bits in the pointer;
138 * - the structure shares storage spacer in struct page with @compound_head,
139 * which encode PageTail() in bit 0. The guarantee is needed to avoid
140 * false-positive PageTail().
142 struct callback_head {
143 struct callback_head *next;
144 void (*func)(struct callback_head *head);
145 } __attribute__((aligned(sizeof(void *))));
146 #define rcu_head callback_head
148 typedef void (*rcu_callback_t)(struct rcu_head *head);
149 typedef void (*call_rcu_func_t)(struct rcu_head *head, rcu_callback_t func);
151 /* clocksource cycle base type */
154 #endif /* __ASSEMBLY__ */
155 #endif /* _LINUX_TYPES_H */