summaryrefslogtreecommitdiff
path: root/sys/arch/hppa64/dev
diff options
context:
space:
mode:
authorMartin Reindl <martin@cvs.openbsd.org>2008-04-27 17:48:11 +0000
committerMartin Reindl <martin@cvs.openbsd.org>2008-04-27 17:48:11 +0000
commit3d245af8182de9c1f4255b677e31e5c592e12585 (patch)
tree7eecc7944a753929ae17db76ababd18da6e775a5 /sys/arch/hppa64/dev
parent7046c098af8880891ee39c99d5f5fa11ce76ef4b (diff)
replace ctob/btoc by ptoa/atop
Diffstat (limited to 'sys/arch/hppa64/dev')
-rw-r--r--sys/arch/hppa64/dev/mem.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/hppa64/dev/mem.c b/sys/arch/hppa64/dev/mem.c
index 6f6d5f7dd95..67299590181 100644
--- a/sys/arch/hppa64/dev/mem.c
+++ b/sys/arch/hppa64/dev/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.4 2007/09/22 16:21:32 krw Exp $ */
+/* $OpenBSD: mem.c,v 1.5 2008/04/27 17:48:09 martin Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -186,12 +186,12 @@ mmrw(dev, uio, flags)
/* If the address isn't in RAM, bail. */
v = uio->uio_offset;
- if (btoc(v) > physmem) {
+ if (atop(v) > physmem) {
error = EFAULT;
/* this will break us out of the loop */
continue;
}
- c = ctob(physmem) - v;
+ c = ptoa(physmem) - v;
c = min(c, uio->uio_resid);
error = uiomove((caddr_t)v, c, uio);
break;
@@ -200,7 +200,7 @@ mmrw(dev, uio, flags)
v = uio->uio_offset;
o = v & PAGE_MASK;
c = min(uio->uio_resid, (int)(PAGE_SIZE - o));
- if (btoc(v) > physmem && !uvm_kernacc((caddr_t)v,
+ if (atop(v) > physmem && !uvm_kernacc((caddr_t)v,
c, (uio->uio_rw == UIO_READ) ? B_READ : B_WRITE)) {
error = EFAULT;
/* this will break us out of the loop */
@@ -252,8 +252,8 @@ mmmmap(dev, off, prot)
* Allow access only in RAM.
*/
#if 0
- if (off < ctob(firstusablepage) ||
- off >= ctob(lastusablepage + 1))
+ if (off < ptoa(firstusablepage) ||
+ off >= ptoa(lastusablepage + 1))
return (-1);
#endif
return (atop(off));