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