types.h
Go to the documentation of this file.
1 /*
2  * Bareflank Hypervisor
3  *
4  * Copyright (C) 2015 Assured Information Security, Inc.
5  * Author: Rian Quinn <quinnr@ainfosec.com>
6  * Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef TYPES_H
24 #define TYPES_H
25 
26 /* -------------------------------------------------------------------------- */
27 /* Userspace */
28 /* -------------------------------------------------------------------------- */
29 
30 #if !defined(KERNEL) && !defined(_WIN32)
31 #include <stdint.h>
32 #endif
33 
34 /* -------------------------------------------------------------------------- */
35 /* Linux Types */
36 /* -------------------------------------------------------------------------- */
37 
38 #if defined(KERNEL) && defined(__linux__)
39 #include <linux/types.h>
40 #define PRId64 "lld"
41 #endif
42 
43 /* -------------------------------------------------------------------------- */
44 /* Windows Types */
45 /* -------------------------------------------------------------------------- */
46 
47 #if defined(_WIN32)
48 #include <basetsd.h>
49 typedef INT8 int8_t;
50 typedef INT16 int16_t;
51 typedef INT32 int32_t;
52 typedef INT64 int64_t;
53 typedef UINT8 uint8_t;
54 typedef UINT16 uint16_t;
55 typedef UINT32 uint32_t;
56 typedef UINT64 uint64_t;
57 typedef UINT_PTR uintptr_t;
58 typedef INT_PTR intptr_t;
59 #define PRId64 "lld"
60 #endif
61 
62 /* -------------------------------------------------------------------------- */
63 /* OSX Types */
64 /* -------------------------------------------------------------------------- */
65 
66 #if defined(KERNEL) && defined(__APPLE__)
67 #define PRId64 "lld"
68 #include <stdint.h>
69 #define NULL 0
70 #endif
71 
72 #endif