add memset asm code
[ti-x.git] / src / prefix.h
blobb79750f8e8b50ca471d6d52e8faa4fb65ad74cb8
1 /* the ti-x embed operation system
2 *
3 * it is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * it is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with it; If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>
16 * Copyright (C) 2009, Ruki All rights reserved.
17 * Home: <a href="http://www.xxx.org">http://www.xxx.org</a>
19 * \author ruki
20 * \date 09.11.21
21 * \file prefix.h
22 * \brief the prefix file of ti-x
25 #ifndef TI_PREFIX_H
26 #define TI_PREFIX_H
28 /* ////////////////////////////////////////////////////////////////////////
29 * includes
32 // config
33 #include "config/config.h"
34 #include "arch/support.h"
36 /* ////////////////////////////////////////////////////////////////////////
37 * the basic macros
39 // invalidate handle value
40 #define TI_INVALID_HANDLE ((ti_handle_t)(-1))
42 // return value
43 #define TI_TRUE ((ti_bool_t)(1))
44 #define TI_FALSE ((ti_bool_t)(0))
46 // NULL
47 #define TI_NULL ((void*)0)
49 /* ////////////////////////////////////////////////////////////////////////
50 * the gcc version
53 #define TI_GCC_VERSION_MAJOR (__GNUC__)
54 #define TI_GCC_VERSION_MINOR (__GNUC_MINOR__)
56 #if __GNUC__ == 2
58 # if __GNUC_MINOR__ < 95
59 # define TI_GCC_VERSION_STRING "GNU C/C++ <2.95"
60 # elif __GNUC_MINOR__ == 95
61 # define TI_GCC_VERSION_STRING "GNU C/C++ 2.95"
62 # elif __GNUC_MINOR__ == 96
63 # define TI_GCC_VERSION_STRING "GNU C/C++ 2.96"
64 # else
65 # define TI_GCC_VERSION_STRING "GNU C/C++ >2.96&&<3.0"
66 # endif
68 #elif __GNUC__ == 3
70 # if __GNUC_MINOR__ == 2
71 # define TI_GCC_VERSION_STRING "GNU C/C++ 3.2"
72 # elif __GNUC_MINOR__ == 3
73 # define TI_GCC_VERSION_STRING "GNU C/C++ 3.3"
74 # elif __GNUC_MINOR__ == 4
75 # define TI_GCC_VERSION_STRING "GNU C/C++ 3.4"
76 # else
77 # define TI_GCC_VERSION_STRING "GNU C/C++ >3.4&&<4.0"
78 # endif
80 #elif __GNUC__ == 4
82 # if __GNUC_MINOR__ == 1
83 # define TI_GCC_VERSION_STRING "GNU C/C++ 4.1"
84 # elif __GNUC_MINOR__ == 2
85 # define TI_GCC_VERSION_STRING "GNU C/C++ 4.2"
86 # elif __GNUC_MINOR__ == 3
87 # define TI_GCC_VERSION_STRING "GNU C/C++ 4.3"
88 # elif __GNUC_MINOR__ == 4
89 # define TI_GCC_VERSION_STRING "GNU C/C++ 4.4"
90 # endif
92 #else
93 # error Unknown GNU C/C++ Compiler Version
94 #endif
97 /* ////////////////////////////////////////////////////////////////////////
98 * the basic types
100 typedef signed int ti_int_t;
101 typedef unsigned int ti_uint_t;
102 typedef ti_int_t ti_bool_t;
103 typedef ti_uint_t ti_size_t;
104 typedef signed char ti_int8_t;
105 typedef unsigned char ti_uint8_t;
106 typedef signed short ti_int16_t;
107 typedef unsigned short ti_uint16_t;
108 typedef ti_int_t ti_int32_t;
109 typedef ti_uint_t ti_uint32_t;
110 typedef ti_uint8_t ti_byte_t;
111 typedef char ti_char_t;
112 typedef double ti_float_t;
113 typedef void* ti_handle_t;
115 #ifdef TI_ARCH_HAVE_INT64
116 typedef signed long long ti_int64_t;
117 typedef unsigned long long ti_uint64_t;
118 #else
119 typedef ti_int32_t ti_int64_t;
120 typedef ti_uint32_t ti_uint64_t;
121 #endif
126 // TI_PREFIX_H
127 #endif