25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: cpu_ppc.c,v 1.58 2006/06/16 18:31:26 debug Exp $ |
* $Id: cpu_ppc.c,v 1.60 2006/07/16 13:32:26 debug Exp $ |
29 |
* |
* |
30 |
* PowerPC/POWER CPU emulation. |
* PowerPC/POWER CPU emulation. |
31 |
*/ |
*/ |
116 |
cpu->is_32bit = (cpu->cd.ppc.bits == 32)? 1 : 0; |
cpu->is_32bit = (cpu->cd.ppc.bits == 32)? 1 : 0; |
117 |
|
|
118 |
if (cpu->is_32bit) { |
if (cpu->is_32bit) { |
119 |
|
cpu->run_instr = ppc32_run_instr; |
120 |
cpu->update_translation_table = ppc32_update_translation_table; |
cpu->update_translation_table = ppc32_update_translation_table; |
121 |
cpu->invalidate_translation_caches = |
cpu->invalidate_translation_caches = |
122 |
ppc32_invalidate_translation_caches; |
ppc32_invalidate_translation_caches; |
123 |
cpu->invalidate_code_translation = |
cpu->invalidate_code_translation = |
124 |
ppc32_invalidate_code_translation; |
ppc32_invalidate_code_translation; |
125 |
} else { |
} else { |
126 |
|
cpu->run_instr = ppc_run_instr; |
127 |
cpu->update_translation_table = ppc_update_translation_table; |
cpu->update_translation_table = ppc_update_translation_table; |
128 |
cpu->invalidate_translation_caches = |
cpu->invalidate_translation_caches = |
129 |
ppc_invalidate_translation_caches; |
ppc_invalidate_translation_caches; |
131 |
ppc_invalidate_code_translation; |
ppc_invalidate_code_translation; |
132 |
} |
} |
133 |
|
|
134 |
cpu->translate_address = ppc_translate_address; |
cpu->translate_v2p = ppc_translate_v2p; |
135 |
|
|
136 |
/* Only show name and caches etc for CPU nr 0 (in SMP machines): */ |
/* Only show name and caches etc for CPU nr 0 (in SMP machines): */ |
137 |
if (cpu_id == 0) { |
if (cpu_id == 0) { |
162 |
/* Some default stack pointer value. TODO: move this? */ |
/* Some default stack pointer value. TODO: move this? */ |
163 |
cpu->cd.ppc.gpr[1] = machine->physical_ram_in_mb * 1048576 - 4096; |
cpu->cd.ppc.gpr[1] = machine->physical_ram_in_mb * 1048576 - 4096; |
164 |
|
|
|
ppc_init_64bit_dummy_tables(cpu); |
|
|
|
|
165 |
/* |
/* |
166 |
* NOTE/TODO: Ugly hack for OpenFirmware emulation: |
* NOTE/TODO: Ugly hack for OpenFirmware emulation: |
167 |
*/ |
*/ |