25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: machine.c,v 1.664 2006/02/05 10:26:35 debug Exp $ |
* $Id: machine.c,v 1.671 2006/06/16 18:31:24 debug Exp $ |
29 |
*/ |
*/ |
30 |
|
|
31 |
#include <stdio.h> |
#include <stdio.h> |
90 |
m->serial_nr = 1; |
m->serial_nr = 1; |
91 |
m->machine_type = MACHINE_NONE; |
m->machine_type = MACHINE_NONE; |
92 |
m->machine_subtype = MACHINE_NONE; |
m->machine_subtype = MACHINE_NONE; |
|
#ifdef BINTRANS |
|
|
m->bintrans_enable = 1; |
|
|
m->old_bintrans_enable = 1; |
|
|
#endif |
|
93 |
m->arch_pagesize = 4096; /* Should be overriden in |
m->arch_pagesize = 4096; /* Should be overriden in |
94 |
emul.c for other pagesizes. */ |
emul.c for other pagesizes. */ |
95 |
m->dyntrans_alignment_check = 1; |
m->dyntrans_alignment_check = 1; |
104 |
m->n_gfx_cards = 1; |
m->n_gfx_cards = 1; |
105 |
m->dbe_on_nonexistant_memaccess = 1; |
m->dbe_on_nonexistant_memaccess = 1; |
106 |
m->show_symbolic_register_names = 1; |
m->show_symbolic_register_names = 1; |
|
m->bintrans_size = DEFAULT_BINTRANS_SIZE_IN_MB * 1048576; |
|
107 |
symbol_init(&m->symbol_context); |
symbol_init(&m->symbol_context); |
108 |
|
|
109 |
return m; |
return m; |
214 |
* |
* |
215 |
* Adds a tick function (a function called every now and then, depending on |
* Adds a tick function (a function called every now and then, depending on |
216 |
* clock cycle count) to a machine. |
* clock cycle count) to a machine. |
217 |
|
* |
218 |
|
* If tickshift is non-zero, a tick will occur every (1 << tickshift) cycles. |
219 |
|
* This is used for the normal (fast dyntrans) emulation modes. |
220 |
|
* |
221 |
|
* If tickshift is zero, then this is a cycle-accurate tick function. |
222 |
|
* The hz value is used in this case. |
223 |
*/ |
*/ |
224 |
void machine_add_tickfunction(struct machine *machine, void (*func) |
void machine_add_tickfunction(struct machine *machine, void (*func) |
225 |
(struct cpu *, void *), void *extra, int clockshift) |
(struct cpu *, void *), void *extra, int tickshift, double hz) |
226 |
{ |
{ |
227 |
int n = machine->n_tick_entries; |
int n = machine->n_tick_entries; |
228 |
|
|
232 |
exit(1); |
exit(1); |
233 |
} |
} |
234 |
|
|
235 |
/* Don't use too low clockshifts, that would be too inefficient |
if (!machine->cycle_accurate) { |
236 |
with bintrans. */ |
/* |
237 |
if (clockshift < N_SAFE_BINTRANS_LIMIT_SHIFT) |
* The dyntrans subsystem wants to run code in relatively |
238 |
fatal("WARNING! clockshift = %i, less than " |
* large chunks without checking for external interrupts, |
239 |
"N_SAFE_BINTRANS_LIMIT_SHIFT (%i)\n", |
* so we cannot allow too low tickshifts: |
240 |
clockshift, N_SAFE_BINTRANS_LIMIT_SHIFT); |
*/ |
241 |
|
if (tickshift < N_SAFE_DYNTRANS_LIMIT_SHIFT) { |
242 |
|
fatal("ERROR! tickshift = %i, less than " |
243 |
|
"N_SAFE_DYNTRANS_LIMIT_SHIFT (%i)\n", |
244 |
|
tickshift, N_SAFE_DYNTRANS_LIMIT_SHIFT); |
245 |
|
exit(1); |
246 |
|
} |
247 |
|
} |
248 |
|
|
249 |
machine->ticks_till_next[n] = 0; |
machine->ticks_till_next[n] = 0; |
250 |
machine->ticks_reset_value[n] = 1 << clockshift; |
machine->ticks_reset_value[n] = 1 << tickshift; |
251 |
machine->tick_func[n] = func; |
machine->tick_func[n] = func; |
252 |
machine->tick_extra[n] = extra; |
machine->tick_extra[n] = extra; |
253 |
|
machine->tick_hz[n] = hz; |
254 |
|
|
255 |
machine->n_tick_entries ++; |
machine->n_tick_entries ++; |
256 |
} |
} |
332 |
debug(", dbe_on_nonexistant_memaccess"); |
debug(", dbe_on_nonexistant_memaccess"); |
333 |
debug("\n"); |
debug("\n"); |
334 |
|
|
|
if (m->single_step_on_bad_addr) |
|
|
debug("single-step on bad addresses\n"); |
|
|
|
|
|
if (m->arch == ARCH_MIPS) { |
|
|
if (m->bintrans_enable) |
|
|
debug("bintrans enabled (%i MB cache)\n", |
|
|
(int) (m->bintrans_size / 1048576)); |
|
|
else |
|
|
debug("bintrans disabled, other speedtricks %s\n", |
|
|
m->speed_tricks? "enabled" : "disabled"); |
|
|
} |
|
|
|
|
335 |
debug("clock: "); |
debug("clock: "); |
336 |
if (m->automatic_clock_adjustment) |
if (m->automatic_clock_adjustment) |
337 |
debug("adjusted automatically"); |
debug("adjusted automatically"); |
1072 |
"that actually work. Use the alias\nwhen selecting a machine type " |
"that actually work. Use the alias\nwhen selecting a machine type " |
1073 |
"or subtype, not the real name.\n"); |
"or subtype, not the real name.\n"); |
1074 |
|
|
1075 |
|
#ifdef UNSTABLE_DEVEL |
1076 |
debug("\n"); |
debug("\n"); |
1077 |
|
|
1078 |
useremul_list_emuls(); |
useremul_list_emuls(); |
1079 |
debug("Userland emulation works for programs with the complexity" |
debug("Userland emulation works for programs with the complexity" |
1080 |
" of Hello World,\nbut not much more.\n"); |
" of Hello World,\nbut not much more.\n"); |
1081 |
|
#endif |
1082 |
} |
} |
1083 |
|
|
1084 |
|
|