diff options
author | jkim <jkim@FreeBSD.org> | 2010-08-06 15:24:37 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2010-08-06 15:24:37 +0000 |
commit | 57b610d580a3dd85aaac28dae65ce416f30c3f31 (patch) | |
tree | 49a5bab3d6231b67e7e0a3b23037d238d6fcd8e6 /sys/compat/x86bios/x86bios.c | |
parent | 4ab164bfd343511317777ff71a22bc226cbdd815 (diff) | |
download | FreeBSD-src-57b610d580a3dd85aaac28dae65ce416f30c3f31.zip FreeBSD-src-57b610d580a3dd85aaac28dae65ce416f30c3f31.tar.gz |
Consistently use architecture specific macros.
Diffstat (limited to 'sys/compat/x86bios/x86bios.c')
-rw-r--r-- | sys/compat/x86bios/x86bios.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/compat/x86bios/x86bios.c b/sys/compat/x86bios/x86bios.c index 2662fad..a9fe257 100644 --- a/sys/compat/x86bios/x86bios.c +++ b/sys/compat/x86bios/x86bios.c @@ -120,9 +120,9 @@ x86bios_alloc(uint32_t *offset, size_t size, int flags) if (addr != 0) { *offset = vtophys(addr); mtx_lock(&x86bios_lock); - for (i = 0; i < howmany(size, PAGE_SIZE); i++) + for (i = 0; i < atop(round_page(size)); i++) vm86_addpage(&x86bios_vmc, atop(*offset) + i, - addr + i * PAGE_SIZE); + addr + ptoa(i)); mtx_unlock(&x86bios_lock); } @@ -147,7 +147,7 @@ x86bios_free(void *addr, size_t size) return; } if (last == x86bios_vmc.npages - 1) { - x86bios_vmc.npages -= howmany(size, PAGE_SIZE); + x86bios_vmc.npages -= atop(round_page(size)); for (i = x86bios_vmc.npages - 1; i >= 0 && x86bios_vmc.pmap[i].kva == 0; i--) x86bios_vmc.npages--; |