diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-26 01:44:34 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-26 01:44:34 +0000 |
commit | 2aaba1b4cc9c13329ddadb0a726fac3872ab042e (patch) | |
tree | 1b07ae793334fb50ce60b5eb18a650b11a98d0e2 /sys | |
parent | 22504b38ad62dff9d3329757139472e1a14c4f98 (diff) |
compatibility with uvm kmem allocators
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/pdqvar.h | 7 | ||||
-rw-r--r-- | sys/dev/ramdisk.c | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/sys/dev/ic/pdqvar.h b/sys/dev/ic/pdqvar.h index 8c813111523..6d4b3483325 100644 --- a/sys/dev/ic/pdqvar.h +++ b/sys/dev/ic/pdqvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pdqvar.h,v 1.10 1996/11/28 23:27:52 niklas Exp $ */ +/* $OpenBSD: pdqvar.h,v 1.11 1999/02/26 01:44:33 art Exp $ */ /* $NetBSD: pdqvar.h,v 1.11 1996/10/25 21:33:37 cgd Exp $ */ /*- @@ -95,8 +95,13 @@ enum _pdq_type_t { #define PDQ_OS_MEMALLOC_CONTIG(n) vm_page_alloc_contig(n, 0, 0xffffffff, PAGE_SIZE) #define PDQ_OS_MEMFREE_CONTIG(p, n) kmem_free(kernel_map, (vm_offset_t) p, n) #else +#if defined(UVM) +#define PDQ_OS_MEMALLOC_CONTIG(n) uvm_km_alloc(kernel_map, round_page(n)) +#define PDQ_OS_MEMFREE_CONTIG(p, n) uvm_km_free(kernel_map, (vaddr_t) p, n) +#else #define PDQ_OS_MEMALLOC_CONTIG(n) kmem_alloc(kernel_map, round_page(n)) #define PDQ_OS_MEMFREE_CONTIG(p, n) kmem_free(kernel_map, (vm_offset_t) p, n) +#endif #endif /* __FreeBSD__ */ #if defined(__FreeBSD__) diff --git a/sys/dev/ramdisk.c b/sys/dev/ramdisk.c index 2d6bcf448c0..d89c520aa69 100644 --- a/sys/dev/ramdisk.c +++ b/sys/dev/ramdisk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ramdisk.c,v 1.8 1998/10/03 21:19:00 millert Exp $ */ +/* $OpenBSD: ramdisk.c,v 1.9 1999/02/26 01:44:33 art Exp $ */ /* $NetBSD: ramdisk.c,v 1.8 1996/04/12 08:30:09 leo Exp $ */ /* @@ -61,8 +61,13 @@ #include <vm/vm.h> #include <vm/vm_kern.h> + +#if defined(UVM) +#include <uvm/uvm_extern.h> +#else /* Don't want all those other VM headers... */ extern vm_offset_t kmem_alloc __P((vm_map_t, vm_size_t)); +#endif #include <dev/ramdisk.h> @@ -544,7 +549,11 @@ rd_ioctl_kalloc(sc, urd, proc) /* Sanity check the size. */ size = urd->rd_size; +#if defined(UVM) + addr = uvm_km_zalloc(kernel_map, size); +#else addr = kmem_alloc(kernel_map, size); +#endif if (!addr) return ENOMEM; |