My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sw_types.h
Go to the documentation of this file.
1 /*
2  * OpenVirtualization:
3  * For additional details and support contact developer@sierraware.com.
4  * Additional documentation can be found at www.openvirtualization.org
5  *
6  * Copyright (C) 2010-2014 SierraWare
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program 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
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  */
23 /*
24  * Header for common Data types
25  *
26  */
27 
28 #ifndef __LIB__TYPES_H__
29 #define __LIB__TYPES_H__
30 
31 #define min(a, b) ((a) < (b) ? (a) : (b))
32 
33 #define TRUE 1
34 #define FALSE 0
35 
36 #define true 1
37 #define false 0
38 
39 #ifndef NULL
40 #define NULL 0
41 #endif
42 
43 
44 #define OTZ_OK 0
45 #define OTZ_EFAIL -1
46 #define OTZ_ENOMEM -2
47 #define OTZ_ILLEGAL_ARGUMENT -3
48 
49 #define SW_OK 0
50 #define SW_EFAIL -1
51 #define SW_ENOMEM -2
52 #define SW_ILLEGAL_ARGUMENT -3
53 #define SW_EINVALID -5
54 
55 #define SW_STDIN 0
56 #define SW_STDOUT 1
57 #define SW_STDERR 2
58 
59 #ifdef __CCODE__
60 
61 typedef unsigned char bool;
62 
63 typedef unsigned char u8;
64 typedef unsigned int u32;
65 typedef unsigned long long u64;
66 
67 
68 typedef unsigned long ulong;
69 typedef signed char s8int;
70 typedef signed short s16int;
71 typedef signed int s32int;
72 typedef signed int s32;
73 typedef signed long slong;
74 typedef unsigned short u16;
75 typedef signed long long s64;
76 
77 #ifndef ARM_ARCH_ARMV7
78 typedef long pa_t;
79 typedef char * va_t;
80 typedef u64 sw_u64_t;
81 typedef u64 vir_addr;
82 #else
83 typedef u32 pa_t;
84 typedef u32 va_t;
85 typedef u32 sw_u64_t;
86 typedef u32 vir_addr;
87 #endif
88 
89 
90 typedef unsigned int irq_flags_t;
91 //typedef u32 pa;
92 #ifndef ARM_ARCH_ARMV7
93 //typedef unsigned long size_t;
94 //#else
95 //typedef u32 size_t;
96 #endif
97 
98 #endif
99 
100 #ifndef NULL
101 #if defined(__cplusplus)
102 #define NULL 0
103 #else
104 #define NULL ((void *)0)
105 #endif
106 #endif
107 
108 #endif