]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/lm32/sim-main.h
sim: trim old USING_SIM_BASE_H define
[thirdparty/binutils-gdb.git] / sim / lm32 / sim-main.h
1 /* Lattice Mico32 simulator support code
2 Contributed by Jon Beniston <jon@beniston.com>
3
4 Copyright (C) 2009-2015 Free Software Foundation, Inc.
5
6 This file is part of GDB.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21 /* Main header for the LM32 simulator. */
22
23 #ifndef SIM_MAIN_H
24 #define SIM_MAIN_H
25
26 #include "symcat.h"
27 #include "sim-basics.h"
28 #include "cgen-types.h"
29 #include "lm32-desc.h"
30 #include "lm32-opc.h"
31 #include "arch.h"
32
33 #define SIM_ENGINE_HALT_HOOK(sd, cpu, cia) \
34 do { \
35 if (cpu) /* null if ctrl-c */ \
36 sim_pc_set ((cpu), (cia)); \
37 } while (0)
38 #define SIM_ENGINE_RESTART_HOOK(sd, cpu, cia) \
39 do { \
40 sim_pc_set ((cpu), (cia)); \
41 } while (0)
42
43 #include "sim-base.h"
44 #include "cgen-sim.h"
45 #include "lm32-sim.h"
46 #include "opcode/cgen.h"
47 \f
48 /* The _sim_cpu struct. */
49
50 struct _sim_cpu
51 {
52 /* sim/common cpu base. */
53 sim_cpu_base base;
54
55 /* Static parts of cgen. */
56 CGEN_CPU cgen_cpu;
57
58 /* CPU specific parts go here.
59 Note that in files that don't need to access these pieces WANT_CPU_FOO
60 won't be defined and thus these parts won't appear. This is ok in the
61 sense that things work. It is a source of bugs though.
62 One has to of course be careful to not take the size of this
63 struct and no structure members accessed in non-cpu specific files can
64 go after here. Oh for a better language. */
65 #if defined (WANT_CPU_LM32BF)
66 LM32BF_CPU_DATA cpu_data;
67 #endif
68
69 };
70 \f
71 /* The sim_state struct. */
72
73 struct sim_state
74 {
75 sim_cpu *cpu[MAX_NR_PROCESSORS];
76
77 CGEN_STATE cgen_state;
78
79 sim_state_base base;
80 };
81 \f
82 /* Misc. */
83
84 /* Catch address exceptions. */
85 extern SIM_CORE_SIGNAL_FN lm32_core_signal;
86 #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
87 lm32_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
88 (TRANSFER), (ERROR))
89
90 #endif /* SIM_MAIN_H */