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

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

revision 18 by dpavlin, Mon Oct 8 16:19:11 2007 UTC revision 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: memory_arm.c,v 1.27 2005/10/23 14:24:13 debug Exp $   *  $Id: memory_arm.c,v 1.30 2005/11/05 17:56:46 debug Exp $
29   *   *
30   *   *
31   *  TODO/NOTE:  The B and/or C bits could also cause the return value to   *  TODO/NOTE:  The B and/or C bits could also cause the return value to
# Line 199  int arm_translate_address_mmu(struct cpu Line 199  int arm_translate_address_mmu(struct cpu
199                          ap &= 3;                          ap &= 3;
200                          *return_addr = (d2 & 0xffff0000) | (vaddr & 0x0000ffff);                          *return_addr = (d2 & 0xffff0000) | (vaddr & 0x0000ffff);
201                          break;                          break;
202                    case 3: {
203                                    static int first = 1;
204                                    if (first) {
205                                            fatal("[ WARNING! ARM course second "
206                                                "level page table seems to contain"
207                                                " tiny pages; treating as 4K ]\n");
208                                            first = 0;
209                                    }
210                            }
211                            subpage = 1;
212                  case 2: /*  4KB page:  */                  case 2: /*  4KB page:  */
213                          ap3 = (d2 >> 10) & 3;                          ap3 = (d2 >> 10) & 3;
214                          ap2 = (d2 >>  8) & 3;                          ap2 = (d2 >>  8) & 3;
# Line 210  int arm_translate_address_mmu(struct cpu Line 220  int arm_translate_address_mmu(struct cpu
220                          case 0x800: ap = ap2; break;                          case 0x800: ap = ap2; break;
221                          default:    ap = ap3;                          default:    ap = ap3;
222                          }                          }
223                            /*  Ugly hack: (TODO)  */
224                            if ((d2 & 3) == 3)
225                                    ap = ap0;
226                          if (ap0 != ap1 || ap0 != ap2 || ap0 != ap3)                          if (ap0 != ap1 || ap0 != ap2 || ap0 != ap3)
227                                  subpage = 1;                                  subpage = 1;
228                          *return_addr = (d2 & 0xfffff000) | (vaddr & 0x00000fff);                          *return_addr = (d2 & 0xfffff000) | (vaddr & 0x00000fff);
229                          break;                          break;
230    #if 0
231                  case 3: /*  1KB page:  */                  case 3: /*  1KB page:  */
232                          subpage = 1;                          subpage = 1;
233                          ap = (d2 >> 4) & 3;                          ap = (d2 >> 4) & 3;
234                          *return_addr = (d2 & 0xfffffc00) | (vaddr & 0x000003ff);                          *return_addr = (d2 & 0xfffffc00) | (vaddr & 0x000003ff);
235                          break;                          break;
236    #endif
237                  }                  }
238                  access = arm_check_access(cpu, ap, dav, user);                  access = arm_check_access(cpu, ap, dav, user);
239                  if (access > writeflag)                  if (access > writeflag)

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

  ViewVC Help
Powered by ViewVC 1.1.26