summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/booke
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-26 14:44:49 +0000
committerpfg <pfg@FreeBSD.org>2016-04-26 14:44:49 +0000
commit2a473e5a33c7e9694074a8c154bb60515fb9de81 (patch)
tree93bfc94634184f976f0ef7e930ada93825985a8a /sys/powerpc/booke
parenta4f12ac7887cb625b02ace8876814b167abb7c30 (diff)
downloadFreeBSD-src-2a473e5a33c7e9694074a8c154bb60515fb9de81.zip
FreeBSD-src-2a473e5a33c7e9694074a8c154bb60515fb9de81.tar.gz
sys/powerpc: make use of the howmany() macro when available.
We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read.
Diffstat (limited to 'sys/powerpc/booke')
-rw-r--r--sys/powerpc/booke/pmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c
index cd71526..429f8a9 100644
--- a/sys/powerpc/booke/pmap.c
+++ b/sys/powerpc/booke/pmap.c
@@ -1115,8 +1115,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend)
/* Allocate PTE tables for kernel KVA. */
kernel_pdir = data_end;
- kernel_ptbls = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS +
- PDIR_SIZE - 1) / PDIR_SIZE;
+ kernel_ptbls = howmany(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS,
+ PDIR_SIZE);
data_end += kernel_ptbls * PTBL_PAGES * PAGE_SIZE;
debugf(" kernel ptbls: %d\n", kernel_ptbls);
debugf(" kernel pdir at 0x%08x end = 0x%08x\n", kernel_pdir, data_end);
OpenPOWER on IntegriCloud