This commit was generated by cvs2svn to track changes on a CVS vendor
[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 #define USING_SIM_BASE_H /* FIXME: quick hack */
7
8 struct _sim_cpu; /* FIXME: should be in sim-basics.h */
9 typedef struct _sim_cpu SIM_CPU;
10
11 #include "ansidecl.h"
12 #include "symcat.h"
13 #include "sim-basics.h"
14 #include "cgen-types.h"
15 #include "cpu-opc.h"
16 #include "arch.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 "cpu-sim.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 /* start-sanitize-m32rx */
50 #elif defined (WANT_CPU_M32RXF)
51 M32RXF_CPU_DATA cpu_data;
52 /* end-sanitize-m32rx */
53 #endif
54 };
55 \f
56 /* The sim_state struct. */
57
58 struct sim_state {
59 sim_cpu *cpu;
60 #define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
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 #define M32R_DEFAULT_MEM_SIZE 0x800000 /* 8M */
77
78 #endif /* SIM_MAIN_H */