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

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

revision 35 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 36 by dpavlin, Mon Oct 8 16:21:34 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: memory_sh.c,v 1.15 2007/01/29 18:06:37 debug Exp $   *  $Id: memory_sh.c,v 1.16 2007/03/08 10:02:32 debug Exp $
29   */   */
30    
31  #include <stdio.h>  #include <stdio.h>
# Line 85  static int translate_via_mmu(struct cpu Line 85  static int translate_via_mmu(struct cpu
85    
86                  /*  fatal("urc = %i  ==>  ", urc);  */                  /*  fatal("urc = %i  ==>  ", urc);  */
87                  urc ++;                  urc ++;
88                  if (urc == SH_N_UTLB_ENTRIES || (urb > 0 && urc == urb))                  if (urc >= SH_N_UTLB_ENTRIES || (urb > 0 && urc == urb))
89                          urc = 0;                          urc = 0;
90                  /*  fatal("%i\n", urc);  */                  /*  fatal("%i\n", urc);  */
91    
# Line 141  static int translate_via_mmu(struct cpu Line 141  static int translate_via_mmu(struct cpu
141          if (i == SH_N_UTLB_ENTRIES)          if (i == SH_N_UTLB_ENTRIES)
142                  goto tlb_miss;                  goto tlb_miss;
143    
144          /*  Matching address found! Let's see it is readable/writable, etc:  */          /*  Matching address found! Let's see whether it is
145          d = lo & SH4_PTEL_D;              readable/writable, etc.:  */
146            d = lo & SH4_PTEL_D? 1 : 0;
147          pr = (lo & SH4_PTEL_PR_MASK) >> SH4_PTEL_PR_SHIFT;          pr = (lo & SH4_PTEL_PR_MASK) >> SH4_PTEL_PR_SHIFT;
148    
149          *return_paddr = (vaddr & ~mask) | (lo & mask & 0x1fffffff);          *return_paddr = (vaddr & ~mask) | (lo & mask & 0x1fffffff);
# Line 189  static int translate_via_mmu(struct cpu Line 190  static int translate_via_mmu(struct cpu
190                  case 1:                  case 1:
191                  case 3: if (wf && !d)                  case 3: if (wf && !d)
192                                  goto initial_write_exception;                                  goto initial_write_exception;
193                          return 1;                          return 1 + d;
194                  }                  }
195          }          }
196    
# Line 202  static int translate_via_mmu(struct cpu Line 203  static int translate_via_mmu(struct cpu
203                  return 1;                  return 1;
204          case 3: if (wf && !d)          case 3: if (wf && !d)
205                          goto initial_write_exception;                          goto initial_write_exception;
206                  return 1;                  return 1 + d;
207          }          }
208    
209    

Legend:
Removed from v.35  
changed lines
  Added in v.36

  ViewVC Help
Powered by ViewVC 1.1.26