/[gxemul]/trunk/src/cpus/cpu_hppa.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/cpus/cpu_hppa.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC revision 26 by dpavlin, Mon Oct 8 16:20:10 2007 UTC
# Line 1  Line 1 
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:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: cpu_hppa.c,v 1.6 2005/11/17 21:26:06 debug Exp $   *  $Id: cpu_hppa.c,v 1.14 2006/06/24 21:47:23 debug Exp $
29   *   *
30   *  HP PA-RISC CPU emulation.   *  HP PA-RISC CPU emulation.
31   *   *
# Line 136  void hppa_cpu_register_dump(struct cpu * Line 136  void hppa_cpu_register_dump(struct cpu *
136    
137                  debug("cpu%i: pc  = 0x", x);                  debug("cpu%i: pc  = 0x", x);
138                  if (bits32)                  if (bits32)
139                          debug("%08x", (int)cpu->pc);                          debug("%08"PRIx32, (uint32_t) cpu->pc);
140                  else                  else
141                          debug("%016llx", (long long)cpu->pc);                          debug("%016"PRIx64, (uint64_t) cpu->pc);
142                  debug("  <%s>\n", symbol != NULL? symbol : " no symbol ");                  debug("  <%s>\n", symbol != NULL? symbol : " no symbol ");
143    
144                  if (bits32) {                  if (bits32) {
# Line 146  void hppa_cpu_register_dump(struct cpu * Line 146  void hppa_cpu_register_dump(struct cpu *
146                          for (i=0; i<nregs; i++) {                          for (i=0; i<nregs; i++) {
147                                  if ((i % 4) == 0)                                  if ((i % 4) == 0)
148                                          debug("cpu%i:", x);                                          debug("cpu%i:", x);
149                                  debug(" r%02i = 0x%08x ", i,                                  debug(" r%02i = 0x%08"PRIx32" ", i,
150                                      (int)cpu->cd.hppa.r[i]);                                      (uint32_t)cpu->cd.hppa.r[i]);
151                                  if ((i % 4) == 3)                                  if ((i % 4) == 3)
152                                          debug("\n");                                          debug("\n");
153                          }                          }
# Line 157  void hppa_cpu_register_dump(struct cpu * Line 157  void hppa_cpu_register_dump(struct cpu *
157                                  int r = (i >> 1) + ((i & 1) << 4);                                  int r = (i >> 1) + ((i & 1) << 4);
158                                  if ((i % 2) == 0)                                  if ((i % 2) == 0)
159                                          debug("cpu%i:", x);                                          debug("cpu%i:", x);
160                                  debug(" r%02i = 0x%016llx ", r,                                  debug(" r%02i = 0x%016"PRIx64" ", r,
161                                      (long long)cpu->cd.hppa.r[r]);                                      (uint64_t) cpu->cd.hppa.r[r]);
162                                  if ((i % 2) == 1)                                  if ((i % 2) == 1)
163                                          debug("\n");                                          debug("\n");
164                          }                          }
# Line 191  void hppa_cpu_register_match(struct mach Line 191  void hppa_cpu_register_match(struct mach
191    
192    
193  /*  /*
194     *  hppa_cpu_tlbdump():
195     *
196     *  Called from the debugger to dump the TLB in a readable format.
197     *  x is the cpu number to dump, or -1 to dump all CPUs.
198     *
199     *  If rawflag is nonzero, then the TLB contents isn't formated nicely,
200     *  just dumped.
201     */
202    void hppa_cpu_tlbdump(struct machine *m, int x, int rawflag)
203    {
204    }
205    
206    
207    /*
208     *  hppa_cpu_gdb_stub():
209     *
210     *  Execute a "remote GDB" command. Returns a newly allocated response string
211     *  on success, NULL on failure.
212     */
213    char *hppa_cpu_gdb_stub(struct cpu *cpu, char *cmd)
214    {
215            fatal("hppa_cpu_gdb_stub(): TODO\n");
216            return NULL;
217    }
218    
219    
220    /*
221   *  hppa_cpu_interrupt():   *  hppa_cpu_interrupt():
222   */   */
223  int hppa_cpu_interrupt(struct cpu *cpu, uint64_t irq_nr)  int hppa_cpu_interrupt(struct cpu *cpu, uint64_t irq_nr)
# Line 223  int hppa_cpu_interrupt_ack(struct cpu *c Line 250  int hppa_cpu_interrupt_ack(struct cpu *c
250   *  cpu->pc for relative addresses.   *  cpu->pc for relative addresses.
251   */   */
252  int hppa_cpu_disassemble_instr(struct cpu *cpu, unsigned char *instr,  int hppa_cpu_disassemble_instr(struct cpu *cpu, unsigned char *instr,
253          int running, uint64_t dumpaddr, int bintrans)          int running, uint64_t dumpaddr)
254  {  {
255          uint64_t offset;          uint64_t offset;
256          uint32_t iword;          uint32_t iword;
# Line 241  int hppa_cpu_disassemble_instr(struct cp Line 268  int hppa_cpu_disassemble_instr(struct cp
268                  debug("cpu%i: ", cpu->cpu_id);                  debug("cpu%i: ", cpu->cpu_id);
269    
270          if (cpu->cd.hppa.bits == 32)          if (cpu->cd.hppa.bits == 32)
271                  debug("%08x", (int)dumpaddr);                  debug("%08"PRIx32, (uint32_t) dumpaddr);
272          else          else
273                  debug("%016llx", (long long)dumpaddr);                  debug("%016"PRIx64, (uint64_t) dumpaddr);
274    
275          if (cpu->byte_order == EMUL_BIG_ENDIAN)          if (cpu->byte_order == EMUL_BIG_ENDIAN)
276                  iword = (instr[0] << 24) + (instr[1] << 16) + (instr[2] << 8)                  iword = (instr[0] << 24) + (instr[1] << 16) + (instr[2] << 8)
# Line 252  int hppa_cpu_disassemble_instr(struct cp Line 279  int hppa_cpu_disassemble_instr(struct cp
279                  iword = (instr[3] << 24) + (instr[2] << 16) + (instr[1] << 8)                  iword = (instr[3] << 24) + (instr[2] << 16) + (instr[1] << 8)
280                      + instr[0];                      + instr[0];
281    
282          debug(": %08x\t", iword);          debug(": %08"PRIx32"\t", (uint32_t) iword);
283    
284          /*          /*
285           *  Decode the instruction:           *  Decode the instruction:

Legend:
Removed from v.20  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.26