Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbsh3 Sync with -current.



details:   https://anonhg.NetBSD.org/src/rev/a5ec7420633a
branches:  trunk
changeset: 476355:a5ec7420633a
user:      tsubai <tsubai%NetBSD.org@localhost>
date:      Tue Sep 14 11:21:26 1999 +0000

description:
Sync with -current.

diffstat:

 sys/arch/evbsh3/conf/CQREEKSH3     |    3 +-
 sys/arch/evbsh3/evbsh3/genassym.cf |   13 +-
 sys/arch/evbsh3/evbsh3/locore.s    |   23 ++---
 sys/arch/evbsh3/evbsh3/machdep.c   |  148 +++----------------------------------
 4 files changed, 31 insertions(+), 156 deletions(-)

diffs (truncated from 317 to 300 lines):

diff -r 5577327e332a -r a5ec7420633a sys/arch/evbsh3/conf/CQREEKSH3
--- a/sys/arch/evbsh3/conf/CQREEKSH3    Tue Sep 14 11:20:52 1999 +0000
+++ b/sys/arch/evbsh3/conf/CQREEKSH3    Tue Sep 14 11:21:26 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: CQREEKSH3,v 1.2 1999/09/13 16:26:17 msaitoh Exp $
+#      $NetBSD: CQREEKSH3,v 1.3 1999/09/14 11:21:26 tsubai Exp $
 #
 #      GENERIC -- everything that's currently supported
 #
@@ -69,6 +69,7 @@
 
 # Compatibility options
 options        COMPAT_13       # NetBSD 1.3,
+options        COMPAT_14       # NetBSD 1.4,
 options        COMPAT_43       # and 4.3BSD
 
 # Executable format options
diff -r 5577327e332a -r a5ec7420633a sys/arch/evbsh3/evbsh3/genassym.cf
--- a/sys/arch/evbsh3/evbsh3/genassym.cf        Tue Sep 14 11:20:52 1999 +0000
+++ b/sys/arch/evbsh3/evbsh3/genassym.cf        Tue Sep 14 11:21:26 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.1 1999/09/13 10:30:26 itojun Exp $
+#      $NetBSD: genassym.cf,v 1.2 1999/09/14 11:21:27 tsubai Exp $
 
 #
 # Copyright (c) 1995, 1997 Charles M. Hannum.  All rights reserved.
@@ -60,12 +60,11 @@
 
 define SRUN                    SRUN
 
-define PTDPTDI                 PTDPTDI
-define KPTDI                   KPTDI
-define NKPDE_BASE              NKPDE_BASE
-define NKPDE_MAX               NKPDE_MAX
-define NKPDE_SCALE             NKPDE_SCALE
-define APTDPTDI                APTDPTDI
+define PDSLOT_PTE              PDSLOT_PTE
+define PDSLOT_APTE             PDSLOT_APTE
+define PDSLOT_KERN             PDSLOT_KERN
+define NKPTP_MIN               NKPTP_MIN
+define NKPTP_MAX               NKPTP_MAX
 
 define VM_MAXUSER_ADDRESS      (int)VM_MAXUSER_ADDRESS
 
diff -r 5577327e332a -r a5ec7420633a sys/arch/evbsh3/evbsh3/locore.s
--- a/sys/arch/evbsh3/evbsh3/locore.s   Tue Sep 14 11:20:52 1999 +0000
+++ b/sys/arch/evbsh3/evbsh3/locore.s   Tue Sep 14 11:21:26 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.1 1999/09/13 10:30:26 itojun Exp $        */
+/*     $NetBSD: locore.s,v 1.2 1999/09/14 11:21:27 tsubai Exp $        */
 
 /*-
  * Copyright (c) 1993, 1994, 1995, 1997
@@ -222,23 +222,22 @@
 /*
  * PTmap is recursive pagemap at top of virtual address space.
  * Within PTmap, the page directory can be found (third indirection).
+ *
+ * XXX 4 == sizeof pde
  */
-       .globl  _PTmap,_PTD,_PTDpde,_Sysmap
-
-       .set    _PTmap,(PTDPTDI << PDSHIFT)
-       .set    _PTD,(_PTmap + PTDPTDI * NBPG)
-       .set    _PTDpde,(_PTD + PTDPTDI * 4)    /* XXX 4 == sizeof pde */
-       .set    _Sysmap,(_PTmap + KPTDI * NBPG)
-
+       .set    _C_LABEL(PTmap), (PDSLOT_PTE << PDSHIFT)
+       .set    _C_LABEL(PTD), (_C_LABEL(PTmap) + PDSLOT_PTE * NBPG)
+       .set    _C_LABEL(PTDpde), (_C_LABEL(PTD) + PDSLOT_PTE * 4)
 
 /*
  * APTmap, APTD is the alternate recursive pagemap.
  * It's used when modifying another process's page tables.
+ *
+ * XXX 4 == sizeof pde
  */
-       .globl  _APTmap,_APTD,_APTDpde
-       .set    _APTmap,(APTDPTDI << PDSHIFT)
-       .set    _APTD,(_APTmap + APTDPTDI * NBPG)
-       .set    _APTDpde,(_PTD + APTDPTDI * 4)  /* XXX 4 == sizeof pde */
+       .set    _C_LABEL(APTmap),(PDSLOT_APTE << PDSHIFT)
+       .set    _C_LABEL(APTD),(_C_LABEL(APTmap) + PDSLOT_APTE * NBPG)
+       .set    _C_LABEL(APTDpde),(_C_LABEL(PTD) + PDSLOT_APTE * 4)
 
 /*
  * Initialization
diff -r 5577327e332a -r a5ec7420633a sys/arch/evbsh3/evbsh3/machdep.c
--- a/sys/arch/evbsh3/evbsh3/machdep.c  Tue Sep 14 11:20:52 1999 +0000
+++ b/sys/arch/evbsh3/evbsh3/machdep.c  Tue Sep 14 11:21:26 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.1 1999/09/13 10:30:26 itojun Exp $       */
+/*     $NetBSD: machdep.c,v 1.2 1999/09/14 11:21:27 tsubai Exp $       */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -75,7 +75,6 @@
  *     @(#)machdep.c   7.4 (Berkeley) 6/3/91
  */
 
-#include "opt_bufcache.h"
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
 #include "opt_memsize.h"
@@ -103,15 +102,6 @@
 #include <sys/device.h>
 #include <sys/extent.h>
 #include <sys/syscallargs.h>
-#ifdef SYSVMSG
-#include <sys/msg.h>
-#endif
-#ifdef SYSVSEM
-#include <sys/sem.h>
-#endif
-#ifdef SYSVSHM
-#include <sys/shm.h>
-#endif
 
 #ifdef KGDB
 #include <sys/kgdb.h>
@@ -156,26 +146,6 @@
 
 char bootinfo[BOOTINFO_MAXSIZE];
 
-/*
- * Declare these as initialized data so we can patch them.
- */
-int    nswbuf = 0;
-#ifdef NBUF
-int    nbuf = NBUF;
-#else
-int    nbuf = 0;
-#endif
-#ifdef BUFPAGES
-int    bufpages = BUFPAGES;
-#else
-int    bufpages = 0;
-#endif
-#ifdef BUFCACHE
-int    bufcache = BUFCACHE;    /* % of RAM to use for buffer cache */
-#else
-int    bufcache = 0;           /* fallback to old algorithm */
-#endif
-
 int    physmem;
 int    dumpmem_low;
 int    dumpmem_high;
@@ -217,7 +187,6 @@
 static int ioport_malloc_safe;
 
 void   setup_bootinfo __P((void));
-caddr_t        allocsys __P((caddr_t));
 void   dumpsys __P((void));
 void   identifycpu __P((void));
 void   initSH3 __P((vaddr_t));
@@ -255,22 +224,24 @@
        vaddr_t minaddr, maxaddr;
        vsize_t size;
        struct pcb *pcb;
+       char pbuf[9];
        /* int x; */
 
        printf(version);
 
        sprintf(cpu_model, "Hitachi SH3");
 
-       printf("real mem  = %d\n", ctob(physmem));
+       format_bytes(pbuf, sizeof(pbuf), ctob(physmem));
+       printf("total memory = %s\n", pbuf);
 
        /*
         * Find out how much space we need, allocate it,
         * and then give everything true virtual addresses.
         */
-       sz = (int)allocsys((caddr_t)0);
+       sz = (int)allocsys(NULL, NULL);
        if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0)
                panic("startup: no room for tables");
-       if (allocsys(v) - v != sz)
+       if (allocsys(v, NULL) - v != sz)
                panic("startup: table size inconsistency");
 
        /*
@@ -318,13 +289,8 @@
                        if (pg == NULL)
                                panic("cpu_startup: not enough memory for "
                                    "buffer cache");
-#if defined(PMAP_NEW)
-                       pmap_kenter_pgs(curbuf, &pg, 1);
-#else
-                       pmap_enter(kernel_map->pmap, curbuf,
-                                  VM_PAGE_TO_PHYS(pg), VM_PROT_ALL, TRUE,
-                                  VM_PROT_ALL);
-#endif
+                       pmap_kenter_pa(curbuf, VM_PAGE_TO_PHYS(pg),
+                                       VM_PROT_READ|VM_PROT_WRITE);
                        curbuf += PAGE_SIZE;
                        curbufsize -= PAGE_SIZE;
                }
@@ -356,9 +322,10 @@
        for (i = 1; i < ncallout; i++)
                callout[i-1].c_next = &callout[i];
 
-       printf("avail mem = %ld\n", ptoa(uvmexp.free));
-       printf("using %d buffers containing %d bytes of memory\n",
-               nbuf, bufpages * CLBYTES);
+       format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
+       printf("avail memory = %s\n", pbuf);
+       format_bytes(pbuf, sizeof(pbuf), bufpages * CLBYTES);
+       printf("using %d buffers containing %s of memory\n", nbuf, pbuf);
 
        /*
         * Set up buffers, so they can be used to read disk labels.
@@ -383,103 +350,12 @@
 }
 
 /*
- * Allocate space for system data structures.  We are given
- * a starting virtual address and we return a final virtual
- * address; along the way we set each data structure pointer.
- *
- * We call allocsys() with 0 to find out how much space we want,
- * allocate that much and fill it with zeroes, and then call
- * allocsys() again with the correct base virtual address.
- */
-caddr_t
-allocsys(v)
-       caddr_t v;
-{
-
-#define        valloc(name, type, num) \
-           v = (caddr_t)(((name) = (type *)v) + (num))
-#ifdef REAL_CLISTS
-       valloc(cfree, struct cblock, nclist);
-#endif
-       valloc(callout, struct callout, ncallout);
-#ifdef SYSVSHM
-       valloc(shmsegs, struct shmid_ds, shminfo.shmmni);
-#endif
-#ifdef SYSVSEM
-       valloc(sema, struct semid_ds, seminfo.semmni);
-       valloc(sem, struct sem, seminfo.semmns);
-       /* This is pretty disgusting! */
-       valloc(semu, int, (seminfo.semmnu * seminfo.semusz) / sizeof(int));
-#endif
-#ifdef SYSVMSG
-       valloc(msgpool, char, msginfo.msgmax);
-       valloc(msgmaps, struct msgmap, msginfo.msgseg);
-       valloc(msghdrs, struct msg, msginfo.msgtql);
-       valloc(msqids, struct msqid_ds, msginfo.msgmni);
-#endif
-
-       /*
-        * If necessary, determine the number of pages to use for the
-        * buffer cache.  We allocate 1/2 as many swap buffer headers
-        * as file I/O buffers.
-        */
-       if (bufpages == 0) {
-               if (bufcache == 0) {            /* use old algorithm */
-                       /*
-                        * Determine how many buffers to allocate. We use 10%
-                        * of the first 2MB of memory, and 5% of the rest, with
-                        * a minimum of 16 buffers.
-                        */
-                       if (physmem < btoc(2 * 1024 * 1024))
-                               bufpages = physmem / (10 * CLSIZE);
-                       else
-                               bufpages = (btoc(2 * 1024 * 1024) + physmem) /
-                                   (20 * CLSIZE);
-               } else {
-                       /*
-                        * Set size of buffer cache to physmem/bufcache * 100
-                        * (i.e., bufcache % of physmem).
-                        */
-                       if (bufcache < 5 || bufcache > 95) {
-                               printf(
-               "warning: unable to set bufcache to %d%% of RAM, using 10%%",
-                                   bufcache);
-                               bufcache = 10;
-                       }
-                       bufpages= physmem / (CLSIZE * 100) * bufcache;
-               }
-       }
-       if (nbuf == 0) {
-               nbuf = bufpages;
-               if (nbuf < 16)
-                       nbuf = 16;
-       }
-
-       /*
-        * XXX stopgap measure to prevent wasting too much KVM on
-        * the sparsely filled buffer cache.
-        */
-       if (nbuf * MAXBSIZE > VM_MAX_KERNEL_BUF)
-               nbuf = VM_MAX_KERNEL_BUF / MAXBSIZE;
-
-       if (nswbuf == 0) {
-               nswbuf = (nbuf / 2) &~ 1;       /* force even */
-               if (nswbuf > 256)
-                       nswbuf = 256;           /* sanity */



Home | Main Index | Thread Index | Old Index