]>
Commit | Line | Data |
---|---|---|
c906108c | 1 | /* Types for Cpu tools GENerated simulators. |
1d506c26 | 2 | Copyright (C) 1996-2024 Free Software Foundation, Inc. |
c906108c SS |
3 | Contributed by Cygnus Support. |
4 | ||
5 | This file is part of GDB, the GNU debugger. | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
4744ac1b JB |
9 | the Free Software Foundation; either version 3 of the License, or |
10 | (at your option) any later version. | |
c906108c SS |
11 | |
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
4744ac1b JB |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
c906108c SS |
19 | |
20 | /* This file is not included with cgen-sim.h as it defines types | |
21 | needed by sim-base.h. */ | |
22 | ||
23 | #ifndef CGEN_TYPES_H | |
24 | #define CGEN_TYPES_H | |
25 | ||
26 | /* Miscellaneous cgen configury defined here as this file gets | |
27 | included soon enough. */ | |
28 | ||
c906108c SS |
29 | /* Indicate we support --{profile,trace}-{range,function}. */ |
30 | #undef SIM_HAVE_ADDR_RANGE | |
31 | #define SIM_HAVE_ADDR_RANGE | |
32 | ||
33 | #ifdef __GNUC__ | |
c906108c SS |
34 | #undef DI_FN_SUPPORT |
35 | #else | |
c906108c SS |
36 | #define DI_FN_SUPPORT |
37 | #endif | |
38 | \f | |
39 | /* Mode support. */ | |
40 | ||
41 | /* Common mode types. */ | |
42 | /* ??? Target specific modes. */ | |
43 | typedef enum mode_type { | |
104c1213 | 44 | MODE_VOID, MODE_BI, |
c906108c SS |
45 | MODE_QI, MODE_HI, MODE_SI, MODE_DI, |
46 | MODE_UQI, MODE_UHI, MODE_USI, MODE_UDI, | |
47 | MODE_SF, MODE_DF, MODE_XF, MODE_TF, | |
48 | MODE_TARGET_MAX /* = MODE_TF? */, | |
49 | /* These are host modes. */ | |
50 | MODE_INT, MODE_UINT, MODE_PTR, /*??? MODE_ADDR, MODE_IADDR,*/ | |
51 | MODE_MAX | |
52 | } MODE_TYPE; | |
53 | ||
54 | #define MAX_TARGET_MODES ((int) MODE_TARGET_MAX) | |
55 | #define MAX_MODES ((int) MODE_MAX) | |
56 | ||
12279229 MF |
57 | extern const char * const cgen_mode_names[]; |
58 | #define MODE_NAME(m) (cgen_mode_names[m]) | |
c906108c | 59 | |
93aaa742 MF |
60 | /* Some system headers define VOID already, so undo it. */ |
61 | #undef VOID | |
2d84da1b | 62 | typedef void VOID; |
c906108c | 63 | typedef unsigned char BI; |
e4c803f5 MF |
64 | typedef int8_t QI; |
65 | typedef int16_t HI; | |
66 | typedef int32_t SI; | |
67 | typedef uint8_t UQI; | |
68 | typedef uint16_t UHI; | |
69 | typedef uint32_t USI; | |
70 | ||
71 | typedef int64_t DI; | |
72 | typedef uint64_t UDI; | |
c906108c SS |
73 | #define GETLODI(di) ((SI) (di)) |
74 | #define GETHIDI(di) ((SI) ((UDI) (di) >> 32)) | |
b2ea48df MF |
75 | #define SETLODI(di, val) ((di) = (((di) & 0xffffffff00000000LL) | (USI) (val))) |
76 | #define SETHIDI(di, val) ((di) = (((di) & 0xffffffffLL) | (((UDI) (val)) << 32))) | |
77 | #define MAKEDI(hi, lo) ((DI) (((UDI) (hi) << 32) | (UDI) (USI) (lo))) | |
c906108c | 78 | |
c906108c SS |
79 | /* These are used to record extracted raw data from an instruction, among other |
80 | things. It must be a host data type, and not a target one. */ | |
81 | typedef int INT; | |
82 | typedef unsigned int UINT; | |
83 | ||
84 | typedef unsigned_address ADDR; /* FIXME: wip*/ | |
85 | typedef unsigned_address IADDR; /* FIXME: wip*/ | |
86 | ||
43ff13b4 JM |
87 | /* fp types are in cgen-fpu.h */ |
88 | ||
c906108c | 89 | #endif /* CGEN_TYPES_H */ |