--- trunk/src/include/machine.h 2007/10/08 16:20:58 32 +++ trunk/src/include/machine.h 2007/10/08 16:21:17 34 @@ -2,7 +2,7 @@ #define MACHINE_H /* - * Copyright (C) 2005-2006 Anders Gavare. All rights reserved. + * Copyright (C) 2005-2007 Anders Gavare. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * - * $Id: machine.h,v 1.136 2006/10/25 09:24:06 debug Exp $ + * $Id: machine.h,v 1.156 2007/02/10 14:29:55 debug Exp $ */ #include @@ -39,11 +39,9 @@ #include "machine_arc.h" #include "machine_pmax.h" -#include "machine_x86.h" #define MAX_BREAKPOINTS 8 -#define BREAKPOINT_FLAG_R 1 #define MAX_TICK_FUNCTIONS 16 @@ -57,43 +55,14 @@ struct of_data; struct settings; -/* Ugly: */ -struct kn230_csr; -struct kn02_csr; -struct dec_ioasic_data; -struct ps2_data; -struct footbridge_data; -struct dec5800_data; -struct au1x00_ic_data; -struct malta_data; -struct vr41xx_data; -struct jazz_data; -struct crime_data; -struct mace_data; -struct sgi_ip20_data; -struct sgi_ip22_data; -struct sgi_ip30_data; +/* TODO: This should probably go away... */ struct isa_pic_data { struct pic8259_data *pic1; struct pic8259_data *pic2; int *pending_timer_interrupts; int last_int; - - int native_irq; - int native_secondary_irq; - uint8_t secondary_mask1; -}; - - -struct machine_bus { - struct machine_bus *next; - - char *name; - - void (*debug_dump)(void *); - void *extra; }; @@ -107,10 +76,14 @@ /* Name as choosen by the user: */ char *name; + /* Full "path" to the machine, e.g. "emul[0].machine[0]": */ + char *path; + int arch; /* ARCH_MIPS, ARCH_PPC, .. */ int machine_type; /* MACHINE_PMAX, .. */ int machine_subtype; /* MACHINE_DEC_3MAX_5000, .. */ + /* NOTE/TODO: This isn't working yet: */ int cycle_accurate; /* Set to non-zero for cycle accurate (slow) emulation. */ @@ -149,9 +122,6 @@ void *tick_extra[MAX_TICK_FUNCTIONS]; double tick_hz[MAX_TICK_FUNCTIONS]; - void (*md_interrupt)(struct machine *m, struct cpu *cpu, - int irq_nr, int assert); - char *cpu_name; /* TODO: remove this, there could be several cpus with different names in a machine */ int byte_order_override; @@ -161,11 +131,8 @@ int ncpus; struct cpu **cpus; - /* Registered busses: */ - struct machine_bus *first_bus; - int n_busses; - /* These are used by stuff in cpu.c, mostly: */ + /* TODO: Move to cpu.h! */ int64_t ninstrs; int64_t ninstrs_show; int64_t ninstrs_flush; @@ -197,7 +164,7 @@ int breakpoint_flags[MAX_BREAKPOINTS]; /* Cache sizes: (1 << x) x=0 for default values */ - /* TODO: these are _PER CPU_! */ + /* TODO: these should be _PER CPU_! */ int cache_picache; int cache_pdcache; int cache_secondary; @@ -206,6 +173,7 @@ int cache_secondary_linesize; int dbe_on_nonexistant_memaccess; + int halt_on_nonexistant_memaccess; int instruction_trace; int show_nr_of_instructions; int show_trace_tree; @@ -231,41 +199,13 @@ union { struct machine_arcbios arc; struct machine_pmax pmax; - struct machine_pc pc; + struct of_data *of_data; } md; - /* OpenFirmware: */ - struct of_data *of_data; - /* Bus-specific interrupt data: */ + /* TODO: Remove! */ struct isa_pic_data isa_pic_data; - /* Machine-dependent interrupt specific structs: */ - union { - struct kn230_csr *kn230_csr; - struct kn02_csr *kn02_csr; - struct dec_ioasic_data *dec_ioasic_data; - struct ps2_data *ps2_data; - struct dec5800_data *dec5800_csr; - struct au1x00_ic_data *au1x00_ic_data; - struct vr41xx_data *vr41xx_data; - struct jazz_data *jazz_data; - struct malta_data *malta_data; - struct sgi_ip20_data *sgi_ip20_data; - struct sgi_ip22_data *sgi_ip22_data; - struct sgi_ip30_data *sgi_ip30_data; - struct { - struct crime_data *crime_data; - struct mace_data *mace_data; - } ip32; - struct footbridge_data *footbridge_data; - struct bebox_data *bebox_data; - struct prep_data *prep_data; - struct cpc700_data *cpc700_data; - struct gc_data *gc_data; - struct v3_data *v3_data; - } md_int; - /* X11/framebuffer stuff: */ int use_x11; int x11_scaledown; @@ -292,17 +232,12 @@ #define ARCH_PPC 2 #define ARCH_SPARC 3 #define ARCH_ALPHA 4 -#define ARCH_X86 5 -#define ARCH_ARM 6 -#define ARCH_IA64 7 -#define ARCH_M68K 8 -#define ARCH_SH 9 -#define ARCH_HPPA 10 -#define ARCH_I960 11 -#define ARCH_AVR 12 -#define ARCH_TRANSPUTER 13 -#define ARCH_RCA180X 14 -#define ARCH_AVR32 15 +#define ARCH_ARM 5 +#define ARCH_M68K 6 +#define ARCH_SH 7 +#define ARCH_AVR 8 +#define ARCH_TRANSPUTER 9 +#define ARCH_RCA180X 10 /* MIPS: */ #define MACHINE_BAREMIPS 1000 @@ -329,8 +264,7 @@ #define MACHINE_BEBOX 2005 #define MACHINE_PREP 2006 #define MACHINE_MACPPC 2007 -#define MACHINE_DB64360 2008 -#define MACHINE_MVMEPPC 2009 +#define MACHINE_MVMEPPC 2008 /* SPARC: */ #define MACHINE_BARESPARC 3000 @@ -342,60 +276,41 @@ #define MACHINE_TESTALPHA 4001 #define MACHINE_ALPHA 4002 -/* X86: */ -#define MACHINE_BAREX86 5000 -#define MACHINE_X86 5001 - /* ARM: */ -#define MACHINE_BAREARM 6000 -#define MACHINE_TESTARM 6001 -#define MACHINE_CATS 6002 -#define MACHINE_HPCARM 6003 -#define MACHINE_ZAURUS 6004 -#define MACHINE_NETWINDER 6005 -#define MACHINE_SHARK 6006 -#define MACHINE_IQ80321 6007 -#define MACHINE_IYONIX 6008 -#define MACHINE_TS7200 6009 -#define MACHINE_QEMU_ARM 6010 - -/* IA64: */ -#define MACHINE_BAREIA64 7000 -#define MACHINE_TESTIA64 7001 +#define MACHINE_BAREARM 5000 +#define MACHINE_TESTARM 5001 +#define MACHINE_CATS 5002 +#define MACHINE_HPCARM 5003 +#define MACHINE_ZAURUS 5004 +#define MACHINE_NETWINDER 5005 +#define MACHINE_SHARK 5006 +#define MACHINE_IQ80321 5007 +#define MACHINE_IYONIX 5008 +#define MACHINE_TS7200 5009 +#define MACHINE_QEMU_ARM 5010 /* M68K: */ -#define MACHINE_BAREM68K 8000 -#define MACHINE_TESTM68K 8001 +#define MACHINE_BAREM68K 6000 +#define MACHINE_TESTM68K 6001 /* SH: */ -#define MACHINE_BARESH 9000 -#define MACHINE_TESTSH 9001 -#define MACHINE_HPCSH 9002 -#define MACHINE_DREAMCAST 9003 - -/* HPPA: */ -#define MACHINE_BAREHPPA 10000 -#define MACHINE_TESTHPPA 10001 - -/* I960: */ -#define MACHINE_BAREI960 11000 -#define MACHINE_TESTI960 11001 +#define MACHINE_BARESH 7000 +#define MACHINE_TESTSH 7001 +#define MACHINE_HPCSH 7002 +#define MACHINE_DREAMCAST 7003 +#define MACHINE_LANDISK 7004 /* AVR: */ -#define MACHINE_BAREAVR 12000 -#define MACHINE_AVR_PAL 12001 -#define MACHINE_AVR_MAHPONG 12002 +#define MACHINE_BAREAVR 8000 +#define MACHINE_AVR_PAL 8001 +#define MACHINE_AVR_MAHPONG 8002 /* TRANSPUTER: */ -#define MACHINE_BARETRANSPUTER 13000 +#define MACHINE_BARETRANSPUTER 9000 /* ARCH_RCA180X: */ -#define MACHINE_BARE180X 14000 -#define MACHINE_CHIP8 14001 - -/* AVR32: */ -#define MACHINE_BAREAVR32 15000 -#define MACHINE_TESTAVR32 15001 +#define MACHINE_BARE180X 10000 +#define MACHINE_CHIP8 10001 /* Other "pseudo"-machines: */ #define MACHINE_NONE 0 @@ -477,10 +392,6 @@ #define MACHINE_MVMEPPC_2100 2 #define MACHINE_MVMEPPC_5500 3 -/* X86: */ -#define MACHINE_X86_GENERIC 1 -#define MACHINE_X86_XT 2 - /* For the automachine system: */ struct machine_entry_subtype { @@ -524,7 +435,7 @@ /* machine.c: */ -struct machine *machine_new(char *name, struct emul *emul); +struct machine *machine_new(char *name, struct emul *emul, int id); void machine_destroy(struct machine *machine); int machine_name_to_type(char *stype, char *ssubtype, int *type, int *subtype, int *arch); @@ -558,8 +469,6 @@ void machine_memsize_fix(struct machine *); void machine_default_cputype(struct machine *); void machine_dumpinfo(struct machine *); -void machine_bus_register(struct machine *, char *busname, - void (*debug_dump)(void *), void *extra); int machine_run(struct machine *machine); void machine_list_available_types_and_cpus(void); struct machine_entry *machine_entry_new(const char *name,