28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: machine.h,v 1.105 2006/02/18 13:42:39 debug Exp $ |
* $Id: machine.h,v 1.118 2006/06/22 13:22:41 debug Exp $ |
32 |
*/ |
*/ |
33 |
|
|
34 |
#include <sys/types.h> |
#include <sys/types.h> |
35 |
#include <sys/time.h> |
#include <sys/time.h> |
36 |
|
|
37 |
|
#include "debugger_gdb.h" |
38 |
#include "symbol.h" |
#include "symbol.h" |
39 |
|
|
40 |
#include "machine_arc.h" |
#include "machine_arc.h" |
41 |
|
#include "machine_pmax.h" |
42 |
#include "machine_x86.h" |
#include "machine_x86.h" |
43 |
|
|
44 |
|
|
45 |
#define MAX_BREAKPOINTS 8 |
#define MAX_BREAKPOINTS 8 |
46 |
#define BREAKPOINT_FLAG_R 1 |
#define BREAKPOINT_FLAG_R 1 |
47 |
|
|
48 |
#define MAX_TICK_FUNCTIONS 14 |
#define MAX_TICK_FUNCTIONS 16 |
49 |
|
|
50 |
struct cpu_family; |
struct cpu_family; |
51 |
struct diskimage; |
struct diskimage; |
101 |
int machine_type; /* MACHINE_PMAX, .. */ |
int machine_type; /* MACHINE_PMAX, .. */ |
102 |
int machine_subtype; /* MACHINE_DEC_3MAX_5000, .. */ |
int machine_subtype; /* MACHINE_DEC_3MAX_5000, .. */ |
103 |
|
|
104 |
|
int cycle_accurate; /* Set to non-zero for cycle |
105 |
|
accurate (slow) emulation. */ |
106 |
|
|
107 |
/* Name set by code in src/machines/machine_*.c: */ |
/* Name set by code in src/machines/machine_*.c: */ |
108 |
char *machine_name; |
char *machine_name; |
109 |
|
|
136 |
int ticks_reset_value[MAX_TICK_FUNCTIONS]; |
int ticks_reset_value[MAX_TICK_FUNCTIONS]; |
137 |
void (*tick_func[MAX_TICK_FUNCTIONS])(struct cpu *, void *); |
void (*tick_func[MAX_TICK_FUNCTIONS])(struct cpu *, void *); |
138 |
void *tick_extra[MAX_TICK_FUNCTIONS]; |
void *tick_extra[MAX_TICK_FUNCTIONS]; |
139 |
|
double tick_hz[MAX_TICK_FUNCTIONS]; |
140 |
|
|
141 |
void (*md_interrupt)(struct machine *m, struct cpu *cpu, |
void (*md_interrupt)(struct machine *m, struct cpu *cpu, |
142 |
int irq_nr, int assert); |
int irq_nr, int assert); |
179 |
char *bootstr; |
char *bootstr; |
180 |
char *bootarg; |
char *bootarg; |
181 |
|
|
182 |
|
struct debugger_gdb gdb; |
183 |
|
|
184 |
int n_breakpoints; |
int n_breakpoints; |
185 |
char *breakpoint_string[MAX_BREAKPOINTS]; |
char *breakpoint_string[MAX_BREAKPOINTS]; |
186 |
uint64_t breakpoint_addr[MAX_BREAKPOINTS]; |
uint64_t breakpoint_addr[MAX_BREAKPOINTS]; |
197 |
|
|
198 |
int dbe_on_nonexistant_memaccess; |
int dbe_on_nonexistant_memaccess; |
199 |
int dyntrans_alignment_check; |
int dyntrans_alignment_check; |
|
int bintrans_enable; |
|
|
int old_bintrans_enable; |
|
|
int bintrans_enabled_from_start; |
|
|
size_t bintrans_size; |
|
200 |
int instruction_trace; |
int instruction_trace; |
|
int single_step_on_bad_addr; |
|
201 |
int show_nr_of_instructions; |
int show_nr_of_instructions; |
202 |
int show_symbolic_register_names; |
int show_symbolic_register_names; |
|
int64_t max_instructions; |
|
203 |
int emulated_hz; |
int emulated_hz; |
|
int max_random_cycles_per_chunk; |
|
204 |
int speed_tricks; |
int speed_tricks; |
205 |
char *userland_emul; /* NULL for no userland emulation */ |
char *userland_emul; /* NULL for no userland emulation */ |
206 |
int force_netboot; |
int force_netboot; |
218 |
/* Machine-dependent: (PROM stuff, etc.) */ |
/* Machine-dependent: (PROM stuff, etc.) */ |
219 |
union { |
union { |
220 |
struct machine_arcbios arc; |
struct machine_arcbios arc; |
221 |
|
struct machine_pmax pmax; |
222 |
struct machine_pc pc; |
struct machine_pc pc; |
223 |
} md; |
} md; |
224 |
|
|
294 |
#define MACHINE_PS2 1005 |
#define MACHINE_PS2 1005 |
295 |
#define MACHINE_SGI 1006 |
#define MACHINE_SGI 1006 |
296 |
#define MACHINE_ARC 1007 |
#define MACHINE_ARC 1007 |
297 |
#define MACHINE_MESHCUBE 1008 |
#define MACHINE_NETGEAR 1008 |
298 |
#define MACHINE_NETGEAR 1009 |
#define MACHINE_SONYNEWS 1009 |
299 |
#define MACHINE_SONYNEWS 1010 |
#define MACHINE_EVBMIPS 1010 |
300 |
#define MACHINE_EVBMIPS 1011 |
#define MACHINE_PSP 1011 |
301 |
#define MACHINE_PSP 1012 |
#define MACHINE_ALGOR 1012 |
|
#define MACHINE_ALGOR 1013 |
|
302 |
|
|
303 |
/* PPC: */ |
/* PPC: */ |
304 |
#define MACHINE_BAREPPC 2000 |
#define MACHINE_BAREPPC 2000 |
315 |
/* SPARC: */ |
/* SPARC: */ |
316 |
#define MACHINE_BARESPARC 3000 |
#define MACHINE_BARESPARC 3000 |
317 |
#define MACHINE_TESTSPARC 3001 |
#define MACHINE_TESTSPARC 3001 |
318 |
#define MACHINE_ULTRA1 3002 |
#define MACHINE_SPARC 3002 |
319 |
|
|
320 |
/* Alpha: */ |
/* Alpha: */ |
321 |
#define MACHINE_BAREALPHA 4000 |
#define MACHINE_BAREALPHA 4000 |
361 |
|
|
362 |
/* AVR: */ |
/* AVR: */ |
363 |
#define MACHINE_BAREAVR 12000 |
#define MACHINE_BAREAVR 12000 |
364 |
|
#define MACHINE_AVR_PAL 12001 |
365 |
|
#define MACHINE_AVR_MAHPONG 12002 |
366 |
|
|
367 |
/* Other "pseudo"-machines: */ |
/* Other "pseudo"-machines: */ |
368 |
#define MACHINE_NONE 0 |
#define MACHINE_NONE 0 |
426 |
/* EVBMIPS: */ |
/* EVBMIPS: */ |
427 |
#define MACHINE_EVBMIPS_MALTA 1 |
#define MACHINE_EVBMIPS_MALTA 1 |
428 |
#define MACHINE_EVBMIPS_MALTA_BE 2 |
#define MACHINE_EVBMIPS_MALTA_BE 2 |
429 |
#define MACHINE_EVBMIPS_PB1000 3 |
#define MACHINE_EVBMIPS_MESHCUBE 3 |
430 |
|
#define MACHINE_EVBMIPS_PB1000 4 |
431 |
|
|
432 |
/* PReP: */ |
/* PReP: */ |
433 |
#define MACHINE_PREP_IBM6050 1 |
#define MACHINE_PREP_IBM6050 1 |
434 |
#define MACHINE_PREP_MVME2400 2 |
#define MACHINE_PREP_MVME2400 2 |
435 |
|
|
436 |
|
/* Sun SPARC: */ |
437 |
|
#define MACHINE_SPARC_SS5 1 |
438 |
|
#define MACHINE_SPARC_SS20 2 |
439 |
|
#define MACHINE_SPARC_ULTRA1 3 |
440 |
|
#define MACHINE_SPARC_ULTRA60 4 |
441 |
|
|
442 |
/* MacPPC: TODO: Real model names */ |
/* MacPPC: TODO: Real model names */ |
443 |
#define MACHINE_MACPPC_G4 1 |
#define MACHINE_MACPPC_G3 1 |
444 |
#define MACHINE_MACPPC_G5 2 |
#define MACHINE_MACPPC_G4 2 |
445 |
|
#define MACHINE_MACPPC_G5 3 |
446 |
|
|
447 |
/* MVMEPPC */ |
/* MVMEPPC */ |
448 |
#define MACHINE_MVMEPPC_1600 1 |
#define MACHINE_MVMEPPC_1600 1 |
521 |
int machine_name_to_type(char *stype, char *ssubtype, |
int machine_name_to_type(char *stype, char *ssubtype, |
522 |
int *type, int *subtype, int *arch); |
int *type, int *subtype, int *arch); |
523 |
void machine_add_tickfunction(struct machine *machine, |
void machine_add_tickfunction(struct machine *machine, |
524 |
void (*func)(struct cpu *, void *), void *extra, int clockshift); |
void (*func)(struct cpu *, void *), void *extra, |
525 |
|
int clockshift, double hz); |
526 |
void machine_register(char *name, MACHINE_SETUP_TYPE(setup)); |
void machine_register(char *name, MACHINE_SETUP_TYPE(setup)); |
527 |
void dump_mem_string(struct cpu *cpu, uint64_t addr); |
void dump_mem_string(struct cpu *cpu, uint64_t addr); |
528 |
void store_string(struct cpu *cpu, uint64_t addr, char *s); |
void store_string(struct cpu *cpu, uint64_t addr, char *s); |