diff --git a/sys/arch/algor/algor/bus_dma.c b/sys/arch/algor/algor/bus_dma.c index 46e9972edd24..d441aa8e862d 100644 --- a/sys/arch/algor/algor/bus_dma.c +++ b/sys/arch/algor/algor/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.13 2005/04/01 11:59:22 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.14 2005/11/24 13:08:32 yamt Exp $ */ /*- * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.13 2005/04/01 11:59:22 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.14 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -652,6 +652,8 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, use K0SEG, to avoid @@ -667,7 +669,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/alpha/common/bus_dma.c b/sys/arch/alpha/common/bus_dma.c index a2a9d6b90204..33bf5710fc2a 100644 --- a/sys/arch/alpha/common/bus_dma.c +++ b/sys/arch/alpha/common/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.59 2005/07/30 17:25:51 mhitch Exp $ */ +/* $NetBSD: bus_dma.c,v 1.60 2005/11/24 13:08:32 yamt Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.59 2005/07/30 17:25:51 mhitch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.60 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -574,6 +574,8 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, use K0SEG, to avoid @@ -586,7 +588,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/arc/arc/bus_dma.c b/sys/arch/arc/arc/bus_dma.c index 637ebc4e2f7a..93b1e7b8ef54 100644 --- a/sys/arch/arc/arc/bus_dma.c +++ b/sys/arch/arc/arc/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.24 2005/04/01 11:59:23 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.25 2005/11/24 13:08:32 yamt Exp $ */ /* NetBSD: bus_dma.c,v 1.20 2000/01/10 03:24:36 simonb Exp */ /*- @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.24 2005/04/01 11:59:23 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.25 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -668,6 +668,8 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid @@ -683,7 +685,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return ENOMEM; diff --git a/sys/arch/arc/arc/bus_space_sparse.c b/sys/arch/arc/arc/bus_space_sparse.c index 17b8e62de76e..12c6c9d3832e 100644 --- a/sys/arch/arc/arc/bus_space_sparse.c +++ b/sys/arch/arc/arc/bus_space_sparse.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space_sparse.c,v 1.12 2005/04/01 11:59:23 yamt Exp $ */ +/* $NetBSD: bus_space_sparse.c,v 1.13 2005/11/24 13:08:32 yamt Exp $ */ /* NetBSD: bus_machdep.c,v 1.1 2000/01/26 18:48:00 drochner Exp */ /*- @@ -46,7 +46,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_space_sparse.c,v 1.12 2005/04/01 11:59:23 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_space_sparse.c,v 1.13 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -120,7 +120,7 @@ arc_sparse_bus_space_compose_handle(bus_space_tag_t bst, bus_addr_t addr, } else { vaddr_t va, vaddr = uvm_km_alloc(kernel_map, (vsize_t)(end - start), 0, - UVM_KMF_VAONLY); + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (vaddr == 0) panic("arc_sparse_bus_space_compose_handle: " diff --git a/sys/arch/arm/arm32/bus_dma.c b/sys/arch/arm/arm32/bus_dma.c index 24b329c81766..7a9e9510bbb4 100644 --- a/sys/arch/arm/arm32/bus_dma.c +++ b/sys/arch/arm/arm32/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.44 2005/04/01 11:59:23 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.45 2005/11/24 13:08:32 yamt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ #define _ARM32_BUS_DMA_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.44 2005/04/01 11:59:23 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.45 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -826,6 +826,8 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, bus_addr_t addr; int curseg; pt_entry_t *ptep/*, pte*/; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; #ifdef DEBUG_DMA printf("dmamem_map: t=%p segs=%p nsegs=%x size=%lx flags=%x\n", t, @@ -833,7 +835,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, #endif /* DEBUG_DMA */ size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/arm/ep93xx/ep93xx_space.c b/sys/arch/arm/ep93xx/ep93xx_space.c index 6e8501680738..70433a1cdced 100644 --- a/sys/arch/arm/ep93xx/ep93xx_space.c +++ b/sys/arch/arm/ep93xx/ep93xx_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: ep93xx_space.c,v 1.2 2005/04/01 11:59:24 yamt Exp $ */ +/* $NetBSD: ep93xx_space.c,v 1.3 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 2004 Jesse Off @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ep93xx_space.c,v 1.2 2005/04/01 11:59:24 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ep93xx_space.c,v 1.3 2005/11/24 13:08:32 yamt Exp $"); /* * bus_space I/O functions for ep93xx @@ -156,7 +156,8 @@ ep93xx_bs_map(void *t, bus_addr_t bpa, bus_size_t size, startpa = trunc_page(bpa); /* Get some VM. */ - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return ENOMEM; diff --git a/sys/arch/arm/footbridge/footbridge_io.c b/sys/arch/arm/footbridge/footbridge_io.c index 2d2af1e45a36..a6c4604fcb29 100644 --- a/sys/arch/arm/footbridge/footbridge_io.c +++ b/sys/arch/arm/footbridge/footbridge_io.c @@ -1,4 +1,4 @@ -/* $NetBSD: footbridge_io.c,v 1.11 2005/07/30 15:14:29 chris Exp $ */ +/* $NetBSD: footbridge_io.c,v 1.12 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 1997 Causality Limited @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: footbridge_io.c,v 1.11 2005/07/30 15:14:29 chris Exp $"); +__KERNEL_RCSID(0, "$NetBSD: footbridge_io.c,v 1.12 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -208,7 +208,8 @@ footbridge_mem_bs_map(t, bpa, size, flags, bshp) * multiple mappings */ - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return ENOMEM; diff --git a/sys/arch/arm/ixp12x0/ixp12x0_io.c b/sys/arch/arm/ixp12x0/ixp12x0_io.c index 96c26f306373..7676ec99fb02 100644 --- a/sys/arch/arm/ixp12x0/ixp12x0_io.c +++ b/sys/arch/arm/ixp12x0/ixp12x0_io.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixp12x0_io.c,v 1.10 2005/04/01 11:59:24 yamt Exp $ */ +/* $NetBSD: ixp12x0_io.c,v 1.11 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 2002, 2003 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ixp12x0_io.c,v 1.10 2005/04/01 11:59:24 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixp12x0_io.c,v 1.11 2005/11/24 13:08:32 yamt Exp $"); /* * bus_space I/O functions for ixp12x0 @@ -159,7 +159,8 @@ ixp12x0_bs_map(void *t, bus_addr_t bpa, bus_size_t size, offset = bpa & PAGE_MASK; startpa = trunc_page(bpa); - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return ENOMEM; diff --git a/sys/arch/arm/mainbus/mainbus_io.c b/sys/arch/arm/mainbus/mainbus_io.c index b8608b746bba..4a0779721a34 100644 --- a/sys/arch/arm/mainbus/mainbus_io.c +++ b/sys/arch/arm/mainbus/mainbus_io.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus_io.c,v 1.16 2005/04/01 11:59:25 yamt Exp $ */ +/* $NetBSD: mainbus_io.c,v 1.17 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 1997 Mark Brinicombe. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus_io.c,v 1.16 2005/04/01 11:59:25 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus_io.c,v 1.17 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -156,7 +156,8 @@ mainbus_bs_map(t, bpa, size, flags, bshp) /* XXX use extent manager to check duplicate mapping */ - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (! va) return(ENOMEM); diff --git a/sys/arch/arm/s3c2xx0/s3c2800_pci.c b/sys/arch/arm/s3c2xx0/s3c2800_pci.c index f0ec4029b4a0..c0754fbf98fc 100644 --- a/sys/arch/arm/s3c2xx0/s3c2800_pci.c +++ b/sys/arch/arm/s3c2xx0/s3c2800_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: s3c2800_pci.c,v 1.10 2005/04/01 11:59:25 yamt Exp $ */ +/* $NetBSD: s3c2800_pci.c,v 1.11 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 2002 Fujitsu Component Limited @@ -100,7 +100,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: s3c2800_pci.c,v 1.10 2005/04/01 11:59:25 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: s3c2800_pci.c,v 1.11 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -356,7 +356,8 @@ sspci_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flag, endpa = round_page(bpa + size); /* Get some VM. */ - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return ENOMEM; diff --git a/sys/arch/arm/s3c2xx0/s3c2xx0_space.c b/sys/arch/arm/s3c2xx0/s3c2xx0_space.c index ff1f73e5e638..0216fef91fa0 100644 --- a/sys/arch/arm/s3c2xx0/s3c2xx0_space.c +++ b/sys/arch/arm/s3c2xx0/s3c2xx0_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: s3c2xx0_space.c,v 1.6 2005/04/13 03:39:18 yamt Exp $ */ +/* $NetBSD: s3c2xx0_space.c,v 1.7 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 2002 Fujitsu Component Limited @@ -74,7 +74,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: s3c2xx0_space.c,v 1.6 2005/04/13 03:39:18 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: s3c2xx0_space.c,v 1.7 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -185,7 +185,8 @@ s3c2xx0_bs_map(void *t, bus_addr_t bpa, bus_size_t size, /* XXX use extent manager to check duplicate mapping */ - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (!va) return (ENOMEM); diff --git a/sys/arch/arm/sa11x0/sa11x0_io.c b/sys/arch/arm/sa11x0/sa11x0_io.c index 8b46b2a8285d..6a1421aa557a 100644 --- a/sys/arch/arm/sa11x0/sa11x0_io.c +++ b/sys/arch/arm/sa11x0/sa11x0_io.c @@ -1,4 +1,4 @@ -/* $NetBSD: sa11x0_io.c,v 1.13 2005/04/01 11:59:25 yamt Exp $ */ +/* $NetBSD: sa11x0_io.c,v 1.14 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 1997 Mark Brinicombe. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sa11x0_io.c,v 1.13 2005/04/01 11:59:25 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sa11x0_io.c,v 1.14 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -163,7 +163,8 @@ sa11x0_bs_map(t, bpa, size, cacheable, bshp) /* XXX use extent manager to check duplicate mapping */ - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (! va) return(ENOMEM); diff --git a/sys/arch/arm/xscale/i80312_space.c b/sys/arch/arm/xscale/i80312_space.c index daeafb1b3424..27eec2a76048 100644 --- a/sys/arch/arm/xscale/i80312_space.c +++ b/sys/arch/arm/xscale/i80312_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: i80312_space.c,v 1.8 2005/04/01 11:59:25 yamt Exp $ */ +/* $NetBSD: i80312_space.c,v 1.9 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i80312_space.c,v 1.8 2005/04/01 11:59:25 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i80312_space.c,v 1.9 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -316,7 +316,8 @@ i80312_mem_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, pa = trunc_page((bpa - busbase) + physbase); endpa = round_page(((bpa - busbase) + physbase) + size); - va = uvm_km_alloc(kernel_map, endpa - pa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - pa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return (ENOMEM); diff --git a/sys/arch/arm/xscale/i80321_space.c b/sys/arch/arm/xscale/i80321_space.c index df2db5b9491f..89631920951f 100644 --- a/sys/arch/arm/xscale/i80321_space.c +++ b/sys/arch/arm/xscale/i80321_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: i80321_space.c,v 1.8 2005/04/01 11:59:25 yamt Exp $ */ +/* $NetBSD: i80321_space.c,v 1.9 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 2001, 2002 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.8 2005/04/01 11:59:25 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i80321_space.c,v 1.9 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -305,7 +305,8 @@ i80321_mem_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, pa = trunc_page((bpa - busbase) + physbase); endpa = round_page(((bpa - busbase) + physbase) + size); - va = uvm_km_alloc(kernel_map, endpa - pa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - pa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return (ENOMEM); diff --git a/sys/arch/arm/xscale/ixp425_pci_space.c b/sys/arch/arm/xscale/ixp425_pci_space.c index de8cf585c2db..60c62261a736 100644 --- a/sys/arch/arm/xscale/ixp425_pci_space.c +++ b/sys/arch/arm/xscale/ixp425_pci_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixp425_pci_space.c,v 1.3 2005/04/01 11:59:25 yamt Exp $ */ +/* $NetBSD: ixp425_pci_space.c,v 1.4 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 2003 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ixp425_pci_space.c,v 1.3 2005/04/01 11:59:25 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixp425_pci_space.c,v 1.4 2005/11/24 13:08:32 yamt Exp $"); /* * bus_space PCI functions for ixp425 @@ -401,7 +401,8 @@ ixp425_pci_mem_bs_map(void *t, bus_addr_t bpa, bus_size_t size, startpa = trunc_page(bpa); /* Get some VM. */ - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return ENOMEM; diff --git a/sys/arch/arm/xscale/ixp425_space.c b/sys/arch/arm/xscale/ixp425_space.c index baa8d6ca9e86..9c210589c096 100644 --- a/sys/arch/arm/xscale/ixp425_space.c +++ b/sys/arch/arm/xscale/ixp425_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixp425_space.c,v 1.4 2005/04/01 11:59:25 yamt Exp $ */ +/* $NetBSD: ixp425_space.c,v 1.5 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 2003 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ixp425_space.c,v 1.4 2005/04/01 11:59:25 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixp425_space.c,v 1.5 2005/11/24 13:08:32 yamt Exp $"); /* * bus_space I/O functions for ixp425 @@ -157,7 +157,8 @@ ixp425_bs_map(void *t, bus_addr_t bpa, bus_size_t size, startpa = trunc_page(bpa); /* Get some VM. */ - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return ENOMEM; diff --git a/sys/arch/arm/xscale/pxa2x0_space.c b/sys/arch/arm/xscale/pxa2x0_space.c index 180d53cd2546..ea9c4cd5d12c 100644 --- a/sys/arch/arm/xscale/pxa2x0_space.c +++ b/sys/arch/arm/xscale/pxa2x0_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: pxa2x0_space.c,v 1.7 2005/04/01 11:59:25 yamt Exp $ */ +/* $NetBSD: pxa2x0_space.c,v 1.8 2005/11/24 13:08:32 yamt Exp $ */ /* * Copyright (c) 2001, 2002 Wasabi Systems, Inc. @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pxa2x0_space.c,v 1.7 2005/04/01 11:59:25 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pxa2x0_space.c,v 1.8 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -188,7 +188,8 @@ pxa2x0_bs_map(void *t, bus_addr_t bpa, bus_size_t size, /* XXX use extent manager to check duplicate mapping */ - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (! va) return(ENOMEM); diff --git a/sys/arch/atari/atari/bus.c b/sys/arch/atari/atari/bus.c index d06270a5acca..2f503d0c83a9 100644 --- a/sys/arch/atari/atari/bus.c +++ b/sys/arch/atari/atari/bus.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus.c,v 1.39 2005/04/01 11:59:25 yamt Exp $ */ +/* $NetBSD: bus.c,v 1.40 2005/11/24 13:08:32 yamt Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.39 2005/04/01 11:59:25 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.40 2005/11/24 13:08:32 yamt Exp $"); #include #include @@ -263,7 +263,8 @@ bus_space_handle_t *bshp; return (0); } - va = uvm_km_alloc(kernel_map, endpa - pa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - pa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return (ENOMEM); @@ -719,12 +720,14 @@ bus_dmamem_map(t, segs, nsegs, size, kvap, flags) vaddr_t va; bus_addr_t addr, offset; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; offset = t->_displacement; size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/cobalt/cobalt/bus.c b/sys/arch/cobalt/cobalt/bus.c index f2389a0a8ace..7ea2a4ad8abd 100644 --- a/sys/arch/cobalt/cobalt/bus.c +++ b/sys/arch/cobalt/cobalt/bus.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus.c,v 1.21 2005/04/01 11:59:25 yamt Exp $ */ +/* $NetBSD: bus.c,v 1.22 2005/11/24 13:08:33 yamt Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.21 2005/04/01 11:59:25 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.22 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -747,6 +747,8 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid @@ -762,7 +764,7 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/dreamcast/dev/g2/gapspci_dma.c b/sys/arch/dreamcast/dev/g2/gapspci_dma.c index 857e87fbcad7..0a6705003d1a 100644 --- a/sys/arch/dreamcast/dev/g2/gapspci_dma.c +++ b/sys/arch/dreamcast/dev/g2/gapspci_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: gapspci_dma.c,v 1.11 2005/04/01 11:59:26 yamt Exp $ */ +/* $NetBSD: gapspci_dma.c,v 1.12 2005/11/24 13:08:33 yamt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: gapspci_dma.c,v 1.11 2005/04/01 11:59:26 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gapspci_dma.c,v 1.12 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -573,6 +573,8 @@ gaps_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, use P2SEG, to avoid @@ -585,7 +587,7 @@ gaps_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return ENOMEM; diff --git a/sys/arch/evbarm/adi_brh/obio_space.c b/sys/arch/evbarm/adi_brh/obio_space.c index 9ff4c088e1c0..00e883d7f181 100644 --- a/sys/arch/evbarm/adi_brh/obio_space.c +++ b/sys/arch/evbarm/adi_brh/obio_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: obio_space.c,v 1.4 2005/04/01 11:59:26 yamt Exp $ */ +/* $NetBSD: obio_space.c,v 1.5 2005/11/24 13:08:33 yamt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: obio_space.c,v 1.4 2005/04/01 11:59:26 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: obio_space.c,v 1.5 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -155,7 +155,8 @@ obio_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, offset = bpa & PAGE_MASK; startpa = trunc_page(bpa); - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return ENOMEM; diff --git a/sys/arch/evbarm/ifpga/ifpga_io.c b/sys/arch/evbarm/ifpga/ifpga_io.c index 8ba666406188..6090b2186696 100644 --- a/sys/arch/evbarm/ifpga/ifpga_io.c +++ b/sys/arch/evbarm/ifpga/ifpga_io.c @@ -1,4 +1,4 @@ -/* $NetBSD: ifpga_io.c,v 1.7 2005/04/01 11:59:26 yamt Exp $ */ +/* $NetBSD: ifpga_io.c,v 1.8 2005/11/24 13:08:33 yamt Exp $ */ /* * Copyright (c) 1997 Causality Limited @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ifpga_io.c,v 1.7 2005/04/01 11:59:26 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ifpga_io.c,v 1.8 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -187,7 +187,8 @@ ifpga_mem_bs_map(t, bpa, size, cacheable, bshp) endpa = round_page(bpa + size); /* Get some VM. */ - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return ENOMEM; diff --git a/sys/arch/evbarm/iq80310/obio_space.c b/sys/arch/evbarm/iq80310/obio_space.c index ed28a696734c..5ff9e181f67d 100644 --- a/sys/arch/evbarm/iq80310/obio_space.c +++ b/sys/arch/evbarm/iq80310/obio_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: obio_space.c,v 1.11 2005/04/01 11:59:26 yamt Exp $ */ +/* $NetBSD: obio_space.c,v 1.12 2005/11/24 13:08:33 yamt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: obio_space.c,v 1.11 2005/04/01 11:59:26 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: obio_space.c,v 1.12 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -154,7 +154,8 @@ obio_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, offset = bpa & PAGE_MASK; startpa = trunc_page(bpa); - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return(ENOMEM); diff --git a/sys/arch/evbarm/iq80321/obio_space.c b/sys/arch/evbarm/iq80321/obio_space.c index 41c2d030c3ce..dbea85ea6a70 100644 --- a/sys/arch/evbarm/iq80321/obio_space.c +++ b/sys/arch/evbarm/iq80321/obio_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: obio_space.c,v 1.8 2005/04/01 11:59:26 yamt Exp $ */ +/* $NetBSD: obio_space.c,v 1.9 2005/11/24 13:08:33 yamt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: obio_space.c,v 1.8 2005/04/01 11:59:26 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: obio_space.c,v 1.9 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -155,7 +155,8 @@ obio_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, offset = bpa & PAGE_MASK; startpa = trunc_page(bpa); - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return (ENOMEM); diff --git a/sys/arch/evbppc/evbppc/bus_dma.c b/sys/arch/evbppc/evbppc/bus_dma.c index 3a25d75f3dab..dbe41c8f5881 100644 --- a/sys/arch/evbppc/evbppc/bus_dma.c +++ b/sys/arch/evbppc/evbppc/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.8 2005/04/01 11:59:26 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.9 2005/11/24 13:08:33 yamt Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.8 2005/04/01 11:59:26 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.9 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -563,10 +563,12 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/evbsh3/evbsh3/machdep.c b/sys/arch/evbsh3/evbsh3/machdep.c index a8631164bbcb..5cb97e5fce01 100644 --- a/sys/arch/evbsh3/evbsh3/machdep.c +++ b/sys/arch/evbsh3/evbsh3/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.54 2005/06/05 13:49:26 he Exp $ */ +/* $NetBSD: machdep.c,v 1.55 2005/11/24 13:08:33 yamt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.54 2005/06/05 13:49:26 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.55 2005/11/24 13:08:33 yamt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -441,7 +441,8 @@ shpcmcia_mem_add_mapping(bpa, size, type, bshp) panic("sh3_pcmcia_mem_add_mapping: overflow"); #endif - va = uvm_km_alloc(kernel_map, endpa - pa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - pa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0){ printf("shpcmcia_add_mapping: nomem \n"); return (ENOMEM); diff --git a/sys/arch/hp700/hp700/mainbus.c b/sys/arch/hp700/hp700/mainbus.c index d7de95ec3fe2..87cb53f86fb0 100644 --- a/sys/arch/hp700/hp700/mainbus.c +++ b/sys/arch/hp700/hp700/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.29 2005/08/26 13:19:35 drochner Exp $ */ +/* $NetBSD: mainbus.c,v 1.30 2005/11/24 13:08:33 yamt Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.29 2005/08/26 13:19:35 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.30 2005/11/24 13:08:33 yamt Exp $"); #include "locators.h" #include "opt_power_switch.h" @@ -1286,6 +1286,8 @@ mbus_dmamem_map(void *v, bus_dma_segment_t *segs, int nsegs, size_t size, struct pglist *pglist; vaddr_t va; paddr_t pa; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; size = round_page(size); @@ -1298,7 +1300,7 @@ mbus_dmamem_map(void *v, bus_dma_segment_t *segs, int nsegs, size_t size, } /* Get a chunk of kernel virtual space. */ - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/hpcmips/hpcmips/bus_dma.c b/sys/arch/hpcmips/hpcmips/bus_dma.c index fc0c12076d96..a6de9dd64dcf 100644 --- a/sys/arch/hpcmips/hpcmips/bus_dma.c +++ b/sys/arch/hpcmips/hpcmips/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.24 2005/04/01 11:59:28 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.25 2005/11/24 13:08:33 yamt Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.24 2005/04/01 11:59:28 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.25 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -634,6 +634,8 @@ _hpcmips_bd_mem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid @@ -649,7 +651,7 @@ _hpcmips_bd_mem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/iyonix/iyonix/obio_space.c b/sys/arch/iyonix/iyonix/obio_space.c index f0cb5f6718d7..7c86fb5e6d7b 100644 --- a/sys/arch/iyonix/iyonix/obio_space.c +++ b/sys/arch/iyonix/iyonix/obio_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: obio_space.c,v 1.2 2005/04/01 11:59:31 yamt Exp $ */ +/* $NetBSD: obio_space.c,v 1.3 2005/11/24 13:08:33 yamt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: obio_space.c,v 1.2 2005/04/01 11:59:31 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: obio_space.c,v 1.3 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -155,7 +155,8 @@ obio_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, offset = bpa & PAGE_MASK; startpa = trunc_page(bpa); - va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - startpa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return (ENOMEM); diff --git a/sys/arch/m68k/m68k/bus_dma.c b/sys/arch/m68k/m68k/bus_dma.c index 6f73591e2cb0..fc6900905d3a 100644 --- a/sys/arch/m68k/m68k/bus_dma.c +++ b/sys/arch/m68k/m68k/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.14 2005/04/01 11:59:32 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.15 2005/11/24 13:08:33 yamt Exp $ */ /* * This file was taken from from alpha/common/bus_dma.c @@ -46,7 +46,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.14 2005/04/01 11:59:32 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.15 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -670,10 +670,12 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/mac68k/mac68k/bus_space.c b/sys/arch/mac68k/mac68k/bus_space.c index 244fffc2da35..cface99baa9e 100644 --- a/sys/arch/mac68k/mac68k/bus_space.c +++ b/sys/arch/mac68k/mac68k/bus_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space.c,v 1.26 2005/04/01 11:59:32 yamt Exp $ */ +/* $NetBSD: bus_space.c,v 1.27 2005/11/24 13:08:33 yamt Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.26 2005/04/01 11:59:32 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.27 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -76,7 +76,8 @@ bus_mem_add_mapping(bus_addr_t bpa, bus_size_t size, int flags, panic("bus_mem_add_mapping: overflow"); #endif - va = uvm_km_alloc(kernel_map, endpa - pa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - pa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return (ENOMEM); diff --git a/sys/arch/macppc/macppc/bus_dma.c b/sys/arch/macppc/macppc/bus_dma.c index 51a2715a4031..bb5ef15709f7 100644 --- a/sys/arch/macppc/macppc/bus_dma.c +++ b/sys/arch/macppc/macppc/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.31 2005/04/01 11:59:33 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.32 2005/11/24 13:08:33 yamt Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.31 2005/04/01 11:59:33 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.32 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -535,10 +535,12 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/mips/mips/bus_dma.c b/sys/arch/mips/mips/bus_dma.c index c5587a71eb17..393cc441355d 100644 --- a/sys/arch/mips/mips/bus_dma.c +++ b/sys/arch/mips/mips/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.14 2005/04/01 11:59:33 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.15 2005/11/24 13:08:33 yamt Exp $ */ /*- * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.14 2005/04/01 11:59:33 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.15 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -653,6 +653,8 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, use K0SEG, to avoid @@ -668,7 +670,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/mipsco/mipsco/bus_dma.c b/sys/arch/mipsco/mipsco/bus_dma.c index e2edd1229694..fc5da8273f4f 100644 --- a/sys/arch/mipsco/mipsco/bus_dma.c +++ b/sys/arch/mipsco/mipsco/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.16 2005/04/01 11:59:33 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.17 2005/11/24 13:08:33 yamt Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.16 2005/04/01 11:59:33 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.17 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -672,6 +672,8 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid @@ -687,7 +689,7 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/mvme68k/mvme68k/bus_dma.c b/sys/arch/mvme68k/mvme68k/bus_dma.c index a9cc4c4f3550..4d210774edb8 100644 --- a/sys/arch/mvme68k/mvme68k/bus_dma.c +++ b/sys/arch/mvme68k/mvme68k/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.28 2005/04/01 11:59:33 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.29 2005/11/24 13:08:33 yamt Exp $ */ /* * This file was taken from from next68k/dev/bus_dma.c, which was originally @@ -46,7 +46,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.28 2005/04/01 11:59:33 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.29 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -756,10 +756,12 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/newsmips/newsmips/bus.c b/sys/arch/newsmips/newsmips/bus.c index 125244e7225f..016b1cc116df 100644 --- a/sys/arch/newsmips/newsmips/bus.c +++ b/sys/arch/newsmips/newsmips/bus.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus.c,v 1.20 2005/04/01 11:59:33 yamt Exp $ */ +/* $NetBSD: bus.c,v 1.21 2005/11/24 13:08:33 yamt Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.20 2005/04/01 11:59:33 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.21 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -800,6 +800,8 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, and the address is lower than @@ -815,7 +817,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return ENOMEM; diff --git a/sys/arch/playstation2/playstation2/bus_dma.c b/sys/arch/playstation2/playstation2/bus_dma.c index 374e792dbf12..f2fd162b6057 100644 --- a/sys/arch/playstation2/playstation2/bus_dma.c +++ b/sys/arch/playstation2/playstation2/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.11 2005/04/01 11:59:33 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.12 2005/11/24 13:08:33 yamt Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.11 2005/04/01 11:59:33 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.12 2005/11/24 13:08:33 yamt Exp $"); #include #include @@ -579,6 +579,8 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid @@ -594,7 +596,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/pmax/pmax/bus_dma.c b/sys/arch/pmax/pmax/bus_dma.c index d48913e51d04..eaa4d7d2890b 100644 --- a/sys/arch/pmax/pmax/bus_dma.c +++ b/sys/arch/pmax/pmax/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.42 2005/04/01 11:59:33 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.43 2005/11/24 13:08:34 yamt Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.42 2005/04/01 11:59:33 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.43 2005/11/24 13:08:34 yamt Exp $"); #include "opt_cputype.h" @@ -809,6 +809,8 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid @@ -824,7 +826,7 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/powerpc/marvell/bus_dma.c b/sys/arch/powerpc/marvell/bus_dma.c index ef2d6101a335..f7390ab0be00 100644 --- a/sys/arch/powerpc/marvell/bus_dma.c +++ b/sys/arch/powerpc/marvell/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.8 2005/04/01 11:59:34 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.9 2005/11/24 13:08:34 yamt Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.8 2005/04/01 11:59:34 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.9 2005/11/24 13:08:34 yamt Exp $"); #define DEBUG 1 @@ -743,10 +743,12 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/powerpc/powerpc/bus_dma.c b/sys/arch/powerpc/powerpc/bus_dma.c index 39c6310ce6db..060dc0443571 100644 --- a/sys/arch/powerpc/powerpc/bus_dma.c +++ b/sys/arch/powerpc/powerpc/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.22 2005/04/01 11:59:34 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.23 2005/11/24 13:08:34 yamt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.22 2005/04/01 11:59:34 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.23 2005/11/24 13:08:34 yamt Exp $"); #include #include @@ -650,10 +650,12 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/sgimips/sgimips/bus.c b/sys/arch/sgimips/sgimips/bus.c index 34b58c9a6579..c6ca26480b0d 100644 --- a/sys/arch/sgimips/sgimips/bus.c +++ b/sys/arch/sgimips/sgimips/bus.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus.c,v 1.39 2005/04/01 11:59:34 yamt Exp $ */ +/* $NetBSD: bus.c,v 1.40 2005/11/24 13:08:34 yamt Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.39 2005/04/01 11:59:34 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.40 2005/11/24 13:08:34 yamt Exp $"); #include #include @@ -1026,6 +1026,8 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid @@ -1041,7 +1043,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/sh5/sh5/bus_dma.c b/sys/arch/sh5/sh5/bus_dma.c index 14bd965e8dba..f19d08772776 100644 --- a/sys/arch/sh5/sh5/bus_dma.c +++ b/sys/arch/sh5/sh5/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.14 2005/04/01 11:59:34 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.15 2005/11/24 13:08:34 yamt Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.14 2005/04/01 11:59:34 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.15 2005/11/24 13:08:34 yamt Exp $"); #include #include @@ -749,10 +749,12 @@ _bus_dmamem_map(void *cookie, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/sh5/sh5/pmap.c b/sys/arch/sh5/sh5/pmap.c index a166a9061af7..92e6f2333ba2 100644 --- a/sys/arch/sh5/sh5/pmap.c +++ b/sys/arch/sh5/sh5/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.39 2005/06/01 13:05:29 scw Exp $ */ +/* $NetBSD: pmap.c,v 1.40 2005/11/24 13:08:34 yamt Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -103,7 +103,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.39 2005/06/01 13:05:29 scw Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.40 2005/11/24 13:08:34 yamt Exp $"); #include "opt_ddb.h" #include "opt_kernel_ipt.h" @@ -1183,7 +1183,8 @@ pmap_map_device(paddr_t pa, u_int len) panic("pmap_map_device: out of device bootstrap kva"); pmap_device_kva_start += len; } else - rv = va = uvm_km_alloc(kernel_map, len, 0, UVM_KMF_VAONLY); + rv = va = uvm_km_alloc(kernel_map, len, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); while (len) { idx = kva_to_iptidx(va); diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index c4f0efd70cd1..7c6551826e1c 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.261 2005/11/16 21:42:50 uwe Exp $ */ +/* $NetBSD: machdep.c,v 1.262 2005/11/24 13:08:34 yamt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -78,7 +78,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.261 2005/11/16 21:42:50 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.262 2005/11/24 13:08:34 yamt Exp $"); #include "opt_compat_netbsd.h" #include "opt_compat_sunos.h" @@ -1999,13 +1999,15 @@ sun4_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, struct vm_page *m; vaddr_t va; struct pglist *mlist; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; if (nsegs != 1) panic("sun4_dmamem_map: nsegs = %d", nsegs); size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/sparc/sparc/msiiep.c b/sys/arch/sparc/sparc/msiiep.c index 756786dcefbe..3bc3b955117c 100644 --- a/sys/arch/sparc/sparc/msiiep.c +++ b/sys/arch/sparc/sparc/msiiep.c @@ -1,4 +1,4 @@ -/* $NetBSD: msiiep.c,v 1.32 2005/11/16 03:00:23 uwe Exp $ */ +/* $NetBSD: msiiep.c,v 1.33 2005/11/24 13:08:34 yamt Exp $ */ /* * Copyright (c) 2001 Valeriy E. Ushakov @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: msiiep.c,v 1.32 2005/11/16 03:00:23 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msiiep.c,v 1.33 2005/11/24 13:08:34 yamt Exp $"); #include #include @@ -672,13 +672,15 @@ mspcic_dmamem_map(bus_dma_tag_t tag, bus_dma_segment_t *segs, int nsegs, struct vm_page *m; vaddr_t va; int pagesz = PAGE_SIZE; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; if (nsegs != 1) panic("mspcic_dmamem_map: nsegs = %d", nsegs); size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/sparc64/dev/iommu.c b/sys/arch/sparc64/dev/iommu.c index c46594da2300..ed554d76659f 100644 --- a/sys/arch/sparc64/dev/iommu.c +++ b/sys/arch/sparc64/dev/iommu.c @@ -1,4 +1,4 @@ -/* $NetBSD: iommu.c,v 1.76 2005/04/01 11:59:35 yamt Exp $ */ +/* $NetBSD: iommu.c,v 1.77 2005/11/24 13:08:34 yamt Exp $ */ /* * Copyright (c) 2001, 2002 Eduardo Horvath @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.76 2005/04/01 11:59:35 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.77 2005/11/24 13:08:34 yamt Exp $"); #include "opt_ddb.h" @@ -1050,6 +1050,8 @@ iommu_dvmamem_map(t, sb, segs, nsegs, size, kvap, flags) bus_addr_t addr; struct pglist *pglist; int cbit; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; DPRINTF(IDB_BUSDMA, ("iommu_dvmamem_map: segp %p nsegs %d size %lx\n", segs, nsegs, size)); @@ -1059,7 +1061,7 @@ iommu_dvmamem_map(t, sb, segs, nsegs, size, kvap, flags) * into this space. */ size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/sun68k/sun68k/bus.c b/sys/arch/sun68k/sun68k/bus.c index ff033f37d968..e4b745c7b401 100644 --- a/sys/arch/sun68k/sun68k/bus.c +++ b/sys/arch/sun68k/sun68k/bus.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus.c,v 1.14 2005/04/01 11:59:36 yamt Exp $ */ +/* $NetBSD: bus.c,v 1.15 2005/11/24 13:08:34 yamt Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -160,7 +160,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.14 2005/04/01 11:59:36 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.15 2005/11/24 13:08:34 yamt Exp $"); #include #include @@ -326,13 +326,15 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, struct vm_page *m; vaddr_t va; struct pglist *mlist; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; if (nsegs != 1) panic("_bus_dmamem_map: nsegs = %d", nsegs); size = m68k_round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/vax/vax/bus_dma.c b/sys/arch/vax/vax/bus_dma.c index cbc09f3f1868..99981143836c 100644 --- a/sys/arch/vax/vax/bus_dma.c +++ b/sys/arch/vax/vax/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.23 2005/04/01 11:59:36 yamt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.24 2005/11/24 13:08:34 yamt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.23 2005/04/01 11:59:36 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.24 2005/11/24 13:08:34 yamt Exp $"); #include #include @@ -443,6 +443,8 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * Special case (but common): @@ -464,7 +466,7 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags) return 0; } size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/vax/vax/bus_mem.c b/sys/arch/vax/vax/bus_mem.c index 18738dfdc141..ea6a68da7a0e 100644 --- a/sys/arch/vax/vax/bus_mem.c +++ b/sys/arch/vax/vax/bus_mem.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_mem.c,v 1.11 2005/04/01 11:59:36 yamt Exp $ */ +/* $NetBSD: bus_mem.c,v 1.12 2005/11/24 13:08:34 yamt Exp $ */ /* * Copyright (c) 1998 Matt Thomas * All rights reserved. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_mem.c,v 1.11 2005/04/01 11:59:36 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_mem.c,v 1.12 2005/11/24 13:08:34 yamt Exp $"); #include #include @@ -60,7 +60,7 @@ vax_mem_bus_space_map( vaddr_t va; size += (pa & VAX_PGOFSET); /* have to include the byte offset */ - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return (ENOMEM); diff --git a/sys/arch/x68k/x68k/bus.c b/sys/arch/x68k/x68k/bus.c index 1726d3d37560..cb565b90ffc8 100644 --- a/sys/arch/x68k/x68k/bus.c +++ b/sys/arch/x68k/x68k/bus.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus.c,v 1.27 2005/04/01 11:59:36 yamt Exp $ */ +/* $NetBSD: bus.c,v 1.28 2005/11/24 13:08:34 yamt Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.27 2005/04/01 11:59:36 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.28 2005/11/24 13:08:34 yamt Exp $"); #include #include @@ -455,10 +455,12 @@ x68k_bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, vaddr_t va; bus_addr_t addr; int curseg; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; size = round_page(size); - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/x86/x86/bus_dma.c b/sys/arch/x86/x86/bus_dma.c index 8ea5c44a7c25..6117ecc16a74 100644 --- a/sys/arch/x86/x86/bus_dma.c +++ b/sys/arch/x86/x86/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.24 2005/09/20 04:48:10 thorpej Exp $ */ +/* $NetBSD: bus_dma.c,v 1.25 2005/11/24 13:08:34 yamt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.24 2005/09/20 04:48:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.25 2005/11/24 13:08:34 yamt Exp $"); /* * The following is included because _bus_dma_uiomove is derived from @@ -1034,13 +1034,15 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, int nocache; int marked; pt_entry_t *pte; + const uvm_flag_t kmflags = + (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; size = round_page(size); cpumask = 0; nocache = (flags & BUS_DMA_NOCACHE) != 0 && pmap_cpu_has_pg_n(); marked = 0; - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (va == 0) return (ENOMEM); diff --git a/sys/arch/x86/x86/bus_space.c b/sys/arch/x86/x86/bus_space.c index 2c25a70ab385..b530b3f71607 100644 --- a/sys/arch/x86/x86/bus_space.c +++ b/sys/arch/x86/x86/bus_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space.c,v 1.3 2005/04/01 11:59:36 yamt Exp $ */ +/* $NetBSD: bus_space.c,v 1.4 2005/11/24 13:08:34 yamt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.3 2005/04/01 11:59:36 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.4 2005/11/24 13:08:34 yamt Exp $"); #include #include @@ -283,7 +283,8 @@ x86_mem_add_mapping(bpa, size, cacheable, bshp) panic("x86_mem_add_mapping: overflow"); #endif - va = uvm_km_alloc(kernel_map, endpa - pa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - pa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return (ENOMEM); diff --git a/sys/arch/xen/x86/bus_space.c b/sys/arch/xen/x86/bus_space.c index 31effe5443cd..01007af67303 100644 --- a/sys/arch/xen/x86/bus_space.c +++ b/sys/arch/xen/x86/bus_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space.c,v 1.4 2005/04/01 11:59:36 yamt Exp $ */ +/* $NetBSD: bus_space.c,v 1.5 2005/11/24 13:08:34 yamt Exp $ */ /* NetBSD: bus_space.c,v 1.2 2003/03/14 18:47:53 christos Exp */ /*- @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.4 2005/04/01 11:59:36 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.5 2005/11/24 13:08:34 yamt Exp $"); #include "opt_xen.h" @@ -299,7 +299,8 @@ x86_mem_add_mapping(bpa, size, cacheable, bshp) if (bpa >= IOM_BEGIN && (bpa + size) <= IOM_END) { va = (vaddr_t)ISA_HOLE_VADDR(pa); } else { - va = uvm_km_alloc(kernel_map, endpa - pa, 0, UVM_KMF_VAONLY); + va = uvm_km_alloc(kernel_map, endpa - pa, 0, + UVM_KMF_VAONLY | UVM_KMF_NOWAIT); if (va == 0) return (ENOMEM); }