修订版 | 20bca71d82598a015de0991196e45f0b5f7ead81 (tree) |
---|---|
时间 | 2015-04-18 17:31:36 |
作者 | Mike Frysinger <vapier@gent...> |
Commiter | Mike Frysinger |
sim: unify SIM_CPU definition
Since every target typedefs this the same way, move it to the common code.
We have to leave Blackfin behind here for now because of inter-dependencies
on types and headers: sim-base.h includes sim-model.h which needs types in
machs.h which needs types in bfim-sim.h which needs SIM_CPU.
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -20,9 +20,6 @@ | ||
20 | 20 | #define SIM_MAIN_H |
21 | 21 | |
22 | 22 | #include "sim-basics.h" |
23 | - | |
24 | -typedef struct _sim_cpu SIM_CPU; | |
25 | - | |
26 | 23 | #include "sim-base.h" |
27 | 24 | #include "bfd.h" |
28 | 25 |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -23,8 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
23 | 23 | |
24 | 24 | extern unsigned int pc; |
25 | 25 | |
26 | -typedef struct _sim_cpu SIM_CPU; | |
27 | - | |
28 | 26 | #include "sim-base.h" |
29 | 27 | |
30 | 28 | struct _sim_cpu { |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Add note to clean this up. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -24,6 +24,8 @@ | ||
24 | 24 | #include "sim-basics.h" |
25 | 25 | #include "sim-signal.h" |
26 | 26 | |
27 | +/* TODO: Delete this. Need to convert bu32/etc... to common sim types | |
28 | + and unwind the bfin-sim.h/machs.h include below first though. */ | |
27 | 29 | typedef struct _sim_cpu SIM_CPU; |
28 | 30 | |
29 | 31 | #include "bfin-sim.h" |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-base.h (SIM_CPU): New typedef. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * cgen-engine.h (CIA_ADDR): Delete. |
4 | 8 | * sim-base.h: Update sim_cia example. |
5 | 9 | [!CIA_ADDR] (sim_cia): New typedef. |
@@ -72,6 +72,8 @@ typedef address_word sim_cia; | ||
72 | 72 | #define INVALID_INSTRUCTION_ADDRESS ((address_word)0 - 1) |
73 | 73 | #endif |
74 | 74 | |
75 | +/* TODO: Probably should just delete SIM_CPU. */ | |
76 | +typedef struct _sim_cpu SIM_CPU; | |
75 | 77 | typedef struct _sim_cpu sim_cpu; |
76 | 78 | |
77 | 79 | #include "sim-module.h" |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -24,8 +24,6 @@ | ||
24 | 24 | typedef long int word; |
25 | 25 | typedef unsigned long int uword; |
26 | 26 | |
27 | -typedef struct _sim_cpu SIM_CPU; | |
28 | - | |
29 | 27 | #include "sim-base.h" |
30 | 28 | #include "bfd.h" |
31 | 29 |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (_sim_cpu, SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -26,9 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
26 | 26 | |
27 | 27 | #define USING_SIM_BASE_H |
28 | 28 | |
29 | -struct _sim_cpu; | |
30 | -typedef struct _sim_cpu SIM_CPU; | |
31 | - | |
32 | 29 | #include "symcat.h" |
33 | 30 | #include "sim-basics.h" |
34 | 31 | #include "cgen-types.h" |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -24,8 +24,6 @@ | ||
24 | 24 | typedef long int word; |
25 | 25 | typedef unsigned long int uword; |
26 | 26 | |
27 | -typedef struct _sim_cpu SIM_CPU; | |
28 | - | |
29 | 27 | #include "sim-base.h" |
30 | 28 | #include "bfd.h" |
31 | 29 |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (_sim_cpu, SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | (frv_sim_engine_halt_hook): Move below includes. |
5 | 9 |
@@ -21,9 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
21 | 21 | |
22 | 22 | #define USING_SIM_BASE_H /* FIXME: quick hack */ |
23 | 23 | |
24 | -struct _sim_cpu; /* FIXME: should be in sim-basics.h */ | |
25 | -typedef struct _sim_cpu SIM_CPU; | |
26 | - | |
27 | 24 | /* Set the mask of unsupported traces. */ |
28 | 25 | #define WITH_TRACE \ |
29 | 26 | (~(TRACE_alu | TRACE_decode | TRACE_memory | TRACE_model | TRACE_fpu \ |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -25,8 +25,6 @@ | ||
25 | 25 | #include "sim-base.h" |
26 | 26 | #include "bfd.h" |
27 | 27 | |
28 | -typedef struct _sim_cpu SIM_CPU; | |
29 | - | |
30 | 28 | #include "ft32-sim.h" |
31 | 29 | |
32 | 30 | struct _sim_cpu { |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -87,9 +87,6 @@ enum h8_typecodes { | ||
87 | 87 | }; |
88 | 88 | |
89 | 89 | #include "sim-basics.h" |
90 | - | |
91 | -typedef struct _sim_cpu SIM_CPU; | |
92 | - | |
93 | 90 | #include "sim-base.h" |
94 | 91 | |
95 | 92 | /* Structure used to describe addressing */ |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (_sim_cpu, SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -6,9 +6,6 @@ | ||
6 | 6 | |
7 | 7 | #define USING_SIM_BASE_H /* FIXME: quick hack */ |
8 | 8 | |
9 | -struct _sim_cpu; /* FIXME: should be in sim-basics.h */ | |
10 | -typedef struct _sim_cpu SIM_CPU; | |
11 | - | |
12 | 9 | /* sim-basics.h includes config.h but cgen-types.h must be included before |
13 | 10 | sim-basics.h and cgen-types.h needs config.h. */ |
14 | 11 | #include "config.h" |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (_sim_cpu, SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -25,9 +25,6 @@ | ||
25 | 25 | |
26 | 26 | #define USING_SIM_BASE_H /* FIXME: quick hack */ |
27 | 27 | |
28 | -struct _sim_cpu; /* FIXME: should be in sim-basics.h */ | |
29 | -typedef struct _sim_cpu SIM_CPU; | |
30 | - | |
31 | 28 | #include "symcat.h" |
32 | 29 | #include "sim-basics.h" |
33 | 30 | #include "cgen-types.h" |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (_sim_cpu, SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -5,9 +5,6 @@ | ||
5 | 5 | |
6 | 6 | #define USING_SIM_BASE_H /* FIXME: quick hack */ |
7 | 7 | |
8 | -struct _sim_cpu; /* FIXME: should be in sim-basics.h */ | |
9 | -typedef struct _sim_cpu SIM_CPU; | |
10 | - | |
11 | 8 | #include "symcat.h" |
12 | 9 | #include "sim-basics.h" |
13 | 10 | #include "cgen-types.h" |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -25,9 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
25 | 25 | #define SIM_HANDLES_LMA 1 |
26 | 26 | |
27 | 27 | #include "sim-basics.h" |
28 | - | |
29 | -typedef struct _sim_cpu SIM_CPU; | |
30 | - | |
31 | 28 | #include "sim-signal.h" |
32 | 29 | #include "sim-base.h" |
33 | 30 |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -24,8 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
24 | 24 | typedef long int word; |
25 | 25 | typedef unsigned long int uword; |
26 | 26 | |
27 | -typedef struct _sim_cpu SIM_CPU; | |
28 | - | |
29 | 27 | #include "sim-base.h" |
30 | 28 | #include "bfd.h" |
31 | 29 |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -20,9 +20,6 @@ | ||
20 | 20 | |
21 | 21 | #include "microblaze.h" |
22 | 22 | #include "sim-basics.h" |
23 | - | |
24 | -typedef struct _sim_cpu SIM_CPU; | |
25 | - | |
26 | 23 | #include "sim-base.h" |
27 | 24 | |
28 | 25 | /* The machine state. |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -33,9 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
33 | 33 | mips_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), (ERROR)) |
34 | 34 | |
35 | 35 | #include "sim-basics.h" |
36 | - | |
37 | -typedef struct _sim_cpu SIM_CPU; | |
38 | - | |
39 | 36 | #include "sim-base.h" |
40 | 37 | #include "bfd.h" |
41 | 38 |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | (SIM_ADDR): Delete comment. |
5 | 9 |
@@ -42,8 +42,6 @@ | ||
42 | 42 | #include "itable.h" |
43 | 43 | #include "idecode.h" |
44 | 44 | |
45 | -typedef struct _sim_cpu SIM_CPU; | |
46 | - | |
47 | 45 | #define WITH_WATCHPOINTS 1 |
48 | 46 | |
49 | 47 | #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \ |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -21,9 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
21 | 21 | #define SIM_MAIN_H |
22 | 22 | |
23 | 23 | #include "sim-basics.h" |
24 | - | |
25 | -typedef struct _sim_cpu SIM_CPU; | |
26 | - | |
27 | 24 | #include "sim-base.h" |
28 | 25 | #include "bfd.h" |
29 | 26 |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -23,9 +23,6 @@ | ||
23 | 23 | |
24 | 24 | #include "sim-basics.h" |
25 | 25 | #include "sim-signal.h" |
26 | - | |
27 | -typedef struct _sim_cpu SIM_CPU; | |
28 | - | |
29 | 26 | #include "msp430-sim.h" |
30 | 27 | #include "sim-base.h" |
31 | 28 |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -20,9 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
20 | 20 | #define SIM_MAIN_H |
21 | 21 | |
22 | 22 | #include "sim-basics.h" |
23 | - | |
24 | -typedef struct _sim_cpu SIM_CPU; | |
25 | - | |
26 | 23 | #include "sim-base.h" |
27 | 24 | |
28 | 25 | typedef struct |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (_sim_cpu, SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (CIA_ADDR): Define. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -5,9 +5,6 @@ | ||
5 | 5 | |
6 | 6 | #define USING_SIM_BASE_H /* FIXME: quick hack */ |
7 | 7 | |
8 | -struct _sim_cpu; /* FIXME: should be in sim-basics.h */ | |
9 | -typedef struct _sim_cpu SIM_CPU; | |
10 | - | |
11 | 8 | /* sim-basics.h includes config.h but cgen-types.h must be included before |
12 | 9 | sim-basics.h and cgen-types.h needs config.h. */ |
13 | 10 | #include "config.h" |
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2015-04-18 Mike Frysinger <vapier@gentoo.org> |
2 | 2 | |
3 | + * sim-main.h (SIM_CPU): Delete. | |
4 | + | |
5 | +2015-04-18 Mike Frysinger <vapier@gentoo.org> | |
6 | + | |
3 | 7 | * sim-main.h (sim_cia): Delete. |
4 | 8 | |
5 | 9 | 2015-04-17 Mike Frysinger <vapier@gentoo.org> |
@@ -16,9 +16,6 @@ | ||
16 | 16 | #include "sim-basics.h" |
17 | 17 | #include "sim-signal.h" |
18 | 18 | #include "sim-fpu.h" |
19 | - | |
20 | -typedef struct _sim_cpu SIM_CPU; | |
21 | - | |
22 | 19 | #include "sim-base.h" |
23 | 20 | |
24 | 21 | #include "simops.h" |