]> git.buserror.net Git - polintos/scott/priv.git/blob - kernel/include/kern/types.h
Initial checkin from Perforce.
[polintos/scott/priv.git] / kernel / include / kern / types.h
1 #ifndef _KERN_TYPES_H
2 #define _KERN_TYPES_H
3
4 #include <lowlevel/types.h>
5
6 typedef uint8_t  u8;
7 typedef uint16_t u16;
8 typedef uint32_t u32;
9 typedef uint64_t u64;
10 typedef int8_t   s8;
11 typedef int16_t  s16;
12 typedef int32_t  s32;
13 typedef int64_t  s64;
14
15 typedef u8 octet;
16
17 typedef unsigned char uchar;
18 typedef unsigned short ushort;
19 typedef unsigned int uint;
20 typedef unsigned long ulong;
21
22 static inline bool valid_size_t(u64 size)
23 {
24         void unsupported_size_t();
25         
26         if (sizeof(size_t) == 8)
27                 return true;
28         
29         if (sizeof(size_t) != 4)
30                 unsupported_size_t();
31         
32         return (size >> 32) == 0;
33 }
34
35 #endif