]>
Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* Main header for the fr30. */ |
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 "symcat.h" | |
13 | #include "sim-basics.h" | |
14 | #include "cgen-types.h" | |
15 | #include "fr30-desc.h" | |
16 | #include "fr30-opc.h" | |
17 | #include "arch.h" | |
18 | ||
19 | /* These must be defined before sim-base.h. */ | |
20 | typedef USI sim_cia; | |
21 | ||
22 | #define CIA_GET(cpu) CPU_PC_GET (cpu) | |
23 | #define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val)) | |
24 | ||
25 | #include "sim-base.h" | |
26 | #include "cgen-sim.h" | |
27 | #include "fr30-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_FR30BF) | |
46 | FR30BF_CPU_DATA cpu_data; | |
47 | #endif | |
48 | }; | |
49 | \f | |
50 | /* The sim_state struct. */ | |
51 | ||
52 | struct sim_state { | |
53 | sim_cpu *cpu; | |
54 | #define STATE_CPU(sd, n) (/*&*/ (sd)->cpu) | |
55 | ||
56 | CGEN_STATE cgen_state; | |
57 | ||
58 | sim_state_base base; | |
59 | }; | |
60 | \f | |
61 | /* Misc. */ | |
62 | ||
63 | /* Catch address exceptions. */ | |
64 | extern SIM_CORE_SIGNAL_FN fr30_core_signal; | |
65 | #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \ | |
66 | fr30_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \ | |
67 | (TRANSFER), (ERROR)) | |
68 | ||
69 | /* Default memory size. */ | |
70 | #define FR30_DEFAULT_MEM_SIZE 0x800000 /* 8M */ |