1 |
/* |
/* |
2 |
* Copyright (C) 2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2005-2006 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: cpu_sh.c,v 1.9 2006/02/17 18:38:30 debug Exp $ |
* $Id: cpu_sh.c,v 1.15 2006/06/16 18:31:26 debug Exp $ |
29 |
* |
* |
30 |
* Hitachi SuperH ("SH") CPU emulation. |
* Hitachi SuperH ("SH") CPU emulation. |
31 |
* |
* |
89 |
debug("%s", cpu->name); |
debug("%s", cpu->name); |
90 |
} |
} |
91 |
|
|
92 |
|
sh_init_64bit_dummy_tables(cpu); |
93 |
|
|
94 |
return 1; |
return 1; |
95 |
} |
} |
96 |
|
|
194 |
|
|
195 |
|
|
196 |
/* |
/* |
197 |
|
* sh_cpu_tlbdump(): |
198 |
|
* |
199 |
|
* Called from the debugger to dump the TLB in a readable format. |
200 |
|
* x is the cpu number to dump, or -1 to dump all CPUs. |
201 |
|
* |
202 |
|
* If rawflag is nonzero, then the TLB contents isn't formated nicely, |
203 |
|
* just dumped. |
204 |
|
*/ |
205 |
|
void sh_cpu_tlbdump(struct machine *m, int x, int rawflag) |
206 |
|
{ |
207 |
|
} |
208 |
|
|
209 |
|
|
210 |
|
/* |
211 |
|
* sh_cpu_gdb_stub(): |
212 |
|
* |
213 |
|
* Execute a "remote GDB" command. Returns a newly allocated response string |
214 |
|
* on success, NULL on failure. |
215 |
|
*/ |
216 |
|
char *sh_cpu_gdb_stub(struct cpu *cpu, char *cmd) |
217 |
|
{ |
218 |
|
fatal("sh_cpu_gdb_stub(): TODO\n"); |
219 |
|
return NULL; |
220 |
|
} |
221 |
|
|
222 |
|
|
223 |
|
/* |
224 |
* sh_cpu_interrupt(): |
* sh_cpu_interrupt(): |
225 |
*/ |
*/ |
226 |
int sh_cpu_interrupt(struct cpu *cpu, uint64_t irq_nr) |
int sh_cpu_interrupt(struct cpu *cpu, uint64_t irq_nr) |
248 |
* lowest 4 or 8 bits then select sub-opcode. |
* lowest 4 or 8 bits then select sub-opcode. |
249 |
*/ |
*/ |
250 |
int sh_cpu_disassemble_instr_compact(struct cpu *cpu, unsigned char *instr, |
int sh_cpu_disassemble_instr_compact(struct cpu *cpu, unsigned char *instr, |
251 |
int running, uint64_t dumpaddr, int bintrans) |
int running, uint64_t dumpaddr) |
252 |
{ |
{ |
253 |
uint64_t addr; |
uint64_t addr; |
254 |
uint16_t iword; |
uint16_t iword; |
571 |
* cpu->pc for relative addresses. |
* cpu->pc for relative addresses. |
572 |
*/ |
*/ |
573 |
int sh_cpu_disassemble_instr(struct cpu *cpu, unsigned char *instr, |
int sh_cpu_disassemble_instr(struct cpu *cpu, unsigned char *instr, |
574 |
int running, uint64_t dumpaddr, int bintrans) |
int running, uint64_t dumpaddr) |
575 |
{ |
{ |
576 |
uint64_t offset; |
uint64_t offset; |
577 |
uint32_t iword; |
uint32_t iword; |
595 |
|
|
596 |
if (cpu->cd.sh.compact) |
if (cpu->cd.sh.compact) |
597 |
return sh_cpu_disassemble_instr_compact(cpu, instr, |
return sh_cpu_disassemble_instr_compact(cpu, instr, |
598 |
running, dumpaddr, bintrans); |
running, dumpaddr); |
599 |
|
|
600 |
if (cpu->byte_order == EMUL_BIG_ENDIAN) |
if (cpu->byte_order == EMUL_BIG_ENDIAN) |
601 |
iword = (instr[0] << 24) + (instr[1] << 16) + (instr[2] << 8) |
iword = (instr[0] << 24) + (instr[1] << 16) + (instr[2] << 8) |