923465fde21c536ace8e4b884427121202311f93
[deliverable/binutils-gdb.git] / sim / m32r / sim-main.h
1 /* Main header for the m32r. */
2
3 #define USING_SIM_BASE_H /* FIXME: quick hack */
4
5 struct _sim_cpu; /* FIXME: should be in sim-basics.h */
6 typedef struct _sim_cpu SIM_CPU;
7
8 /* sim-basics.h includes config.h but cgen-types.h must be included before
9 sim-basics.h and cgen-types.h needs config.h. */
10 #include "config.h"
11
12 #include "ansidecl.h"
13 #include "symcat.h"
14 #include "cgen-types.h"
15 #include "arch.h"
16 #include "sim-basics.h"
17
18 /* These must be defined before sim-base.h. */
19 typedef USI sim_cia;
20
21 #define CIA_GET(cpu) CPU_PC_GET (cpu)
22 #define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
23
24 #include "sim-base.h"
25 #include "cgen-sim.h"
26 #include "cgen-scache.h"
27 #include "cgen-cpu.h"
28 #include "cgen-trace.h"
29 #include "cpu-sim.h"
30 #include "cpuall.h"
31 \f
32 /* The _sim_cpu struct. */
33
34 struct _sim_cpu {
35 /* sim/common cpu base. */
36 sim_cpu_base base;
37
38 /* Static parts of cgen. */
39 CGEN_CPU cgen_cpu;
40
41 M32R_MISC_PROFILE m32r_misc_profile;
42 #define CPU_M32R_MISC_PROFILE(cpu) (& (cpu)->m32r_misc_profile)
43
44 /* CPU specific parts go here.
45 Note that in files that don't need to access these pieces WANT_CPU_FOO
46 won't be defined and thus these parts won't appear. This is ok in the
47 sense that things work. It is a source of bugs though.
48 One has to of course be careful to not take the size of this
49 struct and no structure members accessed in non-cpu specific files can
50 go after here. Oh for a better language. */
51 #if defined (WANT_CPU_M32RBF)
52 M32RBF_CPU_DATA cpu_data;
53 /* start-sanitize-m32rx */
54 #elif defined (WANT_CPU_M32RXF)
55 M32RXF_CPU_DATA cpu_data;
56 /* end-sanitize-m32rx */
57 #endif
58 };
59 \f
60 /* The sim_state struct. */
61
62 struct sim_state {
63 sim_cpu *cpu;
64 #define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
65
66 CGEN_STATE cgen_state;
67
68 sim_state_base base;
69 };
70 \f
71 /* Misc. */
72
73 /* Catch address exceptions. */
74 extern SIM_CORE_SIGNAL_FN m32r_core_signal;
75 #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
76 m32r_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
77 (TRANSFER), (ERROR))
78
79 /* Default memory size. */
80 #define M32R_DEFAULT_MEM_SIZE 0x800000 /* 8M */
This page took 0.032413 seconds and 3 git commands to generate.