Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Sep 2008 12:53:05 GMT
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 149603 for review
Message-ID:  <200809111253.m8BCr5gQ035026@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=149603

Change 149603 by raj@raj_mimi on 2008/09/11 12:53:05

	IFC @149602

Affected files ...

.. //depot/projects/arm/src/ObsoleteFiles.inc#39 integrate
.. //depot/projects/arm/src/bin/cp/utils.c#6 integrate
.. //depot/projects/arm/src/contrib/gcc/config/arm/arm.h#3 integrate
.. //depot/projects/arm/src/etc/rc.initdiskless#6 integrate
.. //depot/projects/arm/src/include/rpc/svc_auth.h#2 integrate
.. //depot/projects/arm/src/lib/libc/gen/arc4random.c#5 integrate
.. //depot/projects/arm/src/lib/libc/rpc/svc.c#3 integrate
.. //depot/projects/arm/src/lib/libc/rpc/svc_auth.c#3 integrate
.. //depot/projects/arm/src/lib/libc/stdlib/malloc.c#18 integrate
.. //depot/projects/arm/src/lib/libthr/thread/thr_exit.c#10 integrate
.. //depot/projects/arm/src/release/doc/en_US.ISO8859-1/relnotes/article.sgml#32 integrate
.. //depot/projects/arm/src/share/man/man4/man4.i386/Makefile#4 integrate
.. //depot/projects/arm/src/share/man/man4/man4.i386/sbni.4#3 branch
.. //depot/projects/arm/src/share/man/man4/tap.4#4 integrate
.. //depot/projects/arm/src/share/man/man9/dev_clone.9#1 branch
.. //depot/projects/arm/src/share/man/man9/devfs_set_cdevpriv.9#1 branch
.. //depot/projects/arm/src/share/man/man9/insmntque.9#2 integrate
.. //depot/projects/arm/src/share/man/man9/make_dev.9#4 integrate
.. //depot/projects/arm/src/sys/amd64/pci/pci_cfgreg.c#5 integrate
.. //depot/projects/arm/src/sys/arm/arm/intr.c#17 integrate
.. //depot/projects/arm/src/sys/arm/arm/nexus.c#8 integrate
.. //depot/projects/arm/src/sys/arm/include/intr.h#10 integrate
.. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_qmgr.c#7 integrate
.. //depot/projects/arm/src/sys/boot/common/dev_net.c#4 integrate
.. //depot/projects/arm/src/sys/boot/forth/loader.conf#20 integrate
.. //depot/projects/arm/src/sys/boot/sparc64/loader/main.c#9 integrate
.. //depot/projects/arm/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#5 integrate
.. //depot/projects/arm/src/sys/compat/linux/linux_file.c#20 integrate
.. //depot/projects/arm/src/sys/compat/linux/linux_socket.c#16 integrate
.. //depot/projects/arm/src/sys/conf/files.i386#37 integrate
.. //depot/projects/arm/src/sys/conf/files.pc98#23 integrate
.. //depot/projects/arm/src/sys/conf/files.sparc64#17 integrate
.. //depot/projects/arm/src/sys/dev/ath/if_athvar.h#21 integrate
.. //depot/projects/arm/src/sys/dev/bge/if_bge.c#41 integrate
.. //depot/projects/arm/src/sys/dev/cxgb/cxgb_adapter.h#12 integrate
.. //depot/projects/arm/src/sys/dev/cxgb/cxgb_main.c#19 integrate
.. //depot/projects/arm/src/sys/dev/cxgb/cxgb_sge.c#16 integrate
.. //depot/projects/arm/src/sys/dev/drm/ati_pcigart.c#4 integrate
.. //depot/projects/arm/src/sys/dev/drm/drm_bufs.c#4 integrate
.. //depot/projects/arm/src/sys/dev/drm/drm_pci.c#4 integrate
.. //depot/projects/arm/src/sys/dev/drm/i915_dma.c#9 integrate
.. //depot/projects/arm/src/sys/dev/drm/mach64_dma.c#4 integrate
.. //depot/projects/arm/src/sys/dev/esp/esp_sbus.c#9 integrate
.. //depot/projects/arm/src/sys/dev/esp/ncr53c9x.c#9 integrate
.. //depot/projects/arm/src/sys/dev/esp/ncr53c9xreg.h#3 integrate
.. //depot/projects/arm/src/sys/dev/esp/ncr53c9xvar.h#5 integrate
.. //depot/projects/arm/src/sys/dev/iicbus/ds133x.c#3 integrate
.. //depot/projects/arm/src/sys/dev/iicbus/ds1672.c#2 integrate
.. //depot/projects/arm/src/sys/dev/jme/if_jme.c#2 integrate
.. //depot/projects/arm/src/sys/dev/jme/if_jmereg.h#2 integrate
.. //depot/projects/arm/src/sys/dev/le/if_le_ledma.c#5 integrate
.. //depot/projects/arm/src/sys/dev/sbni/if_sbni.c#6 branch
.. //depot/projects/arm/src/sys/dev/sbni/if_sbni_isa.c#5 branch
.. //depot/projects/arm/src/sys/dev/sbni/if_sbni_pci.c#4 branch
.. //depot/projects/arm/src/sys/dev/sbni/if_sbnireg.h#3 branch
.. //depot/projects/arm/src/sys/dev/sbni/if_sbnivar.h#4 branch
.. //depot/projects/arm/src/sys/dev/usb/if_zyd.c#9 integrate
.. //depot/projects/arm/src/sys/dev/usb/if_zydreg.h#5 integrate
.. //depot/projects/arm/src/sys/dev/usb/usb_quirks.c#20 integrate
.. //depot/projects/arm/src/sys/dev/usb/usbdevs#49 integrate
.. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h#3 integrate
.. //depot/projects/arm/src/sys/i386/conf/NOTES#32 integrate
.. //depot/projects/arm/src/sys/i386/conf/XEN#2 integrate
.. //depot/projects/arm/src/sys/i386/cpufreq/est.c#10 integrate
.. //depot/projects/arm/src/sys/i386/i386/local_apic.c#24 integrate
.. //depot/projects/arm/src/sys/i386/i386/machdep.c#36 integrate
.. //depot/projects/arm/src/sys/i386/include/xen/xenpmap.h#2 integrate
.. //depot/projects/arm/src/sys/i386/include/xen/xenvar.h#2 integrate
.. //depot/projects/arm/src/sys/i386/pci/pci_cfgreg.c#7 integrate
.. //depot/projects/arm/src/sys/i386/xen/mp_machdep.c#1 branch
.. //depot/projects/arm/src/sys/i386/xen/mptable.c#1 branch
.. //depot/projects/arm/src/sys/i386/xen/pmap.c#2 integrate
.. //depot/projects/arm/src/sys/i386/xen/xen_machdep.c#3 integrate
.. //depot/projects/arm/src/sys/kern/kern_exec.c#28 integrate
.. //depot/projects/arm/src/sys/kern/kern_lock.c#20 integrate
.. //depot/projects/arm/src/sys/kern/kern_mutex.c#22 integrate
.. //depot/projects/arm/src/sys/kern/kern_rmlock.c#2 integrate
.. //depot/projects/arm/src/sys/kern/kern_rwlock.c#18 integrate
.. //depot/projects/arm/src/sys/kern/kern_sx.c#18 integrate
.. //depot/projects/arm/src/sys/kern/subr_sleepqueue.c#24 integrate
.. //depot/projects/arm/src/sys/kern/subr_turnstile.c#15 integrate
.. //depot/projects/arm/src/sys/kern/subr_witness.c#31 integrate
.. //depot/projects/arm/src/sys/kern/tty_ttydisc.c#4 integrate
.. //depot/projects/arm/src/sys/mips/adm5120/admpci.c#2 integrate
.. //depot/projects/arm/src/sys/mips/adm5120/if_admsw.c#2 integrate
.. //depot/projects/arm/src/sys/mips/adm5120/if_admswvar.h#2 integrate
.. //depot/projects/arm/src/sys/mips/adm5120/obio.c#2 integrate
.. //depot/projects/arm/src/sys/mips/adm5120/uart_bus_adm5120.c#2 integrate
.. //depot/projects/arm/src/sys/mips/adm5120/uart_cpu_adm5120.c#2 integrate
.. //depot/projects/arm/src/sys/mips/adm5120/uart_dev_adm5120.c#2 integrate
.. //depot/projects/arm/src/sys/mips/idt/idtpci.c#2 integrate
.. //depot/projects/arm/src/sys/mips/idt/if_kr.c#2 integrate
.. //depot/projects/arm/src/sys/mips/idt/obio.c#2 integrate
.. //depot/projects/arm/src/sys/mips/idt/uart_bus_rc32434.c#2 integrate
.. //depot/projects/arm/src/sys/mips/malta/gt.c#2 integrate
.. //depot/projects/arm/src/sys/mips/malta/gt_pci.c#2 integrate
.. //depot/projects/arm/src/sys/mips/malta/malta_machdep.c#2 integrate
.. //depot/projects/arm/src/sys/mips/malta/obio.c#2 integrate
.. //depot/projects/arm/src/sys/mips/malta/uart_bus_maltausart.c#2 integrate
.. //depot/projects/arm/src/sys/mips/malta/uart_cpu_maltausart.c#2 integrate
.. //depot/projects/arm/src/sys/mips/malta/yamon.c#2 integrate
.. //depot/projects/arm/src/sys/mips/sentry5/obio.c#2 integrate
.. //depot/projects/arm/src/sys/mips/sentry5/s5_machdep.c#2 integrate
.. //depot/projects/arm/src/sys/mips/sentry5/uart_bus_sbusart.c#2 integrate
.. //depot/projects/arm/src/sys/mips/sentry5/uart_cpu_sbusart.c#2 integrate
.. //depot/projects/arm/src/sys/modules/Makefile#59 integrate
.. //depot/projects/arm/src/sys/modules/sbni/Makefile#3 branch
.. //depot/projects/arm/src/sys/net/if_mib.c#5 integrate
.. //depot/projects/arm/src/sys/net/if_tap.c#14 integrate
.. //depot/projects/arm/src/sys/net/if_tap.h#3 integrate
.. //depot/projects/arm/src/sys/netinet/tcp_input.c#44 integrate
.. //depot/projects/arm/src/sys/netinet6/mld6.c#11 integrate
.. //depot/projects/arm/src/sys/pc98/conf/NOTES#19 integrate
.. //depot/projects/arm/src/sys/security/mac_bsdextended/mac_bsdextended.c#17 integrate
.. //depot/projects/arm/src/sys/sparc64/include/asi.h#5 integrate
.. //depot/projects/arm/src/sys/sparc64/include/tlb.h#3 integrate
.. //depot/projects/arm/src/sys/sparc64/sbus/dma_sbus.c#7 integrate
.. //depot/projects/arm/src/sys/sparc64/sbus/lsi64854.c#4 integrate
.. //depot/projects/arm/src/sys/sparc64/sbus/lsi64854var.h#4 integrate
.. //depot/projects/arm/src/sys/sparc64/sparc64/cheetah.c#5 integrate
.. //depot/projects/arm/src/sys/sparc64/sparc64/exception.S#11 integrate
.. //depot/projects/arm/src/sys/sparc64/sparc64/genassym.c#12 integrate
.. //depot/projects/arm/src/sys/sparc64/sparc64/jbusppm.c#1 branch
.. //depot/projects/arm/src/sys/sparc64/sparc64/mp_exception.S#4 integrate
.. //depot/projects/arm/src/sys/sparc64/sparc64/mp_locore.S#5 integrate
.. //depot/projects/arm/src/sys/sparc64/sparc64/pmap.c#21 integrate
.. //depot/projects/arm/src/sys/sparc64/sparc64/schppm.c#1 branch
.. //depot/projects/arm/src/sys/sparc64/sparc64/support.S#6 integrate
.. //depot/projects/arm/src/sys/sparc64/sparc64/swtch.S#4 integrate
.. //depot/projects/arm/src/sys/sparc64/sparc64/tlb.c#4 integrate
.. //depot/projects/arm/src/sys/sun4v/include/asi.h#3 integrate
.. //depot/projects/arm/src/sys/sys/lock.h#17 integrate
.. //depot/projects/arm/src/sys/sys/param.h#48 integrate
.. //depot/projects/arm/src/sys/sys/systm.h#32 integrate
.. //depot/projects/arm/src/sys/sys/vnode.h#29 integrate
.. //depot/projects/arm/src/tools/regression/sockets/sendfile/sendfile.c#3 integrate
.. //depot/projects/arm/src/usr.sbin/cxgbtool/cxgbtool.c#3 integrate
.. //depot/projects/arm/src/usr.sbin/fwcontrol/fwcontrol.8#6 integrate
.. //depot/projects/arm/src/usr.sbin/fwcontrol/fwcontrol.c#4 integrate
.. //depot/projects/arm/src/usr.sbin/iostat/iostat.c#8 integrate

Differences ...

==== //depot/projects/arm/src/ObsoleteFiles.inc#39 (text+ko) ====

@@ -1,5 +1,5 @@
 #
-# $FreeBSD: src/ObsoleteFiles.inc,v 1.157 2008/08/31 08:33:41 antoine Exp $
+# $FreeBSD: src/ObsoleteFiles.inc,v 1.158 2008/09/10 18:36:58 jhb Exp $
 #
 # This file lists old files (OLD_FILES), libraries (OLD_LIBS) and
 # directories (OLD_DIRS) which should get removed at an update. Recently
@@ -53,11 +53,6 @@
 # 20080704: sbsh(4) removed
 OLD_FILES+=usr/share/man/man4/if_sbsh.4.gz
 OLD_FILES+=usr/share/man/man4/sbsh.4.gz
-# 20080704: sbni(4) removed
-.if ${TARGET_ARCH} == "i386"
-OLD_FILES+=usr/share/man/man4/i386/if_sbni.4.gz
-OLD_FILES+=usr/share/man/man4/i386/sbni.4.gz
-.endif
 # 20080704: cnw(4) removed
 OLD_FILES+=usr/share/man/man4/if_cnw.4.gz
 OLD_FILES+=usr/share/man/man4/cnw.4.gz

==== //depot/projects/arm/src/bin/cp/utils.c#6 (text+ko) ====

@@ -33,7 +33,7 @@
 #endif
 #endif /* not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/cp/utils.c,v 1.54 2008/08/07 07:29:26 trasz Exp $");
+__FBSDID("$FreeBSD: src/bin/cp/utils.c,v 1.55 2008/09/09 12:31:42 trasz Exp $");
 
 #include <sys/types.h>
 #include <sys/acl.h>
@@ -224,7 +224,6 @@
 			rval = 1;
 		if (pflag && preserve_fd_acls(from_fd, to_fd) != 0)
 			rval = 1;
-		(void)close(from_fd);
 		if (close(to_fd)) {
 			warn("%s", to.p_path);
 			rval = 1;

==== //depot/projects/arm/src/contrib/gcc/config/arm/arm.h#3 (text+ko) ====

@@ -507,7 +507,7 @@
 /* wchar_t is unsigned under the AAPCS.  */
 #ifndef WCHAR_TYPE
 #define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "int")
-
+#undef  WCHAR_TYPE_SIZE
 #define WCHAR_TYPE_SIZE BITS_PER_WORD
 #endif
 

==== //depot/projects/arm/src/etc/rc.initdiskless#6 (text+ko) ====

@@ -24,7 +24,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: src/etc/rc.initdiskless,v 1.53 2008/05/15 11:00:23 bms Exp $
+# $FreeBSD: src/etc/rc.initdiskless,v 1.54 2008/09/09 18:40:50 bms Exp $
 
 # On entry to this script the entire system consists of a read-only root
 # mounted via NFS. The kernel has run BOOTP and configured an interface
@@ -73,6 +73,16 @@
 #		If this file exists, then failure to execute the mount
 #		command contained in /conf/T/M/remount is non-fatal.
 #
+# /conf/T/M/remount_subdir
+#		If this file exists, then the behaviour of /conf/T/M/remount
+#		changes as follows:
+#		 1. /conf/T/M/remount is invoked to mount the root of the
+#		    filesystem where the configuration data exists on a
+#		    temporary mountpoint.
+#		 2. /conf/T/M/remount_subdir is then invoked to mount a
+#		    *subdirectory* of the filesystem mounted by
+#		    /conf/T/M/remount on /conf/T/M/.
+#
 # /conf/T/M/diskless_remount
 #		The contents of the file points to an NFS filesystem,
 #		possibly followed by mount_nfs options. If the server name
@@ -296,10 +306,33 @@
 
 	# remount. Beware, the command is in the file itself!
 	if [ -f $j/remount ]; then
-	    nfspt=`/bin/cat $j/remount`
-	    $nfspt $j
-	    chkerr $? "$nfspt $j"
-	    to_umount="$j ${to_umount}" # XXX hope it is really a mount!
+	    if [ -f $j/remount_subdir ]; then
+		k="/conf.tmp/$i/$subdir"
+		[ -d $k ] || continue
+
+		# Mount the filesystem root where the config data is
+		# on the temporary mount point.
+		nfspt=`/bin/cat $j/remount`
+		$nfspt $k
+		chkerr $? "$nfspt $k"
+
+		# Now use a nullfs mount to get the data where we
+		# really want to see it.
+		remount_subdir=`/bin/cat $j/remount_subdir`
+		remount_subdir_cmd="mount -t nullfs $k/$remount_subdir"
+
+		$remount_subdir_cmd $j
+		chkerr $? "$remount_subdir_cmd $j"
+
+		# XXX check order -- we must force $k to be unmounted
+		# after j, as j depends on k.
+		to_umount="$j $k ${to_umount}"
+	    else
+		nfspt=`/bin/cat $j/remount`
+		$nfspt $j
+		chkerr $? "$nfspt $j"
+		to_umount="$j ${to_umount}" # XXX hope it is really a mount!
+	    fi
 	fi
 
 	# NFS remount

==== //depot/projects/arm/src/include/rpc/svc_auth.h#2 (text+ko) ====

@@ -30,7 +30,7 @@
  *
  *	from: @(#)svc_auth.h 1.6 86/07/16 SMI
  *	@(#)svc_auth.h	2.1 88/07/29 4.0 RPCSRC
- * $FreeBSD: src/include/rpc/svc_auth.h,v 1.14 2002/03/23 17:24:55 imp Exp $
+ * $FreeBSD: src/include/rpc/svc_auth.h,v 1.15 2008/09/09 14:15:55 dfr Exp $
  */
 
 /*
@@ -46,6 +46,8 @@
  * Server side authenticator
  */
 __BEGIN_DECLS
+extern struct svc_auth_ops svc_auth_null_ops;
+
 extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *);
 extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *,
 			  struct rpc_msg *));

==== //depot/projects/arm/src/lib/libc/gen/arc4random.c#5 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/gen/arc4random.c,v 1.24 2008/08/03 20:15:22 ache Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/gen/arc4random.c,v 1.25 2008/09/09 09:46:36 ache Exp $");
 
 #include "namespace.h"
 #include <sys/types.h>
@@ -54,7 +54,7 @@
 
 static pthread_mutex_t	arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
 
-#define	RANDOMDEV	"/dev/urandom"
+#define	RANDOMDEV	"/dev/random"
 #define KEYSIZE		128
 #define	THREAD_LOCK()						\
 	do {							\
@@ -193,6 +193,7 @@
 	THREAD_LOCK();
 	arc4_check_init();
 	arc4_stir();
+	rs_stired = 1;
 	THREAD_UNLOCK();
 }
 

==== //depot/projects/arm/src/lib/libc/rpc/svc.c#3 (text+ko) ====

@@ -34,7 +34,7 @@
 static char *sccsid = "@(#)svc.c	2.4 88/08/11 4.0 RPCSRC";
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/rpc/svc.c,v 1.25 2008/08/06 14:02:05 dfr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/rpc/svc.c,v 1.26 2008/09/09 14:15:55 dfr Exp $");
 
 /*
  * svc.c, Server-side remote procedure call interface.
@@ -569,6 +569,7 @@
 	ext = mem_alloc(sizeof(SVCXPRT_EXT));
 	memset(ext, 0, sizeof(SVCXPRT_EXT));
 	xprt->xp_p3 = ext;
+	ext->xp_auth.svc_ah_ops = &svc_auth_null_ops;
 
 	return (xprt);
 }

==== //depot/projects/arm/src/lib/libc/rpc/svc_auth.c#3 (text+ko) ====

@@ -37,7 +37,7 @@
 static char sccsid[] = "@(#)svc_auth.c 1.26 89/02/07 Copyr 1984 Sun Micro";
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/rpc/svc_auth.c,v 1.14 2008/08/06 14:02:05 dfr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/rpc/svc_auth.c,v 1.15 2008/09/09 14:15:55 dfr Exp $");
 
 /*
  * svc_auth.c, Server-side rpc authenticator interface.
@@ -75,7 +75,7 @@
 };
 static struct authsvc *Auths = NULL;
 
-static struct svc_auth_ops svc_auth_null_ops;
+struct svc_auth_ops svc_auth_null_ops;
 
 /*
  * The call rpc message, msg has been obtained from the wire.  The msg contains
@@ -162,7 +162,7 @@
 	return (xdr_func(xdrs, xdr_ptr));
 }
 
-static struct svc_auth_ops svc_auth_null_ops = {
+struct svc_auth_ops svc_auth_null_ops = {
 	svcauth_null_wrap,
 	svcauth_null_wrap,
 };

==== //depot/projects/arm/src/lib/libc/stdlib/malloc.c#18 (text+ko) ====

@@ -156,7 +156,7 @@
 #define	MALLOC_DSS
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.178 2008/09/06 05:26:31 marcel Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.179 2008/09/10 14:27:34 jasone Exp $");
 
 #include "libc_private.h"
 #ifdef MALLOC_DEBUG
@@ -174,6 +174,7 @@
 #include <sys/ktrace.h> /* Must come after several other sys/ includes. */
 
 #include <machine/cpufunc.h>
+#include <machine/param.h>
 #include <machine/vmparam.h>
 
 #include <errno.h>
@@ -213,55 +214,43 @@
 #define	STRERROR_BUF		64
 
 /*
- * The const_size2bin table is sized according to PAGESIZE_2POW, but for
- * correctness reasons, we never assume that
- * (pagesize == (1U << * PAGESIZE_2POW)).
- *
  * Minimum alignment of allocations is 2^QUANTUM_2POW bytes.
  */
 #ifdef __i386__
-#  define PAGESIZE_2POW		12
 #  define QUANTUM_2POW		4
 #  define SIZEOF_PTR_2POW	2
 #  define CPU_SPINWAIT		__asm__ volatile("pause")
 #endif
 #ifdef __ia64__
-#  define PAGESIZE_2POW		13
 #  define QUANTUM_2POW		4
 #  define SIZEOF_PTR_2POW	3
 #endif
 #ifdef __alpha__
-#  define PAGESIZE_2POW		13
 #  define QUANTUM_2POW		4
 #  define SIZEOF_PTR_2POW	3
 #  define NO_TLS
 #endif
 #ifdef __sparc64__
-#  define PAGESIZE_2POW		13
 #  define QUANTUM_2POW		4
 #  define SIZEOF_PTR_2POW	3
 #  define NO_TLS
 #endif
 #ifdef __amd64__
-#  define PAGESIZE_2POW		12
 #  define QUANTUM_2POW		4
 #  define SIZEOF_PTR_2POW	3
 #  define CPU_SPINWAIT		__asm__ volatile("pause")
 #endif
 #ifdef __arm__
-#  define PAGESIZE_2POW		12
 #  define QUANTUM_2POW		3
 #  define SIZEOF_PTR_2POW	2
 #  define NO_TLS
 #endif
 #ifdef __mips__
-#  define PAGESIZE_2POW		12
 #  define QUANTUM_2POW		3
 #  define SIZEOF_PTR_2POW	2
 #  define NO_TLS
 #endif
 #ifdef __powerpc__
-#  define PAGESIZE_2POW		12
 #  define QUANTUM_2POW		4
 #  define SIZEOF_PTR_2POW	2
 #endif
@@ -361,7 +350,7 @@
 #define	RUN_MAX_OVRHD_RELAX	0x00001800U
 
 /* Put a cap on small object run size.  This overrides RUN_MAX_OVRHD. */
-#define	RUN_MAX_SMALL	(12 * pagesize)
+#define	RUN_MAX_SMALL	(12 * PAGE_SIZE)
 
 /*
  * Hyper-threaded CPUs may need a special instruction inside spin loops in
@@ -733,7 +722,8 @@
 
 	/*
 	 * bins is used to store rings of free regions of the following sizes,
-	 * assuming a 16-byte quantum, 4kB pagesize, and default MALLOC_OPTIONS.
+	 * assuming a 16-byte quantum, 4kB page size, and default
+	 * MALLOC_OPTIONS.
 	 *
 	 *   bins[i] | size |
 	 *   --------+------+
@@ -794,11 +784,6 @@
 /* Number of CPUs. */
 static unsigned		ncpus;
 
-/* VM page size. */
-static size_t		pagesize;
-static size_t		pagesize_mask;
-static size_t		pagesize_2pow;
-
 /* Various bin-related settings. */
 #ifdef MALLOC_TINY		/* Number of (2^n)-spaced tiny bins. */
 #  define		ntbins	((unsigned)(QUANTUM_2POW - TINY_MIN_2POW))
@@ -835,7 +820,7 @@
 #define	S2B_64(i)	S2B_32(i) S2B_32(i)
 #define	S2B_128(i)	S2B_64(i) S2B_64(i)
 #define	S2B_256(i)	S2B_128(i) S2B_128(i)
-static const uint8_t	const_size2bin[(1U << PAGESIZE_2POW) - 255] = {
+static const uint8_t	const_size2bin[PAGE_SIZE - 255] = {
 	S2B_1(0xffU)		/*    0 */
 #if (QUANTUM_2POW == 4)
 /* 64-bit system ************************/
@@ -906,7 +891,7 @@
 	S2B_256(S2B_SMIN + 10)	/* 3328 */
 	S2B_256(S2B_SMIN + 11)	/* 3584 */
 	S2B_256(S2B_SMIN + 12)	/* 3840 */
-#if (PAGESIZE_2POW == 13)
+#if (PAGE_SHIFT == 13)
 	S2B_256(S2B_SMIN + 13)	/* 4096 */
 	S2B_256(S2B_SMIN + 14)	/* 4352 */
 	S2B_256(S2B_SMIN + 15)	/* 4608 */
@@ -1345,9 +1330,9 @@
 #define	SUBPAGE_CEILING(s)						\
 	(((s) + SUBPAGE_MASK) & ~SUBPAGE_MASK)
 
-/* Return the smallest pagesize multiple that is >= s. */
+/* Return the smallest PAGE_SIZE multiple that is >= s. */
 #define	PAGE_CEILING(s)							\
-	(((s) + pagesize_mask) & ~pagesize_mask)
+	(((s) + PAGE_MASK) & ~PAGE_MASK)
 
 #ifdef MALLOC_TINY
 /* Compute the smallest power of 2 that is >= x. */
@@ -1693,7 +1678,7 @@
 			    i < ntbins + nqbins + ncbins ? "C" : "S",
 			    arena->bins[i].reg_size,
 			    arena->bins[i].nregs,
-			    arena->bins[i].run_size >> pagesize_2pow,
+			    arena->bins[i].run_size >> PAGE_SHIFT,
 #ifdef MALLOC_MAG
 			    (__isthreaded && opt_mag) ?
 			    arena->bins[i].stats.nmags :
@@ -2335,8 +2320,8 @@
 arena_avail_comp(arena_chunk_map_t *a, arena_chunk_map_t *b)
 {
 	int ret;
-	size_t a_size = a->bits & ~pagesize_mask;
-	size_t b_size = b->bits & ~pagesize_mask;
+	size_t a_size = a->bits & ~PAGE_MASK;
+	size_t b_size = b->bits & ~PAGE_MASK;
 
 	ret = (a_size > b_size) - (a_size < b_size);
 	if (ret == 0) {
@@ -2521,7 +2506,7 @@
 		    SSIZE_INV(4), SSIZE_INV(5), SSIZE_INV(6), SSIZE_INV(7),
 		    SSIZE_INV(8), SSIZE_INV(9), SSIZE_INV(10), SSIZE_INV(11),
 		    SSIZE_INV(12), SSIZE_INV(13), SSIZE_INV(14), SSIZE_INV(15)
-#if (PAGESIZE_2POW == 13)
+#if (PAGE_SHIFT == 13)
 		    ,
 		    SSIZE_INV(16), SSIZE_INV(17), SSIZE_INV(18), SSIZE_INV(19),
 		    SSIZE_INV(20), SSIZE_INV(21), SSIZE_INV(22), SSIZE_INV(23),
@@ -2530,7 +2515,7 @@
 #endif
 		};
 		assert(SUBPAGE * (((sizeof(ssize_invs)) / sizeof(unsigned)) + 3)
-		    >= (1U << PAGESIZE_2POW));
+		    >= PAGE_SIZE);
 
 		if (size < (((sizeof(ssize_invs) / sizeof(unsigned)) + 2) <<
 		    SUBPAGE_2POW)) {
@@ -2562,10 +2547,10 @@
 	chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run);
 	old_ndirty = chunk->ndirty;
 	run_ind = (unsigned)(((uintptr_t)run - (uintptr_t)chunk)
-	    >> pagesize_2pow);
-	total_pages = (chunk->map[run_ind].bits & ~pagesize_mask) >>
-	    pagesize_2pow;
-	need_pages = (size >> pagesize_2pow);
+	    >> PAGE_SHIFT);
+	total_pages = (chunk->map[run_ind].bits & ~PAGE_MASK) >>
+	    PAGE_SHIFT;
+	need_pages = (size >> PAGE_SHIFT);
 	assert(need_pages > 0);
 	assert(need_pages <= total_pages);
 	rem_pages = total_pages - need_pages;
@@ -2575,11 +2560,11 @@
 	/* Keep track of trailing unused pages for later use. */
 	if (rem_pages > 0) {
 		chunk->map[run_ind+need_pages].bits = (rem_pages <<
-		    pagesize_2pow) | (chunk->map[run_ind+need_pages].bits &
-		    pagesize_mask);
+		    PAGE_SHIFT) | (chunk->map[run_ind+need_pages].bits &
+		    PAGE_MASK);
 		chunk->map[run_ind+total_pages-1].bits = (rem_pages <<
-		    pagesize_2pow) | (chunk->map[run_ind+total_pages-1].bits &
-		    pagesize_mask);
+		    PAGE_SHIFT) | (chunk->map[run_ind+total_pages-1].bits &
+		    PAGE_MASK);
 		arena_avail_tree_insert(&arena->runs_avail,
 		    &chunk->map[run_ind+need_pages]);
 	}
@@ -2590,7 +2575,7 @@
 			if ((chunk->map[run_ind + i].bits & CHUNK_MAP_ZEROED)
 			    == 0) {
 				memset((void *)((uintptr_t)chunk + ((run_ind
-				    + i) << pagesize_2pow)), 0, pagesize);
+				    + i) << PAGE_SHIFT)), 0, PAGE_SIZE);
 				/* CHUNK_MAP_ZEROED is cleared below. */
 			}
 		}
@@ -2706,7 +2691,7 @@
 	arena_chunk_map_t *mapelm, key;
 
 	assert(size <= arena_maxclass);
-	assert((size & pagesize_mask) == 0);
+	assert((size & PAGE_MASK) == 0);
 
 	/* Search the arena's chunks for the lowest best fit. */
 	key.bits = size | CHUNK_MAP_KEY;
@@ -2717,7 +2702,7 @@
 		    / sizeof(arena_chunk_map_t);
 
 		run = (arena_run_t *)((uintptr_t)run_chunk + (pageind
-		    << pagesize_2pow));
+		    << PAGE_SHIFT));
 		arena_run_split(arena, run, size, large, zero);
 		return (run);
 	}
@@ -2729,7 +2714,7 @@
 	if (chunk == NULL)
 		return (NULL);
 	run = (arena_run_t *)((uintptr_t)chunk + (arena_chunk_header_npages <<
-	    pagesize_2pow));
+	    PAGE_SHIFT));
 	/* Update page map. */
 	arena_run_split(arena, run, size, large, zero);
 	return (run);
@@ -2781,7 +2766,7 @@
 				arena->ndirty -= npages;
 
 				madvise((void *)((uintptr_t)chunk + (i <<
-				    pagesize_2pow)), (npages << pagesize_2pow),
+				    PAGE_SHIFT)), (npages << PAGE_SHIFT),
 				    MADV_FREE);
 #ifdef MALLOC_STATS
 				arena->stats.nmadvise++;
@@ -2807,14 +2792,14 @@
 
 	chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run);
 	run_ind = (size_t)(((uintptr_t)run - (uintptr_t)chunk)
-	    >> pagesize_2pow);
+	    >> PAGE_SHIFT);
 	assert(run_ind >= arena_chunk_header_npages);
 	assert(run_ind < chunk_npages);
 	if ((chunk->map[run_ind].bits & CHUNK_MAP_LARGE) != 0)
-		size = chunk->map[run_ind].bits & ~pagesize_mask;
+		size = chunk->map[run_ind].bits & ~PAGE_MASK;
 	else
 		size = run->bin->run_size;
-	run_pages = (size >> pagesize_2pow);
+	run_pages = (size >> PAGE_SHIFT);
 
 	/* Mark pages as unallocated in the chunk map. */
 	if (dirty) {
@@ -2841,15 +2826,15 @@
 		}
 	}
 	chunk->map[run_ind].bits = size | (chunk->map[run_ind].bits &
-	    pagesize_mask);
+	    PAGE_MASK);
 	chunk->map[run_ind+run_pages-1].bits = size |
-	    (chunk->map[run_ind+run_pages-1].bits & pagesize_mask);
+	    (chunk->map[run_ind+run_pages-1].bits & PAGE_MASK);
 
 	/* Try to coalesce forward. */
 	if (run_ind + run_pages < chunk_npages &&
 	    (chunk->map[run_ind+run_pages].bits & CHUNK_MAP_ALLOCATED) == 0) {
 		size_t nrun_size = chunk->map[run_ind+run_pages].bits &
-		    ~pagesize_mask;
+		    ~PAGE_MASK;
 
 		/*
 		 * Remove successor from runs_avail; the coalesced run is
@@ -2859,22 +2844,22 @@
 		    &chunk->map[run_ind+run_pages]);
 
 		size += nrun_size;
-		run_pages = size >> pagesize_2pow;
+		run_pages = size >> PAGE_SHIFT;
 
-		assert((chunk->map[run_ind+run_pages-1].bits & ~pagesize_mask)
+		assert((chunk->map[run_ind+run_pages-1].bits & ~PAGE_MASK)
 		    == nrun_size);
 		chunk->map[run_ind].bits = size | (chunk->map[run_ind].bits &
-		    pagesize_mask);
+		    PAGE_MASK);
 		chunk->map[run_ind+run_pages-1].bits = size |
-		    (chunk->map[run_ind+run_pages-1].bits & pagesize_mask);
+		    (chunk->map[run_ind+run_pages-1].bits & PAGE_MASK);
 	}
 
 	/* Try to coalesce backward. */
 	if (run_ind > arena_chunk_header_npages && (chunk->map[run_ind-1].bits &
 	    CHUNK_MAP_ALLOCATED) == 0) {
-		size_t prun_size = chunk->map[run_ind-1].bits & ~pagesize_mask;
+		size_t prun_size = chunk->map[run_ind-1].bits & ~PAGE_MASK;
 
-		run_ind -= prun_size >> pagesize_2pow;
+		run_ind -= prun_size >> PAGE_SHIFT;
 
 		/*
 		 * Remove predecessor from runs_avail; the coalesced run is
@@ -2884,21 +2869,21 @@
 		    &chunk->map[run_ind]);
 
 		size += prun_size;
-		run_pages = size >> pagesize_2pow;
+		run_pages = size >> PAGE_SHIFT;
 
-		assert((chunk->map[run_ind].bits & ~pagesize_mask) ==
+		assert((chunk->map[run_ind].bits & ~PAGE_MASK) ==
 		    prun_size);
 		chunk->map[run_ind].bits = size | (chunk->map[run_ind].bits &
-		    pagesize_mask);
+		    PAGE_MASK);
 		chunk->map[run_ind+run_pages-1].bits = size |
-		    (chunk->map[run_ind+run_pages-1].bits & pagesize_mask);
+		    (chunk->map[run_ind+run_pages-1].bits & PAGE_MASK);
 	}
 
 	/* Insert into runs_avail, now that coalescing is complete. */
 	arena_avail_tree_insert(&arena->runs_avail, &chunk->map[run_ind]);
 
 	/* Deallocate chunk if it is now completely unused. */
-	if ((chunk->map[arena_chunk_header_npages].bits & (~pagesize_mask |
+	if ((chunk->map[arena_chunk_header_npages].bits & (~PAGE_MASK |
 	    CHUNK_MAP_ALLOCATED)) == arena_maxclass)
 		arena_chunk_dealloc(arena, chunk);
 
@@ -2911,8 +2896,8 @@
 arena_run_trim_head(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run,
     size_t oldsize, size_t newsize)
 {
-	size_t pageind = ((uintptr_t)run - (uintptr_t)chunk) >> pagesize_2pow;
-	size_t head_npages = (oldsize - newsize) >> pagesize_2pow;
+	size_t pageind = ((uintptr_t)run - (uintptr_t)chunk) >> PAGE_SHIFT;
+	size_t head_npages = (oldsize - newsize) >> PAGE_SHIFT;
 
 	assert(oldsize > newsize);
 
@@ -2932,8 +2917,8 @@
 arena_run_trim_tail(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run,
     size_t oldsize, size_t newsize, bool dirty)
 {
-	size_t pageind = ((uintptr_t)run - (uintptr_t)chunk) >> pagesize_2pow;
-	size_t npages = newsize >> pagesize_2pow;
+	size_t pageind = ((uintptr_t)run - (uintptr_t)chunk) >> PAGE_SHIFT;
+	size_t npages = newsize >> PAGE_SHIFT;
 
 	assert(oldsize > newsize);
 
@@ -2962,7 +2947,7 @@
 	if (mapelm != NULL) {
 		/* run is guaranteed to have available space. */
 		arena_run_tree_remove(&bin->runs, mapelm);
-		run = (arena_run_t *)(mapelm->bits & ~pagesize_mask);
+		run = (arena_run_t *)(mapelm->bits & ~PAGE_MASK);
 #ifdef MALLOC_STATS
 		bin->stats.reruns++;
 #endif
@@ -3053,7 +3038,7 @@
 	unsigned good_nregs, good_mask_nelms, good_reg0_offset;
 	unsigned try_nregs, try_mask_nelms, try_reg0_offset;
 
-	assert(min_run_size >= pagesize);
+	assert(min_run_size >= PAGE_SIZE);
 	assert(min_run_size <= arena_maxclass);
 	assert(min_run_size <= RUN_MAX_SMALL);
 
@@ -3089,7 +3074,7 @@
 		good_reg0_offset = try_reg0_offset;
 
 		/* Try more aggressive settings. */
-		try_run_size += pagesize;
+		try_run_size += PAGE_SIZE;
 		try_nregs = ((try_run_size - sizeof(arena_run_t)) /
 		    bin->reg_size) + 1; /* Counter-act try_nregs-- in loop. */
 		do {
@@ -3405,8 +3390,8 @@
 	size_t offset;
 	arena_chunk_t *chunk;
 
-	assert((size & pagesize_mask) == 0);
-	assert((alignment & pagesize_mask) == 0);
+	assert((size & PAGE_MASK) == 0);
+	assert((alignment & PAGE_MASK) == 0);
 
 #ifdef MALLOC_BALANCE
 	arena_lock_balance(arena);
@@ -3422,7 +3407,7 @@
 	chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ret);
 
 	offset = (uintptr_t)ret & (alignment - 1);
-	assert((offset & pagesize_mask) == 0);
+	assert((offset & PAGE_MASK) == 0);
 	assert(offset < alloc_size);
 	if (offset == 0)
 		arena_run_trim_tail(arena, chunk, ret, alloc_size, size, false);
@@ -3492,7 +3477,7 @@
 		return (NULL);
 	}
 
-	if (ceil_size <= pagesize || (alignment <= pagesize
+	if (ceil_size <= PAGE_SIZE || (alignment <= PAGE_SIZE
 	    && ceil_size <= arena_maxclass))
 		ret = arena_malloc(choose_arena(), ceil_size, false);
 	else {
@@ -3506,7 +3491,7 @@
 		ceil_size = PAGE_CEILING(size);
 		/*
 		 * (ceil_size < size) protects against very large sizes within
-		 * pagesize of SIZE_T_MAX.
+		 * PAGE_SIZE of SIZE_T_MAX.
 		 *
 		 * (ceil_size + alignment < ceil_size) protects against the
 		 * combination of maximal alignment and ceil_size large enough
@@ -3526,18 +3511,18 @@
 		 * would need to allocate in order to guarantee the alignment.
 		 */
 		if (ceil_size >= alignment)
-			run_size = ceil_size + alignment - pagesize;
+			run_size = ceil_size + alignment - PAGE_SIZE;
 		else {
 			/*
 			 * It is possible that (alignment << 1) will cause
 			 * overflow, but it doesn't matter because we also
-			 * subtract pagesize, which in the case of overflow
+			 * subtract PAGE_SIZE, which in the case of overflow
 			 * leaves us with a very large run_size.  That causes
 			 * the first conditional below to fail, which means
 			 * that the bogus run_size value never gets used for
 			 * anything important.
 			 */
-			run_size = (alignment << 1) - pagesize;
+			run_size = (alignment << 1) - PAGE_SIZE;
 		}
 
 		if (run_size <= arena_maxclass) {
@@ -3565,15 +3550,15 @@
 	assert(CHUNK_ADDR2BASE(ptr) != ptr);
 
 	chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
-	pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> pagesize_2pow);
+	pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT);
 	mapbits = chunk->map[pageind].bits;
 	assert((mapbits & CHUNK_MAP_ALLOCATED) != 0);
 	if ((mapbits & CHUNK_MAP_LARGE) == 0) {
-		arena_run_t *run = (arena_run_t *)(mapbits & ~pagesize_mask);
+		arena_run_t *run = (arena_run_t *)(mapbits & ~PAGE_MASK);
 		assert(run->magic == ARENA_RUN_MAGIC);
 		ret = run->bin->reg_size;
 	} else {
-		ret = mapbits & ~pagesize_mask;
+		ret = mapbits & ~PAGE_MASK;
 		assert(ret != 0);
 	}
 
@@ -3622,7 +3607,7 @@
 	arena_bin_t *bin;
 	size_t size;
 
-	run = (arena_run_t *)(mapelm->bits & ~pagesize_mask);
+	run = (arena_run_t *)(mapelm->bits & ~PAGE_MASK);
 	assert(run->magic == ARENA_RUN_MAGIC);
 	bin = run->bin;
 	size = bin->reg_size;
@@ -3639,7 +3624,7 @@
 			bin->runcur = NULL;
 		else if (bin->nregs != 1) {
 			size_t run_pageind = (((uintptr_t)run -
-			    (uintptr_t)chunk)) >> pagesize_2pow;
+			    (uintptr_t)chunk)) >> PAGE_SHIFT;
 			arena_chunk_map_t *run_mapelm =
 			    &chunk->map[run_pageind];
 			/*
@@ -3670,7 +3655,7 @@
 				    CHUNK_ADDR2BASE(bin->runcur);
 				size_t runcur_pageind =
 				    (((uintptr_t)bin->runcur -
-				    (uintptr_t)runcur_chunk)) >> pagesize_2pow;
+				    (uintptr_t)runcur_chunk)) >> PAGE_SHIFT;
 				arena_chunk_map_t *runcur_mapelm =
 				    &runcur_chunk->map[runcur_pageind];
 
@@ -3681,7 +3666,7 @@
 			bin->runcur = run;
 		} else {
 			size_t run_pageind = (((uintptr_t)run -
-			    (uintptr_t)chunk)) >> pagesize_2pow;
+			    (uintptr_t)chunk)) >> PAGE_SHIFT;
 			arena_chunk_map_t *run_mapelm =
 			    &chunk->map[run_pageind];
 
@@ -3721,7 +3706,7 @@
 			chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(round);
 			if (chunk->arena == arena) {
 				size_t pageind = (((uintptr_t)round -
-				    (uintptr_t)chunk) >> pagesize_2pow);
+				    (uintptr_t)chunk) >> PAGE_SHIFT);
 				arena_chunk_map_t *mapelm =
 				    &chunk->map[pageind];
 				arena_dalloc_small(arena, chunk, round, mapelm);
@@ -3756,9 +3741,9 @@
 
 	chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
 	arena = chunk->arena;
-	pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> pagesize_2pow);
+	pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT);
 	mapelm = &chunk->map[pageind];
-	run = (arena_run_t *)(mapelm->bits & ~pagesize_mask);
+	run = (arena_run_t *)(mapelm->bits & ~PAGE_MASK);
 	assert(run->magic == ARENA_RUN_MAGIC);
 	bin = run->bin;
 	binind = ((uintptr_t)bin - (uintptr_t)&arena->bins) /
@@ -3823,8 +3808,8 @@
 #endif
 	{
 		size_t pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >>
-		    pagesize_2pow;
-		size_t size = chunk->map[pageind].bits & ~pagesize_mask;
+		    PAGE_SHIFT;
+		size_t size = chunk->map[pageind].bits & ~PAGE_MASK;
 
 #ifdef MALLOC_STATS
 		if (opt_junk)
@@ -3854,7 +3839,7 @@
 	assert(ptr != NULL);
 	assert(CHUNK_ADDR2BASE(ptr) != ptr);
 
-	pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> pagesize_2pow);
+	pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT);
 	mapelm = &chunk->map[pageind];
 	assert((mapelm->bits & CHUNK_MAP_ALLOCATED) != 0);
 	if ((mapelm->bits & CHUNK_MAP_LARGE) == 0) {
@@ -3927,10 +3912,10 @@
 arena_ralloc_large_grow(arena_t *arena, arena_chunk_t *chunk, void *ptr,
     size_t size, size_t oldsize)
 {
-	size_t pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> pagesize_2pow;
-	size_t npages = oldsize >> pagesize_2pow;
+	size_t pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT;
+	size_t npages = oldsize >> PAGE_SHIFT;
 
-	assert(oldsize == (chunk->map[pageind].bits & ~pagesize_mask));
+	assert(oldsize == (chunk->map[pageind].bits & ~PAGE_MASK));
 
 	/* Try to extend the run. */
 	assert(size > oldsize);
@@ -3941,14 +3926,14 @@
 #endif
 	if (pageind + npages < chunk_npages && (chunk->map[pageind+npages].bits
 	    & CHUNK_MAP_ALLOCATED) == 0 && (chunk->map[pageind+npages].bits &
-	    ~pagesize_mask) >= size - oldsize) {
+	    ~PAGE_MASK) >= size - oldsize) {
 		/*
 		 * The next run is available and sufficiently large.  Split the
 		 * following run, then merge the first part with the existing
 		 * allocation.
 		 */
 		arena_run_split(arena, (arena_run_t *)((uintptr_t)chunk +
-		    ((pageind+npages) << pagesize_2pow)), size - oldsize, true,
+		    ((pageind+npages) << PAGE_SHIFT)), size - oldsize, true,
 		    false);
 
 		chunk->map[pageind].bits = size | CHUNK_MAP_LARGE |
@@ -4097,7 +4082,7 @@
 #endif
 
 	/* Initialize bins. */
-	prev_run_size = pagesize;
+	prev_run_size = PAGE_SIZE;
 
 	i = 0;
 #ifdef MALLOC_TINY
@@ -4232,7 +4217,7 @@
 
 	chunk = CHUNK_ADDR2BASE(mag);
 	arena = chunk->arena;
-	pageind = (((uintptr_t)mag - (uintptr_t)chunk) >> pagesize_2pow);
+	pageind = (((uintptr_t)mag - (uintptr_t)chunk) >> PAGE_SHIFT);
 	mapelm = &chunk->map[pageind];
 
 	assert(mag->nrounds == 0);
@@ -4280,7 +4265,7 @@
 
 	chunk = CHUNK_ADDR2BASE(rack);
 	arena = chunk->arena;
-	pageind = (((uintptr_t)rack - (uintptr_t)chunk) >> pagesize_2pow);
+	pageind = (((uintptr_t)rack - (uintptr_t)chunk) >> PAGE_SHIFT);
 	mapelm = &chunk->map[pageind];
 
 	malloc_spin_lock(&arena->lock);
@@ -4803,23 +4788,6 @@
 		}
 	}
 
-	/* Get page size. */
-	{
-		long result;
-
-		result = sysconf(_SC_PAGESIZE);
-		assert(result != -1);
-		pagesize = (unsigned)result;
-
-		/*
-		 * We assume that pagesize is a power of 2 when calculating
-		 * pagesize_mask and pagesize_2pow.
-		 */
-		assert(((result - 1) & result) == 0);
-		pagesize_mask = result - 1;
-		pagesize_2pow = ffs((int)result) - 1;
-	}
-
 	for (i = 0; i < 3; i++) {
 		unsigned j;
 

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809111253.m8BCr5gQ035026>