Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/yamt-km]: src/sys/arch/xen (re-)convert arch/xen to the new API.
details: https://anonhg.NetBSD.org/src/rev/57661ac5b4f0
branches: yamt-km
changeset: 573381:57661ac5b4f0
user: yamt <yamt%NetBSD.org@localhost>
date: Sat Mar 19 09:06:56 2005 +0000
description:
(re-)convert arch/xen to the new API.
XXX except for xbdback.c and xennetback.c, because i'm not sure
what they're doing.
diffstat:
sys/arch/xen/i386/xen_shm_machdep.c | 5 +++--
sys/arch/xen/x86/bus_dma.c | 8 +++++---
sys/arch/xen/xen/if_xennet.c | 10 ++++++----
sys/arch/xen/xen/xbd.c | 17 +++++++++--------
4 files changed, 23 insertions(+), 17 deletions(-)
diffs (144 lines):
diff -r 7e4d5bade81c -r 57661ac5b4f0 sys/arch/xen/i386/xen_shm_machdep.c
--- a/sys/arch/xen/i386/xen_shm_machdep.c Sat Mar 19 08:32:44 2005 +0000
+++ b/sys/arch/xen/i386/xen_shm_machdep.c Sat Mar 19 09:06:56 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_shm_machdep.c,v 1.5.4.2 2005/03/19 08:33:22 yamt Exp $ */
+/* $NetBSD: xen_shm_machdep.c,v 1.5.4.3 2005/03/19 09:06:56 yamt Exp $ */
/*
* Copyright (c) 2005 Manuel Bouyer.
@@ -100,7 +100,8 @@
panic("xen_shm_init can't prime pool");
}
- xen_shm_base_address = uvm_km_valloc(kernel_map, xen_shm_size);
+ xen_shm_base_address = uvm_km_alloc(kernel_map, xen_shm_size, 0,
+ UVM_KMF_VAONLY);
xen_shm_end_address = xen_shm_base_address + xen_shm_size;
xen_shm_base_address_pg = xen_shm_base_address >> PAGE_SHIFT;
if (xen_shm_base_address == 0) {
diff -r 7e4d5bade81c -r 57661ac5b4f0 sys/arch/xen/x86/bus_dma.c
--- a/sys/arch/xen/x86/bus_dma.c Sat Mar 19 08:32:44 2005 +0000
+++ b/sys/arch/xen/x86/bus_dma.c Sat Mar 19 09:06:56 2005 +0000
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.1.4.1 2005/03/19 08:33:26 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.1.4.2 2005/03/19 09:06:56 yamt Exp $");
/*
* The following is included because _bus_dma_uiomove is derived from
@@ -1023,7 +1023,7 @@
nocache = (flags & BUS_DMA_NOCACHE) != 0 && pmap_cpu_has_pg_n();
marked = 0;
- va = uvm_km_valloc(kernel_map, size);
+ va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY);
if (va == 0)
return (ENOMEM);
@@ -1096,7 +1096,9 @@
if (marked)
pmap_tlb_shootnow(cpumask);
- 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 7e4d5bade81c -r 57661ac5b4f0 sys/arch/xen/xen/if_xennet.c
--- a/sys/arch/xen/xen/if_xennet.c Sat Mar 19 08:32:44 2005 +0000
+++ b/sys/arch/xen/xen/if_xennet.c Sat Mar 19 09:06:56 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_xennet.c,v 1.11.8.2 2005/03/19 08:33:26 yamt Exp $ */
+/* $NetBSD: if_xennet.c,v 1.11.8.3 2005/03/19 09:06:56 yamt Exp $ */
/*
*
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.11.8.2 2005/03/19 08:33:26 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.11.8.3 2005/03/19 09:06:56 yamt Exp $");
#include "opt_inet.h"
#include "rnd.h"
@@ -443,11 +443,13 @@
if (sc->sc_backend_state == BEST_CLOSED) {
/* Move from CLOSED to DISCONNECTED state. */
sc->sc_tx = (netif_tx_interface_t *)
- uvm_km_valloc_align(kernel_map, PAGE_SIZE, PAGE_SIZE);
+ uvm_km_alloc(kernel_map, PAGE_SIZE, PAGE_SIZE,
+ UVM_KMF_VAONLY);
if (sc->sc_tx == NULL)
panic("netif: no tx va");
sc->sc_rx = (netif_rx_interface_t *)
- uvm_km_valloc_align(kernel_map, PAGE_SIZE, PAGE_SIZE);
+ uvm_km_alloc(kernel_map, PAGE_SIZE, PAGE_SIZE,
+ UVM_KMF_VAONLY);
if (sc->sc_rx == NULL)
panic("netif: no rx va");
sc->sc_pg_tx = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_ZERO);
diff -r 7e4d5bade81c -r 57661ac5b4f0 sys/arch/xen/xen/xbd.c
--- a/sys/arch/xen/xen/xbd.c Sat Mar 19 08:32:44 2005 +0000
+++ b/sys/arch/xen/xen/xbd.c Sat Mar 19 09:06:56 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xbd.c,v 1.12.6.2 2005/03/19 08:33:26 yamt Exp $ */
+/* $NetBSD: xbd.c,v 1.12.6.3 2005/03/19 09:06:56 yamt Exp $ */
/*
*
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd.c,v 1.12.6.2 2005/03/19 08:33:26 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd.c,v 1.12.6.3 2005/03/19 09:06:56 yamt Exp $");
#include "xbd.h"
#include "rnd.h"
@@ -439,8 +439,8 @@
blkif_response_t rsp;
paddr_t pa;
- buf = (vdisk_t *)uvm_km_kmemalloc1(kmem_map, NULL,
- PAGE_SIZE, PAGE_SIZE, UVM_UNKNOWN_OFFSET, 0);
+ buf = (vdisk_t *)uvm_km_alloc(kmem_map, PAGE_SIZE, PAGE_SIZE,
+ UVM_KMF_WIRED);
pmap_extract(pmap_kernel(), (vaddr_t)buf, &pa);
/* Probe for disk information. */
memset(&req, 0, sizeof(req));
@@ -456,7 +456,7 @@
memcpy(disk_info, buf, nr * sizeof(vdisk_t));
- uvm_km_free(kmem_map, (vaddr_t)buf, PAGE_SIZE);
+ uvm_km_free(kmem_map, (vaddr_t)buf, PAGE_SIZE, UVM_KMF_WIRED);
return nr;
}
@@ -519,7 +519,8 @@
/* Free resources associated with old device channel. */
if (blk_ring) {
- uvm_km_free(kmem_map, (vaddr_t)blk_ring, PAGE_SIZE);
+ uvm_km_free(kmem_map, (vaddr_t)blk_ring, PAGE_SIZE,
+ UVM_KMF_WIRED);
blk_ring = NULL;
}
@@ -547,8 +548,8 @@
{
if (blk_ring == NULL)
- blk_ring = (blkif_ring_t *)uvm_km_kmemalloc1(kmem_map, NULL,
- PAGE_SIZE, PAGE_SIZE, UVM_UNKNOWN_OFFSET, 0);
+ blk_ring = (blkif_ring_t *)uvm_km_alloc(kmem_map,
+ PAGE_SIZE, PAGE_SIZE, UVM_KMF_WIRED);
memset(blk_ring, 0, PAGE_SIZE);
blk_ring->req_prod = blk_ring->resp_prod = resp_cons = req_prod =
last_req_prod = 0;
Home |
Main Index |
Thread Index |
Old Index