--- trunk/src/include/cpu.h 2007/10/08 16:19:56 24 +++ trunk/src/include/cpu.h 2007/10/08 16:20:10 26 @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * - * $Id: cpu.h,v 1.75 2006/06/16 18:31:26 debug Exp $ + * $Id: cpu.h,v 1.79 2006/06/25 00:27:36 debug Exp $ * * CPU-related definitions. */ @@ -114,6 +114,7 @@ #define DYNTRANS_ITC(arch) struct arch ## _tc_physpage *cur_physpage; \ struct arch ## _instr_call *cur_ic_page; \ struct arch ## _instr_call *next_ic; \ + struct arch ## _tc_physpage *physpage_template;\ void (*combination_check)(struct cpu *, \ struct arch ## _instr_call *, int low_addr); @@ -224,8 +225,8 @@ uint64_t dumpaddr); void (*register_dump)(struct cpu *cpu, int gprs, int coprocs); - int (*run)(struct emul *emul, - struct machine *machine); + int (*run_instr)(struct emul *emul, + struct cpu *cpu); void (*dumpinfo)(struct cpu *cpu); void (*tlbdump)(struct machine *m, int x, int rawflag); @@ -235,6 +236,7 @@ void (*functioncall_trace)(struct cpu *, uint64_t f, int n_args); char *(*gdb_stub)(struct cpu *, char *cmd); + void (*init_tables)(struct cpu *cpu); }; @@ -258,8 +260,8 @@ #define N_SAFE_DYNTRANS_LIMIT_SHIFT 14 #define N_SAFE_DYNTRANS_LIMIT ((1 << (N_SAFE_DYNTRANS_LIMIT_SHIFT - 1)) - 1) -#define DYNTRANS_CACHE_SIZE (16*1048576) -#define DYNTRANS_CACHE_MARGIN 300000 +#define DYNTRANS_CACHE_SIZE (24*1048576) +#define DYNTRANS_CACHE_MARGIN 350000 #define N_BASE_TABLE_ENTRIES 32768 #define PAGENR_TO_TABLE_INDEX(a) ((a) & (N_BASE_TABLE_ENTRIES-1)) @@ -286,8 +288,8 @@ struct memory *mem, uint64_t vaddr, unsigned char *data, size_t len, int writeflag, int cache_flags); - int (*translate_address)(struct cpu *, uint64_t vaddr, - uint64_t *return_addr, int flags); + int (*translate_v2p)(struct cpu *, uint64_t vaddr, + uint64_t *return_paddr, int flags); void (*update_translation_table)(struct cpu *, uint64_t vaddr_page, unsigned char *host_page, int writeflag, uint64_t paddr_page); @@ -351,7 +353,6 @@ void cpu_functioncall_trace_return(struct cpu *cpu); void cpu_create_or_reset_tc(struct cpu *cpu); void cpu_run_init(struct machine *machine); -int cpu_run(struct emul *emul, struct machine *machine); void cpu_run_deinit(struct machine *machine); void cpu_dumpinfo(struct machine *m, struct cpu *cpu); void cpu_list_available_types(void); @@ -366,8 +367,6 @@ #define INVALIDATE_VADDR 8 #define INVALIDATE_VADDR_UPPER4 16 /* useful for PPC emulation */ -#define TLB_CODE 0x02 - #define CPU_FAMILY_INIT(n,s) int n ## _cpu_family_init( \ struct cpu_family *fp) { \ @@ -378,13 +377,14 @@ fp->register_match = n ## _cpu_register_match; \ fp->disassemble_instr = n ## _cpu_disassemble_instr; \ fp->register_dump = n ## _cpu_register_dump; \ - fp->run = n ## _cpu_run; \ fp->dumpinfo = n ## _cpu_dumpinfo; \ fp->interrupt = n ## _cpu_interrupt; \ fp->interrupt_ack = n ## _cpu_interrupt_ack; \ fp->functioncall_trace = n ## _cpu_functioncall_trace; \ fp->gdb_stub = n ## _cpu_gdb_stub; \ fp->tlbdump = n ## _cpu_tlbdump; \ + fp->run_instr = n ## _cpu_run_instr; \ + fp->init_tables = n ## _cpu_init_tables; \ return 1; \ }