--- trunk/src/cpus/memory_arm.c 2007/10/08 16:19:11 18 +++ trunk/src/cpus/memory_arm.c 2007/10/08 16:19:23 20 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $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 $ * * * TODO/NOTE: The B and/or C bits could also cause the return value to @@ -199,6 +199,16 @@ ap &= 3; *return_addr = (d2 & 0xffff0000) | (vaddr & 0x0000ffff); break; + case 3: { + static int first = 1; + if (first) { + fatal("[ WARNING! ARM course second " + "level page table seems to contain" + " tiny pages; treating as 4K ]\n"); + first = 0; + } + } + subpage = 1; case 2: /* 4KB page: */ ap3 = (d2 >> 10) & 3; ap2 = (d2 >> 8) & 3; @@ -210,15 +220,20 @@ case 0x800: ap = ap2; break; default: ap = ap3; } + /* Ugly hack: (TODO) */ + if ((d2 & 3) == 3) + ap = ap0; if (ap0 != ap1 || ap0 != ap2 || ap0 != ap3) subpage = 1; *return_addr = (d2 & 0xfffff000) | (vaddr & 0x00000fff); break; +#if 0 case 3: /* 1KB page: */ subpage = 1; ap = (d2 >> 4) & 3; *return_addr = (d2 & 0xfffffc00) | (vaddr & 0x000003ff); break; +#endif } access = arm_check_access(cpu, ap, dav, user); if (access > writeflag)