28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: machine.h,v 1.120 2006/06/24 19:52:28 debug Exp $ |
* $Id: machine.h,v 1.128 2006/08/14 17:45:47 debug Exp $ |
32 |
*/ |
*/ |
33 |
|
|
34 |
#include <sys/types.h> |
#include <sys/types.h> |
47 |
|
|
48 |
#define MAX_TICK_FUNCTIONS 16 |
#define MAX_TICK_FUNCTIONS 16 |
49 |
|
|
50 |
|
#define MAX_STATISTICS_FIELDS 8 |
51 |
|
|
52 |
struct cpu_family; |
struct cpu_family; |
53 |
struct diskimage; |
struct diskimage; |
54 |
struct emul; |
struct emul; |
75 |
struct isa_pic_data { |
struct isa_pic_data { |
76 |
struct pic8259_data *pic1; |
struct pic8259_data *pic1; |
77 |
struct pic8259_data *pic2; |
struct pic8259_data *pic2; |
78 |
|
|
79 |
int last_int; |
int last_int; |
80 |
int native_irq; |
int native_irq; |
81 |
|
int native_secondary_irq; |
82 |
|
uint8_t secondary_mask1; |
83 |
}; |
}; |
84 |
|
|
85 |
|
|
93 |
}; |
}; |
94 |
|
|
95 |
|
|
|
#define MACHINE_NAME_MAXBUF 150 |
|
|
|
|
96 |
struct machine { |
struct machine { |
97 |
/* Pointer back to the emul struct we are in: */ |
/* Pointer back to the emul struct we are in: */ |
98 |
struct emul *emul; |
struct emul *emul; |
119 |
int serial_nr; |
int serial_nr; |
120 |
int nr_of_nics; |
int nr_of_nics; |
121 |
|
|
122 |
|
/* TODO: How about multiple cpu familys in one machine? */ |
123 |
struct cpu_family *cpu_family; |
struct cpu_family *cpu_family; |
124 |
|
|
125 |
/* |
/* |
159 |
int n_busses; |
int n_busses; |
160 |
|
|
161 |
/* These are used by stuff in cpu.c, mostly: */ |
/* These are used by stuff in cpu.c, mostly: */ |
162 |
int64_t ncycles; |
int64_t ninstrs; |
163 |
int64_t ncycles_show; |
int64_t ninstrs_show; |
164 |
int64_t ncycles_flush; |
int64_t ninstrs_flush; |
165 |
int64_t ncycles_since_gettimeofday; |
int64_t ninstrs_since_gettimeofday; |
166 |
struct timeval starttime; |
struct timeval starttime; |
|
int a_few_cycles; |
|
|
int a_few_instrs; |
|
167 |
|
|
168 |
struct diskimage *first_diskimage; |
struct diskimage *first_diskimage; |
169 |
|
|
183 |
|
|
184 |
struct debugger_gdb gdb; |
struct debugger_gdb gdb; |
185 |
|
|
186 |
|
/* Breakpoints: */ |
187 |
int n_breakpoints; |
int n_breakpoints; |
188 |
char *breakpoint_string[MAX_BREAKPOINTS]; |
char *breakpoint_string[MAX_BREAKPOINTS]; |
189 |
uint64_t breakpoint_addr[MAX_BREAKPOINTS]; |
uint64_t breakpoint_addr[MAX_BREAKPOINTS]; |
199 |
int cache_secondary_linesize; |
int cache_secondary_linesize; |
200 |
|
|
201 |
int dbe_on_nonexistant_memaccess; |
int dbe_on_nonexistant_memaccess; |
|
int dyntrans_alignment_check; |
|
202 |
int instruction_trace; |
int instruction_trace; |
203 |
int show_nr_of_instructions; |
int show_nr_of_instructions; |
204 |
|
int show_trace_tree; |
205 |
int show_symbolic_register_names; |
int show_symbolic_register_names; |
206 |
int emulated_hz; |
int emulated_hz; |
207 |
int speed_tricks; |
int allow_instruction_combinations; |
208 |
char *userland_emul; /* NULL for no userland emulation */ |
char *userland_emul; /* NULL for no userland emulation */ |
209 |
int force_netboot; |
int force_netboot; |
210 |
int slow_serial_interrupts_hack_for_linux; |
int slow_serial_interrupts_hack_for_linux; |
211 |
uint64_t file_loaded_end_addr; |
uint64_t file_loaded_end_addr; |
212 |
char *boot_kernel_filename; |
char *boot_kernel_filename; |
213 |
char *boot_string_argument; |
char *boot_string_argument; |
|
|
|
214 |
int automatic_clock_adjustment; |
int automatic_clock_adjustment; |
215 |
int exit_without_entering_debugger; |
int exit_without_entering_debugger; |
|
int show_trace_tree; |
|
|
|
|
216 |
int n_gfx_cards; |
int n_gfx_cards; |
217 |
|
|
218 |
|
/* Instruction statistics: */ |
219 |
|
char *statistics_filename; |
220 |
|
FILE *statistics_file; |
221 |
|
int statistics_enabled; |
222 |
|
char *statistics_fields; /* "vpi" etc. */ |
223 |
|
|
224 |
/* Machine-dependent: (PROM stuff, etc.) */ |
/* Machine-dependent: (PROM stuff, etc.) */ |
225 |
union { |
union { |
226 |
struct machine_arcbios arc; |
struct machine_arcbios arc; |
273 |
}; |
}; |
274 |
|
|
275 |
|
|
276 |
|
/* Tick function "prototype": */ |
277 |
|
#define DEVICE_TICK(x) void dev_ ## x ## _tick(struct cpu *cpu, void *extra) |
278 |
|
|
279 |
|
|
280 |
/* |
/* |
281 |
* Machine emulation types: |
* Machine emulation types: |
282 |
*/ |
*/ |
294 |
#define ARCH_HPPA 10 |
#define ARCH_HPPA 10 |
295 |
#define ARCH_I960 11 |
#define ARCH_I960 11 |
296 |
#define ARCH_AVR 12 |
#define ARCH_AVR 12 |
297 |
|
#define ARCH_TRANSPUTER 13 |
298 |
|
|
299 |
/* MIPS: */ |
/* MIPS: */ |
300 |
#define MACHINE_BAREMIPS 1000 |
#define MACHINE_BAREMIPS 1000 |
310 |
#define MACHINE_EVBMIPS 1010 |
#define MACHINE_EVBMIPS 1010 |
311 |
#define MACHINE_PSP 1011 |
#define MACHINE_PSP 1011 |
312 |
#define MACHINE_ALGOR 1012 |
#define MACHINE_ALGOR 1012 |
313 |
|
#define MACHINE_QEMU_MIPS 1013 |
314 |
|
|
315 |
/* PPC: */ |
/* PPC: */ |
316 |
#define MACHINE_BAREPPC 2000 |
#define MACHINE_BAREPPC 2000 |
362 |
#define MACHINE_BARESH 9000 |
#define MACHINE_BARESH 9000 |
363 |
#define MACHINE_TESTSH 9001 |
#define MACHINE_TESTSH 9001 |
364 |
#define MACHINE_HPCSH 9002 |
#define MACHINE_HPCSH 9002 |
365 |
|
#define MACHINE_DREAMCAST 9003 |
366 |
|
|
367 |
/* HPPA: */ |
/* HPPA: */ |
368 |
#define MACHINE_BAREHPPA 10000 |
#define MACHINE_BAREHPPA 10000 |
377 |
#define MACHINE_AVR_PAL 12001 |
#define MACHINE_AVR_PAL 12001 |
378 |
#define MACHINE_AVR_MAHPONG 12002 |
#define MACHINE_AVR_MAHPONG 12002 |
379 |
|
|
380 |
|
/* TRANSPUTER: */ |
381 |
|
#define MACHINE_BARETRANSPUTER 13000 |
382 |
|
|
383 |
/* Other "pseudo"-machines: */ |
/* Other "pseudo"-machines: */ |
384 |
#define MACHINE_NONE 0 |
#define MACHINE_NONE 0 |
385 |
#define MACHINE_USERLAND 100000 |
#define MACHINE_USERLAND 100000 |
420 |
#define MACHINE_HPCSH_JORNADA680 1 |
#define MACHINE_HPCSH_JORNADA680 1 |
421 |
#define MACHINE_HPCSH_JORNADA690 2 |
#define MACHINE_HPCSH_JORNADA690 2 |
422 |
|
|
|
/* Playstation 2: */ |
|
|
#define PLAYSTATION2_BDA 0xffffffffa0001000ULL |
|
|
#define PLAYSTATION2_OPTARGS 0xffffffff81fff100ULL |
|
|
#define PLAYSTATION2_SIFBIOS 0xffffffffbfc10000ULL |
|
|
|
|
423 |
/* SGI and ARC: */ |
/* SGI and ARC: */ |
424 |
#define MACHINE_ARC_NEC_RD94 1 |
#define MACHINE_ARC_NEC_RD94 1 |
425 |
#define MACHINE_ARC_JAZZ_PICA 2 |
#define MACHINE_ARC_JAZZ_PICA 2 |
465 |
#define MACHINE_X86_XT 2 |
#define MACHINE_X86_XT 2 |
466 |
|
|
467 |
|
|
|
/* |
|
|
* Problem: kernels seem to be loaded at low addresses in RAM, so |
|
|
* storing environment strings and memory descriptors there is a bad |
|
|
* idea. They are stored at 0xbfc..... instead. The ARC SPB must |
|
|
* be at physical address 0x1000 though. |
|
|
*/ |
|
|
#define SGI_SPB_ADDR 0xffffffff80001000ULL |
|
|
/* 0xbfc10000 is firmware callback vector stuff */ |
|
|
#define ARC_FIRMWARE_VECTORS 0xffffffffbfc80000ULL |
|
|
#define ARC_FIRMWARE_ENTRIES 0xffffffffbfc88000ULL |
|
|
#define ARC_ARGV_START 0xffffffffbfc90000ULL |
|
|
#define ARC_ENV_STRINGS 0xffffffffbfc98000ULL |
|
|
#define ARC_ENV_POINTERS 0xffffffffbfc9d000ULL |
|
|
#define SGI_SYSID_ADDR 0xffffffffbfca1800ULL |
|
|
#define ARC_DSPSTAT_ADDR 0xffffffffbfca1c00ULL |
|
|
#define ARC_MEMDESC_ADDR 0xffffffffbfca1c80ULL |
|
|
#define ARC_CONFIG_DATA_ADDR 0xffffffffbfca2000ULL |
|
|
#define FIRST_ARC_COMPONENT 0xffffffffbfca8000ULL |
|
|
#define ARC_PRIVATE_VECTORS 0xffffffffbfcb0000ULL |
|
|
#define ARC_PRIVATE_ENTRIES 0xffffffffbfcb8000ULL |
|
|
|
|
|
|
|
468 |
/* For the automachine system: */ |
/* For the automachine system: */ |
469 |
struct machine_entry_subtype { |
struct machine_entry_subtype { |
470 |
int machine_subtype;/* Old-style subtype */ |
int machine_subtype;/* Old-style subtype */ |
513 |
void machine_add_tickfunction(struct machine *machine, |
void machine_add_tickfunction(struct machine *machine, |
514 |
void (*func)(struct cpu *, void *), void *extra, |
void (*func)(struct cpu *, void *), void *extra, |
515 |
int clockshift, double hz); |
int clockshift, double hz); |
516 |
|
void machine_statistics_init(struct machine *, char *fname); |
517 |
void machine_register(char *name, MACHINE_SETUP_TYPE(setup)); |
void machine_register(char *name, MACHINE_SETUP_TYPE(setup)); |
518 |
void dump_mem_string(struct cpu *cpu, uint64_t addr); |
void dump_mem_string(struct cpu *cpu, uint64_t addr); |
519 |
void store_string(struct cpu *cpu, uint64_t addr, char *s); |
void store_string(struct cpu *cpu, uint64_t addr, char *s); |