PERFORCE change 137122 for review

Marcel Moolenaar marcel at FreeBSD.org
Fri Mar 7 22:34:49 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=137122

Change 137122 by marcel at marcel_cluster on 2008/03/07 22:34:21

	IFC @137121

Affected files ...

.. //depot/projects/e500/contrib/bsnmp/snmpd/main.c#2 integrate
.. //depot/projects/e500/etc/Makefile#5 integrate
.. //depot/projects/e500/etc/ddb.conf#1 branch
.. //depot/projects/e500/etc/defaults/rc.conf#7 integrate
.. //depot/projects/e500/etc/rc.d/Makefile#5 integrate
.. //depot/projects/e500/etc/rc.d/ddb#1 branch
.. //depot/projects/e500/etc/rc.d/mountcritlocal#4 integrate
.. //depot/projects/e500/etc/rc.d/mountlate#3 integrate
.. //depot/projects/e500/lib/libc/posix1e/mac.c#2 integrate
.. //depot/projects/e500/lib/libc/posix1e/mac_exec.c#2 integrate
.. //depot/projects/e500/lib/libc/posix1e/mac_get.c#2 integrate
.. //depot/projects/e500/lib/libc/posix1e/mac_set.c#2 integrate
.. //depot/projects/e500/lib/libc/stdlib/malloc.c#9 integrate
.. //depot/projects/e500/lib/libthr/pthread.map#8 integrate
.. //depot/projects/e500/lib/libthr/thread/thr_attr.c#2 integrate
.. //depot/projects/e500/lib/libthr/thread/thr_create.c#2 integrate
.. //depot/projects/e500/lib/libthr/thread/thr_exit.c#3 integrate
.. //depot/projects/e500/lib/libthr/thread/thr_init.c#4 integrate
.. //depot/projects/e500/lib/libthr/thread/thr_private.h#5 integrate
.. //depot/projects/e500/lib/libthr/thread/thr_sig.c#3 integrate
.. //depot/projects/e500/rescue/rescue/Makefile#4 integrate
.. //depot/projects/e500/sbin/ddb/ddb.8#2 integrate
.. //depot/projects/e500/sbin/ddb/ddb.c#2 integrate
.. //depot/projects/e500/sbin/fsck_ffs/main.c#4 integrate
.. //depot/projects/e500/sbin/geom/Makefile#3 integrate
.. //depot/projects/e500/sbin/geom/class/label/geom_label.c#3 integrate
.. //depot/projects/e500/sbin/geom/core/geom.8#4 integrate
.. //depot/projects/e500/sbin/geom/core/geom.c#6 integrate
.. //depot/projects/e500/sbin/newfs/mkfs.c#3 integrate
.. //depot/projects/e500/secure/usr.bin/ssh/Makefile#2 integrate
.. //depot/projects/e500/secure/usr.sbin/sshd/Makefile#2 integrate
.. //depot/projects/e500/share/man/man4/Makefile#13 integrate
.. //depot/projects/e500/share/man/man4/cmx.4#1 branch
.. //depot/projects/e500/share/man/man4/ddb.4#4 integrate
.. //depot/projects/e500/share/man/man4/uslcom.4#1 branch
.. //depot/projects/e500/share/man/man5/rc.conf.5#8 integrate
.. //depot/projects/e500/share/man/man9/bus_space.9#2 integrate
.. //depot/projects/e500/share/mk/sys.mk#4 integrate
.. //depot/projects/e500/sys/amd64/amd64/pmap.c#7 integrate
.. //depot/projects/e500/sys/amd64/conf/GENERIC#12 integrate
.. //depot/projects/e500/sys/amd64/include/pmap.h#3 integrate
.. //depot/projects/e500/sys/arm/arm/pmap.c#9 integrate
.. //depot/projects/e500/sys/arm/arm/uio_machdep.c#2 integrate
.. //depot/projects/e500/sys/arm/conf/AVILA#5 integrate
.. //depot/projects/e500/sys/arm/include/pmap.h#5 integrate
.. //depot/projects/e500/sys/boot/i386/pxeldr/pxeldr.S#2 integrate
.. //depot/projects/e500/sys/conf/NOTES#16 integrate
.. //depot/projects/e500/sys/conf/files#18 integrate
.. //depot/projects/e500/sys/conf/kmod.mk#5 integrate
.. //depot/projects/e500/sys/ddb/db_command.c#3 integrate
.. //depot/projects/e500/sys/ddb/db_examine.c#3 integrate
.. //depot/projects/e500/sys/ddb/db_input.c#3 integrate
.. //depot/projects/e500/sys/dev/agp/agp_nvidia.c#2 integrate
.. //depot/projects/e500/sys/dev/ata/ata-chipset.c#5 integrate
.. //depot/projects/e500/sys/dev/ata/ata-pci.h#5 integrate
.. //depot/projects/e500/sys/dev/bge/if_bge.c#8 integrate
.. //depot/projects/e500/sys/dev/bge/if_bgereg.h#4 integrate
.. //depot/projects/e500/sys/dev/cmx/cmx.c#1 branch
.. //depot/projects/e500/sys/dev/cmx/cmx_pccard.c#1 branch
.. //depot/projects/e500/sys/dev/cmx/cmxreg.h#1 branch
.. //depot/projects/e500/sys/dev/cmx/cmxvar.h#1 branch
.. //depot/projects/e500/sys/dev/lge/if_lge.c#4 integrate
.. //depot/projects/e500/sys/dev/mii/brgphy.c#4 integrate
.. //depot/projects/e500/sys/dev/mii/miidevs#9 integrate
.. //depot/projects/e500/sys/dev/mii/rgephy.c#3 integrate
.. //depot/projects/e500/sys/dev/msk/if_msk.c#7 integrate
.. //depot/projects/e500/sys/dev/nfe/if_nfe.c#7 integrate
.. //depot/projects/e500/sys/dev/nfe/if_nfereg.h#3 integrate
.. //depot/projects/e500/sys/dev/nfe/if_nfevar.h#3 integrate
.. //depot/projects/e500/sys/dev/pccard/pccarddevs#4 integrate
.. //depot/projects/e500/sys/dev/usb/if_axe.c#7 integrate
.. //depot/projects/e500/sys/dev/usb/usbdevs#11 integrate
.. //depot/projects/e500/sys/dev/usb/uslcom.c#1 branch
.. //depot/projects/e500/sys/i386/conf/GENERIC#11 integrate
.. //depot/projects/e500/sys/i386/include/_types.h#2 integrate
.. //depot/projects/e500/sys/i386/include/float.h#2 integrate
.. //depot/projects/e500/sys/kern/kern_cpuset.c#2 integrate
.. //depot/projects/e500/sys/kern/kern_priv.c#3 integrate
.. //depot/projects/e500/sys/kern/kern_shutdown.c#7 integrate
.. //depot/projects/e500/sys/modules/Makefile#10 integrate
.. //depot/projects/e500/sys/modules/cmx/Makefile#1 branch
.. //depot/projects/e500/sys/modules/uslcom/Makefile#1 branch
.. //depot/projects/e500/sys/net/if.c#5 integrate
.. //depot/projects/e500/sys/net/if_ethersubr.c#6 integrate
.. //depot/projects/e500/sys/net/if_gif.c#3 integrate
.. //depot/projects/e500/sys/netgraph/ng_base.c#10 integrate
.. //depot/projects/e500/sys/netgraph/ng_ksocket.c#2 integrate
.. //depot/projects/e500/sys/netgraph/ng_nat.h#4 integrate
.. //depot/projects/e500/sys/netinet/in.h#3 integrate
.. //depot/projects/e500/sys/netinet/in_pcb.c#7 integrate
.. //depot/projects/e500/sys/netinet/libalias/alias.c#2 integrate
.. //depot/projects/e500/sys/netinet/libalias/alias_db.c#2 integrate
.. //depot/projects/e500/sys/netinet/libalias/alias_ftp.c#2 integrate
.. //depot/projects/e500/sys/netinet/libalias/alias_irc.c#2 integrate
.. //depot/projects/e500/sys/netinet/libalias/alias_local.h#2 integrate
.. //depot/projects/e500/sys/netinet/libalias/alias_proxy.c#2 integrate
.. //depot/projects/e500/sys/netinet/libalias/alias_smedia.c#2 integrate
.. //depot/projects/e500/sys/nfsclient/nfs_vfsops.c#9 integrate
.. //depot/projects/e500/sys/nfsserver/nfs_serv.c#5 integrate
.. //depot/projects/e500/sys/powerpc/aim/locore.S#6 integrate
.. //depot/projects/e500/sys/powerpc/aim/machdep.c#11 integrate
.. //depot/projects/e500/sys/powerpc/conf/NOTES#11 integrate
.. //depot/projects/e500/sys/powerpc/include/intr_machdep.h#5 integrate
.. //depot/projects/e500/sys/powerpc/include/md_var.h#8 integrate
.. //depot/projects/e500/sys/powerpc/include/openpicvar.h#4 integrate
.. //depot/projects/e500/sys/powerpc/include/pcpu.h#6 integrate
.. //depot/projects/e500/sys/powerpc/mpc85xx/ocpbus.c#10 integrate
.. //depot/projects/e500/sys/powerpc/mpc85xx/opic.c#6 integrate
.. //depot/projects/e500/sys/powerpc/mpc85xx/pci_ocp.c#7 integrate
.. //depot/projects/e500/sys/powerpc/powermac/openpic_macio.c#4 integrate
.. //depot/projects/e500/sys/powerpc/powerpc/cpu.c#4 integrate
.. //depot/projects/e500/sys/powerpc/powerpc/intr_machdep.c#6 integrate
.. //depot/projects/e500/sys/powerpc/powerpc/openpic.c#4 integrate
.. //depot/projects/e500/sys/powerpc/powerpc/pic_if.m#4 integrate
.. //depot/projects/e500/sys/powerpc/psim/openpic_iobus.c#4 integrate
.. //depot/projects/e500/sys/security/audit/audit_syscalls.c#8 integrate
.. //depot/projects/e500/sys/sys/cpuset.h#2 integrate
.. //depot/projects/e500/sys/sys/pcpu.h#5 integrate
.. //depot/projects/e500/sys/ufs/ffs/ffs_vfsops.c#7 integrate
.. //depot/projects/e500/sys/ufs/ufs/extattr.h#2 integrate
.. //depot/projects/e500/sys/ufs/ufs/ufs_extattr.c#6 integrate
.. //depot/projects/e500/usr.bin/chat/chat.c#2 integrate
.. //depot/projects/e500/usr.bin/cpuset/Makefile#2 integrate
.. //depot/projects/e500/usr.bin/cpuset/cpuset.1#1 branch
.. //depot/projects/e500/usr.bin/cpuset/cpuset.c#2 integrate
.. //depot/projects/e500/usr.bin/make/Makefile#2 integrate
.. //depot/projects/e500/usr.bin/make/Makefile.dist#3 integrate
.. //depot/projects/e500/usr.bin/make/arch.c#2 integrate
.. //depot/projects/e500/usr.bin/make/job.c#2 integrate
.. //depot/projects/e500/usr.bin/make/main.c#4 integrate
.. //depot/projects/e500/usr.bin/make/make.1#3 integrate
.. //depot/projects/e500/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8#3 integrate
.. //depot/projects/e500/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c#2 integrate
.. //depot/projects/e500/usr.sbin/fwcontrol/fwcontrol.8#3 integrate
.. //depot/projects/e500/usr.sbin/fwcontrol/fwcontrol.c#2 integrate
.. //depot/projects/e500/usr.sbin/mountd/mountd.c#4 integrate
.. //depot/projects/e500/usr.sbin/moused/Makefile#2 integrate
.. //depot/projects/e500/usr.sbin/moused/moused.c#3 integrate

Differences ...

==== //depot/projects/e500/contrib/bsnmp/snmpd/main.c#2 (text+ko) ====

@@ -2242,6 +2242,8 @@
 	return (m);
 
   err:
+	if ((m->flags & LM_ONSTARTLIST) != 0)
+		TAILQ_REMOVE(&modules_start, m, start);
 	if (m->handle)
 		dlclose(m->handle);
 	free(m->path);

==== //depot/projects/e500/etc/Makefile#5 (text+ko) ====

@@ -1,5 +1,5 @@
 #	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
-# $FreeBSD: src/etc/Makefile,v 1.365 2007/11/11 01:16:51 mlaier Exp $
+# $FreeBSD: src/etc/Makefile,v 1.366 2008/03/05 18:32:58 brooks Exp $
 
 .include <bsd.own.mk>
 
@@ -9,7 +9,7 @@
 
 BIN1=	amd.map apmd.conf auth.conf \
 	crontab csh.cshrc csh.login csh.logout devd.conf devfs.conf \
-	dhclient.conf disktab fbtab freebsd-update.conf \
+	ddb.conf dhclient.conf disktab fbtab freebsd-update.conf \
 	ftpusers gettytab group \
 	hosts hosts.allow hosts.equiv hosts.lpd \
 	inetd.conf libalias.conf login.access login.conf mac.conf motd \

==== //depot/projects/e500/etc/defaults/rc.conf#7 (text+ko) ====

@@ -15,7 +15,7 @@
 # For a more detailed explanation of all the rc.conf variables, please
 # refer to the rc.conf(5) manual page.
 #
-# $FreeBSD: src/etc/defaults/rc.conf,v 1.326 2008/01/27 15:15:11 mtm Exp $
+# $FreeBSD: src/etc/defaults/rc.conf,v 1.328 2008/03/06 14:01:10 mtm Exp $
 
 ##############################################################
 ###  Important initial Boot-time options  ####################
@@ -33,6 +33,8 @@
 apm_enable="NO"		# Set to YES to enable APM BIOS functions (or NO).
 apmd_enable="NO"	# Run apmd to handle APM event from userland.
 apmd_flags=""		# Flags to apmd (if enabled).
+ddb_enable="NO"		# Set to YES to load ddb scripts at boot.
+ddb_config="/etc/ddb.conf"	# ddb(8) config file.
 devd_enable="YES" 	# Run devd, to trigger programs on device tree changes.
 devd_flags=""		# Additional flags for devd(8).
 kldxref_enable="NO"	# Build linker.hints files with kldxref(8).
@@ -249,7 +251,7 @@
 rwhod_enable="NO"		# Run the rwho daemon (or NO).
 rwhod_flags=""			# Flags for rwhod
 rarpd_enable="NO"		# Run rarpd (or NO).
-rarpd_flags=""			# Flags to rarpd.
+rarpd_flags="-a"		# Flags to rarpd.
 bootparamd_enable="NO"		# Run bootparamd (or NO).
 bootparamd_flags=""		# Flags to bootparamd
 pppoed_enable="NO"		# Run the PPP over Ethernet daemon.

==== //depot/projects/e500/etc/rc.d/Makefile#5 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/rc.d/Makefile,v 1.88 2007/12/08 07:20:22 dougb Exp $
+# $FreeBSD: src/etc/rc.d/Makefile,v 1.89 2008/03/05 18:32:58 brooks Exp $
 
 .include <bsd.own.mk>
 
@@ -7,7 +7,7 @@
 	apm apmd archdep atm1 atm2 atm3 auditd auto_linklocal \
 	bgfsck bluetooth bootparams bridge bsnmpd bthidd \
 	ccd cleanvar cleartmp cron \
-	devd devfs dhclient \
+	ddb devd devfs dhclient \
 	dmesg dumpon \
 	early.sh encswap \
 	fsck ftp-proxy ftpd \

==== //depot/projects/e500/etc/rc.d/mountcritlocal#4 (text+ko) ====

@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $FreeBSD: src/etc/rc.d/mountcritlocal,v 1.15 2007/12/08 07:20:22 dougb Exp $
+# $FreeBSD: src/etc/rc.d/mountcritlocal,v 1.16 2008/03/06 14:39:33 mtm Exp $
 #
 
 # PROVIDE: mountcritlocal
@@ -15,6 +15,8 @@
 
 mountcritlocal_start()
 {
+	local err
+
 	# Set up the list of network filesystem types for which mounting
 	# should be delayed until after network initialization.
 	case ${extra_netfs_types} in
@@ -34,9 +36,10 @@
 	done
 	mount_excludes=${mount_excludes%,}
 	mount -a -t ${mount_excludes}
+	err=$?
 	echo '.'
 
-	case $? in
+	case ${err} in
 	0)
 		;;
 	*)

==== //depot/projects/e500/etc/rc.d/mountlate#3 (text+ko) ====

@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $FreeBSD: src/etc/rc.d/mountlate,v 1.2 2007/05/18 12:04:41 mtm Exp $
+# $FreeBSD: src/etc/rc.d/mountlate,v 1.3 2008/03/06 14:39:33 mtm Exp $
 #
 
 # PROVIDE: mountlate
@@ -16,12 +16,15 @@
 
 mountlate_start()
 {
+	local err
+
 	# Mount "late" filesystems.
 	echo -n 'Mounting late file systems:'
 	mount -a -l
+	err=$?
 	echo '.'
 
-	case $? in
+	case ${err} in
 	0)
 		;;
 	*)

==== //depot/projects/e500/lib/libc/posix1e/mac.c#2 (text+ko) ====

@@ -30,10 +30,11 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/posix1e/mac.c,v 1.12 2004/01/06 18:26:15 nectar Exp $
  */
 
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/lib/libc/posix1e/mac.c,v 1.13 2008/03/07 15:25:56 rwatson Exp $");
+
 #include <sys/types.h>
 #include <sys/queue.h>
 #include <sys/sysctl.h>

==== //depot/projects/e500/lib/libc/posix1e/mac_exec.c#2 (text+ko) ====

@@ -27,10 +27,11 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/posix1e/mac_exec.c,v 1.2 2003/02/16 17:29:10 nectar Exp $
  */
 
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/lib/libc/posix1e/mac_exec.c,v 1.3 2008/03/07 15:25:56 rwatson Exp $");
+
 #include <sys/types.h>
 #include <sys/mac.h>
 

==== //depot/projects/e500/lib/libc/posix1e/mac_get.c#2 (text+ko) ====

@@ -27,10 +27,11 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/posix1e/mac_get.c,v 1.5 2005/01/23 15:28:02 rwatson Exp $
  */
 
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/lib/libc/posix1e/mac_get.c,v 1.6 2008/03/07 15:25:56 rwatson Exp $");
+
 #include <sys/types.h>
 #include <sys/mac.h>
 #include <sys/socket.h>

==== //depot/projects/e500/lib/libc/posix1e/mac_set.c#2 (text+ko) ====

@@ -27,10 +27,11 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/posix1e/mac_set.c,v 1.3 2003/02/27 13:40:01 nectar Exp $
  */
 
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/lib/libc/posix1e/mac_set.c,v 1.4 2008/03/07 15:25:56 rwatson Exp $");
+
 #include <sys/types.h>
 #include <sys/mac.h>
 

==== //depot/projects/e500/lib/libc/stdlib/malloc.c#9 (text+ko) ====

@@ -45,7 +45,8 @@
  * Allocation requests are rounded up to the nearest size class, and no record
  * of the original request size is maintained.  Allocations are broken into
  * categories according to size class.  Assuming runtime defaults, 4 kB pages
- * and a 16 byte quantum, the size classes in each category are as follows:
+ * and a 16 byte quantum on a 32-bit system, the size classes in each category
+ * are as follows:
  *
  *   |=====================================|
  *   | Category | Subcategory    |    Size |
@@ -69,9 +70,9 @@
  *   |                           |    8 kB |
  *   |                           |   12 kB |
  *   |                           |     ... |
+ *   |                           | 1004 kB |
+ *   |                           | 1008 kB |
  *   |                           | 1012 kB |
- *   |                           | 1016 kB |
- *   |                           | 1020 kB |
  *   |=====================================|
  *   | Huge                      |    1 MB |
  *   |                           |    2 MB |
@@ -127,7 +128,7 @@
 #define	MALLOC_DSS
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.166 2008/02/17 18:34:17 jasone Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.167 2008/03/07 16:54:03 jasone Exp $");
 
 #include "libc_private.h"
 #ifdef MALLOC_DEBUG
@@ -145,7 +146,6 @@
 #include <sys/uio.h>
 #include <sys/ktrace.h> /* Must come after several other sys/ includes. */
 
-#include <machine/atomic.h>
 #include <machine/cpufunc.h>
 #include <machine/vmparam.h>
 

==== //depot/projects/e500/lib/libthr/pthread.map#8 (text+ko) ====

@@ -1,5 +1,5 @@
 /*
- * $FreeBSD: src/lib/libthr/pthread.map,v 1.27 2008/03/03 09:16:28 davidxu Exp $
+ * $FreeBSD: src/lib/libthr/pthread.map,v 1.28 2008/03/05 06:56:35 davidxu Exp $
  */
 
 /*
@@ -228,6 +228,7 @@
 	_pthread_barrierattr_setpshared;
 	_pthread_attr_destroy;
 	_pthread_attr_get_np;
+	_pthread_attr_getaffinity_np;
 	_pthread_attr_getdetachstate;
 	_pthread_attr_getguardsize;
 	_pthread_attr_getinheritsched;
@@ -238,6 +239,7 @@
 	_pthread_attr_getstackaddr;
 	_pthread_attr_getstacksize;
 	_pthread_attr_init;
+	_pthread_attr_setaffinity_np;
 	_pthread_attr_setcreatesuspend_np;
 	_pthread_attr_setdetachstate;
 	_pthread_attr_setguardsize;
@@ -267,6 +269,7 @@
 	_pthread_detach;
 	_pthread_equal;
 	_pthread_exit;
+	_pthread_getaffinity_np;
 	_pthread_getconcurrency;
 	_pthread_getprio;
 	_pthread_getschedparam;
@@ -321,6 +324,7 @@
 	_pthread_rwlockattr_setpshared;
 	_pthread_self;
 	_pthread_set_name_np;
+	_pthread_setaffinity_np;
 	_pthread_setcancelstate;
 	_pthread_setcanceltype;
 	_pthread_setconcurrency;
@@ -388,6 +392,8 @@
 };
 
 FBSD_1.1 {
+	pthread_attr_getaffinity_np;
+	pthread_attr_setaffinity_np;
 	pthread_getaffinity_np;
 	pthread_setaffinity_np;
 	pthread_mutex_getspinloops_np;

==== //depot/projects/e500/lib/libthr/thread/thr_attr.c#2 (text+ko) ====

@@ -90,7 +90,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libthr/thread/thr_attr.c,v 1.8 2007/01/12 07:26:20 imp Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_attr.c,v 1.11 2008/03/06 03:24:03 davidxu Exp $
  */
 
 #include "namespace.h"
@@ -99,6 +99,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <pthread_np.h>
+#include <sys/sysctl.h>
 #include "un-namespace.h"
 
 #include "thr_private.h"
@@ -148,7 +149,9 @@
 		attr.flags |= PTHREAD_DETACHED;
 	_thr_ref_delete(curthread, pid);
 	memcpy(*dst, &attr, sizeof(struct pthread_attr));
-
+	/* XXX */
+	(*dst)->cpuset = NULL;
+	(*dst)->cpusetsize = 0;
 	return (0);
 }
 
@@ -543,3 +546,92 @@
 	}
 	return(ret);
 }
+
+static int
+_get_kern_cpuset_size()
+{
+	static int kern_cpuset_size = 0;
+
+	if (kern_cpuset_size == 0) {
+		int len;
+
+		len = sizeof(kern_cpuset_size);
+		if (sysctlbyname("kern.smp.maxcpus", &kern_cpuset_size,
+		    &len, NULL, 0))
+			PANIC("failed to get sysctl kern.smp.maxcpus");
+
+		kern_cpuset_size = (kern_cpuset_size + 7) / 8;
+	}
+
+	return (kern_cpuset_size);
+}
+
+__weak_reference(_pthread_attr_setaffinity_np, pthread_attr_setaffinity_np);
+int
+_pthread_attr_setaffinity_np(pthread_attr_t *pattr, size_t cpusetsize,
+	const cpuset_t *cpuset)
+{
+	pthread_attr_t attr;
+	int ret;
+
+	if (pattr == NULL || (attr = (*pattr)) == NULL)
+		ret = EINVAL;
+	else {
+		if (cpusetsize == 0 || cpuset == NULL) {
+			if (attr->cpuset != NULL) {
+				free(attr->cpuset);
+				attr->cpuset = NULL;
+				attr->cpusetsize = 0;
+			}
+			return (0);
+		}
+			
+		if (cpusetsize > attr->cpusetsize) {
+			int kern_size = _get_kern_cpuset_size();
+			if (cpusetsize > kern_size) {
+				int i;
+				for (i = kern_size; i < cpusetsize; ++i) {
+					if (((char *)cpuset)[i])
+						return (EINVAL);
+				}
+			}
+			void *newset = realloc(attr->cpuset, cpusetsize);
+       			if (newset == NULL)
+		            return (ENOMEM);
+			attr->cpuset = newset;
+			attr->cpusetsize = cpusetsize;
+		} else {
+			memset(((char *)attr->cpuset) + cpusetsize, 0,
+				attr->cpusetsize - cpusetsize);
+			attr->cpusetsize = cpusetsize;
+		}
+		memcpy(attr->cpuset, cpuset, cpusetsize);
+		ret = 0;
+	}
+	return (ret);
+}
+
+__weak_reference(_pthread_attr_getaffinity_np, pthread_attr_getaffinity_np);
+int
+_pthread_attr_getaffinity_np(const pthread_attr_t *pattr, size_t cpusetsize,
+	cpuset_t *cpuset)
+{
+	pthread_attr_t attr;
+	int ret = 0;
+
+	if (pattr == NULL || (attr = (*pattr)) == NULL)
+		ret = EINVAL;
+	else if (attr->cpuset != NULL) {
+		memcpy(cpuset, attr->cpuset, MIN(cpusetsize, attr->cpusetsize));
+		if (cpusetsize > attr->cpusetsize)
+			memset(((char *)cpuset) + attr->cpusetsize, 0, 
+				cpusetsize - attr->cpusetsize);
+	} else {
+		int kern_size = _get_kern_cpuset_size();
+		memset(cpuset, -1, MIN(cpusetsize, kern_size));
+		if (cpusetsize > kern_size)
+			memset(((char *)cpuset) + kern_size, 0,
+				cpusetsize - kern_size);
+	}
+	return (ret);
+}

==== //depot/projects/e500/lib/libthr/thread/thr_create.c#2 (text+ko) ====

@@ -24,7 +24,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libthr/thread/thr_create.c,v 1.36 2006/12/15 11:52:01 davidxu Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_create.c,v 1.40 2008/03/06 01:59:08 davidxu Exp $
  */
 
 #include "namespace.h"
@@ -36,6 +36,7 @@
 #include <string.h>
 #include <stddef.h>
 #include <pthread.h>
+#include <pthread_np.h>
 #include "un-namespace.h"
 
 #include "thr_private.h"
@@ -55,6 +56,8 @@
 	struct rtprio rtp;
 	int ret = 0, locked, create_suspended;
 	sigset_t set, oset;
+	cpuset_t *cpuset = NULL;
+	int cpusetsize = 0;
 
 	_thr_check_init();
 
@@ -73,8 +76,13 @@
 	if (attr == NULL || *attr == NULL)
 		/* Use the default thread attributes: */
 		new_thread->attr = _pthread_attr_default;
-	else
+	else {
 		new_thread->attr = *(*attr);
+		cpuset = new_thread->attr.cpuset;
+		cpusetsize = new_thread->attr.cpusetsize;
+		new_thread->attr.cpuset = NULL;
+		new_thread->attr.cpusetsize = 0;
+	}
 	if (new_thread->attr.sched_inherit == PTHREAD_INHERIT_SCHED) {
 		/* inherit scheduling contention scope */
 		if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM)
@@ -119,12 +127,17 @@
 	if (new_thread->attr.flags & PTHREAD_CREATE_DETACHED)
 		new_thread->tlflags |= TLFLAGS_DETACHED;
 
+	if (curthread->in_sigcancel_handler)
+		new_thread->unblock_sigcancel = 1;
+	else
+		new_thread->unblock_sigcancel = 0;
+
 	/* Add the new thread. */
 	new_thread->refcount = 1;
 	_thr_link(curthread, new_thread);
 	/* Return thread pointer eariler so that new thread can use it. */
 	(*thread) = new_thread;
-	if (SHOULD_REPORT_EVENT(curthread, TD_CREATE)) {
+	if (SHOULD_REPORT_EVENT(curthread, TD_CREATE) || cpuset != NULL) {
 		THR_THREAD_LOCK(curthread, new_thread);
 		locked = 1;
 	} else
@@ -142,11 +155,11 @@
 		param.flags |= THR_SYSTEM_SCOPE;
 	if (new_thread->attr.sched_inherit == PTHREAD_INHERIT_SCHED)
 		param.rtp = NULL;
-	else {
-		sched_param.sched_priority = new_thread->attr.prio;
-		_schedparam_to_rtp(new_thread->attr.sched_policy,
-			&sched_param, &rtp);
-		param.rtp = &rtp;
+	else { 	 
+		sched_param.sched_priority = new_thread->attr.prio; 	 
+		_schedparam_to_rtp(new_thread->attr.sched_policy, 	 
+			&sched_param, &rtp); 	 
+		param.rtp = &rtp; 	 
 	}
 
 	/* Schedule the new thread. */
@@ -168,8 +181,10 @@
 			ret = EAGAIN;
 	}
 
-	if (create_suspended)
+	if (create_suspended) {
 		__sys_sigprocmask(SIG_SETMASK, &oset, NULL);
+		SIGDELSET(oset, SIGCANCEL);
+	}
 
 	if (ret != 0) {
 		if (!locked)
@@ -186,11 +201,31 @@
 		new_thread->tlflags |= TLFLAGS_DETACHED;
 		_thr_ref_delete_unlocked(curthread, new_thread);
 		THREAD_LIST_UNLOCK(curthread);
-		(*thread) = 0;
 	} else if (locked) {
+		if (cpuset != NULL) {
+			if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID,
+				TID(new_thread), cpusetsize, cpuset)) {
+				ret = errno;
+				/* kill the new thread */
+				new_thread->force_exit = 1;
+				THR_THREAD_UNLOCK(curthread, new_thread);
+				goto out;
+			}
+		}
+
 		_thr_report_creation(curthread, new_thread);
 		THR_THREAD_UNLOCK(curthread, new_thread);
+out:
+		if (ret) {
+			THREAD_LIST_LOCK(curthread);
+			new_thread->tlflags |= TLFLAGS_DETACHED;
+			_thr_ref_delete_unlocked(curthread, new_thread);
+			THREAD_LIST_UNLOCK(curthread);
+		}
 	}
+
+	if (ret)
+		(*thread) = 0;
 	return (ret);
 }
 
@@ -213,6 +248,25 @@
 static void
 thread_start(struct pthread *curthread)
 {
+	/*
+	 * This is used as a serialization point to allow parent
+	 * to report 'new thread' event to debugger or tweak new thread's
+	 * attributes before the new thread does real-world work.
+	 */
+	THR_LOCK(curthread);
+	THR_UNLOCK(curthread);
+
+	if (curthread->force_exit)
+		_pthread_exit(PTHREAD_CANCELED);
+
+	if (curthread->unblock_sigcancel) {
+		sigset_t set;
+
+		SIGEMPTYSET(set);
+		SIGADDSET(set, SIGCANCEL);
+		sigprocmask(SIG_UNBLOCK, &set, NULL);
+	}
+
 	if (curthread->attr.suspend == THR_CREATE_SUSPENDED) {
 		sigset_t set = curthread->sigmask;
 
@@ -225,14 +279,6 @@
 		sigprocmask(SIG_SETMASK, &set, NULL);
 	}
 
-	/*
-	 * This is used as a serialization point to allow parent
-	 * to report 'new thread' event to debugger before the thread
-	 * does real work.
-	 */
-	THR_LOCK(curthread);
-	THR_UNLOCK(curthread);
-
 	/* Run the current thread's start routine with argument: */
 	_pthread_exit(curthread->start_routine(curthread->arg));
 

==== //depot/projects/e500/lib/libthr/thread/thr_exit.c#3 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libthr/thread/thr_exit.c,v 1.24 2007/12/20 04:40:12 davidxu Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_exit.c,v 1.25 2008/03/06 02:07:18 davidxu Exp $
  */
 
 #include <errno.h>
@@ -130,7 +130,7 @@
 	if (curthread->tlflags & TLFLAGS_DETACHED)
 		THR_GCLIST_ADD(curthread);
 	THREAD_LIST_UNLOCK(curthread);
-	if (SHOULD_REPORT_EVENT(curthread, TD_DEATH))
+	if (!curthread->force_exit && SHOULD_REPORT_EVENT(curthread, TD_DEATH))
 		_thr_report_death(curthread);
 
 	/*

==== //depot/projects/e500/lib/libthr/thread/thr_init.c#4 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libthr/thread/thr_init.c,v 1.47 2007/10/30 05:57:36 davidxu Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_init.c,v 1.49 2008/03/05 07:01:20 davidxu Exp $
  */
 
 #include "namespace.h"
@@ -75,13 +75,15 @@
 
 struct pthread_attr _pthread_attr_default = {
 	.sched_policy = SCHED_OTHER,
-	.sched_inherit = 0,
+	.sched_inherit = PTHREAD_INHERIT_SCHED,
 	.prio = 0,
 	.suspend = THR_CREATE_RUNNING,
 	.flags = PTHREAD_SCOPE_SYSTEM,
 	.stackaddr_attr = NULL,
 	.stacksize_attr = THR_STACK_DEFAULT,
-	.guardsize_attr = 0
+	.guardsize_attr = 0,
+	.cpusetsize = 0,
+	.cpuset = NULL
 };
 
 struct pthread_mutex_attr _pthread_mutexattr_default = {

==== //depot/projects/e500/lib/libthr/thread/thr_private.h#5 (text+ko) ====

@@ -26,7 +26,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libthr/thread/thr_private.h,v 1.81 2007/12/14 06:25:57 davidxu Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_private.h,v 1.85 2008/03/05 07:01:20 davidxu Exp $
  */
 
 #ifndef _THR_PRIVATE_H
@@ -39,6 +39,8 @@
 #include <sys/time.h>
 #include <sys/cdefs.h>
 #include <sys/queue.h>
+#include <sys/param.h>
+#include <sys/cpuset.h>
 #include <machine/atomic.h>
 #include <errno.h>
 #include <limits.h>
@@ -221,6 +223,8 @@
 	void	*stackaddr_attr;
 	size_t	stacksize_attr;
 	size_t	guardsize_attr;
+	cpuset_t	*cpuset;
+	size_t	cpusetsize;
 };
 
 /*
@@ -374,6 +378,15 @@
 	/* Thread temporary signal mask. */
 	sigset_t		sigmask;
 
+	/* Thread is in SIGCANCEL handler. */
+	int			in_sigcancel_handler;
+
+	/* New thread should unblock SIGCANCEL. */
+	int			unblock_sigcancel;
+
+	/* Force new thread to exit. */
+	int			force_exit;
+
 	/* Thread state: */
 	enum pthread_state 	state;
 
@@ -658,6 +671,8 @@
 void	_thread_bp_create(void);
 void	_thread_bp_death(void);
 int	_sched_yield(void);
+int	_pthread_getaffinity_np(pthread_t, size_t, cpuset_t *);
+int	_pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *);
 
 /* #include <fcntl.h> */
 #ifdef  _SYS_FCNTL_H_

==== //depot/projects/e500/lib/libthr/thread/thr_sig.c#3 (text+ko) ====

@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libthr/thread/thr_sig.c,v 1.25 2007/11/21 05:23:54 davidxu Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_sig.c,v 1.27 2008/03/05 07:04:55 davidxu Exp $
  */
 
 #include "namespace.h"
@@ -69,7 +69,9 @@
 
 	if (curthread->cancel_defer && curthread->cancel_pending)
 		thr_wake(curthread->tid);
+	curthread->in_sigcancel_handler++;
 	_thr_ast(curthread);
+	curthread->in_sigcancel_handler--;
 }
 
 void

==== //depot/projects/e500/rescue/rescue/Makefile#4 (text+ko) ====

@@ -1,4 +1,4 @@
-#$FreeBSD: src/rescue/rescue/Makefile,v 1.58 2007/11/04 00:44:10 marcel Exp $
+#$FreeBSD: src/rescue/rescue/Makefile,v 1.59 2008/03/05 23:32:12 delphij Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/2/93
 
 NO_MAN=
@@ -186,6 +186,7 @@
 CRUNCH_ALIAS_dump= rdump
 CRUNCH_ALIAS_fsck_ffs= fsck_4.2bsd fsck_ufs
 CRUNCH_ALIAS_geom= gpart
+CRUNCH_ALIAS_geom= glabel
 
 # dhclient has historically been troublesome...
 CRUNCH_PROGS_sbin+= dhclient

==== //depot/projects/e500/sbin/ddb/ddb.8#2 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/sbin/ddb/ddb.8,v 1.2 2007/12/26 12:20:19 rwatson Exp $
+.\" $FreeBSD: src/sbin/ddb/ddb.8,v 1.3 2008/03/05 17:51:06 brooks Exp $
 .\"
 .Dd 25 December, 2007
 .Dt DDB 8
@@ -43,6 +43,8 @@
 .Nm
 .Cm unscript
 .Ar scriptname
+.Nm
+.Ar pathname
 .Sh DESCRIPTION
 .Nm
 configures certain aspects of the
@@ -51,6 +53,18 @@
 easily via
 .Xr sysctl 8
 MIB entries.
+.Pp
+To ease configuration, commands can be put in a file which is processed using
+.Nm
+as shown in the last synopsis line.
+An absolute
+.Ar pathname
+must be used.
+The file will be read line by line and applied as arguments to the
+.Nm
+utility.
+Whitespace at the beginning of lines will be ignored as will lines where the
+first non-whitespace character is #.
 .Sh SCRIPTING
 .Nm
 can be used to configure aspects of

==== //depot/projects/e500/sbin/ddb/ddb.c#2 (text+ko) ====

@@ -25,15 +25,20 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sbin/ddb/ddb.c,v 1.1 2007/12/26 09:38:22 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sbin/ddb/ddb.c,v 1.2 2008/03/05 17:51:06 brooks Exp $");
 
+#include <err.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sysexits.h>
+#include <unistd.h>
 
 #include "ddb.h"
 
+void ddb_readfile(char *file);
+void ddb_main(int argc, char *argv[]);
+
 void
 usage(void)
 {
@@ -46,15 +51,58 @@
 	exit(EX_USAGE);
 }
 
-int
-main(int argc, char *argv[])
+void
+ddb_readfile(char *filename)
+{
+	char    buf[BUFSIZ];
+	FILE*	f;
+
+	if ((f = fopen(filename, "r")) == NULL)
+		err(EX_UNAVAILABLE, "fopen: %s", filename);
+
+#define WHITESP		" \t"
+#define MAXARG	 	2
+	while (fgets(buf, BUFSIZ, f)) {
+		int argc = 0;
+		char *argv[MAXARG];
+		size_t spn;
+
+		spn = strlen(buf);
+		if (buf[spn-1] == '\n')
+			buf[spn-1] = '\0';
+
+		spn = strspn(buf, WHITESP);
+		argv[0] = buf + spn;
+		if (*argv[0] == '#' || *argv[0] == '\0')
+			continue;
+		argc++;
+
+		spn = strcspn(argv[0], WHITESP);
+		argv[1] = argv[0] + spn + strspn(argv[0] + spn, WHITESP);;
+		argv[0][spn] = '\0';
+		if (*argv[1] != '\0')
+			argc++;
+
+#ifdef DEBUG
+		{
+			int i;
+			printf("argc = %d\n", argc);
+			for (i = 0; i < argc; i++) {
+				printf("arg[%d] = %s\n", i, argv[i]);
+			}
+		}
+#endif
+		ddb_main(argc, argv);
+	}
+}
+
+void
+ddb_main(int argc, char *argv[])
 {

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


More information about the p4-projects mailing list