Source-Changes-HG archive

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

[src/yamt-km]: src/sys/arch/powerpc convert arch/powerpc to new apis.



details:   https://anonhg.NetBSD.org/src/rev/9bc4e63a33fb
branches:  yamt-km
changeset: 573310:9bc4e63a33fb
user:      yamt <yamt%NetBSD.org@localhost>
date:      Fri Jan 28 13:52:18 2005 +0000

description:
convert arch/powerpc to new apis.

diffstat:

 sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c |   7 ++++---
 sys/arch/powerpc/ibm4xx/pmap.c           |  22 ++++++++++++----------
 sys/arch/powerpc/marvell/bus_dma.c       |  10 ++++++----
 sys/arch/powerpc/oea/oea_machdep.c       |   6 +++---
 sys/arch/powerpc/powerpc/vm_machdep.c    |   8 ++++----
 5 files changed, 29 insertions(+), 24 deletions(-)

diffs (205 lines):

diff -r 905cf4d6d232 -r 9bc4e63a33fb sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c
--- a/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c  Fri Jan 28 13:40:26 2005 +0000
+++ b/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c  Fri Jan 28 13:52:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibm4xx_machdep.c,v 1.1 2005/01/18 17:11:25 shige Exp $ */
+/*     $NetBSD: ibm4xx_machdep.c,v 1.1.4.1 2005/01/28 13:52:18 yamt Exp $      */
 /*     Original: ibm40x_machdep.c,v 1.3 2005/01/17 17:19:36 shige Exp $ */
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.1 2005/01/18 17:11:25 shige Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.1.4.1 2005/01/28 13:52:18 yamt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -284,7 +284,8 @@
         * Besides, do we really have to put it at the end of core?
         * Let's use static buffer for now
         */
-       if (!(msgbuf_vaddr = uvm_km_alloc(kernel_map, round_page(MSGBUFSIZE))))
+       if (!(msgbuf_vaddr = uvm_km_alloc(kernel_map, round_page(MSGBUFSIZE),
+           0, UVM_KMF_VAONLY)))
                panic("startup: no room for message buffer");
        for (i = 0; i < btoc(MSGBUFSIZE); i++)
                pmap_kenter_pa(msgbuf_vaddr + i * PAGE_SIZE,
diff -r 905cf4d6d232 -r 9bc4e63a33fb sys/arch/powerpc/ibm4xx/pmap.c
--- a/sys/arch/powerpc/ibm4xx/pmap.c    Fri Jan 28 13:40:26 2005 +0000
+++ b/sys/arch/powerpc/ibm4xx/pmap.c    Fri Jan 28 13:52:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.30 2005/01/16 21:35:58 chs Exp $    */
+/*     $NetBSD: pmap.c,v 1.30.2.1 2005/01/28 13:52:18 yamt Exp $       */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.30 2005/01/16 21:35:58 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.30.2.1 2005/01/28 13:52:18 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -211,7 +211,8 @@
                        return (0);
                /* Allocate a page XXXX this will sleep! */
                pm->pm_ptbl[seg] =
-                   (uint *)uvm_km_zalloc(kernel_map, PAGE_SIZE);
+                   (uint *)uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
+                   UVM_KMF_WIRED | UVM_KMF_ZERO);
        }
        oldpte = pm->pm_ptbl[seg][ptn];
        pm->pm_ptbl[seg][ptn] = pte;
@@ -443,7 +444,7 @@
 
        sz = (vsize_t)((sizeof(struct pv_entry) + 1) * npgs);
        sz = round_page(sz);
-       addr = uvm_km_zalloc(kernel_map, sz);
+       addr = uvm_km_alloc(kernel_map, sz, 0, UVM_KMF_WIRED | UVM_KMF_ZERO);
        s = splvm();
        pv = pv_table = (struct pv_entry *)addr;
        for (i = npgs; --i >= 0;)
@@ -623,7 +624,7 @@
        for (i = 0; i < STSZ; i++)
                if (pm->pm_ptbl[i]) {
                        uvm_km_free(kernel_map, (vaddr_t)pm->pm_ptbl[i],
-                           PAGE_SIZE);
+                           PAGE_SIZE, UVM_KMF_WIRED);
                        pm->pm_ptbl[i] = NULL;
                }
        if (pm->pm_ctx)
@@ -1532,14 +1533,15 @@
        int ref, mod;
 
        /* Allocate a page */
-       va = (vaddr_t)uvm_km_zalloc(kernel_map, PAGE_SIZE);
+       va = (vaddr_t)uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
+           UVM_KMF_WIRED | UVM_KMF_ZERO);
        loc = (int*)va;
 
        pmap_extract(pmap_kernel(), va, &pa);
        pg = PHYS_TO_VM_PAGE(pa);
        pmap_unwire(pmap_kernel(), va);
 
-       pmap_remove(pmap_kernel(), va, va+1);
+       pmap_kremove(va, PAGE_SIZE);
        pmap_enter(pmap_kernel(), va, pa, VM_PROT_ALL, 0);
        pmap_update(pmap_kernel());
 
@@ -1786,8 +1788,8 @@
        printf("Checking cleared page: ref %d, mod %d\n",
               ref, mod);
 
-       pmap_enter(pmap_kernel(), va, pa, VM_PROT_ALL,
-               VM_PROT_ALL|PMAP_WIRED);
-       uvm_km_free(kernel_map, (vaddr_t)va, PAGE_SIZE);
+       pmap_remove(pmap_kernel(), va, va + PAGE_SIZE);
+       pmap_kenter_pa(va, pa, VM_PROT_ALL, VM_PROT_ALL);
+       uvm_km_free(kernel_map, (vaddr_t)va, PAGE_SIZE, UVM_KMF_WIRED);
 }
 #endif
diff -r 905cf4d6d232 -r 9bc4e63a33fb sys/arch/powerpc/marvell/bus_dma.c
--- a/sys/arch/powerpc/marvell/bus_dma.c        Fri Jan 28 13:40:26 2005 +0000
+++ b/sys/arch/powerpc/marvell/bus_dma.c        Fri Jan 28 13:52:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.6 2004/11/28 17:34:46 thorpej Exp $      */
+/*     $NetBSD: bus_dma.c,v 1.6.6.1 2005/01/28 13:52:18 yamt Exp $     */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.6 2004/11/28 17:34:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.6.6.1 2005/01/28 13:52:18 yamt Exp $");
 
 #define DEBUG 1
 
@@ -741,7 +741,7 @@
 
        size = round_page(size);
 
-       va = uvm_km_valloc(kernel_map, size);
+       va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY);
 
        if (va == 0)
                return (ENOMEM);
@@ -782,7 +782,9 @@
 
        size = round_page(size);
 
-       uvm_km_free(kernel_map, (vaddr_t)kva, size);
+       pmap_remove(pmap_kernel(), (vaddr_t)kva, (vaddr_t)kva + size);
+       pmap_update(pmap_kernel());
+       uvm_km_free(kernel_map, (vaddr_t)kva, size, UVM_KMF_VAONLY);
 }
 
 /*
diff -r 905cf4d6d232 -r 9bc4e63a33fb sys/arch/powerpc/oea/oea_machdep.c
--- a/sys/arch/powerpc/oea/oea_machdep.c        Fri Jan 28 13:40:26 2005 +0000
+++ b/sys/arch/powerpc/oea/oea_machdep.c        Fri Jan 28 13:52:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: oea_machdep.c,v 1.19 2004/06/26 21:48:30 kleink Exp $  */
+/*     $NetBSD: oea_machdep.c,v 1.19.6.1 2005/01/28 13:52:18 yamt Exp $        */
 
 /*
  * Copyright (C) 2002 Matt Thomas
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.19 2004/06/26 21:48:30 kleink Exp $");
+__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.19.6.1 2005/01/28 13:52:18 yamt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -802,7 +802,7 @@
        faddr = trunc_page(pa);
        off = pa - faddr;
        len = round_page(off + len);
-       va = taddr = uvm_km_valloc(kernel_map, len);
+       va = taddr = uvm_km_alloc(kernel_map, len, 0, UVM_KMF_VAONLY);
 
        if (va == 0)
                return NULL;
diff -r 905cf4d6d232 -r 9bc4e63a33fb sys/arch/powerpc/powerpc/vm_machdep.c
--- a/sys/arch/powerpc/powerpc/vm_machdep.c     Fri Jan 28 13:40:26 2005 +0000
+++ b/sys/arch/powerpc/powerpc/vm_machdep.c     Fri Jan 28 13:52:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.62 2004/09/17 14:11:21 skrll Exp $    */
+/*     $NetBSD: vm_machdep.c,v 1.62.6.1 2005/01/28 13:52:18 yamt Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.62 2004/09/17 14:11:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.62.6.1 2005/01/28 13:52:18 yamt Exp $");
 
 #include "opt_altivec.h"
 #include "opt_multiprocessor.h"
@@ -301,7 +301,7 @@
        faddr = trunc_page(uaddr);
        off = uaddr - faddr;
        len = round_page(off + len);
-       taddr = uvm_km_valloc_wait(phys_map, len);
+       taddr = uvm_km_alloc(phys_map, len, 0, UVM_KMF_VAONLY | UVM_KMF_WAITVA);
        kaddr = taddr + off;
        for (; len > 0; len -= PAGE_SIZE) {
                (void) pmap_extract(vm_map_pmap(&p->p_vmspace->vm_map),
@@ -326,7 +326,7 @@
        off = kaddr - addr;
        len = round_page(off + len);
        pmap_kremove(addr, len);
-       uvm_km_free_wakeup(phys_map, addr, len);
+       uvm_km_free(phys_map, addr, len, UVM_KMF_VAONLY);
 }
 #endif /* PPC_IBM4XX */
 



Home | Main Index | Thread Index | Old Index