summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc
diff options
context:
space:
mode:
authorMartin Reindl <martin@cvs.openbsd.org>2007-11-04 13:43:40 +0000
committerMartin Reindl <martin@cvs.openbsd.org>2007-11-04 13:43:40 +0000
commit03b7854a5f55c1c5037acf4c3727dc11004a288e (patch)
treeaf095fa6937131224a5d4d74ac7c3ad553215e54 /sys/arch/powerpc
parent9ca9c9b5b03559ce53f033908a7d1a55ced590aa (diff)
replace even more ctob/btoc with ptoa/atop
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r--sys/arch/powerpc/include/param.h7
-rw-r--r--sys/arch/powerpc/powerpc/pmap.c8
2 files changed, 5 insertions, 10 deletions
diff --git a/sys/arch/powerpc/include/param.h b/sys/arch/powerpc/include/param.h
index dd40e4052fe..89d2ac92102 100644
--- a/sys/arch/powerpc/include/param.h
+++ b/sys/arch/powerpc/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.29 2007/05/28 21:02:49 thib Exp $ */
+/* $OpenBSD: param.h,v 1.30 2007/11/04 13:43:39 martin Exp $ */
/* $NetBSD: param.h,v 1.1 1996/09/30 16:34:28 ws Exp $ */
/*-
@@ -86,11 +86,6 @@
*/
#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT))
#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT))
-/*
- * bytes to pages
- */
-#define ctob(x) ((x) << PGSHIFT)
-#define btoc(x) (((x) + PGOFSET) >> PGSHIFT)
/*
* bytes to disk blocks
diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c
index d303f6cd5f1..fbd61b827fe 100644
--- a/sys/arch/powerpc/powerpc/pmap.c
+++ b/sys/arch/powerpc/powerpc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.102 2007/09/15 14:28:17 krw Exp $ */
+/* $OpenBSD: pmap.c,v 1.103 2007/11/04 13:43:39 martin Exp $ */
/*
* Copyright (c) 2001, 2002, 2007 Dale Rahn.
@@ -1269,7 +1269,7 @@ pmap_avail_setup(void)
ndumpmem = 0;
for (mp = pmap_mem; mp->size !=0; mp++, ndumpmem++) {
- physmem += btoc(mp->size);
+ physmem += atop(mp->size);
dumpmem[ndumpmem].start = atop(mp->start);
dumpmem[ndumpmem].end = atop(mp->start + mp->size);
}
@@ -1526,7 +1526,7 @@ pmap_bootstrap(u_int kernelstart, u_int kernelend)
pmap_ptab_cnt <<= 1;
} else {
pmap_ptab_cnt = HTABENTS_32;
- while (HTABSIZE_32 < (ctob(physmem) >> 7))
+ while (HTABSIZE_32 < (ptoa(physmem) >> 7))
pmap_ptab_cnt <<= 1;
}
/*
@@ -1601,7 +1601,7 @@ pmap_bootstrap(u_int kernelstart, u_int kernelend)
if (ppc_proc_is_64b) {
for(i = 0; i < 0x10000; i++)
- pmap_kenter_cache(ctob(i), ctob(i), VM_PROT_ALL,
+ pmap_kenter_cache(ptoa(i), ptoa(i), VM_PROT_ALL,
PMAP_CACHE_WB);
asm volatile ("sync; mtsdr1 %0; isync"
:: "r"((u_int)pmap_ptable64 | HTABSIZE_64));