summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-02-26 01:38:24 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-02-26 01:38:24 +0000
commit22504b38ad62dff9d3329757139472e1a14c4f98 (patch)
tree673de113db8adbeded8c8a0f45632b62f1772e68 /sys/dev
parent272858548f30639cf49734c988ecf207fda65a71 (diff)
uvm compat
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ccd.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index 97543402345..9aafe13b161 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccd.c,v 1.37 1998/10/03 21:19:00 millert Exp $ */
+/* $OpenBSD: ccd.c,v 1.38 1999/02/26 01:38:23 art Exp $ */
/* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */
/*-
@@ -119,6 +119,10 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
+#if defined(UVM)
+#include <uvm/uvm_extern.h>
+#endif
+
#ifdef __GNUC__
#define INLINE static __inline
#else
@@ -929,8 +933,13 @@ ccdbuffer(cs, bp, bn, addr, bcount, cbpp, old_io)
nbp->b_data = addr;
else {
do {
- nbp->b_data = (caddr_t)kmem_alloc_pageable(
- ccdmap, bp->b_bcount);
+#if defined(UVM)
+ nbp->b_data = (caddr_t) uvm_km_valloc(ccdmap,
+ bp->b_bcount);
+#else
+ nbp->b_data = (caddr_t) kmem_alloc_pageable(
+ ccdmap, bp->b_bcount);
+#endif
/*
* XXX Instead of sleeping, we might revert
@@ -1082,7 +1091,11 @@ ccdiodone(vbp)
off += cbp->cb_sg[i].cs_sglen;
}
+#if defined(UVM)
+ uvm_km_free(ccdmap, (vaddr_t)vbp->b_data, count);
+#else
kmem_free(ccdmap, (vm_offset_t)vbp->b_data, count);
+#endif
if (ccd_need_kvm) {
ccd_need_kvm = 0;
wakeup(ccdmap);
@@ -1297,8 +1310,13 @@ ccdioctl(dev, cmd, data, flag, p)
* XXX doable via a freelist implementation though.
*/
if (!ccdmap && !(ccd.ccd_flags & CCDF_OLD))
+#if defined(UVM)
+ ccdmap = uvm_km_suballoc(kernel_map, &min, &max,
+ CCD_CLUSTERS * MAXBSIZE, FALSE, FALSE, NULL);
+#else
ccdmap = kmem_suballoc(kernel_map, &min, &max,
CCD_CLUSTERS * MAXBSIZE, FALSE);
+#endif
/* Attach the disk. */
cs->sc_dkdev.dk_name = cs->sc_xname;