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.
This commit is contained in:
Mike Frysinger
2015-04-18 04:19:56 -04:00
parent 7e83aa92f2
commit 20bca71d82
46 changed files with 96 additions and 57 deletions

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -20,9 +20,6 @@
#define SIM_MAIN_H
#include "sim-basics.h"
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
#include "bfd.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -23,8 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
extern unsigned int pc;
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
struct _sim_cpu {

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Add note to clean this up.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -24,6 +24,8 @@
#include "sim-basics.h"
#include "sim-signal.h"
/* TODO: Delete this. Need to convert bu32/etc... to common sim types
and unwind the bfin-sim.h/machs.h include below first though. */
typedef struct _sim_cpu SIM_CPU;
#include "bfin-sim.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-base.h (SIM_CPU): New typedef.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* cgen-engine.h (CIA_ADDR): Delete.

View File

@@ -72,6 +72,8 @@ typedef address_word sim_cia;
#define INVALID_INSTRUCTION_ADDRESS ((address_word)0 - 1)
#endif
/* TODO: Probably should just delete SIM_CPU. */
typedef struct _sim_cpu SIM_CPU;
typedef struct _sim_cpu sim_cpu;
#include "sim-module.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -24,8 +24,6 @@
typedef long int word;
typedef unsigned long int uword;
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
#include "bfd.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (_sim_cpu, SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -26,9 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define USING_SIM_BASE_H
struct _sim_cpu;
typedef struct _sim_cpu SIM_CPU;
#include "symcat.h"
#include "sim-basics.h"
#include "cgen-types.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -24,8 +24,6 @@
typedef long int word;
typedef unsigned long int uword;
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
#include "bfd.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (_sim_cpu, SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -21,9 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define USING_SIM_BASE_H /* FIXME: quick hack */
struct _sim_cpu; /* FIXME: should be in sim-basics.h */
typedef struct _sim_cpu SIM_CPU;
/* Set the mask of unsupported traces. */
#define WITH_TRACE \
(~(TRACE_alu | TRACE_decode | TRACE_memory | TRACE_model | TRACE_fpu \

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -25,8 +25,6 @@
#include "sim-base.h"
#include "bfd.h"
typedef struct _sim_cpu SIM_CPU;
#include "ft32-sim.h"
struct _sim_cpu {

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -87,9 +87,6 @@ enum h8_typecodes {
};
#include "sim-basics.h"
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
/* Structure used to describe addressing */

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (_sim_cpu, SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -6,9 +6,6 @@
#define USING_SIM_BASE_H /* FIXME: quick hack */
struct _sim_cpu; /* FIXME: should be in sim-basics.h */
typedef struct _sim_cpu SIM_CPU;
/* sim-basics.h includes config.h but cgen-types.h must be included before
sim-basics.h and cgen-types.h needs config.h. */
#include "config.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (_sim_cpu, SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -25,9 +25,6 @@
#define USING_SIM_BASE_H /* FIXME: quick hack */
struct _sim_cpu; /* FIXME: should be in sim-basics.h */
typedef struct _sim_cpu SIM_CPU;
#include "symcat.h"
#include "sim-basics.h"
#include "cgen-types.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (_sim_cpu, SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -5,9 +5,6 @@
#define USING_SIM_BASE_H /* FIXME: quick hack */
struct _sim_cpu; /* FIXME: should be in sim-basics.h */
typedef struct _sim_cpu SIM_CPU;
#include "symcat.h"
#include "sim-basics.h"
#include "cgen-types.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -25,9 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define SIM_HANDLES_LMA 1
#include "sim-basics.h"
typedef struct _sim_cpu SIM_CPU;
#include "sim-signal.h"
#include "sim-base.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -24,8 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
typedef long int word;
typedef unsigned long int uword;
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
#include "bfd.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -20,9 +20,6 @@
#include "microblaze.h"
#include "sim-basics.h"
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
/* The machine state.

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -33,9 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
mips_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), (ERROR))
#include "sim-basics.h"
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
#include "bfd.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -42,8 +42,6 @@
#include "itable.h"
#include "idecode.h"
typedef struct _sim_cpu SIM_CPU;
#define WITH_WATCHPOINTS 1
#define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -21,9 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define SIM_MAIN_H
#include "sim-basics.h"
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
#include "bfd.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -23,9 +23,6 @@
#include "sim-basics.h"
#include "sim-signal.h"
typedef struct _sim_cpu SIM_CPU;
#include "msp430-sim.h"
#include "sim-base.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -20,9 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define SIM_MAIN_H
#include "sim-basics.h"
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
typedef struct

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (_sim_cpu, SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (CIA_ADDR): Define.

View File

@@ -5,9 +5,6 @@
#define USING_SIM_BASE_H /* FIXME: quick hack */
struct _sim_cpu; /* FIXME: should be in sim-basics.h */
typedef struct _sim_cpu SIM_CPU;
/* sim-basics.h includes config.h but cgen-types.h must be included before
sim-basics.h and cgen-types.h needs config.h. */
#include "config.h"

View File

@@ -1,3 +1,7 @@
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_CPU): Delete.
2015-04-18 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (sim_cia): Delete.

View File

@@ -16,9 +16,6 @@
#include "sim-basics.h"
#include "sim-signal.h"
#include "sim-fpu.h"
typedef struct _sim_cpu SIM_CPU;
#include "sim-base.h"
#include "simops.h"