From: martin Date: Thu, 14 Aug 2008 11:41:30 +0000 (+0000) Subject: convert the last traces of btoc/ctob macros X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c8369cfb935660b806da8d0d0aecda77daba689c;p=openbsd convert the last traces of btoc/ctob macros ok miod@ --- diff --git a/sys/arch/vax/if/if_de.c b/sys/arch/vax/if/if_de.c index 9071bb95413..57ec258e7f2 100644 --- a/sys/arch/vax/if/if_de.c +++ b/sys/arch/vax/if/if_de.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_de.c,v 1.19 2006/04/16 00:46:32 pascoe Exp $ */ +/* $OpenBSD: if_de.c,v 1.20 2008/08/14 11:41:30 martin Exp $ */ /* $NetBSD: if_de.c,v 1.27 1997/04/19 15:02:29 ragge Exp $ */ /* @@ -258,7 +258,7 @@ deinit(ds) return; if ((ifp->if_flags & IFF_RUNNING) == 0) { if (if_ubaminit(&ds->ds_deuba, (void *)ds->ds_dev.dv_parent, - sizeof (struct ether_header), (int)vax_btoc(ETHERMTU), + sizeof (struct ether_header), (int)vax_atop(ETHERMTU), ds->ds_ifr, NRCV, ds->ds_ifw, NXMT) == 0) { printf("%s: can't initialize\n", ds->ds_dev.dv_xname); ds->ds_if.if_flags &= ~IFF_UP; diff --git a/sys/arch/vax/include/param.h b/sys/arch/vax/include/param.h index 789f32c49ba..6069808dc04 100644 --- a/sys/arch/vax/include/param.h +++ b/sys/arch/vax/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.33 2007/05/28 21:02:49 thib Exp $ */ +/* $OpenBSD: param.h,v 1.34 2008/08/14 11:41:30 martin Exp $ */ /* $NetBSD: param.h,v 1.39 1999/10/22 21:14:34 ragge Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -114,16 +114,12 @@ #define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT)) #define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT)) -/* clicks to bytes */ -#define ctob(x) ((x) << PGSHIFT) -#define btoc(x) (((unsigned)(x) + PGOFSET) >> PGSHIFT) - /* bytes to disk blocks */ #define btodb(x) ((x) >> DEV_BSHIFT) #define dbtob(x) ((x) << DEV_BSHIFT) /* MD conversion macros */ -#define vax_btoc(x) (((unsigned)(x) + VAX_PGOFSET) >> VAX_PGSHIFT) +#define vax_atop(x) (((unsigned)(x) + VAX_PGOFSET) >> VAX_PGSHIFT) #define vax_btop(x) (((unsigned)(x)) >> VAX_PGSHIFT) #define ovbcopy(x,y,z) bcopy(x, y, z) diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c index 9f30ae69a6b..ab73c279126 100644 --- a/sys/arch/vax/vax/disksubr.c +++ b/sys/arch/vax/vax/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.57 2008/06/12 06:58:38 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.58 2008/08/14 11:41:30 martin Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1999/06/30 18:48:06 ragge Exp $ */ /* @@ -175,7 +175,7 @@ disk_reallymapin(struct buf *bp, pt_entry_t *map, int reg, int flag) caddr_t addr; o = (int)bp->b_data & VAX_PGOFSET; - npf = vax_btoc(bp->b_bcount + o) + 1; + npf = vax_atop(bp->b_bcount + o) + 1; addr = bp->b_data; p = bp->b_proc; diff --git a/sys/arch/vax/vax/ka650.c b/sys/arch/vax/vax/ka650.c index 07241be1938..e9cbec591b0 100644 --- a/sys/arch/vax/vax/ka650.c +++ b/sys/arch/vax/vax/ka650.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ka650.c,v 1.13 2004/01/29 21:34:17 deraadt Exp $ */ +/* $OpenBSD: ka650.c,v 1.14 2008/08/14 11:41:30 martin Exp $ */ /* $NetBSD: ka650.c,v 1.25 2001/04/27 15:02:37 ragge Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -106,9 +106,9 @@ uvaxIII_conf() syssub == VAX_SIE_KA655 ? 5 : 0, (vax_cpudata & 0xff), GETFRMREV(vax_siedata)); ka650setcache(CACHEON); - if (ctob(physmem) > ka650merr_ptr->merr_qbmbr) { + if (ptoa(physmem) > ka650merr_ptr->merr_qbmbr) { printf("physmem(0x%x) > qbmbr(0x%x)\n", - ctob(physmem), (int)ka650merr_ptr->merr_qbmbr); + ptoa(physmem), (int)ka650merr_ptr->merr_qbmbr); panic("qbus map unprotected"); } if (mfpr(PR_TODR) == 0) diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index 89268ab6bca..2d652f22d52 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.96 2008/06/27 17:22:15 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.97 2008/08/14 11:41:30 martin Exp $ */ /* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */ /* @@ -192,7 +192,7 @@ cpu_startup() printf("real mem = %u (%uMB)\n", avail_end, avail_end/1024/1024); - physmem = btoc(avail_end); + physmem = atop(avail_end); mtpr(AST_NO, PR_ASTLVL); spl0(); @@ -287,10 +287,10 @@ dumpconf(void) * XXX include the final RAM page which is not included in physmem. */ dumpsize = physmem + 1; - if (dumpsize > btoc(dbtob(nblks - dumplo))) - dumpsize = btoc(dbtob(nblks - dumplo)); + if (dumpsize > atop(dbtob(nblks - dumplo))) + dumpsize = atop(dbtob(nblks - dumplo)); else if (dumplo == 0) - dumplo = nblks - btodb(ctob(dumpsize)); + dumplo = nblks - btodb(ptoa(dumpsize)); /* * Don't dump on the first block in case the dump diff --git a/sys/arch/vax/vax/pmap.c b/sys/arch/vax/vax/pmap.c index 8831ca80c55..fab3009d1d2 100644 --- a/sys/arch/vax/vax/pmap.c +++ b/sys/arch/vax/vax/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.44 2008/06/14 10:55:20 mk Exp $ */ +/* $OpenBSD: pmap.c,v 1.45 2008/08/14 11:41:30 martin Exp $ */ /* $NetBSD: pmap.c,v 1.74 1999/11/13 21:32:25 matt Exp $ */ /* * Copyright (c) 1994, 1998, 1999 Ludd, University of Lule}, Sweden. @@ -291,7 +291,7 @@ pmap_steal_memory(size, vstartp, vendp) size, vstartp, vendp); #endif size = round_page(size); - npgs = btoc(size); + npgs = atop(size); #ifdef DIAGNOSTIC if (uvm.page_init_done == TRUE) @@ -390,9 +390,9 @@ pmap_create() (u_long *)&pmap->pm_p0br); if (res) panic("pmap_create"); - pmap->pm_p0lr = vax_btoc(MAXTSIZ + MAXDSIZ + BRKSIZ) | AST_PCB; + pmap->pm_p0lr = vax_atop(MAXTSIZ + MAXDSIZ + BRKSIZ) | AST_PCB; (vaddr_t)pmap->pm_p1br = (vaddr_t)pmap->pm_p0br + bytesiz - 0x800000; - pmap->pm_p1lr = vax_btoc(0x40000000 - MAXSSIZ); + pmap->pm_p1lr = vax_atop(0x40000000 - MAXSSIZ); pmap->pm_stack = USRSTACK; #ifdef PMAPDEBUG