Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Consistently use pmap_steal_memory() to allocate US...



details:   https://anonhg.NetBSD.org/src/rev/a84211e92179
branches:  trunk
changeset: 499692:a84211e92179
user:      soren <soren%NetBSD.org@localhost>
date:      Mon Nov 27 05:57:25 2000 +0000

description:
Consistently use pmap_steal_memory() to allocate USPACE.

diffstat:

 sys/arch/arc/arc/machdep.c           |  21 ++++++++++-----------
 sys/arch/cobalt/cobalt/machdep.c     |  12 ++++++------
 sys/arch/hpcmips/hpcmips/machdep.c   |  24 +++++++++++-------------
 sys/arch/mipsco/mipsco/machdep.c     |  24 +++++++++++-------------
 sys/arch/newsmips/newsmips/machdep.c |  24 +++++++++++-------------
 sys/arch/pmax/pmax/machdep.c         |   6 +++---
 sys/arch/sgimips/sgimips/machdep.c   |  10 +++++-----
 7 files changed, 57 insertions(+), 64 deletions(-)

diffs (290 lines):

diff -r 1c7234cb08ad -r a84211e92179 sys/arch/arc/arc/machdep.c
--- a/sys/arch/arc/arc/machdep.c        Mon Nov 27 05:17:06 2000 +0000
+++ b/sys/arch/arc/arc/machdep.c        Mon Nov 27 05:57:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.45 2000/09/24 12:32:32 jdolecek Exp $    */
+/*     $NetBSD: machdep.c,v 1.46 2000/11/27 05:57:25 soren Exp $       */
 /*     $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $   */
 
 /*
@@ -647,16 +647,6 @@
                ddb_init(1000, &end, (int*)esym);
 #endif
 #endif
-       /*
-        * Alloc u pages for proc0 stealing KSEG0 memory.
-        */
-       proc0.p_addr = proc0paddr = (struct user *)kernend;
-       proc0.p_md.md_regs = (struct frame *)(kernend + USPACE) - 1;
-       memset(proc0.p_addr, 0, USPACE);
-       curpcb = &proc0.p_addr->u_pcb;
-       curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
-
-       kernend += USPACE;
 
        maxmem = physmem;
 
@@ -723,6 +713,15 @@
        mips_init_msgbuf();
 
        /*
+        * Allocate space for proc0's USPACE.
+        */
+       v = (caddr_t)pmap_steal_memory(USPACE, NULL, NULL); 
+       proc0.p_addr = proc0paddr = (struct user *)v;
+       proc0.p_md.md_regs = (struct frame *)(v + USPACE) - 1;
+       curpcb = &proc0.p_addr->u_pcb;
+       curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
+
+       /*
         * Allocate space for system data structures.  These data structures
         * are allocated here instead of cpu_startup() because physical
         * memory is directly addressable.  We don't have to map these into
diff -r 1c7234cb08ad -r a84211e92179 sys/arch/cobalt/cobalt/machdep.c
--- a/sys/arch/cobalt/cobalt/machdep.c  Mon Nov 27 05:17:06 2000 +0000
+++ b/sys/arch/cobalt/cobalt/machdep.c  Mon Nov 27 05:57:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.23 2000/10/05 02:36:44 cgd Exp $ */
+/*     $NetBSD: machdep.c,v 1.24 2000/11/27 05:57:26 soren Exp $       */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -115,7 +115,7 @@
 mach_init(memsize)
        unsigned int memsize;
 {
-       caddr_t kernend, v, p0;
+       caddr_t kernend, v;
         u_long first, last;
        vsize_t size;
        extern char edata[], end[];
@@ -208,11 +208,11 @@
        mips_init_msgbuf();
 
        /*
-        * Allocate space for proc0's USPACE
+        * Allocate space for proc0's USPACE.
         */
-       p0 = (caddr_t)pmap_steal_memory(USPACE, NULL, NULL); 
-       proc0.p_addr = proc0paddr = (struct user *)p0;
-       proc0.p_md.md_regs = (struct frame *)(p0 + USPACE) - 1;
+       v = (caddr_t)pmap_steal_memory(USPACE, NULL, NULL); 
+       proc0.p_addr = proc0paddr = (struct user *)v;
+       proc0.p_md.md_regs = (struct frame *)(v + USPACE) - 1;
        curpcb = &proc0.p_addr->u_pcb;
        curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
 
diff -r 1c7234cb08ad -r a84211e92179 sys/arch/hpcmips/hpcmips/machdep.c
--- a/sys/arch/hpcmips/hpcmips/machdep.c        Mon Nov 27 05:17:06 2000 +0000
+++ b/sys/arch/hpcmips/hpcmips/machdep.c        Mon Nov 27 05:57:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.35 2000/10/05 02:36:45 cgd Exp $ */
+/*     $NetBSD: machdep.c,v 1.36 2000/11/27 05:57:26 soren Exp $       */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.35 2000/10/05 02:36:45 cgd Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.36 2000/11/27 05:57:26 soren Exp $");
 
 /* from: Utah Hdr: machdep.c 1.63 91/04/24 */
 #include "opt_vr41x1.h"
@@ -360,17 +360,6 @@
        if (esym)
                ddb_init(1000, &end, (int*)esym);
 #endif
-       /*
-        * Alloc u pages for proc0 stealing KSEG0 memory.
-        */
-       proc0.p_addr = proc0paddr = (struct user *)kernend;
-       proc0.p_md.md_regs =
-           (struct frame *)((caddr_t)kernend + UPAGES * PAGE_SIZE) - 1;
-       memset(kernend, 0, UPAGES * PAGE_SIZE);
-       curpcb = &proc0.p_addr->u_pcb;
-       curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
-
-       kernend += UPAGES * PAGE_SIZE;
 
        /* Setup interrupt handler */
        (*platform.os_init)();
@@ -425,6 +414,15 @@
        mips_init_msgbuf();
 
        /*
+        * Allocate space for proc0's USPACE.
+        */
+       v = (caddr_t)pmap_steal_memory(USPACE, NULL, NULL); 
+       proc0.p_addr = proc0paddr = (struct user *)v;
+       proc0.p_md.md_regs = (struct frame *)(v + USPACE) - 1;
+       curpcb = &proc0.p_addr->u_pcb;
+       curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
+
+       /*
         * Allocate space for system data structures.  These data structures
         * are allocated here instead of cpu_startup() because physical
         * memory is directly addressable.  We don't have to map these into
diff -r 1c7234cb08ad -r a84211e92179 sys/arch/mipsco/mipsco/machdep.c
--- a/sys/arch/mipsco/mipsco/machdep.c  Mon Nov 27 05:17:06 2000 +0000
+++ b/sys/arch/mipsco/mipsco/machdep.c  Mon Nov 27 05:57:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.12 2000/10/02 07:57:29 wdk Exp $ */
+/*     $NetBSD: machdep.c,v 1.13 2000/11/27 05:57:26 soren Exp $       */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.12 2000/10/02 07:57:29 wdk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.13 2000/11/27 05:57:26 soren Exp $");
 
 /* from: Utah Hdr: machdep.c 1.63 91/04/24 */
 
@@ -323,17 +323,6 @@
 #endif
 
        /*
-        * Alloc u pages for proc0 stealing KSEG0 memory.
-        */
-       proc0.p_addr = proc0paddr = (struct user *)kernend;
-       proc0.p_md.md_regs = (struct frame *)(kernend + USPACE) - 1;
-       memset(proc0.p_addr, 0, USPACE);
-       curpcb = &proc0.p_addr->u_pcb;
-       curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
-
-       kernend += USPACE;
-
-       /*
         * Load the rest of the available pages into the VM system.
         */
        first = round_page(MIPS_KSEG0_TO_PHYS(kernend));
@@ -347,6 +336,15 @@
        mips_init_msgbuf();
 
        /*
+        * Allocate space for proc0's USPACE.
+        */
+       v = (caddr_t)pmap_steal_memory(USPACE, NULL, NULL); 
+       proc0.p_addr = proc0paddr = (struct user *)v;
+       proc0.p_md.md_regs = (struct frame *)(v + USPACE) - 1;
+       curpcb = &proc0.p_addr->u_pcb;
+       curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
+
+       /*
         * Allocate space for system data structures.  These data structures
         * are allocated here instead of cpu_startup() because physical
         * memory is directly addressable.  We don't have to map these into
diff -r 1c7234cb08ad -r a84211e92179 sys/arch/newsmips/newsmips/machdep.c
--- a/sys/arch/newsmips/newsmips/machdep.c      Mon Nov 27 05:17:06 2000 +0000
+++ b/sys/arch/newsmips/newsmips/machdep.c      Mon Nov 27 05:57:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.48 2000/10/13 17:22:52 tsutsui Exp $     */
+/*     $NetBSD: machdep.c,v 1.49 2000/11/27 05:57:26 soren Exp $       */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.48 2000/10/13 17:22:52 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.49 2000/11/27 05:57:26 soren Exp $");
 
 /* from: Utah Hdr: machdep.c 1.63 91/04/24 */
 
@@ -310,17 +310,6 @@
 #endif
 
        /*
-        * Alloc u pages for proc0 stealing KSEG0 memory.
-        */
-       proc0.p_addr = proc0paddr = (struct user *)kernend;
-       proc0.p_md.md_regs = (struct frame *)(kernend + USPACE) - 1;
-       memset(proc0.p_addr, 0, USPACE);
-       curpcb = &proc0.p_addr->u_pcb;
-       curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
-
-       kernend += USPACE;
-
-       /*
         * Load the rest of the available pages into the VM system.
         */
        first = round_page(MIPS_KSEG0_TO_PHYS(kernend));
@@ -334,6 +323,15 @@
        mips_init_msgbuf();
 
        /*
+        * Allocate space for proc0's USPACE.
+        */
+       v = (caddr_t)pmap_steal_memory(USPACE, NULL, NULL); 
+       proc0.p_addr = proc0paddr = (struct user *)v;
+       proc0.p_md.md_regs = (struct frame *)(v + USPACE) - 1;
+       curpcb = &proc0.p_addr->u_pcb;
+       curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
+
+       /*
         * Allocate space for system data structures.  These data structures
         * are allocated here instead of cpu_startup() because physical
         * memory is directly addressable.  We don't have to map these into
diff -r 1c7234cb08ad -r a84211e92179 sys/arch/pmax/pmax/machdep.c
--- a/sys/arch/pmax/pmax/machdep.c      Mon Nov 27 05:17:06 2000 +0000
+++ b/sys/arch/pmax/pmax/machdep.c      Mon Nov 27 05:57:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.182 2000/11/27 05:17:06 nisimura Exp $   */
+/*     $NetBSD: machdep.c,v 1.183 2000/11/27 05:57:27 soren Exp $      */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.182 2000/11/27 05:17:06 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.183 2000/11/27 05:57:27 soren Exp $");
 
 #include "fs_mfs.h"
 #include "opt_ddb.h"
@@ -357,7 +357,7 @@
        mips_init_msgbuf();
 
        /*
-        * Allocate space for proc0's USPACE
+        * Allocate space for proc0's USPACE.
         */
        v = (caddr_t)pmap_steal_memory(USPACE, NULL, NULL); 
        proc0.p_addr = proc0paddr = (struct user *)v;
diff -r 1c7234cb08ad -r a84211e92179 sys/arch/sgimips/sgimips/machdep.c
--- a/sys/arch/sgimips/sgimips/machdep.c        Mon Nov 27 05:17:06 2000 +0000
+++ b/sys/arch/sgimips/sgimips/machdep.c        Mon Nov 27 05:57:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.6 2000/10/05 02:36:46 cgd Exp $  */
+/*     $NetBSD: machdep.c,v 1.7 2000/11/27 05:57:27 soren Exp $        */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -125,7 +125,7 @@
        char **envp;
 {
        unsigned long first, last;
-       caddr_t kernend, v, p0;
+       caddr_t kernend, v;
        vsize_t size;
        extern char edata[], end[];
        struct arcs_mem *mem;
@@ -271,9 +271,9 @@
        /*
         * Allocate space for proc0's USPACE.
         */
-       p0 = (caddr_t)pmap_steal_memory(USPACE, NULL, NULL); 
-       proc0.p_addr = proc0paddr = (struct user *)p0;
-       proc0.p_md.md_regs = (struct frame *)(p0 + USPACE) - 1;
+       v = (caddr_t)pmap_steal_memory(USPACE, NULL, NULL); 
+       proc0.p_addr = proc0paddr = (struct user *)v;
+       proc0.p_md.md_regs = (struct frame *)(v + USPACE) - 1;
        curpcb = &proc0.p_addr->u_pcb;
        curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
 



Home | Main Index | Thread Index | Old Index