--- trunk/src/include/machine.h 2007/10/08 16:20:18 27 +++ trunk/src/include/machine.h 2007/10/08 16:20:26 28 @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * - * $Id: machine.h,v 1.120 2006/06/24 19:52:28 debug Exp $ + * $Id: machine.h,v 1.126 2006/07/21 16:55:41 debug Exp $ */ #include @@ -47,6 +47,8 @@ #define MAX_TICK_FUNCTIONS 16 +#define MAX_STATISTICS_FIELDS 8 + struct cpu_family; struct diskimage; struct emul; @@ -88,8 +90,6 @@ }; -#define MACHINE_NAME_MAXBUF 150 - struct machine { /* Pointer back to the emul struct we are in: */ struct emul *emul; @@ -116,6 +116,7 @@ int serial_nr; int nr_of_nics; + /* TODO: How about multiple cpu familys in one machine? */ struct cpu_family *cpu_family; /* @@ -155,13 +156,11 @@ int n_busses; /* These are used by stuff in cpu.c, mostly: */ - int64_t ncycles; - int64_t ncycles_show; - int64_t ncycles_flush; - int64_t ncycles_since_gettimeofday; + int64_t ninstrs; + int64_t ninstrs_show; + int64_t ninstrs_flush; + int64_t ninstrs_since_gettimeofday; struct timeval starttime; - int a_few_cycles; - int a_few_instrs; struct diskimage *first_diskimage; @@ -181,6 +180,7 @@ struct debugger_gdb gdb; + /* Breakpoints: */ int n_breakpoints; char *breakpoint_string[MAX_BREAKPOINTS]; uint64_t breakpoint_addr[MAX_BREAKPOINTS]; @@ -196,25 +196,28 @@ int cache_secondary_linesize; int dbe_on_nonexistant_memaccess; - int dyntrans_alignment_check; int instruction_trace; int show_nr_of_instructions; + int show_trace_tree; int show_symbolic_register_names; int emulated_hz; - int speed_tricks; + int allow_instruction_combinations; char *userland_emul; /* NULL for no userland emulation */ int force_netboot; int slow_serial_interrupts_hack_for_linux; uint64_t file_loaded_end_addr; char *boot_kernel_filename; char *boot_string_argument; - int automatic_clock_adjustment; int exit_without_entering_debugger; - int show_trace_tree; - int n_gfx_cards; + /* Instruction statistics: */ + char *statistics_filename; + FILE *statistics_file; + int statistics_enabled; + char *statistics_fields; /* "vpi" etc. */ + /* Machine-dependent: (PROM stuff, etc.) */ union { struct machine_arcbios arc; @@ -267,6 +270,10 @@ }; +/* Tick function "prototype": */ +#define DEVICE_TICK(x) void dev_ ## x ## _tick(struct cpu *cpu, void *extra) + + /* * Machine emulation types: */ @@ -284,6 +291,7 @@ #define ARCH_HPPA 10 #define ARCH_I960 11 #define ARCH_AVR 12 +#define ARCH_TRANSPUTER 13 /* MIPS: */ #define MACHINE_BAREMIPS 1000 @@ -299,6 +307,7 @@ #define MACHINE_EVBMIPS 1010 #define MACHINE_PSP 1011 #define MACHINE_ALGOR 1012 +#define MACHINE_QEMU_MIPS 1013 /* PPC: */ #define MACHINE_BAREPPC 2000 @@ -364,6 +373,9 @@ #define MACHINE_AVR_PAL 12001 #define MACHINE_AVR_MAHPONG 12002 +/* TRANSPUTER: */ +#define MACHINE_BARETRANSPUTER 13000 + /* Other "pseudo"-machines: */ #define MACHINE_NONE 0 #define MACHINE_USERLAND 100000 @@ -404,11 +416,6 @@ #define MACHINE_HPCSH_JORNADA680 1 #define MACHINE_HPCSH_JORNADA690 2 -/* Playstation 2: */ -#define PLAYSTATION2_BDA 0xffffffffa0001000ULL -#define PLAYSTATION2_OPTARGS 0xffffffff81fff100ULL -#define PLAYSTATION2_SIFBIOS 0xffffffffbfc10000ULL - /* SGI and ARC: */ #define MACHINE_ARC_NEC_RD94 1 #define MACHINE_ARC_JAZZ_PICA 2 @@ -454,28 +461,6 @@ #define MACHINE_X86_XT 2 -/* - * 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 - - /* For the automachine system: */ struct machine_entry_subtype { int machine_subtype;/* Old-style subtype */ @@ -524,6 +509,7 @@ void machine_add_tickfunction(struct machine *machine, void (*func)(struct cpu *, void *), void *extra, int clockshift, double hz); +void machine_statistics_init(struct machine *, char *fname); void machine_register(char *name, MACHINE_SETUP_TYPE(setup)); void dump_mem_string(struct cpu *cpu, uint64_t addr); void store_string(struct cpu *cpu, uint64_t addr, char *s);