This commit was generated by cvs2svn to track changes on a CVS vendor
[binutils-gdb.git] / sim / m32r / sim-main.h
1 /* Main header for the m32r. */
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 "ansidecl.h"
13 #include "cgen-types.h"
14 #include "arch.h"
15 #include "sim-basics.h"
16
17 /* These must be defined before sim-base.h. */
18 typedef SI sim_cia;
19 #define CIA_GET(cpu) 0 /* FIXME:(CPU_CGEN_HW (cpu)->h_pc) */
20 #define CIA_SET(cpu,val) 0 /* FIXME:(CPU_CGEN_HW (cpu)->h_pc = (val)) */
21
22 /* FIXME: Shouldn't be required to define these this early. */
23 #define SIM_ENGINE_HALT_HOOK(SD, LAST_CPU, CIA)
24 #define SIM_ENGINE_RESTART_HOOK(SD, LAST_CPU, CIA)
25
26 #include "sim-base.h"
27 #include "cgen-sim.h"
28 /*#include "cgen-mem.h"*/
29 #include "cgen-trace.h"
30 #include "cpu-sim.h"
31
32 #ifdef WANT_CPU_M32R
33 #include "cpu.h"
34 #include "decode.h"
35 #endif
36 /* start-sanitize-m32rx */
37 #ifdef WANT_CPU_M32RX
38 #include "cpux.h"
39 #include "decodex.h"
40 #endif
41 /* end-sanitize-m32rx */
42 #include "cpuall.h"
43
44 /* Misc. profile data. */
45 typedef struct {
46 /* nop insn slot filler count */
47 unsigned int fillnop_count;
48 } M32R_MISC_PROFILE;
49
50 struct _sim_cpu {
51 sim_cpu_base base;
52
53 /* Static parts of cgen. */
54 CGEN_CPU cgen_cpu;
55
56 /* CPU specific parts go here.
57 Note that in files that don't need to access these pieces WANT_CPU_FOO
58 won't be defined and thus these parts won't appear. This is ok.
59 One has to of course be careful to not take the size of this
60 struct, etc. */
61 #if defined (WANT_CPU_M32R)
62 M32R_CPU_DATA cpu_data;
63 /* start-sanitize-m32rx */
64 #elif defined (WANT_CPU_M32RX)
65 M32RX_CPU_DATA cpu_data;
66 /* end-sanitize-m32rx */
67 #endif
68
69 M32R_MISC_PROFILE m32r_misc_profile;
70 #define CPU_M32R_MISC_PROFILE(cpu) ((cpu)->m32r_misc_profile)
71 };
72
73 struct sim_state {
74 sim_cpu *cpu;
75 #define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
76
77 CGEN_STATE cgen_state;
78
79 sim_state_base base;
80 };
81
82 /* Default memory size. */
83 #define M32R_DEFAULT_MEM_SIZE 0x800000 /* 8M */