Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/yamt-km]: src/sys/arch/m68k/m68k convert arch/m68k to new apis.
details: https://anonhg.NetBSD.org/src/rev/b0370f382d9f
branches: yamt-km
changeset: 573303:b0370f382d9f
user: yamt <yamt%NetBSD.org@localhost>
date: Wed Jan 26 12:10:35 2005 +0000
description:
convert arch/m68k to new apis.
diffstat:
sys/arch/m68k/m68k/bus_dma.c | 11 +++++++----
sys/arch/m68k/m68k/mappedcopy.c | 10 ++++++----
sys/arch/m68k/m68k/pmap_motorola.c | 32 +++++++++++++++++---------------
sys/arch/m68k/m68k/vm_machdep.c | 8 ++++----
4 files changed, 34 insertions(+), 27 deletions(-)
diffs (223 lines):
diff -r 3988d2087cee -r b0370f382d9f sys/arch/m68k/m68k/bus_dma.c
--- a/sys/arch/m68k/m68k/bus_dma.c Wed Jan 26 11:59:24 2005 +0000
+++ b/sys/arch/m68k/m68k/bus_dma.c Wed Jan 26 12:10:35 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.12 2004/11/28 17:34:46 thorpej Exp $ */
+/* $NetBSD: bus_dma.c,v 1.12.6.1 2005/01/26 12:10:35 yamt Exp $ */
/*
* This file was taken from from alpha/common/bus_dma.c
@@ -46,7 +46,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.12 2004/11/28 17:34:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.12.6.1 2005/01/26 12:10:35 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -668,7 +668,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);
@@ -708,7 +708,10 @@
#endif
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 3988d2087cee -r b0370f382d9f sys/arch/m68k/m68k/mappedcopy.c
--- a/sys/arch/m68k/m68k/mappedcopy.c Wed Jan 26 11:59:24 2005 +0000
+++ b/sys/arch/m68k/m68k/mappedcopy.c Wed Jan 26 12:10:35 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mappedcopy.c,v 1.19 2003/12/04 13:05:16 keihan Exp $ */
+/* $NetBSD: mappedcopy.c,v 1.19.10.1 2005/01/26 12:10:35 yamt Exp $ */
/*
* XXX This doesn't work yet. Soon. --thorpej%NetBSD.org@localhost
@@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mappedcopy.c,v 1.19 2003/12/04 13:05:16 keihan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mappedcopy.c,v 1.19.10.1 2005/01/26 12:10:35 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -129,7 +129,8 @@
#endif
if (CADDR1 == 0)
- CADDR1 = (caddr_t) uvm_km_valloc(kernel_map, PAGE_SIZE);
+ CADDR1 = (caddr_t) uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
+ UVM_KMF_VAONLY);
kva = (vaddr_t)CADDR1;
off = (int)((u_long)fromp & PAGE_MASK);
@@ -188,7 +189,8 @@
#endif
if (CADDR2 == 0)
- CADDR2 = (caddr_t) uvm_km_valloc(kernel_map, PAGE_SIZE);
+ CADDR2 = (caddr_t) uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
+ UVM_KMF_VAONLY);
kva = (vaddr_t) CADDR2;
off = (int)((u_long)top & PAGE_MASK);
diff -r 3988d2087cee -r b0370f382d9f sys/arch/m68k/m68k/pmap_motorola.c
--- a/sys/arch/m68k/m68k/pmap_motorola.c Wed Jan 26 11:59:24 2005 +0000
+++ b/sys/arch/m68k/m68k/pmap_motorola.c Wed Jan 26 12:10:35 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_motorola.c,v 1.12 2005/01/01 21:02:13 yamt Exp $ */
+/* $NetBSD: pmap_motorola.c,v 1.12.4.1 2005/01/26 12:10:35 yamt Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.12 2005/01/01 21:02:13 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.12.4.1 2005/01/26 12:10:35 yamt Exp $");
#include "opt_compat_hpux.h"
@@ -412,7 +412,7 @@
s += page_cnt * sizeof(struct pv_entry); /* pv table */
s += page_cnt * sizeof(char); /* attribute table */
s = round_page(s);
- addr = uvm_km_zalloc(kernel_map, s);
+ addr = uvm_km_alloc(kernel_map, s, 0, UVM_KMF_WIRED | UVM_KMF_ZERO);
if (addr == 0)
panic("pmap_init: can't allocate data structures");
@@ -467,7 +467,7 @@
* Now allocate the space and link the pages together to
* form the KPT free list.
*/
- addr = uvm_km_zalloc(kernel_map, s);
+ addr = uvm_km_alloc(kernel_map, s, 0, UVM_KMF_WIRED | UVM_KMF_ZERO);
if (addr == 0)
panic("pmap_init: cannot allocate KPT free list");
s = ptoa(npages);
@@ -571,9 +571,10 @@
int i;
if (pv_nfree == 0) {
- pvp = (struct pv_page *)uvm_km_zalloc(kernel_map, PAGE_SIZE);
+ pvp = (struct pv_page *)uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
+ UVM_KMF_WIRED | UVM_KMF_ZERO);
if (pvp == 0)
- panic("pmap_alloc_pv: uvm_km_zalloc() failed");
+ panic("pmap_alloc_pv: uvm_km_alloc() failed");
pvp->pvp_pgi.pgi_freelist = pv = &pvp->pvp_pv[1];
for (i = NPVPPG - 2; i; i--, pv++)
pv->pv_next = pv + 1;
@@ -620,7 +621,7 @@
case NPVPPG:
pv_nfree -= NPVPPG - 1;
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
- uvm_km_free(kernel_map, (vaddr_t)pvp, PAGE_SIZE);
+ uvm_km_free(kernel_map, (vaddr_t)pvp, PAGE_SIZE, UVM_KMF_WIRED);
break;
}
}
@@ -685,7 +686,7 @@
for (pvp = pv_page_collectlist.tqh_first; pvp; pvp = npvp) {
npvp = pvp->pvp_pgi.pgi_list.tqe_next;
- uvm_km_free(kernel_map, (vaddr_t)pvp, PAGE_SIZE);
+ uvm_km_free(kernel_map, (vaddr_t)pvp, PAGE_SIZE, UVM_KMF_WIRED);
}
}
@@ -824,8 +825,8 @@
(vaddr_t)pmap->pm_ptab - vm_map_min(kernel_map),
(vaddr_t)pmap->pm_ptab + M68K_MAX_PTSIZE
- vm_map_min(kernel_map));
- uvm_km_free_wakeup(pt_map, (vaddr_t)pmap->pm_ptab,
- M68K_MAX_PTSIZE);
+ uvm_km_free(pt_map, (vaddr_t)pmap->pm_ptab,
+ M68K_MAX_PTSIZE, UVM_KMF_VAONLY);
}
KASSERT(pmap->pm_stab == Segtabzero);
}
@@ -1208,7 +1209,8 @@
*/
if (pmap->pm_ptab == NULL)
pmap->pm_ptab = (pt_entry_t *)
- uvm_km_valloc_wait(pt_map, M68K_MAX_PTSIZE);
+ uvm_km_alloc(pt_map, M68K_MAX_PTSIZE, 0,
+ UVM_KMF_VAONLY | UVM_KMF_WAITVA);
/*
* Segment table entry not valid, we need a new PT page
@@ -2426,9 +2428,8 @@
(vaddr_t)ptpmap->pm_stab + M68K_STSIZE);
uvm_pagefree(PHYS_TO_VM_PAGE((paddr_t)
ptpmap->pm_stpa));
- uvm_km_free_wakeup(st_map,
- (vaddr_t)ptpmap->pm_stab,
- M68K_STSIZE);
+ uvm_km_free(st_map, (vaddr_t)ptpmap->pm_stab,
+ M68K_STSIZE, UVM_KMF_WIRED);
ptpmap->pm_stab = Segtabzero;
ptpmap->pm_stpa = Segtabzeropa;
#if defined(M68040) || defined(M68060)
@@ -2639,7 +2640,8 @@
*/
if (pmap->pm_stab == Segtabzero) {
pmap->pm_stab = (st_entry_t *)
- uvm_km_zalloc(st_map, M68K_STSIZE);
+ uvm_km_alloc(st_map, M68K_STSIZE, 0,
+ UVM_KMF_WIRED | UVM_KMF_ZERO);
(void) pmap_extract(pmap_kernel(), (vaddr_t)pmap->pm_stab,
(paddr_t *)&pmap->pm_stpa);
#if defined(M68040) || defined(M68060)
diff -r 3988d2087cee -r b0370f382d9f sys/arch/m68k/m68k/vm_machdep.c
--- a/sys/arch/m68k/m68k/vm_machdep.c Wed Jan 26 11:59:24 2005 +0000
+++ b/sys/arch/m68k/m68k/vm_machdep.c Wed Jan 26 12:10:35 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.10 2004/09/17 14:11:21 skrll Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.10.6.1 2005/01/26 12:10:35 yamt Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.10 2004/09/17 14:11:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.10.6.1 2005/01/26 12:10:35 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -275,7 +275,7 @@
uva = m68k_trunc_page(bp->b_saveaddr = bp->b_data);
off = (vaddr_t)bp->b_data - uva;
len = m68k_round_page(off + len);
- kva = uvm_km_valloc_wait(phys_map, len);
+ kva = uvm_km_alloc(phys_map, len, 0, UVM_KMF_VAONLY | UVM_KMF_WAITVA);
bp->b_data = (caddr_t)(kva + off);
upmap = vm_map_pmap(&bp->b_proc->p_vmspace->vm_map);
@@ -318,7 +318,7 @@
pmap_kremove(kva, len);
#endif
pmap_update(pmap_kernel());
- uvm_km_free_wakeup(phys_map, kva, len);
+ uvm_km_free(phys_map, kva, len, UVM_KMF_VAONLY);
bp->b_data = bp->b_saveaddr;
bp->b_saveaddr = 0;
}
Home |
Main Index |
Thread Index |
Old Index