1 /* This file is part of the program psim.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 /* Frustrating header junk */
28 default_insn_bit_size = 32,
29 max_insn_bit_size = 64,
33 /* Define a 64bit data type */
35 #if defined __GNUC__ || defined _WIN32
38 typedef long long signed64;
39 typedef unsigned long long unsigned64;
43 typedef __int64 signed64;
44 typedef unsigned __int64 unsigned64;
47 #else /* Not GNUC or WIN32 */
67 #if !defined (__attribute__) && (!defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7))
68 #define __attribute__(arg)
73 #include "filter_host.h"
75 typedef struct _line_ref line_ref;
77 const char *file_name;
81 /* Error appends a new line, warning and notify do not */
82 typedef void error_func
83 (const line_ref *line,
87 extern error_func error;
88 extern error_func warning;
89 extern error_func notify;
92 #define ERROR(EXPRESSION) \
95 line.file_name = filter_filename (__FILE__); \
96 line.line_nr = __LINE__; \
97 error (&line, EXPRESSION); \
100 #define ASSERT(EXPRESSION) \
102 if (!(EXPRESSION)) { \
104 line.file_name = filter_filename (__FILE__); \
105 line.line_nr = __LINE__; \
106 error(&line, "assertion failed - %s\n", #EXPRESSION); \
110 #define ZALLOC(TYPE) ((TYPE*) zalloc (sizeof(TYPE)))
111 #define NZALLOC(TYPE,N) ((TYPE*) zalloc (sizeof(TYPE) * (N)))
113 #define STRDUP(STRING) (strcpy (zalloc (strlen (STRING) + 1), (STRING)))
114 #define STRNDUP(STRING,LEN) (strncpy (zalloc ((LEN) + 1), (STRING), (LEN)))
120 extern unsigned target_a2i
124 extern unsigned i2target
128 extern unsigned long long a2i
132 /* Try looking for name in the map table (returning the corresponding
135 If the the sentinal (NAME == NULL) its value if >= zero is returned
138 typedef struct _name_map {
145 const name_map *map);
147 extern const char *i2name
149 const name_map *map);