]>
Commit | Line | Data |
---|---|---|
b85e4829 AC |
1 | /* The common simulator framework for GDB, the GNU Debugger. |
2 | ||
3666a048 | 3 | Copyright 2002-2021 Free Software Foundation, Inc. |
b85e4829 AC |
4 | |
5 | Contributed by Andrew Cagney and Red Hat. | |
6 | ||
7 | This file is part of GDB. | |
8 | ||
9 | This program is free software; you can redistribute it and/or modify | |
10 | it under the terms of the GNU General Public License as published by | |
4744ac1b | 11 | the Free Software Foundation; either version 3 of the License, or |
b85e4829 AC |
12 | (at your option) any later version. |
13 | ||
14 | This program is distributed in the hope that it will be useful, | |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | GNU General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU General Public License | |
4744ac1b | 20 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
c906108c SS |
21 | |
22 | ||
618b526e MF |
23 | #ifndef SIM_BASICS_H |
24 | #define SIM_BASICS_H | |
c906108c SS |
25 | |
26 | ||
27 | /* Basic configuration */ | |
28 | ||
6df01ab8 | 29 | #include "defs.h" |
c906108c SS |
30 | |
31 | /* Basic host dependant mess - hopefully <stdio.h> + <stdarg.h> will | |
32 | bring potential conflicts out in the open */ | |
33 | ||
34 | #include <stdarg.h> | |
35 | #include <stdio.h> | |
36 | #include <setjmp.h> | |
37 | ||
c906108c SS |
38 | |
39 | #ifndef NULL | |
40 | #define NULL 0 | |
41 | #endif | |
42 | ||
43 | ||
bc273e17 MF |
44 | #ifndef min |
45 | #define min(a, b) ((a) < (b) ? (a) : (b)) | |
46 | #endif | |
47 | #ifndef max | |
48 | #define max(a, b) ((a) > (b) ? (a) : (b)) | |
49 | #endif | |
50 | ||
028f6515 | 51 | |
c906108c SS |
52 | /* Global types that code manipulates */ |
53 | ||
c906108c SS |
54 | struct hw; |
55 | struct _sim_fpu; | |
56 | ||
57 | ||
58 | /* Generic address space (maps) and access attributes */ | |
59 | ||
60 | enum { | |
61 | read_map = 0, | |
62 | write_map = 1, | |
63 | exec_map = 2, | |
64 | io_map = 3, | |
65 | nr_maps = 32, /* something small */ | |
66 | }; | |
67 | ||
68 | enum { | |
69 | access_invalid = 0, | |
70 | access_read = 1 << read_map, | |
71 | access_write = 1 << write_map, | |
72 | access_exec = 1 << exec_map, | |
73 | access_io = 1 << io_map, | |
74 | }; | |
75 | ||
76 | enum { | |
77 | access_read_write = (access_read | access_write), | |
78 | access_read_exec = (access_read | access_exec), | |
79 | access_write_exec = (access_write | access_exec), | |
80 | access_read_write_exec = (access_read | access_write | access_exec), | |
81 | access_read_io = (access_read | access_io), | |
82 | access_write_io = (access_write | access_io), | |
83 | access_read_write_io = (access_read | access_write | access_io), | |
84 | access_exec_io = (access_exec | access_io), | |
85 | access_read_exec_io = (access_read | access_exec | access_io), | |
86 | access_write_exec_io = (access_write | access_exec | access_io), | |
87 | access_read_write_exec_io = (access_read | access_write | access_exec | access_io), | |
88 | }; | |
89 | ||
90 | ||
91 | /* disposition of an object when things are reset */ | |
92 | ||
93 | typedef enum { | |
94 | permenant_object, | |
95 | temporary_object, | |
96 | } object_disposition; | |
97 | ||
98 | ||
99 | /* Memory transfer types */ | |
100 | ||
101 | typedef enum _transfer_type { | |
102 | read_transfer, | |
103 | write_transfer, | |
104 | } transfer_type; | |
105 | ||
106 | ||
107 | /* directions */ | |
108 | ||
109 | typedef enum { | |
110 | bidirect_port, | |
111 | input_port, | |
112 | output_port, | |
113 | } port_direction; | |
114 | ||
115 | ||
116 | \f | |
117 | /* Basic definitions - ordered so that nothing calls what comes after it. */ | |
118 | ||
c906108c | 119 | #include "ansidecl.h" |
df68e12b MF |
120 | #include "sim/callback.h" |
121 | #include "sim/sim.h" | |
c906108c SS |
122 | |
123 | #include "sim-config.h" | |
124 | ||
125 | #include "sim-inline.h" | |
126 | ||
127 | #include "sim-types.h" | |
128 | #include "sim-bits.h" | |
129 | #include "sim-endian.h" | |
130 | #include "sim-signal.h" | |
c906108c SS |
131 | |
132 | #include "sim-utils.h" | |
133 | ||
d3fe0d7b AB |
134 | #include "libiberty.h" |
135 | ||
c906108c SS |
136 | /* Note: Only the simpler interfaces are defined here. More heavy |
137 | weight objects, such as core and events, are defined in the more | |
138 | serious sim-base.h header. */ | |
139 | ||
618b526e | 140 | #endif /* SIM_BASICS_H */ |