ubinos
type.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 Sung Ho Park
3  Contact: ubinos.org@gmail.com
4 
5  This file is part of the tool_ubibuilder component of the Ubinos.
6 
7  GNU General Public License Usage
8  This file may be used under the terms of the GNU
9  General Public License version 3.0 as published by the Free Software
10  Foundation and appearing in the file license_gpl3.txt included in the
11  packaging of this file. Please review the following information to
12  ensure the GNU General Public License version 3.0 requirements will be
13  met: http://www.gnu.org/copyleft/gpl.html.
14 
15  GNU Lesser General Public License Usage
16  Alternatively, this file may be used under the terms of the GNU Lesser
17  General Public License version 2.1 as published by the Free Software
18  Foundation and appearing in the file license_lgpl.txt included in the
19  packaging of this file. Please review the following information to
20  ensure the GNU Lesser General Public License version 2.1 requirements
21  will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22 
23  Commercial Usage
24  Alternatively, licensees holding valid commercial licenses may
25  use this file in accordance with the commercial license agreement
26  provided with the software or, alternatively, in accordance with the
27  terms contained in a written agreement between you and rightful owner.
28  */
29 
30 #ifndef UBINOS_TYPE_H_
31 #define UBINOS_TYPE_H_
32 
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif
37 
46 #include <ubinos_config.h>
47 
48 #if (UBINOS__BSP__CPU_ARCH == UBINOS__BSP__CPU_ARCH__ARM)
49 
50 #ifndef __ASSEMBLY__
51 
53 typedef unsigned char byte_t;
54 
56 typedef unsigned short word_t;
57 
59 typedef unsigned int dword_t;
60 
61 #endif /* __ASSEMBLY__ */
62 
63 #ifndef NULL
64 
65 #define NULL 0
66 #endif
67 
68 #ifndef EOF
69 
70 #define EOF (-1)
71 #endif
72 
73 #ifndef __SIZE_TYPE__
74 
75 #define __SIZE_TYPE__ long unsigned int
76 #endif
77 
78 #ifndef __ASSEMBLY__
79 
82 
83 #endif /* __ASSEMBLY__ */
84 
86 #define SIZETOUINT(a) (a)
87 
89 #define UINTTOSIZE(a) (a)
90 
91 #ifndef INT_MIN
92 
93 #define INT_MIN 0x80000000L // -2147483648
94 #endif
95 
96 #ifndef INT_MAX
97 
98 #define INT_MAX 0x7FFFFFFFL // 2147483647
99 #endif
100 
101 #ifndef UINT_MAX
102 
103 #define UINT_MAX 0xFFFFFFFFL // 4294967295
104 #endif
105 
106 #ifndef INT_SIZE
107 
108 #define INT_SIZE 4
109 #endif
110 
111 #ifndef INT16_MIN
112 
113 #define INT16_MIN 0x8000 // -32768
114 #endif
115 
116 #ifndef INT16_MAX
117 
118 #define INT16_MAX 0x7FFF // 32767
119 #endif
120 
121 #ifndef UINT16_MAX
122 
123 #define UINT16_MAX 0xFFFF // 65535
124 #endif
125 
127 #define MEM_ALIGNMENT INT_SIZE
128 
130 #define MEM_ALIGNMASK (MEM_ALIGNMENT - 1)
131 
133 #define MEM_ALIGN(a) ((((unsigned int) (a)) + MEM_ALIGNMASK) & (~MEM_ALIGNMASK))
134 
135 #else
136 
137 #error "Unsupported UBINOS__BSP__CPU_ARCH"
138 
139 #endif /* (UBINOS__BSP__CPU_ARCH == ... */
140 
141 #ifndef __ASSEMBLY__
142 
143 #include <ubinos/objtype.h>
144 
145 #endif /* __ASSEMBLY__ */
146 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 #endif /* UBINOS_TYPE_H_ */
152 
dword_t
unsigned int dword_t
Definition: type.h:59
size_t
__SIZE_TYPE__ size_t
Definition: type.h:81
word_t
unsigned short word_t
Definition: type.h:56
byte_t
unsigned char byte_t
Definition: type.h:53
__SIZE_TYPE__
#define __SIZE_TYPE__
Definition: type.h:75
objtype.h
ubinos object type