Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Misc cosmetics to reduce diff among hp300 derived m...



details:   https://anonhg.NetBSD.org/src/rev/f9ee80853b8c
branches:  trunk
changeset: 760298:f9ee80853b8c
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Jan 02 08:40:54 2011 +0000

description:
Misc cosmetics to reduce diff among hp300 derived m68k ports.
XXX: too many quirks to merge...

diffstat:

 sys/arch/cesfic/cesfic/pmap_bootstrap.c   |  51 ++++++++++++----------------
 sys/arch/luna68k/luna68k/pmap_bootstrap.c |  49 +++++++++++++++++----------
 sys/arch/mac68k/mac68k/pmap_bootstrap.c   |  30 ++++++++--------
 sys/arch/next68k/next68k/pmap_bootstrap.c |  54 ++++++++++++++----------------
 4 files changed, 92 insertions(+), 92 deletions(-)

diffs (truncated from 625 to 300 lines):

diff -r 37a97fd36136 -r f9ee80853b8c sys/arch/cesfic/cesfic/pmap_bootstrap.c
--- a/sys/arch/cesfic/cesfic/pmap_bootstrap.c   Sun Jan 02 08:22:35 2011 +0000
+++ b/sys/arch/cesfic/cesfic/pmap_bootstrap.c   Sun Jan 02 08:40:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_bootstrap.c,v 1.28 2010/12/25 16:11:11 tsutsui Exp $      */
+/*     $NetBSD: pmap_bootstrap.c,v 1.29 2011/01/02 08:40:54 tsutsui Exp $      */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,38 +36,34 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.28 2010/12/25 16:11:11 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.29 2011/01/02 08:40:54 tsutsui Exp $");
 
 #include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/msgbuf.h>
+#include <uvm/uvm_extern.h>
 
-#include <machine/frame.h>
 #include <machine/cpu.h>
+#include <machine/pte.h>
 #include <machine/vmparam.h>
-#include <machine/pte.h>
-
-#include <uvm/uvm_extern.h>
 
 #define RELOC(v, t)    *((t*)((uintptr_t)&(v) + firstpa - KERNBASE))
 
 extern char *etext;
 extern paddr_t avail_start, avail_end;
 
-void   pmap_bootstrap(paddr_t, paddr_t);
-
 /*
  * Special purpose kernel virtual addresses, used for mapping
  * physical pages for a variety of temporary or permanent purposes:
  *
  *     CADDR1, CADDR2: pmap zero/copy operations
  *     vmmap:          /dev/mem, crash dumps, parity error checking
- *     msgbufp:        kernel message buffer
+ *     msgbufaddr:     kernel message buffer
  */
 void *CADDR1, *CADDR2;
 char *vmmap;
 void *msgbufaddr;
 
+void pmap_bootstrap(paddr_t, paddr_t);
+
 /*
  * Bootstrap the VM system.
  *
@@ -82,7 +78,8 @@
 void
 pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
 {
-       paddr_t kstpa, kptpa, kptmpa, lkptpa, lwp0upa;
+       paddr_t lwp0upa, kstpa, kptmpa, kptpa;
+       paddr_t lkptpa;
        u_int nptpages, kstsize;
        st_entry_t protoste, *ste, *este;
        pt_entry_t protopte, *pte, *epte;
@@ -91,7 +88,7 @@
        /*
         * Calculate important physical addresses:
         *
-        *      lwp0upa         lwp 0 u-area            UPAGES pages
+        *      lwp0upa         lwp0 u-area             UPAGES pages
         *
         *      kstpa           kernel segment table    1 page (!040)
         *                                              N pages (040)
@@ -103,7 +100,7 @@
         *      kptpa           statically allocated
         *                      kernel PT pages         Sysptsize+ pages
         *
-        * [ Sysptsize is the number of pages of PT, IIOMAPSIZE and
+        * [ Sysptsize is the number of pages of PT, and IIOMAPSIZE and
         *   EIOMAPSIZE are the number of PTEs, hence we need to round
         *   the total to a page boundary with IO maps at the end. ]
         *
@@ -186,7 +183,6 @@
                        *ste++ = protoste;
                        protoste += (SG4_LEV3SIZE * sizeof(st_entry_t));
                }
-
                /*
                 * Initialize level 1 descriptors.  We need:
                 *      howmany(nl2desc, SG4_LEV2SIZE)
@@ -200,7 +196,6 @@
                        *ste++ = protoste;
                        protoste += (SG4_LEV2SIZE * sizeof(st_entry_t));
                }
-
                /*
                 * Initialize the final level 1 descriptor to map the next
                 * block of level 2 descriptors for Sysptmap.
@@ -210,11 +205,11 @@
                *ste = protoste;
                /*
                 * Now initialize the final portion of that block of
-                * descriptors to map kptmpa and the "last PT page".
+                * descriptors to map Sysmap and the "last PT page".
                 */
                i = SG4_LEV1SIZE + (nl1desc * SG4_LEV2SIZE);
                ste = (st_entry_t *)kstpa;
-               ste = &ste[i + SG4_LEV2SIZE - NPTEPG / SG4_LEV3SIZE * 2];
+               ste = &ste[i + SG4_LEV2SIZE - (NPTEPG / SG4_LEV3SIZE) * 2];
                este = &ste[NPTEPG / SG4_LEV3SIZE];
                protoste = kptmpa | SG_U | SG_RW | SG_V;
                while (ste < este) {
@@ -255,7 +250,6 @@
                        *pte++ = protopte;
                        protopte += PAGE_SIZE;
                }
-
                /*
                 * Invalidate all remaining entries.
                 */
@@ -265,7 +259,7 @@
                        *pte++ = PG_NV;
                }
                /*
-                * Initialize the last to point to kptmpa and the page
+                * Initialize the last ones to point to Sysptmap and the page
                 * table page allocated earlier.
                 */
                pte = (pt_entry_t *)kptmpa;
@@ -301,7 +295,7 @@
                while (pte < epte)
                        *pte++ = PG_NV;
                /*
-                * Initialize the last to point to kptmpa and the page
+                * Initialize the last ones to point to Sysptmap and the page
                 * table page allocated earlier.
                 */
                ste = (st_entry_t *)kstpa;
@@ -315,6 +309,7 @@
                *ste = lkptpa | SG_RW | SG_V;
                *pte = lkptpa | PG_RW | PG_CI | PG_V;
        }
+
        /*
         * Invalidate all but the final entry in the last kernel PT page.
         * The final entry maps the last page of physical memory to
@@ -327,7 +322,6 @@
        epte = &pte[NPTEPG];
        while (pte < epte)
                *pte++ = PG_NV;
-
        /*
         * Initialize kernel page table.
         * Start by invalidating the `nptpages' that we have allocated.
@@ -336,7 +330,6 @@
        epte = &pte[nptpages * NPTEPG];
        while (pte < epte)
                *pte++ = PG_NV;
-
        /*
         * Validate PTEs for kernel text (RO).
         */
@@ -368,7 +361,7 @@
        }
 
        /*
-        * Calculate important exported kernel addresses and related vaules.
+        * Calculate important exported kernel addresses and related values.
         */
        /*
         * Sysseg: base of kernel segment table
@@ -400,11 +393,11 @@
         * the pmap module.
         *
         * Note about avail_end: msgbuf is initialized just after
-        * avail_end in machdep.c.  Since the last page is used
-        * for rebooting the system (code is copied there and
-        * excution continues from copied code before the MMU
-        * is disabled), the msgbuf will get trounced between
-        * reboots if it's placed in the last physical page.
+        * avail_end in machdep.c.
+        * Since the last page is used for rebooting the system
+        * (code is copied there and excution continues from copied code
+        * before the MMU is disabled), the msgbuf will get trounced
+        * between reboots if it's placed in the last physical page.
         * To work around this, we move avail_end back one more
         * page so the msgbuf can be preserved.
         */
diff -r 37a97fd36136 -r f9ee80853b8c sys/arch/luna68k/luna68k/pmap_bootstrap.c
--- a/sys/arch/luna68k/luna68k/pmap_bootstrap.c Sun Jan 02 08:22:35 2011 +0000
+++ b/sys/arch/luna68k/luna68k/pmap_bootstrap.c Sun Jan 02 08:40:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_bootstrap.c,v 1.29 2011/01/02 07:51:02 tsutsui Exp $      */
+/*     $NetBSD: pmap_bootstrap.c,v 1.30 2011/01/02 08:40:54 tsutsui Exp $      */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -35,19 +35,17 @@
  *     @(#)pmap_bootstrap.c    8.1 (Berkeley) 6/10/93
  */
 
-#include "opt_m68k_arch.h"
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.30 2011/01/02 08:40:54 tsutsui Exp $");
 
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.29 2011/01/02 07:51:02 tsutsui Exp $");
+#include "opt_m68k_arch.h"
 
 #include <sys/param.h>
+#include <uvm/uvm_extern.h>
 
-#include <machine/frame.h>
 #include <machine/cpu.h>
+#include <machine/pte.h>
 #include <machine/vmparam.h>
-#include <machine/pte.h>
-
-#include <uvm/uvm_extern.h>
 
 #define RELOC(v, t)    *((t*)((uintptr_t)&(v) + firstpa))
 
@@ -56,8 +54,6 @@
 extern int maxmem, physmem;
 extern paddr_t avail_start, avail_end;
 
-void   pmap_bootstrap(paddr_t, paddr_t);
-
 /*
  * Special purpose kernel virtual addresses, used for mapping
  * physical pages for a variety of temporary or permanent purposes:
@@ -70,6 +66,8 @@
 char *vmmap;
 void *msgbufaddr;
 
+void pmap_bootstrap(paddr_t, paddr_t);
+
 /*
  * Bootstrap the VM system.
  *
@@ -84,7 +82,7 @@
 void
 pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
 {
-       paddr_t kstpa, kptpa, kptmpa, lwp0upa;
+       paddr_t lwp0upa, kstpa, kptmpa, kptpa;
        u_int nptpages, kstsize;
        st_entry_t protoste, *ste, *este;
        pt_entry_t protopte, *pte, *epte;
@@ -96,7 +94,7 @@
        /*
         * Calculate important physical addresses:
         *
-        *      lwp0upa         lwp 0 u-area            UPAGES pages
+        *      lwp0upa         lwp0 u-area             UPAGES pages
         *
         *      kstpa           kernel segment table    1 page (!040)
         *                                              N pages (040)
@@ -145,6 +143,12 @@
         * each mapping 256kb.  Note that there may be additional "segment
         * table" pages depending on how large MAXKL2SIZE is.
         *
+        * Portions of the last segment of KVA space (0x3FC00000 -
+        * 0x3FFFFFFF) are mapped for the kernel page tables.
+        *
+        * The rest of KVA space (0x40000000 - 0xFFFFFFFF) is mapped
+        * by tt0/tt1 registers for device I/O in locore.s.
+        *
         * XXX cramming two levels of mapping into the single "segment"
         * table on the 68040 is intended as a temporary hack to get things
         * working.  The 224mb of address space that this allows will most
@@ -290,9 +294,9 @@
                 */
                ste = (st_entry_t *)kstpa;
                ste = &ste[SYSMAP_VA >> SEGSHIFT];
-               *ste = kptmpa | SG_RW | SG_V;
                pte = (pt_entry_t *)kptmpa;
                pte = &pte[SYSMAP_VA >> SEGSHIFT];
+               *ste = kptmpa | SG_RW | SG_V;
                *pte = kptmpa | PG_RW | PG_CI | PG_V;
        }
 
@@ -305,7 +309,7 @@
        while (pte < epte)
                *pte++ = PG_NV;
        /*
-        * Validate PTEs for kernel text (RO)
+        * Validate PTEs for kernel text (RO).
         */
        pte = (pt_entry_t *)kptpa;
        pte = &pte[m68k_btop(KERNBASE)];
@@ -339,10 +343,10 @@
 
 #define        PTE2VA(pte)     m68k_ptob(pte - ((pt_entry_t *)kptpa))
 
+       protopte = RELOC(intiobase_phys, u_int) | PG_RW | PG_CI | PG_V;
        epte = &pte[iiomapsize];
-       protopte = RELOC(intiobase_phys, u_int) | PG_RW | PG_CI | PG_V;
-       RELOC(intiobase, char *) = (char *)PTE2VA(pte);
-       RELOC(intiolimit, char *) = (char *)PTE2VA(epte);



Home | Main Index | Thread Index | Old Index