1 /* Main header for sparc. */
6 #define USING_SIM_BASE_H /* FIXME: quick hack */
8 /* FIXME: For now always provide sparc32 support. */
10 #undef HAVE_SPARC64 /* FIXME:wip */
12 /* ??? May eventually want this model (and perhaps runtime) selectable. */
15 struct _sim_cpu
; /* FIXME: should be in sim-basics.h */
16 typedef struct _sim_cpu SIM_CPU
;
19 #include "sim-basics.h"
20 #include "cgen-types.h"
24 /* These must be defined before sim-base.h. */
28 #define CIA_GET(cpu) CPU_PC_GET (cpu)
29 #define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
31 #define SIM_ENGINE_HALT_HOOK(sd, cpu, cia) \
33 if (cpu) /* null if ctrl-c */ \
34 sim_pc_set ((cpu), (cia)); \
36 #define SIM_ENGINE_RESTART_HOOK(sd, cpu, cia) \
38 sim_pc_set ((cpu), (cia)); \
47 #if defined (WANT_CPU_SPARC32)
50 #elif defined (WANT_CPU_SPARC64)
55 /* The sim_cpu struct. */
58 /* sim/common cpu base. */
61 /* Static parts of cgen. */
64 /* CPU specific parts go here.
65 Note that in files that don't need to access these pieces WANT_CPU_FOO
66 won't be defined and thus these parts won't appear. This is ok in the
67 sense that things work. It is a source of bugs though.
68 One has to of course be careful to not take the size of this
69 struct and no structure members accessed in non-cpu specific files can
70 go after here. Oh for a better language. */
72 #if defined (WANT_CPU_SPARC32)
74 /* Machine generated registers. */
75 SPARC32_CPU_DATA cpu_data
;
77 /* Working variables for generating profiling information. */
78 SPARC32_CPU_PROFILE cpu_profile
;
80 /* Actual values of the window regs. */
81 SI win_regs
[NWINDOWS
][16];
82 /* g0-g7, normal and alternate
83 ??? handling the alternate regs still wip, need REAL_GREGS to dtrt. */
85 /* Working copies of integer regs, swapped in/out on each window change.
86 ??? Doing things this way means the .cpu file needn't mark these as
90 #elif defined (WANT_CPU_SPARC64)
92 /* Machine generated registers. */
93 SPARC64_CPU_DATA cpu_data
;
95 /* Working variables for generating profiling information. */
96 SPARC64_CPU_PROFILE cpu_profile
;
98 /* Actual values of the window regs. */
99 DI win_regs
[NWINDOWS
][16];
100 /* g0-g7, normal and alternate */
101 DI global_regs
[2][8];
102 /* Working copies of integer regs, swapped in/out on each window change.
103 ??? Doing things this way means .cpu file needn't mark these as
110 #define ARCH32_P(cpu) 1 /*FIXME*/
111 #define ARCH64_P(cpu) (! ARCH32_P (cpu))
113 /* The sim_state struct. */
117 #define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
119 CGEN_STATE cgen_state
;
126 /* Catch address exceptions. */
127 extern SIM_CORE_SIGNAL_FN sparc_core_signal
;
128 #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
129 sparc_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
132 /* Default memory size. */
133 #define SPARC_DEFAULT_MEM_SIZE 0x800000 /* 8M */
135 #endif /* SIM_MAIN_H */