]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/m32r/sim-main.h
sim: trim old USING_SIM_BASE_H define
[thirdparty/binutils-gdb.git] / sim / m32r / sim-main.h
1 /* Main header for the m32r. */
2
3 #ifndef SIM_MAIN_H
4 #define SIM_MAIN_H
5
6 #include "symcat.h"
7 #include "sim-basics.h"
8 #include "cgen-types.h"
9 #include "m32r-desc.h"
10 #include "m32r-opc.h"
11 #include "arch.h"
12
13 #define SIM_ENGINE_HALT_HOOK(sd, cpu, cia) \
14 do { \
15 if (cpu) /* null if ctrl-c */ \
16 sim_pc_set ((cpu), (cia)); \
17 } while (0)
18 #define SIM_ENGINE_RESTART_HOOK(sd, cpu, cia) \
19 do { \
20 sim_pc_set ((cpu), (cia)); \
21 } while (0)
22
23 #include "sim-base.h"
24 #include "cgen-sim.h"
25 #include "m32r-sim.h"
26 #include "opcode/cgen.h"
27 \f
28 /* The _sim_cpu struct. */
29
30 struct _sim_cpu {
31 /* sim/common cpu base. */
32 sim_cpu_base base;
33
34 /* Static parts of cgen. */
35 CGEN_CPU cgen_cpu;
36
37 M32R_MISC_PROFILE m32r_misc_profile;
38 #define CPU_M32R_MISC_PROFILE(cpu) (& (cpu)->m32r_misc_profile)
39
40 /* CPU specific parts go here.
41 Note that in files that don't need to access these pieces WANT_CPU_FOO
42 won't be defined and thus these parts won't appear. This is ok in the
43 sense that things work. It is a source of bugs though.
44 One has to of course be careful to not take the size of this
45 struct and no structure members accessed in non-cpu specific files can
46 go after here. Oh for a better language. */
47 #if defined (WANT_CPU_M32RBF)
48 M32RBF_CPU_DATA cpu_data;
49 #endif
50 #if defined (WANT_CPU_M32RXF)
51 M32RXF_CPU_DATA cpu_data;
52 #elif defined (WANT_CPU_M32R2F)
53 M32R2F_CPU_DATA cpu_data;
54 #endif
55 };
56 \f
57 /* The sim_state struct. */
58
59 struct sim_state {
60 sim_cpu *cpu[MAX_NR_PROCESSORS];
61
62 CGEN_STATE cgen_state;
63
64 sim_state_base base;
65 };
66 \f
67 /* Misc. */
68
69 /* Catch address exceptions. */
70 extern SIM_CORE_SIGNAL_FN m32r_core_signal;
71 #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
72 m32r_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
73 (TRANSFER), (ERROR))
74
75 /* Default memory size. */
76 #ifdef M32R_LINUX
77 #define M32R_DEFAULT_MEM_SIZE 0x2000000 /* 32M */
78 #else
79 #define M32R_DEFAULT_MEM_SIZE 0x800000 /* 8M */
80 #endif
81
82 #endif /* SIM_MAIN_H */