Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Mar 2008 22:31:51 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 138052 for review
Message-ID:  <200803182231.m2IMVpeT055741@repoman.freebsd.org>

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

Change 138052 by marcel@marcel_xcllnt on 2008/03/18 22:31:33

	IFC @138051

Affected files ...

.. //depot/projects/powerpc/contrib/cvs/lib/getdate#2 delete
.. //depot/projects/powerpc/lib/libc/locale/wctype.c#2 integrate
.. //depot/projects/powerpc/lib/libsdp/sdp.h#3 integrate
.. //depot/projects/powerpc/lib/libthr/thread/thr_create.c#5 integrate
.. //depot/projects/powerpc/lib/libthr/thread/thr_exit.c#5 integrate
.. //depot/projects/powerpc/lib/libthr/thread/thr_sig.c#4 integrate
.. //depot/projects/powerpc/sbin/atacontrol/atacontrol.8#3 integrate
.. //depot/projects/powerpc/sbin/atacontrol/atacontrol.c#5 integrate
.. //depot/projects/powerpc/share/man/man4/man4.i386/linux.4#2 integrate
.. //depot/projects/powerpc/share/man/man4/man4.i386/scd.4#2 integrate
.. //depot/projects/powerpc/share/man/man4/man4.i386/streams.4#2 integrate
.. //depot/projects/powerpc/share/man/man4/man4.i386/svr4.4#2 integrate
.. //depot/projects/powerpc/share/man/man9/ieee80211_radiotap.9#2 integrate
.. //depot/projects/powerpc/sys/amd64/amd64/intr_machdep.c#9 integrate
.. //depot/projects/powerpc/sys/arm/arm/intr.c#7 integrate
.. //depot/projects/powerpc/sys/cam/scsi/scsi_ses.c#8 integrate
.. //depot/projects/powerpc/sys/compat/svr4/svr4_fcntl.c#8 integrate
.. //depot/projects/powerpc/sys/conf/files#26 integrate
.. //depot/projects/powerpc/sys/dev/ata/ata-all.c#9 integrate
.. //depot/projects/powerpc/sys/dev/ata/ata-all.h#12 integrate
.. //depot/projects/powerpc/sys/dev/ata/ata-disk.c#10 integrate
.. //depot/projects/powerpc/sys/dev/ata/ata-disk.h#6 integrate
.. //depot/projects/powerpc/sys/dev/cxgb/common/cxgb_ael1002.c#5 integrate
.. //depot/projects/powerpc/sys/dev/cxgb/common/cxgb_common.h#7 integrate
.. //depot/projects/powerpc/sys/dev/cxgb/common/cxgb_version.h#4 integrate
.. //depot/projects/powerpc/sys/dev/cxgb/cxgb_ioctl.h#5 integrate
.. //depot/projects/powerpc/sys/dev/cxgb/cxgb_main.c#14 integrate
.. //depot/projects/powerpc/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c#3 integrate
.. //depot/projects/powerpc/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c#5 integrate
.. //depot/projects/powerpc/sys/dev/cxgb/ulp/tom/cxgb_ddp.c#2 integrate
.. //depot/projects/powerpc/sys/dev/cxgb/ulp/tom/cxgb_defs.h#3 integrate
.. //depot/projects/powerpc/sys/dev/hwpmc/hwpmc_amd.c#3 integrate
.. //depot/projects/powerpc/sys/dev/usb/if_zyd.c#4 integrate
.. //depot/projects/powerpc/sys/geom/vinum/geom_vinum_drive.c#3 integrate
.. //depot/projects/powerpc/sys/i386/cpufreq/est.c#4 integrate
.. //depot/projects/powerpc/sys/i386/cpufreq/p4tcc.c#3 integrate
.. //depot/projects/powerpc/sys/i386/i386/intr_machdep.c#9 integrate
.. //depot/projects/powerpc/sys/ia64/ia64/interrupt.c#11 integrate
.. //depot/projects/powerpc/sys/kern/kern_conf.c#9 integrate
.. //depot/projects/powerpc/sys/kern/kern_intr.c#15 integrate
.. //depot/projects/powerpc/sys/kern/subr_witness.c#20 integrate
.. //depot/projects/powerpc/sys/net/ieee8023ad_lacp.h#7 integrate
.. //depot/projects/powerpc/sys/netinet/in_pcb.c#13 integrate
.. //depot/projects/powerpc/sys/netinet/ip_fw2.c#16 integrate
.. //depot/projects/powerpc/sys/netinet/libalias/alias_irc.c#4 integrate
.. //depot/projects/powerpc/sys/nfsserver/nfs_srvsock.c#9 integrate
.. //depot/projects/powerpc/sys/powerpc/powerpc/intr_machdep.c#11 integrate
.. //depot/projects/powerpc/sys/sparc64/sparc64/intr_machdep.c#10 integrate
.. //depot/projects/powerpc/sys/sun4v/sun4v/intr_machdep.c#6 integrate
.. //depot/projects/powerpc/sys/sys/ata.h#9 integrate
.. //depot/projects/powerpc/sys/sys/conf.h#10 integrate
.. //depot/projects/powerpc/sys/sys/interrupt.h#10 integrate
.. //depot/projects/powerpc/sys/vm/vm_page.c#16 integrate
.. //depot/projects/powerpc/sys/vm/vm_page.h#11 integrate
.. //depot/projects/powerpc/sys/vm/vm_pageq.c#9 delete
.. //depot/projects/powerpc/usr.bin/netstat/inet6.c#5 integrate
.. //depot/projects/powerpc/usr.bin/ruptime/ruptime.c#2 integrate
.. //depot/projects/powerpc/usr.bin/tar/Makefile#7 integrate
.. //depot/projects/powerpc/usr.bin/tar/matching.c#4 integrate
.. //depot/projects/powerpc/usr.sbin/bluetooth/sdpd/gn.c#2 integrate
.. //depot/projects/powerpc/usr.sbin/bluetooth/sdpd/lan.c#2 integrate
.. //depot/projects/powerpc/usr.sbin/bluetooth/sdpd/nap.c#2 integrate
.. //depot/projects/powerpc/usr.sbin/bluetooth/sdpd/panu.c#2 integrate
.. //depot/projects/powerpc/usr.sbin/bluetooth/sdpd/profile.c#3 integrate
.. //depot/projects/powerpc/usr.sbin/bluetooth/sdpd/profile.h#3 integrate

Differences ...

==== //depot/projects/powerpc/lib/libc/locale/wctype.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/locale/wctype.c,v 1.3 2004/03/27 08:59:21 tjr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/locale/wctype.c,v 1.4 2008/03/17 18:22:23 antoine Exp $");
 
 #include <ctype.h>
 #include <string.h>
@@ -42,7 +42,7 @@
 wctype_t
 wctype(const char *property)
 {
-	struct {
+	static const struct {
 		const char	*name;
 		wctype_t	 mask;
 	} props[] = {

==== //depot/projects/powerpc/lib/libsdp/sdp.h#3 (text+ko) ====

@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  *
  * $Id: sdp.h,v 1.3 2003/09/05 00:33:59 max Exp $
- * $FreeBSD: src/lib/libsdp/sdp.h,v 1.8 2008/03/11 00:08:40 emax Exp $
+ * $FreeBSD: src/lib/libsdp/sdp.h,v 1.9 2008/03/18 18:21:39 emax Exp $
  */
 
 #ifndef _SDP_H_
@@ -649,20 +649,35 @@
 
 struct sdp_nap_profile
 {
-	uint16_t	security_description;	/* HBO: NAP/GN */
-	uint16_t	net_access_type;	/* HBO: NAP */
-	uint32_t	max_net_access_rate;	/* HBO: NAP */
+	uint8_t		reserved;
+	uint8_t		load_factor;
+	uint16_t	psm;			/* HBO */
+	uint16_t	security_description;	/* HBO */
+	uint16_t	net_access_type;	/* HBO */
+	uint32_t	max_net_access_rate;	/* HBO */
 };
 typedef struct sdp_nap_profile		sdp_nap_profile_t;
 typedef struct sdp_nap_profile *	sdp_nap_profile_p;
 
-/* Reuse struct sdp_nap_profile for GN */
-typedef struct sdp_nap_profile		sdp_gn_profile_t;
-typedef struct sdp_nap_profile *	sdp_gn_profile_p;
+struct sdp_gn_profile
+{	
+	uint8_t		reserved;
+	uint8_t		load_factor;
+	uint16_t	psm;			/* HBO */
+	uint16_t	security_description;	/* HBO */
+	uint16_t	reserved2;
+};
+typedef struct sdp_gn_profile		sdp_gn_profile_t;
+typedef struct sdp_gn_profile *		sdp_gn_profile_p;
 
-/* Reuse struct sdp_nap_profile for PANU */
-typedef struct sdp_nap_profile		sdp_panu_profile_t;
-typedef struct sdp_nap_profile *	sdp_panu_profile_p;
+struct sdp_panu_profile
+{
+	uint8_t		reserved;
+	uint8_t		load_factor;
+	uint16_t	psm;			/* HBO */
+};
+typedef struct sdp_panu_profile		sdp_panu_profile_t;
+typedef struct sdp_panu_profile *	sdp_panu_profile_p;
 
 int32_t	sdp_register_service	(void *xss, uint16_t uuid,
 				 bdaddr_p const bdaddr, uint8_t const *data,

==== //depot/projects/powerpc/lib/libthr/thread/thr_create.c#5 (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.41 2008/03/16 03:22:38 davidxu Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_create.c,v 1.42 2008/03/18 02:06:51 davidxu Exp $
  */
 
 #include "namespace.h"
@@ -247,6 +247,11 @@
 static void
 thread_start(struct pthread *curthread)
 {
+	sigset_t set;
+
+	if (curthread->attr.suspend == THR_CREATE_SUSPENDED)
+		set = curthread->sigmask;
+
 	/*
 	 * This is used as a serialization point to allow parent
 	 * to report 'new thread' event to debugger or tweak new thread's
@@ -263,19 +268,20 @@
 
 		SIGEMPTYSET(set);
 		SIGADDSET(set, SIGCANCEL);
-		sigprocmask(SIG_UNBLOCK, &set, NULL);
+		__sys_sigprocmask(SIG_UNBLOCK, &set, NULL);
 	}
 
 	if (curthread->attr.suspend == THR_CREATE_SUSPENDED) {
-		sigset_t set = curthread->sigmask;
-
+#if 0
+		/* Done in THR_UNLOCK() */
 		_thr_ast(curthread);
+#endif
 
 		/*
 		 * Parent thread have stored signal mask for us,
 		 * we should restore it now.
 		 */
-		sigprocmask(SIG_SETMASK, &set, NULL);
+		__sys_sigprocmask(SIG_SETMASK, &set, NULL);
 	}
 
 	/* Run the current thread's start routine with argument: */

==== //depot/projects/powerpc/lib/libthr/thread/thr_exit.c#5 (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.25 2008/03/06 02:07:18 davidxu Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_exit.c,v 1.26 2008/03/18 02:06:51 davidxu Exp $
  */
 
 #include <errno.h>
@@ -121,6 +121,10 @@
 	}
 	THR_LOCK(curthread);
 	curthread->state = PS_DEAD;
+	if (curthread->flags & THR_FLAGS_NEED_SUSPEND) {
+		curthread->cycle++;
+		_thr_umtx_wake(&curthread->cycle, INT_MAX);
+	}
 	THR_UNLOCK(curthread);
 	/*
 	 * Thread was created with initial refcount 1, we drop the

==== //depot/projects/powerpc/lib/libthr/thread/thr_sig.c#4 (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.27 2008/03/05 07:04:55 davidxu Exp $
+ * $FreeBSD: src/lib/libthr/thread/thr_sig.c,v 1.28 2008/03/18 02:06:51 davidxu Exp $
  */
 
 #include "namespace.h"
@@ -92,6 +92,9 @@
 	long cycle;
 	int err;
 
+	if (curthread->force_exit)
+		return;
+
 	err = errno;
 	/* 
 	 * Blocks SIGCANCEL which other threads must send.

==== //depot/projects/powerpc/sbin/atacontrol/atacontrol.8#3 (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/atacontrol/atacontrol.8,v 1.29 2007/11/28 21:37:25 remko Exp $
+.\" $FreeBSD: src/sbin/atacontrol/atacontrol.8,v 1.30 2008/03/17 10:33:23 phk Exp $
 .\"
 .Dd November 28, 2007
 .Dt ATACONTROL 8
@@ -70,6 +70,10 @@
 .Ic cap
 .Ar device
 .Nm
+.Ic spindown
+.Ar device
+.Op Ar seconds
+.Nm
 .Ic list
 .Sh DESCRIPTION
 The
@@ -190,6 +194,10 @@
 .It Ic cap
 Show detailed info about the device on
 .Ar device .
+.It Ic spindown
+Set or report timeout after which the
+.Ar device 
+will be spun down.
 .It Ic info
 Show info about the attached devices on the
 .Ar channel .

==== //depot/projects/powerpc/sbin/atacontrol/atacontrol.c#5 (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/sbin/atacontrol/atacontrol.c,v 1.46 2008/03/16 17:54:55 phk Exp $
+ * $FreeBSD: src/sbin/atacontrol/atacontrol.c,v 1.47 2008/03/17 10:33:23 phk Exp $
  */
 
 #include <sys/types.h>
@@ -102,6 +102,7 @@
 		"        atacontrol status array\n"
 		"        atacontrol mode device [mode]\n"
 		"        atacontrol cap device\n"
+		"        atacontrol spindown device [seconds]\n"
 	);
 	exit(EX_USAGE);
 }
@@ -285,6 +286,26 @@
 		printf("     no device present\n");
 }
 
+static void
+ata_spindown(int fd, const char *dev, const char *arg)
+{
+	int tmo;
+
+	if (arg != NULL) {
+		tmo = strtoul(arg, NULL, 0);
+		if (ioctl(fd, IOCATASSPINDOWN, &tmo) < 0)
+			err(1, "ioctl(IOCATASSPINDOWN)");
+	} else {
+		if (ioctl(fd, IOCATAGSPINDOWN, &tmo) < 0)
+			err(1, "ioctl(IOCATAGSPINDOWN)");
+		if (tmo == 0)
+			printf("%s: idle spin down disabled\n", dev);
+		else
+			printf("%s: spin down after %d seconds idle\n",
+			    dev, tmo);
+	}
+}
+
 static int
 open_dev(const char *arg, int mode)
 {
@@ -356,6 +377,12 @@
 		exit(EX_OK);
 	}
 
+	if (!strcmp(argv[1], "spindown") && (argc == 3 || argc == 4)) {
+		fd = open_dev(argv[2], O_RDONLY);
+		ata_spindown(fd, argv[2], argv[3]);
+		exit(EX_OK);
+	}
+
 	if ((fd = open("/dev/ata", O_RDWR)) < 0)
 		err(1, "control device not found");
 

==== //depot/projects/powerpc/share/man/man4/man4.i386/linux.4#2 (text+ko) ====

@@ -22,19 +22,28 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/man4.i386/linux.4,v 1.12 2006/09/18 15:24:19 ru Exp $
-.Dd June 18, 2006
+.\" $FreeBSD: src/share/man/man4/man4.i386/linux.4,v 1.13 2008/03/17 08:17:04 brueffer Exp $
+.\"
+.Dd March 17, 2008
 .Dt LINUX 4 i386
 .Os
 .Sh NAME
 .Nm linux
 .Nd Linux ABI support
 .Sh SYNOPSIS
-To link Linux ABI support into the kernel:
+To compile support for this ABI into the kernel,
+place the following line in your
+kernel configuration file:
+.Bd -ragged -offset indent
 .Cd "options COMPAT_LINUX"
+.Ed
 .Pp
-To load the Linux ABI support kernel module:
-.Dl kldload linux
+Alternatively, to load the ABI as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+linux_load="YES"
+.Ed
 .Sh DESCRIPTION
 The
 .Nm

==== //depot/projects/powerpc/share/man/man4/man4.i386/scd.4#2 (text+ko) ====

@@ -24,16 +24,16 @@
 .\" (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/share/man/man4/man4.i386/scd.4,v 1.22 2005/03/16 02:03:15 brueffer Exp $
+.\" $FreeBSD: src/share/man/man4/man4.i386/scd.4,v 1.23 2008/03/17 08:06:41 brueffer Exp $
 .\"
-.Dd March 16, 2005
+.Dd March 17, 2008
 .Dt SCD 4 i386
 .Os
 .Sh NAME
 .Nm scd
 .Nd Sony CDU31/33 CD-ROM driver
 .Sh SYNOPSIS
-.Cd "device scd 1"
+.Cd "device scd"
 .Pp
 In
 .Pa /boot/device.hints :

==== //depot/projects/powerpc/share/man/man4/man4.i386/streams.4#2 (text+ko) ====

@@ -22,21 +22,27 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/man4.i386/streams.4,v 1.7 2005/01/21 08:36:39 ru Exp $
-.Dd November 6, 2000
+.\" $FreeBSD: src/share/man/man4/man4.i386/streams.4,v 1.8 2008/03/17 08:17:04 brueffer Exp $
+.\"
+.Dd March 17, 2008
 .Dt STREAMS 4 i386
 .Os
 .Sh NAME
 .Nm streams
 .Nd System V STREAMS networking ABI support
-.Sh SYNOPSIS
-To link System V Release 4 (SVR4) STREAMS interprocess communication ABI
-support into the kernel:
-.Cd device streams
+To compile support for this ABI into the kernel,
+place the following line in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device streams"
+.Ed
 .Pp
-To load the SVR4 STREAMS interprocess communication ABI support kernel
-module:
-.Dl kldload streams
+Alternatively, to load the ABI as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+streams_load="YES"
+.Ed
 .Sh DESCRIPTION
 The
 .Nm

==== //depot/projects/powerpc/share/man/man4/man4.i386/svr4.4#2 (text+ko) ====

@@ -22,19 +22,28 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/man4.i386/svr4.4,v 1.12 2005/02/13 23:45:49 ru Exp $
-.Dd October 28, 2003
+.\" $FreeBSD: src/share/man/man4/man4.i386/svr4.4,v 1.13 2008/03/17 08:17:04 brueffer Exp $
+.\"
+.Dd March 17, 2008
 .Dt SVR4 4 i386
 .Os
 .Sh NAME
 .Nm svr4
 .Nd System V Release 4 ABI support
 .Sh SYNOPSIS
-To link System V Release 4 (SVR4) ABI support into the kernel:
-.Cd options COMPAT_SVR4
+To compile support for this ABI into the kernel,
+place the following line in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "options COMPAT_SVR4"
+.Ed
 .Pp
-To load the SVR4 ABI support kernel module:
-.Dl kldload svr4
+Alternatively, to load the ABI as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+svr4_load="YES"
+.Ed
 .Sh DESCRIPTION
 The
 .Nm

==== //depot/projects/powerpc/share/man/man9/ieee80211_radiotap.9#2 (text+ko) ====

@@ -25,10 +25,10 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man9/ieee80211_radiotap.9,v 1.3 2004/07/07 12:59:39 ru Exp $
+.\" $FreeBSD: src/share/man/man9/ieee80211_radiotap.9,v 1.5 2008/03/17 16:37:35 brueffer Exp $
 .\" $Id: ieee80211_radiotap.9,v 1.3 2004/03/04 11:38:52 bruce Exp $
 .\"
-.Dd March 2, 2004
+.Dd March 17, 2008
 .Dt IEEE80211_RADIOTAP 9
 .Os
 .Sh NAME
@@ -72,7 +72,7 @@
 It is requested by using the
 .Xr bpf 4
 data-link type
-.Dv DLT_IEEE_80211_RADIO .
+.Dv DLT_IEEE802_11_RADIO .
 .Pp
 .\"
 Each frame using this attachment has the following header prepended to it:
@@ -103,7 +103,7 @@
 by calling
 .Fn bpfattach2
 with the data-link type set to
-.Dv DLT_IEEE_80211_RADIO .
+.Dv DLT_IEEE802_11_RADIO .
 .Pp
 .\"
 When the the information is available,

==== //depot/projects/powerpc/sys/amd64/amd64/intr_machdep.c#9 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.38 2008/03/16 10:58:02 rwatson Exp $
+ * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.39 2008/03/17 22:42:00 jhb Exp $
  */
 
 /*
@@ -77,12 +77,6 @@
 static struct mtx intrcnt_lock;
 static STAILQ_HEAD(, pic) pics;
 
-#ifdef INTR_FILTER
-static void intr_eoi_src(void *arg);
-static void intr_disab_eoi_src(void *arg);
-static void intr_event_stray(void *cookie);
-#endif
-
 #ifdef SMP
 static int assign_cpu;
 
@@ -90,6 +84,10 @@
 #endif
 
 static int	intr_assign_cpu(void *arg, u_char cpu);
+static void	intr_disable_src(void *arg);
+#ifdef INTR_FILTER
+static void	intr_event_stray(void *cookie);
+#endif
 static void	intr_init(void *__dummy);
 static int	intr_pic_registered(struct pic *pic);
 static void	intrcnt_setname(const char *name, int index);
@@ -144,16 +142,10 @@
 	vector = isrc->is_pic->pic_vector(isrc);
 	if (interrupt_sources[vector] != NULL)
 		return (EEXIST);
-#ifdef INTR_FILTER
 	error = intr_event_create(&isrc->is_event, isrc, 0,
-	    (mask_fn)isrc->is_pic->pic_enable_source,
-	    intr_eoi_src, intr_disab_eoi_src, intr_assign_cpu, "irq%d:",
-	    vector);
-#else
-	error = intr_event_create(&isrc->is_event, isrc, 0,
-	    (mask_fn)isrc->is_pic->pic_enable_source, intr_assign_cpu, "irq%d:",
+	    intr_disable_src, (mask_fn)isrc->is_pic->pic_enable_source,
+	    (mask_fn)isrc->is_pic->pic_eoi_source, intr_assign_cpu, "irq%d:",
 	    vector);
-#endif
 	if (error)
 		return (error);
 	sx_xlock(&intr_table_lock);
@@ -237,6 +229,15 @@
 	return (isrc->is_pic->pic_config_intr(isrc, trig, pol));
 }
 
+static void
+intr_disable_src(void *arg)
+{
+	struct intsrc *isrc;
+
+	isrc = arg;
+	isrc->is_pic->pic_disable_source(isrc, PIC_EOI);
+}
+
 #ifdef INTR_FILTER
 void
 intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame)
@@ -289,24 +290,6 @@
 		    "too many stray irq %d's: not logging anymore\n",
 		    isrc->is_pic->pic_vector(isrc));
 }
-
-static void
-intr_eoi_src(void *arg)
-{
-	struct intsrc *isrc;
-
-	isrc = arg;
-	isrc->is_pic->pic_eoi_source(isrc);
-}
-
-static void
-intr_disab_eoi_src(void *arg)
-{
-	struct intsrc *isrc;
-
-	isrc = arg;
-	isrc->is_pic->pic_disable_source(isrc, PIC_EOI);
-}
 #else
 void
 intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame)

==== //depot/projects/powerpc/sys/arm/arm/intr.c#7 (text+ko) ====

@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/intr.c,v 1.18 2008/03/14 19:41:46 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/intr.c,v 1.19 2008/03/17 22:42:00 jhb Exp $");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/syslog.h> 
@@ -50,6 +50,8 @@
 #include <machine/intr.h>
 #include <machine/cpu.h>
 
+typedef void (*mask_fn)(void *);
+
 static struct intr_event *intr_events[NIRQ];
 static int intrcnt_tab[NIRQ];
 static int intrcnt_index = 0;
@@ -57,27 +59,6 @@
 
 void	arm_handler_execute(struct trapframe *, int);
 
-#ifdef INTR_FILTER
-static void
-intr_disab_eoi_src(void *arg)
-{
-	uintptr_t nb;
-
-	nb = (uintptr_t)arg;
-	arm_mask_irq(nb);
-}
-
-static void
-intr_eoi_src(void *arg)
-{
-	uintptr_t nb;
-
-	nb = (uintptr_t)arg;
-	arm_unmask_irq(nb);
-}
-
-#endif
-
 void
 arm_setup_irqhandler(const char *name, driver_filter_t *filt, 
     void (*hand)(void*), void *arg, int irq, int flags, void **cookiep)
@@ -89,14 +70,9 @@
 		return;
 	event = intr_events[irq];
 	if (event == NULL) {
-#ifdef INTR_FILTER
 		error = intr_event_create(&event, (void *)irq, 0,
-		    (void (*)(void *))arm_unmask_irq, intr_eoi_src,
-		    intr_disab_eoi_src, NULL, "intr%d:", irq);
-#else
-		error = intr_event_create(&event, (void *)irq, 0,
-		    (void (*)(void *))arm_unmask_irq, NULL, "intr%d:", irq);
-#endif
+		    (mask_fn)arm_mask_irq, (mask_fn)arm_unmask_irq,
+		    (mask_fn)arm_unmask_irq, NULL, "intr%d:", irq);
 		if (error)
 			return;
 		intr_events[irq] = event;

==== //depot/projects/powerpc/sys/cam/scsi/scsi_ses.c#8 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_ses.c,v 1.36 2008/02/20 19:49:46 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_ses.c,v 1.37 2008/03/17 17:18:16 scottl Exp $");
 
 #include <sys/param.h>
 #include <sys/queue.h>
@@ -144,9 +144,9 @@
 	encvec		ses_vec;	/* vector to handlers */
 	void *		ses_private;	/* per-type private data */
 	encobj *	ses_objmap;	/* objects */
-	u_int32_t	ses_nobjects;	/* number of objects */
+	uint32_t	ses_nobjects;	/* number of objects */
 	ses_encstat	ses_encstat;	/* overall status */
-	u_int8_t	ses_flags;
+	uint8_t	ses_flags;
 	union ccb	ses_saved_ccb;
 	struct cdev *ses_dev;
 	struct cam_periph *periph;
@@ -166,9 +166,9 @@
 static  periph_dtor_t   sescleanup;
 static  periph_start_t  sesstart;
 
-static void sesasync(void *, u_int32_t, struct cam_path *, void *);
+static void sesasync(void *, uint32_t, struct cam_path *, void *);
 static void sesdone(struct cam_periph *, union ccb *);
-static int seserror(union ccb *, u_int32_t, u_int32_t);
+static int seserror(union ccb *, uint32_t, uint32_t);
 
 static struct periph_driver sesdriver = {
 	sesinit, "ses",
@@ -234,7 +234,7 @@
 }
 
 static void
-sesasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
+sesasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
 {
 	struct cam_periph *periph;
 
@@ -303,7 +303,7 @@
 		return (CAM_REQ_CMP_ERR);
 	}
 
-	softc = malloc(sizeof (struct ses_softc), M_SCSISES, M_NOWAIT);
+	softc = SES_MALLOC(sizeof (struct ses_softc));
 	if (softc == NULL) {
 		printf("sesregister: Unable to probe new device. "
 		       "Unable to allocate softc\n");				
@@ -472,7 +472,7 @@
 }
 
 static int
-seserror(union ccb *ccb, u_int32_t cflags, u_int32_t sflags)
+seserror(union ccb *ccb, uint32_t cflags, uint32_t sflags)
 {
 	struct ses_softc *softc;
 	struct cam_periph *periph;
@@ -489,7 +489,7 @@
 	struct cam_periph *periph;
 	ses_encstat tmp;
 	ses_objstat objs;
-	ses_object obj, *uobj;
+	ses_object *uobj;
 	struct ses_softc *ssc;
 	void *addr;
 	int error, i;
@@ -511,6 +511,9 @@
 
 	/*
 	 * Now check to see whether we're initialized or not.
+	 * This actually should never fail as we're not supposed
+	 * to get past ses_open w/o successfully initializing
+	 * things.
 	 */
 	if ((ssc->ses_flags & SES_FLAG_INITIALIZED) == 0) {
 		cam_periph_unlock(periph);
@@ -526,6 +529,14 @@
 	/*
 	 * If this command can change the device's state,
 	 * we must have the device open for writing.
+	 *
+	 * For commands that get information about the
+	 * device- we don't need to lock the peripheral
+	 * if we aren't running a command. The number
+	 * of objects and the contents will stay stable
+	 * after the first open that does initialization.
+	 * The periph also can't go away while a user
+	 * process has it open.
 	 */
 	switch (cmd) {
 	case SESIOC_GETNOBJ:
@@ -546,23 +557,16 @@
 		break;
 		
 	case SESIOC_GETOBJMAP:
-		/*
-		 * XXX Dropping the lock while copying multiple segments is
-		 * bogus.
-		 */
-		cam_periph_lock(periph);
-		for (uobj = addr, i = 0; i != ssc->ses_nobjects; i++, uobj++) {
-			obj.obj_id = i;
-			obj.subencid = ssc->ses_objmap[i].subenclosure;
-			obj.object_type = ssc->ses_objmap[i].enctype;
-			cam_periph_unlock(periph);
-			error = copyout(&obj, uobj, sizeof (ses_object));
-			cam_periph_lock(periph);
+		for (uobj = addr, i = 0; i != ssc->ses_nobjects; i++) {
+			ses_object kobj;
+			kobj.obj_id = i;
+			kobj.subencid = ssc->ses_objmap[i].subenclosure;
+			kobj.object_type = ssc->ses_objmap[i].enctype;
+			error = copyout(&kobj, &uobj[i], sizeof (ses_object));
 			if (error) {
 				break;
 			}
 		}
-		cam_periph_unlock(periph);
 		break;
 
 	case SESIOC_GETENCSTAT:

==== //depot/projects/powerpc/sys/compat/svr4/svr4_fcntl.c#8 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_fcntl.c,v 1.43 2008/01/13 14:44:01 attilio Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_fcntl.c,v 1.44 2008/03/17 18:27:28 antoine Exp $");
 
 #include "opt_mac.h"
 
@@ -79,6 +79,8 @@
 	switch (cmd) {
 	case SVR4_F_DUPFD:
 		return F_DUPFD;
+	case SVR4_F_DUP2FD:
+		return F_DUP2FD;
 	case SVR4_F_GETFD:
 		return F_GETFD;
 	case SVR4_F_SETFD:
@@ -584,6 +586,7 @@
 
 	switch (cmd) {
 	case F_DUPFD:
+	case F_DUP2FD:
 	case F_GETFD:
 	case F_SETFD:
 		return (kern_fcntl(td, uap->fd, cmd, (intptr_t)uap->arg));
@@ -637,19 +640,6 @@
 		}
 	case -1:
 		switch (uap->cmd) {
-		case SVR4_F_DUP2FD:
-			{
-				struct dup2_args du;
-
-				du.from = uap->fd;
-				du.to = (int)uap->arg;
-				error = dup2(td, &du);
-				if (error)
-					return error;
-				*retval = du.to;
-				return 0;
-			}
-
 		case SVR4_F_FREESP:
 			{
 				struct svr4_flock	 ifl;

==== //depot/projects/powerpc/sys/conf/files#26 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1280 2008/03/12 10:11:56 jeff Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1281 2008/03/18 06:52:15 alc Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -2133,7 +2133,6 @@
 vm/vm_object.c			standard
 vm/vm_page.c			standard
 vm/vm_pageout.c			standard
-vm/vm_pageq.c			standard
 vm/vm_pager.c			standard
 vm/vm_phys.c			standard
 vm/vm_reserv.c			standard

==== //depot/projects/powerpc/sys/dev/ata/ata-all.c#9 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.280 2007/10/04 19:17:15 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.281 2008/03/17 10:33:23 phk Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -514,6 +514,12 @@
     case IOCATAGMODE:
 	*mode = atadev->mode;
 	return 0;
+    case IOCATASSPINDOWN:
+	atadev->spindown = *mode;
+	return 0;
+    case IOCATAGSPINDOWN:
+	*mode = atadev->spindown;
+	return 0;
     default:
 	return ENOTTY;
     }

==== //depot/projects/powerpc/sys/dev/ata/ata-all.h#12 (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/sys/dev/ata/ata-all.h,v 1.127 2008/01/02 20:31:14 phk Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.128 2008/03/17 10:33:23 phk Exp $
  */
 
 /* ATA register defines */
@@ -403,6 +403,9 @@
     struct ata_params           param;          /* ata param structure */
     int                         mode;           /* current transfermode */
     u_int32_t                   max_iosize;     /* max IO size */
+    int				spindown;	/* idle spindown timeout */
+    struct callout              spindown_timer;
+    int                         spindown_state;
     int                         flags;
 #define         ATA_D_USE_CHS           0x0001
 #define         ATA_D_MEDIA_CHANGED     0x0002

==== //depot/projects/powerpc/sys/dev/ata/ata-disk.c#10 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.206 2008/01/02 20:33:54 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.207 2008/03/17 10:33:23 phk Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -171,6 +171,8 @@
     device_add_child(dev, "subdisk", device_get_unit(dev));
     ad_firmware_geom_adjust(dev, adp->disk);
     bus_generic_attach(dev);
+
+    callout_init(&atadev->spindown_timer, 1);
     return 0;
 }
 
@@ -178,6 +180,7 @@
 ad_detach(device_t dev)
 {
     struct ad_softc *adp = device_get_ivars(dev);
+    struct ata_device *atadev = device_get_softc(dev);
     device_t *children;
     int nchildren, i;
 
@@ -185,6 +188,9 @@
     if (!device_get_ivars(dev))
 	return ENXIO;
     
+    /* destroy the power timeout */
+    callout_drain(&atadev->spindown_timer);
+
     /* detach & delete all children */
     if (!device_get_children(dev, &children, &nchildren)) {
 	for (i = 0; i < nchildren; i++)
@@ -229,6 +235,38 @@
     return 0;
 }
 
+static void
+ad_power_callback(struct ata_request *request)
+{
+    device_printf(request->dev, "drive spun down.\n");
+    ata_free_request(request);
+}
+
+static void
+ad_spindown(void *priv)
+{
+    device_t dev = priv;
+    struct ata_device *atadev = device_get_softc(dev);
+    struct ata_request *request;
+
+    if(atadev->spindown == 0)
+	return;
+    device_printf(dev, "Idle, spin down\n");
+    atadev->spindown_state = 1;
+    if (!(request = ata_alloc_request())) {
+	device_printf(dev, "FAILURE - out of memory in ad_spindown\n");
+	return;
+    }
+    request->flags = ATA_R_CONTROL;
+    request->dev = dev;
+    request->timeout = 5;
+    request->retries = 1;
+    request->callback = ad_power_callback;
+    request->u.ata.command = ATA_STANDBY_IMMEDIATE;
+    ata_queue_request(request);
+}
+
+
 static void 
 ad_strategy(struct bio *bp)
 {
@@ -236,6 +274,10 @@
     struct ata_device *atadev = device_get_softc(dev);
     struct ata_request *request;
 
+    if (atadev->spindown != 0)
+	callout_reset(&atadev->spindown_timer, hz * atadev->spindown,
+	    ad_spindown, dev);
+
     if (!(request = ata_alloc_request())) {

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



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