--- trunk/src/include/cpu.h 2007/10/08 16:21:43 37 +++ trunk/src/include/cpu.h 2007/10/08 16:21:53 38 @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * - * $Id: cpu.h,v 1.109 2007/02/10 14:29:54 debug Exp $ + * $Id: cpu.h,v 1.114 2007/04/10 17:26:20 debug Exp $ * * CPU-related definitions. */ @@ -197,10 +197,8 @@ #include "cpu_m68k.h" #include "cpu_mips.h" #include "cpu_ppc.h" -#include "cpu_rca180x.h" #include "cpu_sh.h" #include "cpu_sparc.h" -#include "cpu_transputer.h" struct cpu; struct emul; @@ -257,9 +255,6 @@ (This is called for each function call, if running with -t.) */ void (*functioncall_trace)(struct cpu *, uint64_t f, int n_args); - - /* GDB command handler. */ - char *(*gdb_stub)(struct cpu *, char *cmd); }; @@ -282,10 +277,19 @@ #define DEFAULT_DYNTRANS_CACHE_SIZE (40*1048576) #define DYNTRANS_CACHE_MARGIN 200000 -#define N_BASE_TABLE_ENTRIES 32768 +#define N_BASE_TABLE_ENTRIES 65536 #define PAGENR_TO_TABLE_INDEX(a) ((a) & (N_BASE_TABLE_ENTRIES-1)) +#ifdef NATIVE_CODE_GENERATION +/* + * Intermediate Native Representation (INR). + * Used for native code generation. + */ +#include "inr.h" +#endif + + /* * The generic CPU struct: */ @@ -369,26 +373,24 @@ * Note that it can also be adjusted negatively, that is, the way * to "get out" of a dyntrans loop is to set the current instruction * call pointer to the "nothing" instruction. This instruction - * _decreases_ n_translated_instrs. That way, once the dyntrans loop - * exits, only real instructions will be counted, and not the + * _decreases_ n_translated_instrs by 1. That way, once the dyntrans + * loop exits, only real instructions will be counted, and not the * "nothing" instructions. * * The translation cache is a relative large chunk of memory (say, * 32 MB) which is used for translations. When it has been used up, * everything restarts from scratch. * - * When translating to native code, currently_translating_to_native - * is non-zero, and native_code_function_pointer points to the - * "ic->f" which will be modified (once the translation has finished) - * to point to the newly translated code. + * The INR struct contains the Intermediate Native Representation, + * used during native code generation. */ int n_translated_instrs; unsigned char *translation_cache; size_t translation_cache_cur_ofs; - int currently_translating_to_native; - int nr_of_instructions_translated_to_native; - unsigned char *native_cur_output_ptr; - void **native_code_function_pointer; + +#ifdef NATIVE_CODE_GENERATION + struct inr inr; +#endif /* * CPU-family dependent: @@ -403,10 +405,8 @@ struct m68k_cpu m68k; struct mips_cpu mips; struct ppc_cpu ppc; - struct rca180x_cpu rca180x; struct sh_cpu sh; struct sparc_cpu sparc; - struct transputer_cpu transputer; } cd; }; @@ -421,7 +421,6 @@ int gprs, int coprocs); int cpu_disassemble_instr(struct machine *m, struct cpu *cpu, unsigned char *instr, int running, uint64_t addr); -char *cpu_gdb_stub(struct cpu *cpu, char *cmd); void cpu_functioncall_trace(struct cpu *cpu, uint64_t f); void cpu_functioncall_trace_return(struct cpu *cpu); @@ -473,7 +472,6 @@ fp->register_dump = n ## _cpu_register_dump; \ fp->dumpinfo = n ## _cpu_dumpinfo; \ fp->functioncall_trace = n ## _cpu_functioncall_trace; \ - fp->gdb_stub = n ## _cpu_gdb_stub; \ fp->tlbdump = n ## _cpu_tlbdump; \ fp->init_tables = n ## _cpu_init_tables; \ return 1; \