25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: cpu.c,v 1.342 2006/06/22 13:27:03 debug Exp $ |
* $Id: cpu.c,v 1.344 2006/06/24 21:47:22 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 |
*/ |
*/ |
96 |
"NULL\n"); |
"NULL\n"); |
97 |
exit(1); |
exit(1); |
98 |
} |
} |
99 |
return cpu; |
break; |
100 |
} |
} |
101 |
} |
} |
102 |
|
|
103 |
fp = fp->next; |
fp = fp->next; |
104 |
} |
} |
105 |
|
|
106 |
fatal("\ncpu_new(): unknown cpu type '%s'\n", cpu_type_name); |
if (fp == NULL) { |
107 |
return NULL; |
fatal("\ncpu_new(): unknown cpu type '%s'\n", cpu_type_name); |
108 |
|
return NULL; |
109 |
|
} |
110 |
|
|
111 |
|
fp->init_tables(cpu); |
112 |
|
|
113 |
|
return cpu; |
114 |
} |
} |
115 |
|
|
116 |
|
|
328 |
} |
} |
329 |
|
|
330 |
|
|
|
/* |
|
|
* cpu_run(): |
|
|
* |
|
|
* Run instructions on all CPUs in this machine, for a "medium duration" |
|
|
* (or until all CPUs have halted). |
|
|
* |
|
|
* Return value is 1 if anything happened, 0 if all CPUs are stopped. |
|
|
*/ |
|
|
int cpu_run(struct emul *emul, struct machine *m) |
|
|
{ |
|
|
if (m->cpu_family == NULL || m->cpu_family->run == NULL) { |
|
|
fatal("cpu_run(): NULL\n"); |
|
|
return 0; |
|
|
} else |
|
|
return m->cpu_family->run(emul, m); |
|
|
} |
|
|
|
|
|
|
|
331 |
/* |
/* |
332 |
* cpu_dumpinfo(): |
* cpu_dumpinfo(): |
333 |
* |
* |