Commit | Line | Data |
---|---|---|
cbb38b47 BE |
1 | /* Main header for the Hitachi SH64 architecture. */ |
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 | /* sim-basics.h includes config.h but cgen-types.h must be included before | |
12 | sim-basics.h and cgen-types.h needs config.h. */ | |
13 | #include "config.h" | |
14 | ||
15 | #include "symcat.h" | |
16 | #include "sim-basics.h" | |
17 | #include "cgen-types.h" | |
18 | #include "sh-desc.h" | |
19 | #include "sh-opc.h" | |
20 | #include "arch.h" | |
21 | ||
22 | /* These must be defined before sim-base.h. */ | |
23 | typedef UDI sim_cia; | |
24 | ||
cbb38b47 BE |
25 | #include "sim-base.h" |
26 | #include "cgen-sim.h" | |
27 | #include "sh64-sim.h" | |
28 | \f | |
29 | /* The _sim_cpu struct. */ | |
30 | ||
31 | struct _sim_cpu { | |
32 | /* sim/common cpu base. */ | |
33 | sim_cpu_base base; | |
34 | ||
35 | /* Static parts of cgen. */ | |
36 | CGEN_CPU cgen_cpu; | |
37 | ||
38 | /* CPU specific parts go here. | |
39 | Note that in files that don't need to access these pieces WANT_CPU_FOO | |
40 | won't be defined and thus these parts won't appear. This is ok in the | |
41 | sense that things work. It is a source of bugs though. | |
42 | One has to of course be careful to not take the size of this | |
43 | struct and no structure members accessed in non-cpu specific files can | |
44 | go after here. Oh for a better language. */ | |
45 | #if defined (WANT_CPU_SH64) | |
46 | SH64_CPU_DATA cpu_data; | |
47 | #endif | |
48 | }; | |
49 | \f | |
50 | /* The sim_state struct. */ | |
51 | ||
52 | struct sim_state { | |
f95f4ed2 | 53 | sim_cpu *cpu[MAX_NR_PROCESSORS]; |
cbb38b47 BE |
54 | |
55 | CGEN_STATE cgen_state; | |
56 | ||
57 | sim_state_base base; | |
58 | }; | |
59 | \f | |
60 | /* Misc. */ | |
61 | ||
62 | /* Catch address exceptions. */ | |
63 | extern SIM_CORE_SIGNAL_FN sh64_core_signal; | |
64 | #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \ | |
65 | sh64_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \ | |
66 | (TRANSFER), (ERROR)) | |
67 | ||
68 | /* Default memory size. */ | |
69 | #define SH64_DEFAULT_MEM_SIZE 0x800000 /* 8M */ | |
70 | ||
71 | #endif /* SIM_MAIN_H */ |