Port-atari archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Current kernel with http://gnats.netbsd.org/39965 and pmap patches



tjamaloo%gmail.com@localhost wrote:

> Thanks! I missed that one. I applied patch (but corrected place for minus sign
> for VM_MAX_KERNEL_ADDRESS just like in amiga/include/vmparam.h :))
> 
> Installer panics just like before with 030 cpu, but it works with 060 cpu, so 
> it
> seems there's something funny happening with 030 that we need to sort out.

I don't understand what XXX calculations in amiga_init.c do and
how they map PA of Sysmap (Sysptmap_pa) into VM_MAX_KERNEL_ADDRESS
in mmu040_setup() case... (it's a bit different from other m68k ports)

But in mmu030_setup(), I don't think we can use the same way
to map Sysptmap_pa at the end of KVA with other m68k ports
which have 4KB page (i.e. PS/TIA/TIB == 12/10/10) because
amiga and atari have 8KB page (PS/TIA/TIB == 13/8/11) and
hardware segment table and software Sysptmap have different size.
(but I could be wrong since I'm not an m68k guru ;-)
---

--- atari/atari_init.c.0        2008-12-17 19:12:51.000000000 +0900
+++ atari/atari_init.c  2008-12-17 23:47:19.000000000 +0900
@@ -918,7 +918,7 @@
        u_int           sysptmap_pa;    /* System page table            */
        u_int           kbase;
 {
-       st_entry_t      sg_proto, *sg;
+       st_entry_t      sg_proto, *sg, *esg;
        pt_entry_t      pg_proto, *pg, *epg;
 
        /*
@@ -938,14 +938,20 @@
        }
 
        /* 
-        * invalidate the remainder of the tables
+        * Invalidate the remainder of the tables.
         */
-       /* XXX PAGE_SIZE dependent constant: 256 or 1024 */
-       epg = (u_int *)(sysptmap_pa + (256 - 1) * sizeof(st_entry_t));
-       while(pg < epg) {
+#define TIA_SIZE       256
+       esg = (u_int *)(sysptmap_pa + (TIA_SIZE - 1) * sizeof(st_entry_t));
+       while (sg < esg)
                *sg++ = SG_NV;
+
+       epg = (u_int *)(sysptmap_pa + (NPTEPG - 1) * sizeof(st_entry_t));
+       while (pg < epg)
                *pg++ = PG_NV;
-       }
+
+       /*
+        * Initialize the last one to point Sysptmap.
+        */
        *sg = sysptmap_pa | SG_RW | SG_V;
        *pg = sysptmap_pa | PG_RW | PG_CI | PG_V;
 }

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index