23 #include <ubinos_config.h>
25 #if (UBINOS__BSP__CPU_ARCH == UBINOS__BSP__CPU_ARCH__ARM)
52 #define __SIZE_TYPE__ long unsigned int
63 #define SIZETOUINT(a) (a)
66 #define UINTTOSIZE(a) (a)
70 #define INT_MIN 0x80000000L
75 #define INT_MAX 0x7FFFFFFFL
80 #define UINT_MAX 0xFFFFFFFFL
90 #define INT16_MIN 0x8000
95 #define INT16_MAX 0x7FFF
100 #define UINT16_MAX 0xFFFF
104 #define MEM_ALIGNMENT INT_SIZE
107 #define MEM_ALIGNMASK (MEM_ALIGNMENT - 1)
110 #define MEM_ALIGN(a) ((((unsigned int) (a)) + MEM_ALIGNMASK) & (~MEM_ALIGNMASK))
112 #define MEM_ALIGNMASK_16 (16 - 1)
114 #define MEM_ALIGN_16(a) ((((unsigned int) (a)) + MEM_ALIGNMASK_16) & (~MEM_ALIGNMASK_16))
116 #elif (UBINOS__BSP__CPU_ARCH == UBINOS__BSP__CPU_ARCH__LOCAL)
128 #error "Unsupported UBINOS__BSP__CPU_ARCH"
172 #define ubi_assert(__expr) assert(__expr)
174 #define ubi_assert_ok(__ubi_st) ubi_assert(__ubi_st == UBI_ST_OK)
175 #define ubi_assert_not_null(__ptr) ubi_assert((void *) __ptr != NULL)
177 #define ubi_unused(__var) do { (void) __var; } while(0)
180 #define UBI_ERR_INTERNAL UBI_ST_ERR
182 #define ubi_err_t ubi_st_t
184 #define UBI_ERR_OK UBI_ST_OK
185 #define UBI_ERR_ERROR UBI_ST_ERR
186 #define UBI_ERR_BUSY UBI_ST_BUSY
187 #define UBI_ERR_TIMEOUT UBI_ST_TIMEOUT
188 #define UBI_ERR_CANCEL UBI_ST_CANCEL
189 #define UBI_ERR_CANCEL_2 UBI_ST_CANCEL_2
191 #define UBI_ERR_UNKNOWN UBI_ST_ERR_UNKNOWN
192 #define UBI_ERR_NULL UBI_ST_ERR_NULL
193 #define UBI_ERR_NO_MEM UBI_ST_ERR_NO_MEM
194 #define UBI_ERR_BUF_FULL UBI_ST_ERR_BUF_FULL
195 #define UBI_ERR_BUF_EMPTY UBI_ST_ERR_BUF_EMPTY
196 #define UBI_ERR_NOT_FOUND UBI_ST_ERR_NOT_FOUND
197 #define UBI_ERR_NOT_SUPPORTED UBI_ST_ERR_NOT_SUPPORTED
198 #define UBI_ERR_INVALID_PARAM UBI_ST_ERR_INVALID_PARAM
199 #define UBI_ERR_INVALID_DATA UBI_ST_ERR_INVALID_DATA
200 #define UBI_ERR_INVALID_LENGTH UBI_ST_ERR_INVALID_LENGTH
201 #define UBI_ERR_INVALID_ADDR UBI_ST_ERR_INVALID_ADDR
202 #define UBI_ERR_INVALID_STATE UBI_ST_ERR_INVALID_STATE
203 #define UBI_ERR_INIT UBI_ST_ERR_INIT
204 #define UBI_ERR_RESET UBI_ST_ERR_RESET
205 #define UBI_ERR_IO UBI_ST_ERR_IO
206 #define UBI_ERR_TX UBI_ST_ERR_TX
207 #define UBI_ERR_RX UBI_ST_ERR_RX
208 #define UBI_ERR_PACKET UBI_ST_ERR_PACKET
209 #define UBI_ERR_HEAP UBI_ST_ERR_HEAP
210 #define UBI_ERR_BUS UBI_ST_ERR_BUS
212 #define UBI_ERR_BUS_INIT UBI_ST_ERR_INIT
213 #define UBI_ERR_BUS_RESET UBI_ST_ERR_RESET
214 #define UBI_ERR_BUS_IO UBI_ST_ERR_IO
215 #define UBI_ERR_BUS_TX UBI_ST_ERR_TX
216 #define UBI_ERR_BUS_RX UBI_ST_ERR_RX
unsigned int dword_t
Definition: type.h:36
ubi_st_t
Definition: type.h:140
@ UBI_ST_CANCEL_2
Definition: type.h:146
@ UBI_ST_ERR_BUF_EMPTY
Definition: type.h:152
@ UBI_ST_ERR_INVALID_ADDR
Definition: type.h:158
@ UBI_ST_ERR_RESET
Definition: type.h:161
@ UBI_ST_ERR_HEAP
Definition: type.h:166
@ UBI_ST_ERR_TX
Definition: type.h:163
@ UBI_ST_ERR_INVALID_LENGTH
Definition: type.h:157
@ UBI_ST_ERR_NOT_FOUND
Definition: type.h:153
@ UBI_ST_ERR_PACKET
Definition: type.h:165
@ UBI_ST_ERR_BUF_FULL
Definition: type.h:151
@ UBI_ST_OK
Definition: type.h:141
@ UBI_ST_BUSY
Definition: type.h:143
@ UBI_ST_ERR_NOT_SUPPORTED
Definition: type.h:154
@ UBI_ST_ERR_INVALID_DATA
Definition: type.h:156
@ UBI_ST_ERR_INIT
Definition: type.h:160
@ UBI_ST_TIMEOUT
Definition: type.h:144
@ UBI_ST_ERR
Definition: type.h:142
@ UBI_ST_CANCEL
Definition: type.h:145
@ UBI_ST_ERR_IO
Definition: type.h:162
@ UBI_ST_ERR_UNDERFLOW
Definition: type.h:169
@ UBI_ST_ERR_BUS
Definition: type.h:167
@ UBI_ST_ERR_RX
Definition: type.h:164
@ UBI_ST_ERR_UNKNOWN
Definition: type.h:148
@ UBI_ST_ERR_INVALID_STATE
Definition: type.h:159
@ UBI_ST_ERR_INVALID_PARAM
Definition: type.h:155
@ UBI_ST_ERR_OVERFLOW
Definition: type.h:168
@ UBI_ST_ERR_NO_MEM
Definition: type.h:150
@ UBI_ST_ERR_NULL
Definition: type.h:149
unsigned char byte_t
Definition: type.h:30
__SIZE_TYPE__ size_t
Definition: type.h:58
#define __SIZE_TYPE__
Definition: type.h:52
unsigned short word_t
Definition: type.h:33