bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.

bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
This commit is contained in:
yamt 2005-11-24 13:08:32 +00:00
parent 6eaa98c111
commit bc21da4cfb
53 changed files with 241 additions and 160 deletions

View File

@ -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 <sys/cdefs.h> /* 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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h> /* 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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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;

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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: "

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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;

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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;

View File

@ -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 <sys/cdefs.h>
__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;

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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;

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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;

View File

@ -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 <sys/cdefs.h>
__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;

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h> /* 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 <sys/param.h>
#include <sys/systm.h>
@ -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;

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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;

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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;

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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);

View File

@ -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 <sys/cdefs.h>
__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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h> /* 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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h> /* 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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h> /* 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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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;

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/malloc.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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);

View File

@ -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 <sys/cdefs.h>
__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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h> /* 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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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);

View File

@ -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 <sys/cdefs.h>
__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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/malloc.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/types.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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);

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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);

View File

@ -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 <sys/cdefs.h>
__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);
}