/[gxemul]/trunk/src/cpus/cpu_arm_instr.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_arm_instr.c

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

revision 43 by dpavlin, Mon Oct 8 16:22:32 2007 UTC revision 44 by dpavlin, Mon Oct 8 16:22:56 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: cpu_arm_instr.c,v 1.74 2007/06/14 04:53:46 debug Exp $   *  $Id: cpu_arm_instr.c,v 1.77 2007/06/28 13:36:46 debug Exp $
29   *   *
30   *  ARM instructions.   *  ARM instructions.
31   *   *
# Line 1569  X(netbsd_idle) Line 1569  X(netbsd_idle)
1569          }          }
1570    
1571          if (rZ == 0) {          if (rZ == 0) {
1572                    static int x = 0;
1573    
1574                  /*  Synch the program counter.  */                  /*  Synch the program counter.  */
1575                  uint32_t low_pc = ((size_t)ic - (size_t)                  uint32_t low_pc = ((size_t)ic - (size_t)
1576                      cpu->cd.arm.cur_ic_page) / sizeof(struct arm_instr_call);                      cpu->cd.arm.cur_ic_page) / sizeof(struct arm_instr_call);
# Line 1578  X(netbsd_idle) Line 1580  X(netbsd_idle)
1580    
1581                  /*  Quasi-idle for a while:  */                  /*  Quasi-idle for a while:  */
1582                  cpu->has_been_idling = 1;                  cpu->has_been_idling = 1;
1583                  if (cpu->machine->ncpus == 1)                  if (cpu->machine->ncpus == 1 && (++x) == 100) {
1584                          usleep(50);                          usleep(50);
1585                  cpu->n_translated_instrs += N_SAFE_DYNTRANS_LIMIT;                          x = 0;
1586                    }
1587    
1588                    cpu->n_translated_instrs += N_SAFE_DYNTRANS_LIMIT / 6;
1589                  cpu->cd.arm.next_ic = &nothing_call;                  cpu->cd.arm.next_ic = &nothing_call;
1590                  return;                  return;
1591          }          }
# Line 2529  X(to_be_translated) Line 2533  X(to_be_translated)
2533    
2534          /*  Read the instruction word from memory:  */          /*  Read the instruction word from memory:  */
2535          page = cpu->cd.arm.host_load[addr >> 12];          page = cpu->cd.arm.host_load[addr >> 12];
2536    
2537          if (page != NULL) {          if (page != NULL) {
2538                  /*  fatal("TRANSLATION HIT! 0x%08x\n", addr);  */                  /*  fatal("TRANSLATION HIT! 0x%08x\n", addr);  */
2539                  memcpy(ib, page + (addr & 0xfff), sizeof(ib));                  memcpy(ib, page + (addr & 0xfff), sizeof(ib));
# Line 2923  X(to_be_translated) Line 2928  X(to_be_translated)
2928                                  /*  ic->f = cond_instr(mov);  */                                  /*  ic->f = cond_instr(mov);  */
2929                                  ic->f = arm_dpi_instr[condition_code + 16*0xd];                                  ic->f = arm_dpi_instr[condition_code + 16*0xd];
2930                                  ic->arg[2] = (size_t)(&cpu->cd.arm.r[rd]);                                  ic->arg[2] = (size_t)(&cpu->cd.arm.r[rd]);
2931                                  p = cpu->cd.arm.host_load[a >> 12];                                  p = page;
2932                                  if (p != NULL) {                                  if (p != NULL) {
2933                                          memcpy(c, p + (a & 0xfff), len);                                          memcpy(c, p + (a & 0xfff), len);
2934                                  } else {                                  } else {
2935                                          if (!cpu->memory_rw(cpu, cpu->mem, a,                                          fatal("Hm? Internal error in "
2936                                              c, len, MEM_READ, CACHE_DATA)) {                                              "cpu_arm_instr.c!\n");
2937                                                  if (!cpu->translation_readahead)                                          goto bad;
                                                         fatal("read failed X:"  
                                                             " TODO\n");  
                                                 goto bad;  
                                         }  
2938                                  }                                  }
2939                                  if (cpu->byte_order == EMUL_LITTLE_ENDIAN)                                  if (cpu->byte_order == EMUL_LITTLE_ENDIAN)
2940                                          x = c[0] + (c[1]<<8) +                                          x = c[0] + (c[1]<<8) +

Legend:
Removed from v.43  
changed lines
  Added in v.44

  ViewVC Help
Powered by ViewVC 1.1.26