summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMartin Reindl <martin@cvs.openbsd.org>2007-11-28 16:33:21 +0000
committerMartin Reindl <martin@cvs.openbsd.org>2007-11-28 16:33:21 +0000
commit49937de90c40cd165329fbfd7fe3227ba01ad165 (patch)
treefe788d085e6ec56c64b980092ca0676bacf4f0c9 /sys/arch
parentf3088325df5489e3c4f60e102a5ebaeee1884bb8 (diff)
ctob/btoc -> ptoa/atop
from Rodolfo Gouveia
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/dev/xd.c4
-rw-r--r--sys/arch/sparc/dev/xy.c4
-rw-r--r--sys/arch/sparc/include/param.h6
-rw-r--r--sys/arch/sparc/sparc/machdep.c6
-rw-r--r--sys/arch/sparc/sparc/pmap.c8
-rw-r--r--sys/arch/sparc/sparc/vm_machdep.c4
6 files changed, 14 insertions, 18 deletions
diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c
index b33335693b3..6479ca93400 100644
--- a/sys/arch/sparc/dev/xd.c
+++ b/sys/arch/sparc/dev/xd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xd.c,v 1.42 2007/10/01 16:11:19 krw Exp $ */
+/* $OpenBSD: xd.c,v 1.43 2007/11/28 16:33:20 martin Exp $ */
/* $NetBSD: xd.c,v 1.37 1997/07/29 09:58:16 fair Exp $ */
/*
@@ -804,7 +804,7 @@ xddump(dev, blkno, va, size)
/* outline: globals: "dumplo" == sector number of partition to start
* dump at (convert to physical sector with partition table)
* "dumpsize" == size of dump in clicks "physmem" == size of physical
- * memory (clicks, ctob() to get bytes) (normal case: dumpsize ==
+ * memory (clicks, ptoa() to get bytes) (normal case: dumpsize ==
* physmem)
*
* dump a copy of physical memory to the dump device starting at sector
diff --git a/sys/arch/sparc/dev/xy.c b/sys/arch/sparc/dev/xy.c
index 973af681da0..483ee7821bd 100644
--- a/sys/arch/sparc/dev/xy.c
+++ b/sys/arch/sparc/dev/xy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xy.c,v 1.39 2007/10/01 16:11:19 krw Exp $ */
+/* $OpenBSD: xy.c,v 1.40 2007/11/28 16:33:20 martin Exp $ */
/* $NetBSD: xy.c,v 1.26 1997/07/19 21:43:56 pk Exp $ */
/*
@@ -765,7 +765,7 @@ xydump(dev, blkno, va, size)
/* outline: globals: "dumplo" == sector number of partition to start
* dump at (convert to physical sector with partition table)
* "dumpsize" == size of dump in clicks "physmem" == size of physical
- * memory (clicks, ctob() to get bytes) (normal case: dumpsize ==
+ * memory (clicks, ptoa() to get bytes) (normal case: dumpsize ==
* physmem)
*
* dump a copy of physical memory to the dump device starting at sector
diff --git a/sys/arch/sparc/include/param.h b/sys/arch/sparc/include/param.h
index 95dbcd3ea9d..4eb288b689b 100644
--- a/sys/arch/sparc/include/param.h
+++ b/sys/arch/sparc/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.39 2007/05/28 21:02:49 thib Exp $ */
+/* $OpenBSD: param.h,v 1.40 2007/11/28 16:33:20 martin Exp $ */
/* $NetBSD: param.h,v 1.29 1997/03/10 22:50:37 pk Exp $ */
/*
@@ -108,10 +108,6 @@
#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT))
#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT))
-/* pages to bytes */
-#define ctob(x) ((x) << PGSHIFT)
-#define btoc(x) (((x) + PGOFSET) >> PGSHIFT)
-
/* bytes to disk blocks */
#define btodb(x) ((x) >> DEV_BSHIFT)
#define dbtob(x) ((x) << DEV_BSHIFT)
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index 8cc6fe62ce2..2a5c1a48419 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.113 2007/06/06 17:15:12 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.114 2007/11/28 16:33:20 martin Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -180,8 +180,8 @@ cpu_startup()
*/
printf(version);
/*identifycpu();*/
- printf("real mem = %u (%uMB)\n", ctob(physmem),
- ctob(physmem)/1024/1024);
+ printf("real mem = %u (%uMB)\n", ptoa(physmem),
+ ptoa(physmem)/1024/1024);
/*
* Find out how much space we need, allocate it,
diff --git a/sys/arch/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c
index 56f03b9ccb6..3f718191e7f 100644
--- a/sys/arch/sparc/sparc/pmap.c
+++ b/sys/arch/sparc/sparc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.146 2007/09/10 18:49:45 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.147 2007/11/28 16:33:20 martin Exp $ */
/* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */
/*
@@ -818,7 +818,7 @@ pmap_page_upload(first_pa)
*/
physmem = 0;
for (n = 0; n < npmemarr; n++)
- physmem += btoc(pmemarr[n].len);
+ physmem += atop(pmemarr[n].len);
for (n = 0; n < npmemarr; n++) {
start = (first_pa > pmemarr[n].addr) ? first_pa :
@@ -6394,7 +6394,7 @@ pmap_dumpsize()
if (CPU_ISSUN4OR4C)
sz += (seginval + 1) * NPTESG * sizeof(int);
- return (btoc(sz));
+ return (atop(sz));
}
/*
@@ -6444,7 +6444,7 @@ pmap_dumpmmu(dump, blkno)
/* Fill in MI segment header */
ksegp = (kcore_seg_t *)bp;
CORE_SETMAGIC(*ksegp, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
- ksegp->c_size = ctob(pmap_dumpsize()) - ALIGN(sizeof(kcore_seg_t));
+ ksegp->c_size = ptoa(pmap_dumpsize()) - ALIGN(sizeof(kcore_seg_t));
/* Fill in MD segment header (interpreted by MD part of libkvm) */
kcpup = (cpu_kcore_hdr_t *)((int)bp + ALIGN(sizeof(kcore_seg_t)));
diff --git a/sys/arch/sparc/sparc/vm_machdep.c b/sys/arch/sparc/sparc/vm_machdep.c
index 97f5ee4adc1..8f72d010786 100644
--- a/sys/arch/sparc/sparc/vm_machdep.c
+++ b/sys/arch/sparc/sparc/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.50 2007/10/10 15:53:53 art Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.51 2007/11/28 16:33:20 martin Exp $ */
/* $NetBSD: vm_machdep.c,v 1.30 1997/03/10 23:55:40 pk Exp $ */
/*
@@ -165,7 +165,7 @@ dvma_mapin_space(map, va, len, canwait, space)
off = va & PAGE_MASK;
va &= ~PAGE_MASK;
len = round_page(len + off);
- npf = btoc(len);
+ npf = atop(len);
s = splhigh();
if (space & M_SPACE_D24)