summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_contig.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2009-06-26 04:47:43 +0000
committeralc <alc@FreeBSD.org>2009-06-26 04:47:43 +0000
commit91cafd48b17a27bda3cfbc38e8460a14c273ba9a (patch)
treebe473333ccc371c232599396e7b5253cdbad245b /sys/vm/vm_contig.c
parent9a472dd5889ffcc7520ed12bf9cbc791eb34eab7 (diff)
downloadFreeBSD-src-91cafd48b17a27bda3cfbc38e8460a14c273ba9a.zip
FreeBSD-src-91cafd48b17a27bda3cfbc38e8460a14c273ba9a.tar.gz
This change is the next step in implementing the cache control functionality
required by video card drivers. Specifically, this change introduces vm_cache_mode_t with an appropriate VM_CACHE_DEFAULT definition on all architectures. In addition, this changes adds a vm_cache_mode_t parameter to kmem_alloc_contig() and vm_phys_alloc_contig(). These will be the interfaces for allocating mapped kernel memory and physical memory, respectively, with non-default cache modes. In collaboration with: jhb
Diffstat (limited to 'sys/vm/vm_contig.c')
-rw-r--r--sys/vm/vm_contig.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c
index 8dec3b5..d2b6703 100644
--- a/sys/vm/vm_contig.c
+++ b/sys/vm/vm_contig.c
@@ -236,7 +236,7 @@ contigmalloc(
void *ret;
ret = (void *)kmem_alloc_contig(kernel_map, size, flags, low, high,
- alignment, boundary);
+ alignment, boundary, VM_CACHE_DEFAULT);
if (ret != NULL)
malloc_type_allocated(type, round_page(size));
return (ret);
@@ -244,7 +244,8 @@ contigmalloc(
vm_offset_t
kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low,
- vm_paddr_t high, unsigned long alignment, unsigned long boundary)
+ vm_paddr_t high, unsigned long alignment, unsigned long boundary,
+ vm_cache_mode_t mode)
{
vm_offset_t ret;
vm_page_t pages;
@@ -255,7 +256,8 @@ kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low,
npgs = size >> PAGE_SHIFT;
tries = 0;
retry:
- pages = vm_phys_alloc_contig(npgs, low, high, alignment, boundary);
+ pages = vm_phys_alloc_contig(npgs, low, high, alignment, boundary,
+ mode);
if (pages == NULL) {
if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) {
vm_page_lock_queues();
OpenPOWER on IntegriCloud