summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/cgfourteen.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-04-22 16:52:48 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-04-22 16:52:48 +0000
commit4155c29c22c6e3acc5ce692650150a35ae2e0c59 (patch)
tree918f735547a91cb29de04a1fe23e6dda82758f4f /sys/arch/sparc/dev/cgfourteen.c
parent13a1781a8e02ebee2535f82b5d4868f6a31ff233 (diff)
UVM fixes, just a few useracc -> uvm_useracc
Diffstat (limited to 'sys/arch/sparc/dev/cgfourteen.c')
-rw-r--r--sys/arch/sparc/dev/cgfourteen.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/arch/sparc/dev/cgfourteen.c b/sys/arch/sparc/dev/cgfourteen.c
index 052b245c11b..f8cd679af4f 100644
--- a/sys/arch/sparc/dev/cgfourteen.c
+++ b/sys/arch/sparc/dev/cgfourteen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgfourteen.c,v 1.2 1998/11/20 15:57:21 deraadt Exp $ */
+/* $OpenBSD: cgfourteen.c,v 1.3 1999/04/22 16:52:47 art Exp $ */
/* $NetBSD: cgfourteen.c,v 1.7 1997/05/24 20:16:08 pk Exp $ */
/*
@@ -483,9 +483,15 @@ cgfourteenioctl(dev, cmd, data, flags, p)
if ((u_int)p->size.x > 32 || (u_int)p->size.y > 32)
return (EINVAL);
count = p->size.y * 32 / NBBY;
+#if defined(UVM)
+ if (!uvm_useracc(p->image, count, B_READ) ||
+ !uvm_useracc(p->mask, count, B_READ))
+ return (EFAULT);
+#else
if (!useracc(p->image, count, B_READ) ||
!useracc(p->mask, count, B_READ))
return (EFAULT);
+#endif
}
/* parameters are OK; do it */
@@ -761,10 +767,17 @@ cg14_get_cmap(p, cm, cmsize)
}
#endif
+#if defined(UVM)
+ if (!uvm_useracc(p->red, count, B_WRITE) ||
+ !uvm_useracc(p->green, count, B_WRITE) ||
+ !uvm_useracc(p->blue, count, B_WRITE))
+ return (EFAULT);
+#else
if (!useracc(p->red, count, B_WRITE) ||
!useracc(p->green, count, B_WRITE) ||
!useracc(p->blue, count, B_WRITE))
return (EFAULT);
+#endif
for (cp = &cm->cm_map[start][0], i = 0; i < count; cp += 4, i++) {
p->red[i] = cp[3];
p->green[i] = cp[2];
@@ -796,10 +809,17 @@ cg14_put_cmap(p, cm, cmsize)
}
#endif
+#if defined(UVM)
+ if (!uvm_useracc(p->red, count, B_READ) ||
+ !uvm_useracc(p->green, count, B_READ) ||
+ !uvm_useracc(p->blue, count, B_READ))
+ return (EFAULT);
+#else
if (!useracc(p->red, count, B_READ) ||
!useracc(p->green, count, B_READ) ||
!useracc(p->blue, count, B_READ))
return (EFAULT);
+#endif
for (cp = &cm->cm_map[start][0], i = 0; i < count; cp += 4, i++) {
cp[3] = p->red[i];
cp[2] = p->green[i];