summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm_arm.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-03-28 16:27:31 +0000
committerderaadt <deraadt@openbsd.org>2013-03-28 16:27:31 +0000
commit7468fac67961ba0db81721ffacb564ed35aba31d (patch)
tree4f015beda1defbf84e72bd574ec9d07aa0160aa2 /lib/libkvm/kvm_arm.c
parentIf -s to swap-pane is not given, use the current pane. (diff)
downloadwireguard-openbsd-7468fac67961ba0db81721ffacb564ed35aba31d.tar.xz
wireguard-openbsd-7468fac67961ba0db81721ffacb564ed35aba31d.zip
Avoid using PAGE_SHIFT, PAGE_SIZE, and PAGE_MASK defines, since we already
know it from the machine. ok miod
Diffstat (limited to 'lib/libkvm/kvm_arm.c')
-rw-r--r--lib/libkvm/kvm_arm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_arm.c b/lib/libkvm/kvm_arm.c
index 368249bf5ff..6e4cfb600f9 100644
--- a/lib/libkvm/kvm_arm.c
+++ b/lib/libkvm/kvm_arm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_arm.c,v 1.7 2013/03/20 14:46:45 deraadt Exp $ */
+/* $OpenBSD: kvm_arm.c,v 1.8 2013/03/28 16:27:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Miodrag Vallat.
*
@@ -106,7 +106,7 @@ _kvm_kvatop(kvm_t *kd, u_long va, paddr_t *pa)
va < cpup->kernelbase + cpup->kerneloffs + cpup->staticsize) {
*pa = (va - cpup->kernelbase) +
(paddr_t)cpup->ram_segs[0].start;
- return (int)(PAGE_SIZE - (va & PAGE_MASK));
+ return (int)(kd->nbpg - (va & (kd->nbpg - 1)));
}
_kvm_err(kd, 0, "kvm_vatop: va %x unreachable", va);