25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: cpu.c,v 1.370 2007/02/10 14:29:54 debug Exp $ |
* $Id: cpu.c,v 1.374 2007/04/10 17:26:19 debug Exp $ |
29 |
* |
* |
30 |
* Common routines for CPU emulation. (Not specific to any CPU type.) |
* Common routines for CPU emulation. (Not specific to any CPU type.) |
31 |
*/ |
*/ |
222 |
|
|
223 |
|
|
224 |
/* |
/* |
|
* cpu_gdb_stub(): |
|
|
* |
|
|
* Execute a "remote GDB" command. Return value is a pointer to a newly |
|
|
* allocated response string, if the command was successfully executed. If |
|
|
* there was an error, NULL is returned. |
|
|
*/ |
|
|
char *cpu_gdb_stub(struct cpu *cpu, char *cmd) |
|
|
{ |
|
|
if (cpu->machine->cpu_family == NULL || |
|
|
cpu->machine->cpu_family->gdb_stub == NULL) { |
|
|
fatal("cpu_gdb_stub(): NULL\n"); |
|
|
return NULL; |
|
|
} else |
|
|
return cpu->machine->cpu_family->gdb_stub(cpu, cmd); |
|
|
} |
|
|
|
|
|
|
|
|
/* |
|
225 |
* cpu_functioncall_trace(): |
* cpu_functioncall_trace(): |
226 |
* |
* |
227 |
* This function should be called if machine->show_trace_tree is enabled, and |
* This function should be called if machine->show_trace_tree is enabled, and |
305 |
#endif |
#endif |
306 |
} |
} |
307 |
|
|
308 |
cpu->currently_translating_to_native = 0; |
#ifdef NATIVE_CODE_GENERATION |
309 |
|
if (native_code_translation_enabled && cpu->inr.inr_entries == NULL) |
310 |
|
cpu->inr.inr_entries = zeroed_alloc( |
311 |
|
sizeof(struct inr_entry) * INR_MAX_ENTRIES); |
312 |
|
|
313 |
|
cpu->inr.nr_inr_entries_used = 0; |
314 |
|
#endif |
315 |
|
|
316 |
/* Create an empty table at the beginning of the translation cache: */ |
/* Create an empty table at the beginning of the translation cache: */ |
317 |
memset(cpu->translation_cache, 0, sizeof(uint32_t) |
memset(cpu->translation_cache, 0, sizeof(uint32_t) |
587 |
add_cpu_family(avr_cpu_family_init, ARCH_AVR); |
add_cpu_family(avr_cpu_family_init, ARCH_AVR); |
588 |
#endif |
#endif |
589 |
|
|
|
#ifdef ENABLE_RCA180X |
|
|
add_cpu_family(rca180x_cpu_family_init, ARCH_RCA180X); |
|
|
#endif |
|
|
|
|
590 |
#ifdef ENABLE_M68K |
#ifdef ENABLE_M68K |
591 |
add_cpu_family(m68k_cpu_family_init, ARCH_M68K); |
add_cpu_family(m68k_cpu_family_init, ARCH_M68K); |
592 |
#endif |
#endif |
606 |
#ifdef ENABLE_SPARC |
#ifdef ENABLE_SPARC |
607 |
add_cpu_family(sparc_cpu_family_init, ARCH_SPARC); |
add_cpu_family(sparc_cpu_family_init, ARCH_SPARC); |
608 |
#endif |
#endif |
|
|
|
|
#ifdef ENABLE_TRANSPUTER |
|
|
add_cpu_family(transputer_cpu_family_init, ARCH_TRANSPUTER); |
|
|
#endif |
|
609 |
} |
} |
610 |
|
|