Linux asm types h
You are using an outdated browser. Please upgrade your browser to improve your experience and security.
Check our new training course
Linux debugging, tracing, profiling & perf. analysis
Elixir Cross Referencer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_TYPES_H #define _LINUX_TYPES_H #define __EXPORTED_HEADERS__ #include uapi/linux/types.h> #ifndef __ASSEMBLY__ #define DECLARE_BITMAP(name,bits) \ unsigned long name[BITS_TO_LONGS(bits)] typedef u32 __kernel_dev_t; typedef __kernel_fd_set fd_set; typedef __kernel_dev_t dev_t; typedef __kernel_ulong_t ino_t; typedef __kernel_mode_t mode_t; typedef unsigned short umode_t; typedef u32 nlink_t; typedef __kernel_off_t off_t; typedef __kernel_pid_t pid_t; typedef __kernel_daddr_t daddr_t; typedef __kernel_key_t key_t; typedef __kernel_suseconds_t suseconds_t; typedef __kernel_timer_t timer_t; typedef __kernel_clockid_t clockid_t; typedef __kernel_mqd_t mqd_t; typedef _Bool bool; typedef __kernel_uid32_t uid_t; typedef __kernel_gid32_t gid_t; typedef __kernel_uid16_t uid16_t; typedef __kernel_gid16_t gid16_t; typedef unsigned long uintptr_t; #ifdef CONFIG_HAVE_UID16 /* This is defined by include/asm-/posix_types.h */ typedef __kernel_old_uid_t old_uid_t; typedef __kernel_old_gid_t old_gid_t; #endif /* CONFIG_UID16 */ #if defined(__GNUC__) typedef __kernel_loff_t loff_t; #endif /* * The following typedefs are also protected by individual ifdefs for * historical reasons: */ #ifndef _SIZE_T #define _SIZE_T typedef __kernel_size_t size_t; #endif #ifndef _SSIZE_T #define _SSIZE_T typedef __kernel_ssize_t ssize_t; #endif #ifndef _PTRDIFF_T #define _PTRDIFF_T typedef __kernel_ptrdiff_t ptrdiff_t; #endif #ifndef _CLOCK_T #define _CLOCK_T typedef __kernel_clock_t clock_t; #endif #ifndef _CADDR_T #define _CADDR_T typedef __kernel_caddr_t caddr_t; #endif /* bsd */ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; /* sysv */ typedef unsigned char unchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__ typedef u8 u_int8_t; typedef s8 int8_t; typedef u16 u_int16_t; typedef s16 int16_t; typedef u32 u_int32_t; typedef s32 int32_t; #endif /* !(__BIT_TYPES_DEFINED__) */ typedef u8 uint8_t; typedef u16 uint16_t; typedef u32 uint32_t; #if defined(__GNUC__) typedef u64 uint64_t; typedef u64 u_int64_t; typedef s64 int64_t; #endif /* this is a special 64bit data type that is 8-byte aligned */ #define aligned_u64 __aligned_u64 #define aligned_be64 __aligned_be64 #define aligned_le64 __aligned_le64 /** * The type used for indexing onto a disc or disc partition. * * Linux always considers sectors to be 512 bytes long independently * of the devices real block size. * * blkcnt_t is the type of the inode's block count. */ typedef u64 sector_t; typedef u64 blkcnt_t; /* * The type of an index into the pagecache. */ #define pgoff_t unsigned long /* * A dma_addr_t can hold any valid DMA address, i.e., any address returned * by the DMA API. * * If the DMA API only uses 32-bit addresses, dma_addr_t need only be 32 * bits wide. Bus addresses, e.g., PCI BARs, may be wider than 32 bits, * but drivers do memory-mapped I/O to ioremapped kernel virtual addresses, * so they don't care about the size of the actual bus addresses. */ #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT typedef u64 dma_addr_t; #else typedef u32 dma_addr_t; #endif typedef unsigned int __bitwise gfp_t; typedef unsigned int __bitwise slab_flags_t; typedef unsigned int __bitwise fmode_t; #ifdef CONFIG_PHYS_ADDR_T_64BIT typedef u64 phys_addr_t; #else typedef u32 phys_addr_t; #endif typedef phys_addr_t resource_size_t; /* * This type is the placeholder for a hardware interrupt number. It has to be * big enough to enclose whatever representation is used by a given platform. */ typedef unsigned long irq_hw_number_t; typedef struct int counter; > atomic_t; #define ATOMIC_INIT(i) #ifdef CONFIG_64BIT typedef struct s64 counter; > atomic64_t; #endif typedef struct atomic_t refcnt; > rcuref_t; #define RCUREF_INIT(i) < .refcnt = ATOMIC_INIT(i - 1) > struct list_head struct list_head *next, *prev; >; struct hlist_head struct hlist_node *first; >; struct hlist_node struct hlist_node *next, **pprev; >; struct ustat __kernel_daddr_t f_tfree; #ifdef CONFIG_ARCH_32BIT_USTAT_F_TINODE unsigned int f_tinode; #else unsigned long f_tinode; #endif char f_fname[6]; char f_fpack[6]; >; /** * struct callback_head - callback structure for use with RCU and task_work * @next: next update requests in a list * @func: actual update function to call after the grace period. * * The struct is aligned to size of pointer. On most architectures it happens * naturally due ABI requirements, but some architectures (like CRIS) have * weird ABI and we need to ask it explicitly. * * The alignment is required to guarantee that bit 0 of @next will be * clear under normal conditions -- as long as we use call_rcu() or * call_srcu() to queue the callback. * * This guarantee is important for few reasons: * - future call_rcu_lazy() will make use of lower bits in the pointer; * - the structure shares storage space in struct page with @compound_head, * which encode PageTail() in bit 0. The guarantee is needed to avoid * false-positive PageTail(). */ struct callback_head struct callback_head *next; void (*func)(struct callback_head *head); > __attribute__((aligned(sizeof(void *)))); #define rcu_head callback_head typedef void (*rcu_callback_t)(struct rcu_head *head); typedef void (*call_rcu_func_t)(struct rcu_head *head, rcu_callback_t func); typedef void (*swap_r_func_t)(void *a, void *b, int size, const void *priv); typedef void (*swap_func_t)(void *a, void *b, int size); typedef int (*cmp_r_func_t)(const void *a, const void *b, const void *priv); typedef int (*cmp_func_t)(const void *a, const void *b); #endif /* __ASSEMBLY__ */ #endif /* _LINUX_TYPES_H */
Linux asm types h
The data types defined in < sys/types.h >are as follows:
32-bit Solaris
The data types listed below are defined in < sys/types.h >for 32-bit Solaris.
typedef struct < int r[1]; >*physadr; typedef long clock_t; typedef long daddr_t; typedef char * caddr_t; typedef unsigned char unchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong_t; typedef unsigned long ino_t; typedef long uid_t; typedef long gid_t; typedef ulong_t nlink_t; typedef ulong_t mode_t; typedef short cnt_t; typedef long time_t; typedef int label_t[10]; typedef ulong_t dev_t; typedef long off_t; typedef long pid_t; typedef long paddr_t; typedef int key_t; typedef unsigned char use_t; typedef short sysid_t; typedef short index_t; typedef short lock_t; typedef unsigned int size_t; typedef long clock_t; typedef long pid_t;
64-bit Solaris
The data types listed below are defined in < sys/types.h >for 64-bit Solaris.
typedef long blkcnt_t typedef long clock_t typedef long daddr_t typedef ulong_t dev_t typedef ulong_t fsblkcnt_t typedef ulong_t fsfilcnt_t typedef int gid_t typedef int id_t typedef long ino_t typedef int key_t typedef uint_t major_t typedef uint_t minor_t typedef uint_t mode_t typedef uint_t nlink_t typedef int pid_t typedef ptrdiff_t intptr_t typedef ulong_t rlim_t typedef ulong_t size_t typedef uint_t speed_t typedef long ssize_t typedef long suseconds_t typedef uint_t tcflag_t typedef long time_t typedef int uid_t typedef int wchar_t
Preprocessor Symbols
For 32-bit programs, pointers and the C data types int and long are all 32-bit quantities. For 64-bit programs, pointers and the C data type long are defined as 64-bit quantities.
The preprocessor symbol _ILP32 , made visible by the inclusion of < sys/types.h >, can be used with the preprocessor #ifdef construct to define sections of code that will be compiled only as part of a 32-bit version of a given C program.
The preprocessor symbol _LP64 can be used in the same way to define sections of code that will be compiled only as part of a 64-bit version of a given C program. See EXAMPLES.
This header incorporates definitions of other preprocessor symbols that can be useful when keeping code portable between different instruction set architectures.
_LITTLE_ENDIAN
_BIG_ENDIAN The natural byte order of the processor. A pointer to an int points to the least/most significant byte of that int .
_STACK_GROWS_UPWARD
_STACK_GROWS_DOWNWARD The processor specific direction of stack growth. A push onto the stack increases/decreases the stack pointer, so it stores data at successively higher/lower addresses.
_CHAR_IS_UNSIGNED
_CHAR_IS_SIGNED The C Compiler implements objects of type char as unsigned or signed respectively. This is really an implementation choice of the compiler, but it is specified in the ABI and tends to be uniform across compilers for an instruction set architecture.
_CHAR_ALIGNMENT
_SHORT_ALIGNMENT
_INT_ALIGNMENT
_LONG_ALIGNMENT
_LONG_LONG_ALIGNMENT
_DOUBLE_ALIGNMENT
_LONG_DOUBLE_ALIGNMENT
_POINTER_ALIGNMENT
_FLOAT_ALIGNMENT The ABI defines alignment requirements of each of the primitive object types. Some, if not all, might be hardware requirements as well. The values are expressed in bytes.
_MAX_ALIGNMENT The most stringent alignment requirement as specified by the ABI. Equal to the maximum of all the above _ XXX _ ALIGNMENT values.
_LONG_LONG_ALIGNMENT_32 The 32-bit ABI supported by a 64-bit kernel may have different alignment requirements for primitive object types. The value of this identifier is expressed in bytes.
USAGE
The daddr_t type is used for disk addresses except in an inode on disk. Times are encoded in seconds since 00:00:00 UTC, January 1, 1970. The major and minor parts of a device code specify kind and unit number of a device and are installation-dependent. Offsets are measured in bytes from the beginning of a file.
The label_t[] types are used to save the processor state while another process is running.
EXAMPLES
Example 1 Use of preprocessor symbol _LP64 .
In the following example, the preprocessor symbol _LP64 defines sections of code that will be compiled only as part of a 64-bit version of the given C program.
#include sys/types.h> . #ifdef _LP64 printf("The data model is LP64 in this environment\n"); #else #ifdef _ILP32 printf("The data model is ILP32 in this environment\n"); #else #error "Unknown data model!" #endif #endif
ATTRIBUTES
See attributes (5) for descriptions of the following attributes:
|