1 #ifndef __LUNAIX_TYPES_H
2 #define __LUNAIX_TYPES_H
5 #include <lunaix/compiler.h>
6 #include <lunaix/limits.h>
7 #include <usr/lunaix/types.h>
12 typedef unsigned char u8_t;
13 typedef unsigned short u16_t;
14 typedef unsigned int u32_t;
16 #ifndef CONFIG_ARCH_BITS_64
17 typedef unsigned long long u64_t;
19 typedef unsigned long u64_t;
22 typedef __lunaix_pid_t pid_t;
23 typedef __lunaix_tid_t tid_t;
24 typedef __lunaix_uid_t uid_t;
25 typedef __lunaix_gid_t gid_t;
26 typedef __lunaix_size_t size_t;
27 typedef __lunaix_ssize_t ssize_t;
28 typedef __lunaix_size_t off_t;
29 typedef __lunaix_ino_t ino_t;
31 typedef unsigned long ptr_t;
32 typedef unsigned long reg_t;
33 typedef unsigned int cpu_t;
36 typedef __lunaix_dev_t dev_t;
43 * container_of - cast a member of a structure out to the containing structure
45 * @ptr: the pointer to the member.
46 * @type: the type of the container struct this is embedded in.
47 * @member: the name of the member within the struct.
50 #define container_of(ptr, type, member) \
52 const typeof(((type*)0)->member)* __mptr = (ptr); \
53 ((ptr_t)ptr != 0UL) ? (type*)((char*)__mptr - offsetof(type, member)) : 0; \
56 #define offset(data, off) \
57 ((typeof(data))(__ptr(data) + (off)))
59 #define offset_t(data, type, off) \
60 ((type*)(__ptr(data) + (off)))
62 #define __ptr(val) ((ptr_t)(val))
64 typedef va_list* sc_va_list;
66 #endif /* __LUNAIX_TYPES_H */