summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2013-02-15 22:43:08 +0000
committerjkim <jkim@FreeBSD.org>2013-02-15 22:43:08 +0000
commit92f5e4e678b344b1b3374a625c9362e56c1b6a62 (patch)
tree2fbabd4e1f745a8d7f58c18e6f88e05b0dd16dfc /sys/amd64
parentd2c3957e3c25b7446a753e6981ee8e3af870e866 (diff)
downloadFreeBSD-src-92f5e4e678b344b1b3374a625c9362e56c1b6a62.zip
FreeBSD-src-92f5e4e678b344b1b3374a625c9362e56c1b6a62.tar.gz
Consistently use round_page(x) rather than roundup(x, PAGE_SIZE). There is
no functional change.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/acpica/acpi_machdep.c4
-rw-r--r--sys/amd64/amd64/pmap.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c
index f57bdc2..e5dd4c3 100644
--- a/sys/amd64/acpica/acpi_machdep.c
+++ b/sys/amd64/acpica/acpi_machdep.c
@@ -122,7 +122,7 @@ table_map(vm_paddr_t pa, int offset, vm_offset_t length)
void *data;
off = pa & PAGE_MASK;
- length = roundup(length + off, PAGE_SIZE);
+ length = round_page(length + off);
pa = pa & PG_FRAME;
va = (vm_offset_t)pmap_kenter_temporary(pa, offset) +
(offset * PAGE_SIZE);
@@ -146,7 +146,7 @@ table_unmap(void *data, vm_offset_t length)
va = (vm_offset_t)data;
off = va & PAGE_MASK;
- length = roundup(length + off, PAGE_SIZE);
+ length = round_page(length + off);
va &= ~PAGE_MASK;
while (length > 0) {
pmap_kremove(va);
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index f30a071..c6c62ae 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -5015,7 +5015,7 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mode)
return ((void *)va);
}
offset = pa & PAGE_MASK;
- size = roundup(offset + size, PAGE_SIZE);
+ size = round_page(offset + size);
va = kmem_alloc_nofault(kernel_map, size);
if (!va)
panic("pmap_mapdev: Couldn't alloc kernel virtual memory");
@@ -5051,7 +5051,7 @@ pmap_unmapdev(vm_offset_t va, vm_size_t size)
return;
base = trunc_page(va);
offset = va & PAGE_MASK;
- size = roundup(offset + size, PAGE_SIZE);
+ size = round_page(offset + size);
kmem_free(kernel_map, base, size);
}
@@ -5173,7 +5173,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode)
PMAP_LOCK_ASSERT(kernel_pmap, MA_OWNED);
base = trunc_page(va);
offset = va & PAGE_MASK;
- size = roundup(offset + size, PAGE_SIZE);
+ size = round_page(offset + size);
/*
* Only supported on kernel virtual addresses, including the direct
OpenPOWER on IntegriCloud