/[gxemul]/trunk/src/cpus/cpu_sh_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_sh_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_sh_instr.c,v 1.61 2007/06/04 06:32:25 debug Exp $   *  $Id: cpu_sh_instr.c,v 1.64 2007/06/28 13:36:47 debug Exp $
29   *   *
30   *  SH instructions.   *  SH instructions.
31   *   *
# Line 102  X(sleep) Line 102  X(sleep)
102    
103          if (cpu->machine->ncpus == 1) {          if (cpu->machine->ncpus == 1) {
104                  static int x = 0;                  static int x = 0;
105    
106                  if ((++x) == 600) {                  if ((++x) == 600) {
107                          usleep(10);                          usleep(10);
108                          x = 0;                          x = 0;
109                  }                  }
110    
111                  cpu->n_translated_instrs += N_SAFE_DYNTRANS_LIMIT / 6;                  cpu->n_translated_instrs += N_SAFE_DYNTRANS_LIMIT / 6;
112          }          }
113  }  }
# Line 2880  X(end_of_page2) Line 2882  X(end_of_page2)
2882   */   */
2883  X(to_be_translated)  X(to_be_translated)
2884  {  {
2885          uint64_t addr, low_pc;          uint32_t addr, low_pc, iword;
         uint32_t iword;  
2886          unsigned char *page;          unsigned char *page;
2887          unsigned char ib[2];          unsigned char ib[2];
2888          int main_opcode, isize = sizeof(ib);          int main_opcode, isize = sizeof(ib);
# Line 2906  X(to_be_translated) Line 2907  X(to_be_translated)
2907          addr &= ~((1 << SH_INSTR_ALIGNMENT_SHIFT) - 1);          addr &= ~((1 << SH_INSTR_ALIGNMENT_SHIFT) - 1);
2908    
2909          /*  Read the instruction word from memory:  */          /*  Read the instruction word from memory:  */
 #ifdef MODE32  
2910          page = cpu->cd.sh.host_load[(uint32_t)addr >> 12];          page = cpu->cd.sh.host_load[(uint32_t)addr >> 12];
 #else  
         {  
                 const uint32_t mask1 = (1 << DYNTRANS_L1N) - 1;  
                 const uint32_t mask2 = (1 << DYNTRANS_L2N) - 1;  
                 const uint32_t mask3 = (1 << DYNTRANS_L3N) - 1;  
                 uint32_t x1 = (addr >> (64-DYNTRANS_L1N)) & mask1;  
                 uint32_t x2 = (addr >> (64-DYNTRANS_L1N-DYNTRANS_L2N)) & mask2;  
                 uint32_t x3 = (addr >> (64-DYNTRANS_L1N-DYNTRANS_L2N-  
                     DYNTRANS_L3N)) & mask3;  
                 struct DYNTRANS_L2_64_TABLE *l2 = cpu->cd.sh.l1_64[x1];  
                 struct DYNTRANS_L3_64_TABLE *l3 = l2->l3[x2];  
                 page = l3->host_load[x3];  
         }  
 #endif  
2911    
2912          if (page != NULL) {          if (page != NULL) {
2913                  /*  fatal("TRANSLATION HIT!\n");  */                  /*  fatal("TRANSLATION HIT!\n");  */

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

  ViewVC Help
Powered by ViewVC 1.1.26