1 /*
2  * Copyright (c) 2008-2012 Travis Geiselbrecht
3  *
4  * Use of this source code is governed by a MIT-style
5  * license that can be found in the LICENSE file or at
6  * https://opensource.org/licenses/MIT
7  */
8 #pragma once
9 
10 #include <limits.h>
11 #include <stdint.h>
12 #include <stddef.h>
13 
14 typedef unsigned char uchar;
15 typedef unsigned short ushort;
16 typedef unsigned int uint;
17 typedef unsigned long ulong;
18 typedef unsigned char u_char;
19 typedef unsigned short u_short;
20 typedef unsigned int u_int;
21 typedef unsigned long u_long;
22 
23 typedef long long     off_t;
24 
25 typedef int status_t;
26 
27 typedef uintptr_t addr_t;
28 typedef uintptr_t vaddr_t;
29 typedef uintptr_t paddr_t;
30 
31 typedef int kobj_id;
32 
33 typedef uint32_t lk_time_t;
34 typedef unsigned long long lk_bigtime_t;
35 #define INFINITE_TIME UINT32_MAX
36 
37 #define TIME_GTE(a, b) ((int32_t)((a) - (b)) >= 0)
38 #define TIME_LTE(a, b) ((int32_t)((a) - (b)) <= 0)
39 #define TIME_GT(a, b) ((int32_t)((a) - (b)) > 0)
40 #define TIME_LT(a, b) ((int32_t)((a) - (b)) < 0)
41 
42 enum handler_return {
43     INT_NO_RESCHEDULE = 0,
44     INT_RESCHEDULE,
45 };
46 
47 typedef signed long int ssize_t;
48 
49 typedef uint8_t u8;
50 typedef uint16_t u16;
51 typedef uint32_t u32;
52 typedef uint64_t u64;
53 
54 typedef int8_t s8;
55 typedef int16_t s16;
56 typedef int32_t s32;
57 typedef int64_t s64;
58 
59 typedef uint8_t u_int8_t;
60 typedef uint16_t u_int16_t;
61 typedef uint32_t u_int32_t;
62 typedef uint64_t u_int64_t;
63 
64