Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Feb 2015 02:02:57 +0000 (UTC)
From:      Glen Barber <gjb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r278549 - in projects/release-install-debug: . cddl/contrib/opensolaris/lib/libdtrace/arm cddl/contrib/opensolaris/tools/ctf/cvt cddl/lib cddl/lib/libdtrace cddl/usr.sbin etc/rc.d games...
Message-ID:  <201502110202.t1B22vMN064548@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gjb
Date: Wed Feb 11 02:02:56 2015
New Revision: 278549
URL: https://svnweb.freebsd.org/changeset/base/278549

Log:
  MFH: r278489-r278548
  
  Sponsored by:	The FreeBSD Foundation

Added:
  projects/release-install-debug/cddl/contrib/opensolaris/lib/libdtrace/arm/
     - copied from r278548, head/cddl/contrib/opensolaris/lib/libdtrace/arm/
  projects/release-install-debug/sys/cddl/contrib/opensolaris/uts/arm/
     - copied from r278548, head/sys/cddl/contrib/opensolaris/uts/arm/
  projects/release-install-debug/sys/cddl/dev/dtrace/arm/
     - copied from r278548, head/sys/cddl/dev/dtrace/arm/
  projects/release-install-debug/sys/cddl/dev/fbt/arm/
     - copied from r278548, head/sys/cddl/dev/fbt/arm/
Deleted:
  projects/release-install-debug/sys/powerpc/conf/WII
  projects/release-install-debug/sys/powerpc/wii/
Modified:
  projects/release-install-debug/UPDATING
  projects/release-install-debug/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c
  projects/release-install-debug/cddl/lib/Makefile
  projects/release-install-debug/cddl/lib/libdtrace/Makefile
  projects/release-install-debug/cddl/usr.sbin/Makefile
  projects/release-install-debug/etc/rc.d/netif
  projects/release-install-debug/games/fortune/datfiles/freebsd-tips
  projects/release-install-debug/lib/Makefile
  projects/release-install-debug/lib/libc/nls/msgcat.c
  projects/release-install-debug/lib/libproc/proc_bkpt.c
  projects/release-install-debug/lib/libproc/proc_regs.c
  projects/release-install-debug/release/scripts/mk-vmimage.sh
  projects/release-install-debug/share/man/man5/nullfs.5
  projects/release-install-debug/sys/arm/arm/cpufunc.c
  projects/release-install-debug/sys/arm/arm/cpufunc_asm_armv7.S
  projects/release-install-debug/sys/arm/arm/elf_trampoline.c
  projects/release-install-debug/sys/arm/arm/exception.S
  projects/release-install-debug/sys/arm/arm/identcpu.c
  projects/release-install-debug/sys/arm/arm/trap.c
  projects/release-install-debug/sys/arm/conf/BEAGLEBONE
  projects/release-install-debug/sys/arm/include/armreg.h
  projects/release-install-debug/sys/arm/include/cpufunc.h
  projects/release-install-debug/sys/cam/ctl/ctl.c
  projects/release-install-debug/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  projects/release-install-debug/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
  projects/release-install-debug/sys/cddl/dev/lockstat/lockstat.c
  projects/release-install-debug/sys/cddl/dev/profile/profile.c
  projects/release-install-debug/sys/conf/files.powerpc
  projects/release-install-debug/sys/conf/kern.pre.mk
  projects/release-install-debug/sys/conf/options.powerpc
  projects/release-install-debug/sys/dev/malo/if_malo.c
  projects/release-install-debug/sys/dev/mwl/if_mwl.c
  projects/release-install-debug/sys/dev/sound/usb/uaudio.c
  projects/release-install-debug/sys/fs/autofs/autofs.c
  projects/release-install-debug/sys/fs/autofs/autofs_ioctl.h
  projects/release-install-debug/sys/kern/kern_sig.c
  projects/release-install-debug/sys/kern/vfs_mount.c
  projects/release-install-debug/sys/modules/dtrace/Makefile
  projects/release-install-debug/sys/modules/dtrace/dtrace/Makefile
  projects/release-install-debug/sys/powerpc/aim/locore32.S
  projects/release-install-debug/sys/powerpc/aim/machdep.c
  projects/release-install-debug/sys/powerpc/aim/mmu_oea.c
  projects/release-install-debug/sys/powerpc/conf/NOTES
  projects/release-install-debug/sys/powerpc/ofw/ofw_syscons.c
  projects/release-install-debug/usr.bin/w/w.c
  projects/release-install-debug/usr.sbin/bsdconfig/console/INDEX
  projects/release-install-debug/usr.sbin/bsdconfig/includes/INDEX
  projects/release-install-debug/usr.sbin/bsdconfig/networking/share/device.subr
  projects/release-install-debug/usr.sbin/bsdconfig/share/dialog.subr
  projects/release-install-debug/usr.sbin/bsdconfig/share/keymap.subr
  projects/release-install-debug/usr.sbin/bsdconfig/timezone/share/continents.subr
  projects/release-install-debug/usr.sbin/bsdconfig/timezone/share/countries.subr
  projects/release-install-debug/usr.sbin/bsdconfig/timezone/timezone
  projects/release-install-debug/usr.sbin/bsdconfig/usermgmt/share/user.subr
  projects/release-install-debug/usr.sbin/mountd/mountd.c
Directory Properties:
  projects/release-install-debug/   (props changed)
  projects/release-install-debug/cddl/   (props changed)
  projects/release-install-debug/cddl/contrib/opensolaris/   (props changed)
  projects/release-install-debug/etc/   (props changed)
  projects/release-install-debug/lib/libc/   (props changed)
  projects/release-install-debug/share/   (props changed)
  projects/release-install-debug/sys/   (props changed)
  projects/release-install-debug/sys/cddl/contrib/opensolaris/   (props changed)
  projects/release-install-debug/sys/conf/   (props changed)

Modified: projects/release-install-debug/UPDATING
==============================================================================
--- projects/release-install-debug/UPDATING	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/UPDATING	Wed Feb 11 02:02:56 2015	(r278549)
@@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 	disable the most expensive debugging functionality run
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20150210:
+	The autofs(4) ABI was changed in order to restore binary compatibility
+	with 10.1-RELEASE.  The automountd(8) daemon needs to be rebuilt to work
+	with the new kernel.
+
 20150131:
 	The powerpc64 kernel has been changed to a position-independent
 	executable. This can only be booted with a new version of loader(8),

Modified: projects/release-install-debug/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c
==============================================================================
--- projects/release-install-debug/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -169,12 +169,12 @@ write_objects(iidesc_t *idp, ctf_buf_t *
 {
 	ushort_t id = (idp ? idp->ii_dtype->t_id : 0);
 
-	ctf_buf_write(b, &id, sizeof (id));
-
 	if (target_requires_swap) {
 		SWAP_16(id);
 	}
 
+	ctf_buf_write(b, &id, sizeof (id));
+
 	debug(3, "Wrote object %s (%d)\n", (idp ? idp->ii_name : "(null)"), id);
 }
 

Modified: projects/release-install-debug/cddl/lib/Makefile
==============================================================================
--- projects/release-install-debug/cddl/lib/Makefile	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/cddl/lib/Makefile	Wed Feb 11 02:02:56 2015	(r278549)
@@ -27,7 +27,8 @@ _libzpool=	libzpool
 .endif
 
 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
-	${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc"
+	${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" || \
+	${MACHINE_CPUARCH} == "arm"
 _drti=		drti
 _libdtrace=	libdtrace
 .endif

Modified: projects/release-install-debug/cddl/lib/libdtrace/Makefile
==============================================================================
--- projects/release-install-debug/cddl/lib/libdtrace/Makefile	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/cddl/lib/libdtrace/Makefile	Wed Feb 11 02:02:56 2015	(r278549)
@@ -81,6 +81,10 @@ CFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/ut
 CFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/uts/mips
 .PATH:		${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips
 .PATH:		${.CURDIR}/../../../sys/cddl/dev/dtrace/mips
+.elif ${MACHINE_CPUARCH} == "arm"
+CFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/uts/arm
+.PATH:		${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/arm
+.PATH:		${.CURDIR}/../../../sys/cddl/dev/dtrace/arm
 .elif ${MACHINE_CPUARCH} == "powerpc"
 CFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc
 .PATH:		${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc

Modified: projects/release-install-debug/cddl/usr.sbin/Makefile
==============================================================================
--- projects/release-install-debug/cddl/usr.sbin/Makefile	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/cddl/usr.sbin/Makefile	Wed Feb 11 02:02:56 2015	(r278549)
@@ -30,6 +30,12 @@ _plockstat=	plockstat
 .endif
 .endif
 
+.if ${MACHINE_CPUARCH} == "arm"
+_dtrace=	dtrace
+_dtruss=	dtruss
+_lockstat=	lockstat
+.endif
+
 .if ${MACHINE_CPUARCH} == "mips"
 _dtrace=	dtrace
 .endif

Modified: projects/release-install-debug/etc/rc.d/netif
==============================================================================
--- projects/release-install-debug/etc/rc.d/netif	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/etc/rc.d/netif	Wed Feb 11 02:02:56 2015	(r278549)
@@ -252,5 +252,8 @@ netif_common()
 	debug "The following interfaces were not configured: $_fail"
 }
 
+# Load the old "network" config file also for compatibility.
+# This is needed for mfsBSD at least.
+load_rc_config network
 load_rc_config $name
 run_rc_command $*

Modified: projects/release-install-debug/games/fortune/datfiles/freebsd-tips
==============================================================================
--- projects/release-install-debug/games/fortune/datfiles/freebsd-tips	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/games/fortune/datfiles/freebsd-tips	Wed Feb 11 02:02:56 2015	(r278549)
@@ -443,7 +443,7 @@ on this system.  Example entries are in
 %
 You can use "pkg info" to see a list of packages you have installed.
 %
-You can use the 'fetch' command to retrieve files over ftp or http.
+You can use the 'fetch' command to retrieve files over ftp, http or https.
 
 	 fetch http://www.FreeBSD.org/index.html
 

Modified: projects/release-install-debug/lib/Makefile
==============================================================================
--- projects/release-install-debug/lib/Makefile	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/lib/Makefile	Wed Feb 11 02:02:56 2015	(r278549)
@@ -284,6 +284,12 @@ _libsmb=	libsmb
 _libsmb=	libsmb
 .endif
 
+.if ${MACHINE_CPUARCH} == "arm"
+_libsmb=	libsmb
+_libproc=	libproc
+_librtld_db=	librtld_db
+.endif
+
 .if ${MK_OPENSSL} != "no"
 _libmp=		libmp
 .endif

Modified: projects/release-install-debug/lib/libc/nls/msgcat.c
==============================================================================
--- projects/release-install-debug/lib/libc/nls/msgcat.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/lib/libc/nls/msgcat.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$");
 				  	np->name = strdup(n);			\
 					np->path = NULL;			\
 					np->catd = NLERR;			\
+					np->refcount = 0;			\
 					np->lang = (l == NULL) ? NULL :		\
 					    strdup(l);				\
 					np->caterrno = e;			\

Modified: projects/release-install-debug/lib/libproc/proc_bkpt.c
==============================================================================
--- projects/release-install-debug/lib/libproc/proc_bkpt.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/lib/libproc/proc_bkpt.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$");
 #elif defined(__powerpc__)
 #define BREAKPOINT_INSTR	0x7fe00008	/* trap */
 #define BREAKPOINT_INSTR_SZ 4
+#elif defined(__arm__)
+#define BREAKPOINT_INSTR	0xe7ffffff	/* bkpt */
+#define BREAKPOINT_INSTR_SZ	4
 #else
 #error "Add support for your architecture"
 #endif

Modified: projects/release-install-debug/lib/libproc/proc_regs.c
==============================================================================
--- projects/release-install-debug/lib/libproc/proc_regs.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/lib/libproc/proc_regs.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -56,6 +56,8 @@ proc_regget(struct proc_handle *phdl, pr
 	case REG_PC:
 #if defined(__amd64__)
 		*regvalue = regs.r_rip;
+#elif defined(__arm__)
+		*regvalue = regs.r_pc;
 #elif defined(__i386__)
 		*regvalue = regs.r_eip;
 #elif defined(__mips__)
@@ -67,6 +69,8 @@ proc_regget(struct proc_handle *phdl, pr
 	case REG_SP:
 #if defined(__amd64__)
 		*regvalue = regs.r_rsp;
+#elif defined(__arm__)
+		*regvalue = regs.r_sp;
 #elif defined(__i386__)
 		*regvalue = regs.r_esp;
 #elif defined(__mips__)
@@ -99,6 +103,8 @@ proc_regset(struct proc_handle *phdl, pr
 	case REG_PC:
 #if defined(__amd64__)
 		regs.r_rip = regvalue;
+#elif defined(__arm__)
+		regs.r_pc = regvalue;
 #elif defined(__i386__)
 		regs.r_eip = regvalue;
 #elif defined(__mips__)
@@ -110,6 +116,8 @@ proc_regset(struct proc_handle *phdl, pr
 	case REG_SP:
 #if defined(__amd64__)
 		regs.r_rsp = regvalue;
+#elif defined(__arm__)
+		regs.r_sp = regvalue;
 #elif defined(__i386__)
 		regs.r_esp = regvalue;
 #elif defined(__mips__)

Modified: projects/release-install-debug/release/scripts/mk-vmimage.sh
==============================================================================
--- projects/release-install-debug/release/scripts/mk-vmimage.sh	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/release/scripts/mk-vmimage.sh	Wed Feb 11 02:02:56 2015	(r278549)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #-
-# Copyright (c) 2014 The FreeBSD Foundation
+# Copyright (c) 2014, 2015 The FreeBSD Foundation
 # All rights reserved.
 #
 # This software was developed by Glen Barber under sponsorship
@@ -40,6 +40,7 @@ usage() {
 
 main() {
 	local arg
+	VMCONFIG="/dev/null"
 	while getopts "C:c:d:f:i:o:s:S:" arg; do
 		case "${arg}" in
 			C)
@@ -76,10 +77,9 @@ main() {
 		-z "${WORLDDIR}" -o \
 		-z "${DESTDIR}" -o \
 		-z "${VMSIZE}" -o \
-		-z "${VMIMAGE}" -o \
-		-z "${VMCONFIG}" ];
+		-z "${VMIMAGE}" ];
 	then
-		usage
+		usage || exit 0
 	fi
 
 	if [ -z "${VMBUILDCONF}" ] || [ ! -e "${VMBUILDCONF}" ]; then
@@ -89,7 +89,7 @@ main() {
 
 	. "${VMBUILDCONF}"
 
-	if [ ! -z "${VMCONFIG}" ] && [ -e "${VMCONFIG}" ]; then
+	if [ ! -z "${VMCONFIG}" ] && [ ! -c "${VMCONFIG}" ]; then
 		. "${VMCONFIG}"
 	fi
 

Modified: projects/release-install-debug/share/man/man5/nullfs.5
==============================================================================
--- projects/release-install-debug/share/man/man5/nullfs.5	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/share/man/man5/nullfs.5	Wed Feb 11 02:02:56 2015	(r278549)
@@ -24,15 +24,14 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 5, 2008
+.Dd February 10, 2015
 .Dt NULLFS 5
 .Os
 .Sh NAME
 .Nm nullfs
 .Nd "null file system"
 .Sh SYNOPSIS
-To enable support for
-.Nm ,
+To enable support for this driver,
 place the following line in the kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "options NULLFS"

Modified: projects/release-install-debug/sys/arm/arm/cpufunc.c
==============================================================================
--- projects/release-install-debug/sys/arm/arm/cpufunc.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/arm/arm/cpufunc.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -837,6 +837,11 @@ u_int cpu_reset_needs_v4_MMU_disable;	/*
   defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \
   defined(CPU_CORTEXA) || defined(CPU_KRAIT)
 
+/* Global cache line sizes, use 32 as default */
+int	arm_dcache_min_line_size = 32;
+int	arm_icache_min_line_size = 32;
+int	arm_idcache_min_line_size = 32;
+
 static void get_cachetype_cp15(void);
 
 /* Additional cache information local to this file.  Log2 of some of the
@@ -868,6 +873,12 @@ get_cachetype_cp15()
 		goto out;
 
 	if (CPU_CT_FORMAT(ctype) == CPU_CT_ARMV7) {
+		/* Resolve minimal cache line sizes */
+		arm_dcache_min_line_size = 1 << (CPU_CT_DMINLINE(ctype) + 2);
+		arm_icache_min_line_size = 1 << (CPU_CT_IMINLINE(ctype) + 2);
+		arm_idcache_min_line_size =
+		    min(arm_icache_min_line_size, arm_dcache_min_line_size);
+
 		__asm __volatile("mrc p15, 1, %0, c0, c0, 1"
 		    : "=r" (clevel));
 		arm_cache_level = clevel;

Modified: projects/release-install-debug/sys/arm/arm/cpufunc_asm_armv7.S
==============================================================================
--- projects/release-install-debug/sys/arm/arm/cpufunc_asm_armv7.S	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/arm/arm/cpufunc_asm_armv7.S	Wed Feb 11 02:02:56 2015	(r278549)
@@ -41,6 +41,12 @@ __FBSDID("$FreeBSD$");
 	.word	_C_LABEL(arm_cache_loc)
 .Lcache_type:
 	.word	_C_LABEL(arm_cache_type)
+.Larmv7_dcache_line_size:
+	.word	_C_LABEL(arm_dcache_min_line_size)
+.Larmv7_icache_line_size:
+	.word	_C_LABEL(arm_icache_min_line_size)
+.Larmv7_idcache_line_size:
+	.word	_C_LABEL(arm_idcache_min_line_size)
 .Lway_mask:
 	.word	0x3ff
 .Lmax_index:
@@ -180,14 +186,9 @@ ENTRY(armv7_idcache_wbinv_all)
 	RET
 END(armv7_idcache_wbinv_all)
 
-/* XXX Temporary set it to 32 for MV cores, however this value should be
- * get from Cache Type register
- */
-.Larmv7_line_size:
-	.word	32
-
 ENTRY(armv7_dcache_wb_range)
-	ldr	ip, .Larmv7_line_size
+	ldr	ip, .Larmv7_dcache_line_size
+	ldr	ip, [ip]
 	sub	r3, ip, #1
 	and	r2, r0, r3
 	add	r1, r1, r2
@@ -202,7 +203,8 @@ ENTRY(armv7_dcache_wb_range)
 END(armv7_dcache_wb_range)
 
 ENTRY(armv7_dcache_wbinv_range)
-	ldr	ip, .Larmv7_line_size
+	ldr     ip, .Larmv7_dcache_line_size
+	ldr     ip, [ip]
 	sub     r3, ip, #1
 	and     r2, r0, r3
 	add     r1, r1, r2
@@ -221,7 +223,8 @@ END(armv7_dcache_wbinv_range)
  * must use wb-inv of the entire cache.
  */
 ENTRY(armv7_dcache_inv_range)
-	ldr	ip, .Larmv7_line_size
+	ldr     ip, .Larmv7_dcache_line_size
+	ldr     ip, [ip]
 	sub     r3, ip, #1
 	and     r2, r0, r3
 	add     r1, r1, r2
@@ -236,7 +239,8 @@ ENTRY(armv7_dcache_inv_range)
 END(armv7_dcache_inv_range)
 
 ENTRY(armv7_idcache_wbinv_range)
-	ldr	ip, .Larmv7_line_size
+	ldr     ip, .Larmv7_idcache_line_size
+	ldr     ip, [ip]
 	sub     r3, ip, #1
 	and     r2, r0, r3
 	add     r1, r1, r2
@@ -264,7 +268,8 @@ ENTRY_NP(armv7_icache_sync_all)
 END(armv7_icache_sync_all)
 
 ENTRY_NP(armv7_icache_sync_range)
-	ldr	ip, .Larmv7_line_size
+	ldr	ip, .Larmv7_icache_line_size
+	ldr	ip, [ip]
 .Larmv7_sync_next:
 	mcr	CP15_ICIMVAU(r0)
 	mcr	CP15_DCCMVAC(r0)

Modified: projects/release-install-debug/sys/arm/arm/elf_trampoline.c
==============================================================================
--- projects/release-install-debug/sys/arm/arm/elf_trampoline.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/arm/arm/elf_trampoline.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -115,6 +115,10 @@ int     arm_pcache_unified;
 int     arm_dcache_align;
 int     arm_dcache_align_mask;
 
+int     arm_dcache_min_line_size = 32;
+int     arm_icache_min_line_size = 32;
+int     arm_idcache_min_line_size = 32;
+
 u_int	arm_cache_level;
 u_int	arm_cache_type[14];
 u_int	arm_cache_loc;
@@ -277,6 +281,13 @@ get_cachetype_cp15()
 		goto out;
 
 	if (CPU_CT_FORMAT(ctype) == CPU_CT_ARMV7) {
+		/* Resolve minimal cache line sizes */
+		arm_dcache_min_line_size = 1 << (CPU_CT_DMINLINE(ctype) + 2);
+		arm_icache_min_line_size = 1 << (CPU_CT_IMINLINE(ctype) + 2);
+		arm_idcache_min_line_size =
+		    (arm_dcache_min_line_size > arm_icache_min_line_size ?
+		    arm_icache_min_line_size : arm_dcache_min_line_size);
+
 		__asm __volatile("mrc p15, 1, %0, c0, c0, 1"
 		    : "=r" (clevel));
 		arm_cache_level = clevel;

Modified: projects/release-install-debug/sys/arm/arm/exception.S
==============================================================================
--- projects/release-install-debug/sys/arm/arm/exception.S	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/arm/arm/exception.S	Wed Feb 11 02:02:56 2015	(r278549)
@@ -48,11 +48,26 @@
 
 #include "assym.s"
 
+#include "opt_kdtrace.h"
 #include <machine/asm.h>
 #include <machine/armreg.h>
 #include <machine/asmacros.h>
 __FBSDID("$FreeBSD$");
 
+#ifdef KDTRACE_HOOKS
+	.bss
+	.align 4
+	.global	_C_LABEL(dtrace_invop_jump_addr)
+_C_LABEL(dtrace_invop_jump_addr):
+	.word 0
+	.word 0
+
+	.global	_C_LABEL(dtrace_invop_calltrap_addr)
+_C_LABEL(dtrace_invop_calltrap_addr):
+	.word 0
+	.word 0
+#endif
+
 	.text	
 	.align	2
 

Modified: projects/release-install-debug/sys/arm/arm/identcpu.c
==============================================================================
--- projects/release-install-debug/sys/arm/arm/identcpu.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/arm/arm/identcpu.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -387,7 +387,7 @@ identify_arm_cpu(void)
 	u_int8_t type, linesize;
 	int i;
 
-	cpuid = cpu_id();
+	cpuid = cpu_ident();
 
 	if (cpuid == 0) {
 		printf("Processor failed probe - no CPU ID\n");

Modified: projects/release-install-debug/sys/arm/arm/trap.c
==============================================================================
--- projects/release-install-debug/sys/arm/arm/trap.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/arm/arm/trap.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -78,6 +78,9 @@
  * Created      : 28/11/94
  */
 
+#ifdef KDTRACE_HOOKS
+#include <sys/dtrace_bsd.h>
+#endif
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
@@ -427,6 +430,13 @@ dab_fatal(struct trapframe *tf, u_int fs
 {
 	const char *mode;
 
+#ifdef KDTRACE_HOOKS
+	if (!TRAP_USERMODE(tf))	{
+		if (dtrace_trap_func != NULL && (*dtrace_trap_func)(tf, far & FAULT_TYPE_MASK))
+			return (0);
+	}
+#endif
+
 	mode = TRAP_USERMODE(tf) ? "user" : "kernel";
 
 	disable_interrupts(PSR_I|PSR_F);

Modified: projects/release-install-debug/sys/arm/conf/BEAGLEBONE
==============================================================================
--- projects/release-install-debug/sys/arm/conf/BEAGLEBONE	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/arm/conf/BEAGLEBONE	Wed Feb 11 02:02:56 2015	(r278549)
@@ -27,6 +27,12 @@ include		"../ti/am335x/std.am335x"
 
 makeoptions	WITHOUT_MODULES="ahc"
 
+# DTrace support
+options         KDTRACE_HOOKS                # Kernel DTrace hooks
+options                DDB_CTF                      # all architectures - kernel ELF linker loads CTF data
+makeoptions         WITH_CTF=1
+makeoptions     MODULES_OVERRIDE="opensolaris dtrace dtrace/lockstat dtrace/profile dtrace/fbt"
+
 options 	HZ=100
 options 	SCHED_4BSD		# 4BSD scheduler
 options 	PREEMPTION		# Enable kernel thread preemption

Modified: projects/release-install-debug/sys/arm/include/armreg.h
==============================================================================
--- projects/release-install-debug/sys/arm/include/armreg.h	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/arm/include/armreg.h	Wed Feb 11 02:02:56 2015	(r278549)
@@ -320,6 +320,9 @@
 #define	CPU_CT_S		(1U << 24)		/* split cache */
 #define	CPU_CT_CTYPE(x)		(((x) >> 25) & 0xf)	/* cache type */
 #define	CPU_CT_FORMAT(x)	((x) >> 29)
+/* Cache type register definitions for ARM v7 */
+#define	CPU_CT_IMINLINE(x)	((x) & 0xf)		/* I$ min line size */
+#define	CPU_CT_DMINLINE(x)	(((x) >> 16) & 0xf)	/* D$ min line size */
 
 #define	CPU_CT_CTYPE_WT		0	/* write-through */
 #define	CPU_CT_CTYPE_WB1	1	/* write-back, clean w/ read */

Modified: projects/release-install-debug/sys/arm/include/cpufunc.h
==============================================================================
--- projects/release-install-debug/sys/arm/include/cpufunc.h	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/arm/include/cpufunc.h	Wed Feb 11 02:02:56 2015	(r278549)
@@ -175,7 +175,7 @@ struct cpu_functions {
 extern struct cpu_functions cpufuncs;
 extern u_int cputype;
 
-#define cpu_id()		cpufuncs.cf_id()
+#define cpu_ident()		cpufuncs.cf_id()
 #define	cpu_cpwait()		cpufuncs.cf_cpwait()
 
 #define cpu_control(c, e)	cpufuncs.cf_control(c, e)

Modified: projects/release-install-debug/sys/cam/ctl/ctl.c
==============================================================================
--- projects/release-install-debug/sys/cam/ctl/ctl.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/cam/ctl/ctl.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -12286,64 +12286,57 @@ ctl_abort_task(union ctl_io *io)
 		printf("%s\n", sbuf_data(&sb));
 #endif
 
-		if ((xio->io_hdr.nexus.targ_port == io->io_hdr.nexus.targ_port)
-		 && (xio->io_hdr.nexus.initid.id ==
-		     io->io_hdr.nexus.initid.id)) {
-			/*
-			 * If the abort says that the task is untagged, the
-			 * task in the queue must be untagged.  Otherwise,
-			 * we just check to see whether the tag numbers
-			 * match.  This is because the QLogic firmware
-			 * doesn't pass back the tag type in an abort
-			 * request.
-			 */
+		if ((xio->io_hdr.nexus.targ_port != io->io_hdr.nexus.targ_port)
+		 || (xio->io_hdr.nexus.initid.id != io->io_hdr.nexus.initid.id)
+		 || (xio->io_hdr.flags & CTL_FLAG_ABORT))
+			continue;
+
+		/*
+		 * If the abort says that the task is untagged, the
+		 * task in the queue must be untagged.  Otherwise,
+		 * we just check to see whether the tag numbers
+		 * match.  This is because the QLogic firmware
+		 * doesn't pass back the tag type in an abort
+		 * request.
+		 */
 #if 0
-			if (((xio->scsiio.tag_type == CTL_TAG_UNTAGGED)
-			  && (io->taskio.tag_type == CTL_TAG_UNTAGGED))
-			 || (xio->scsiio.tag_num == io->taskio.tag_num)) {
+		if (((xio->scsiio.tag_type == CTL_TAG_UNTAGGED)
+		  && (io->taskio.tag_type == CTL_TAG_UNTAGGED))
+		 || (xio->scsiio.tag_num == io->taskio.tag_num)) {
 #endif
-			/*
-			 * XXX KDM we've got problems with FC, because it
-			 * doesn't send down a tag type with aborts.  So we
-			 * can only really go by the tag number...
-			 * This may cause problems with parallel SCSI.
-			 * Need to figure that out!!
-			 */
-			if (xio->scsiio.tag_num == io->taskio.tag_num) {
-				xio->io_hdr.flags |= CTL_FLAG_ABORT;
-				found = 1;
-				if ((io->io_hdr.flags &
-				     CTL_FLAG_FROM_OTHER_SC) == 0 &&
-				    !(lun->flags & CTL_LUN_PRIMARY_SC)) {
-					union ctl_ha_msg msg_info;
-
-					io->io_hdr.flags |=
-					                CTL_FLAG_SENT_2OTHER_SC;
-					msg_info.hdr.nexus = io->io_hdr.nexus;
-					msg_info.task.task_action =
-						CTL_TASK_ABORT_TASK;
-					msg_info.task.tag_num =
-						io->taskio.tag_num;
-					msg_info.task.tag_type =
-						io->taskio.tag_type;
-					msg_info.hdr.msg_type =
-						CTL_MSG_MANAGE_TASKS;
-					msg_info.hdr.original_sc = NULL;
-					msg_info.hdr.serializing_sc = NULL;
+		/*
+		 * XXX KDM we've got problems with FC, because it
+		 * doesn't send down a tag type with aborts.  So we
+		 * can only really go by the tag number...
+		 * This may cause problems with parallel SCSI.
+		 * Need to figure that out!!
+		 */
+		if (xio->scsiio.tag_num == io->taskio.tag_num) {
+			xio->io_hdr.flags |= CTL_FLAG_ABORT;
+			found = 1;
+			if ((io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) == 0 &&
+			    !(lun->flags & CTL_LUN_PRIMARY_SC)) {
+				union ctl_ha_msg msg_info;
+
+				io->io_hdr.flags |= CTL_FLAG_SENT_2OTHER_SC;
+				msg_info.hdr.nexus = io->io_hdr.nexus;
+				msg_info.task.task_action = CTL_TASK_ABORT_TASK;
+				msg_info.task.tag_num = io->taskio.tag_num;
+				msg_info.task.tag_type = io->taskio.tag_type;
+				msg_info.hdr.msg_type = CTL_MSG_MANAGE_TASKS;
+				msg_info.hdr.original_sc = NULL;
+				msg_info.hdr.serializing_sc = NULL;
 #if 0
-					printf("Sent Abort to other side\n");
+				printf("Sent Abort to other side\n");
 #endif
-					if (CTL_HA_STATUS_SUCCESS !=
-					        ctl_ha_msg_send(CTL_HA_CHAN_CTL,
-		    				(void *)&msg_info,
-						sizeof(msg_info), 0)) {
-					}
+				if (ctl_ha_msg_send(CTL_HA_CHAN_CTL,
+				    (void *)&msg_info, sizeof(msg_info), 0) !=
+				    CTL_HA_STATUS_SUCCESS) {
 				}
+			}
 #if 0
-				printf("ctl_abort_task: found I/O to abort\n");
+			printf("ctl_abort_task: found I/O to abort\n");
 #endif
-				break;
-			}
 		}
 	}
 	mtx_unlock(&lun->lun_lock);

Modified: projects/release-install-debug/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- projects/release-install-debug/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -11880,7 +11880,7 @@ err:
 	int i;
 
 	*factor = 1;
-#if defined(__amd64__) || defined(__mips__) || defined(__powerpc__)
+#if defined(__amd64__) || defined(__arm__) || defined(__mips__) || defined(__powerpc__)
 	/*
 	 * FreeBSD isn't good at limiting the amount of memory we
 	 * ask to malloc, so let's place a limit here before trying

Modified: projects/release-install-debug/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==============================================================================
--- projects/release-install-debug/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h	Wed Feb 11 02:02:56 2015	(r278549)
@@ -2434,6 +2434,13 @@ extern void dtrace_helpers_destroy(proc_
 #define DTRACE_INVOP_MFLR_R0	5
 #define DTRACE_INVOP_NOP	6
 
+#elif defined(__arm__)
+
+#define DTRACE_INVOP_PUSHM	1
+#define DTRACE_INVOP_POPM	2
+#define DTRACE_INVOP_B		3
+
+
 #endif
 
 #ifdef	__cplusplus

Modified: projects/release-install-debug/sys/cddl/dev/lockstat/lockstat.c
==============================================================================
--- projects/release-install-debug/sys/cddl/dev/lockstat/lockstat.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/cddl/dev/lockstat/lockstat.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -44,7 +44,8 @@
 #include <sys/lockstat.h>
 
 #if defined(__i386__) || defined(__amd64__) || \
-	defined(__mips__) || defined(__powerpc__)
+	defined(__mips__) || defined(__powerpc__) || \
+	defined(__arm__)
 #define LOCKSTAT_AFRAMES 1
 #else
 #error "architecture not supported"

Modified: projects/release-install-debug/sys/cddl/dev/profile/profile.c
==============================================================================
--- projects/release-install-debug/sys/cddl/dev/profile/profile.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/cddl/dev/profile/profile.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -128,6 +128,16 @@
 
 struct profile_probe_percpu;
 
+#ifdef __mips
+/* bogus */
+#define	PROF_ARTIFICIAL_FRAMES	3
+#endif
+
+#ifdef __arm__
+/* bogus */
+#define	PROF_ARTIFICIAL_FRAMES	3
+#endif
+
 typedef struct profile_probe {
 	char		prof_name[PROF_NAMELEN];
 	dtrace_id_t	prof_id;

Modified: projects/release-install-debug/sys/conf/files.powerpc
==============================================================================
--- projects/release-install-debug/sys/conf/files.powerpc	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/conf/files.powerpc	Wed Feb 11 02:02:56 2015	(r278549)
@@ -242,9 +242,3 @@ powerpc/psim/iobus.c 		optional	psim
 powerpc/psim/ata_iobus.c	optional	ata psim
 powerpc/psim/openpic_iobus.c	optional	psim
 powerpc/psim/uart_iobus.c	optional	uart psim
-powerpc/wii/platform_wii.c	optional	wii
-powerpc/wii/wii_bus.c		optional	wii
-powerpc/wii/wii_pic.c		optional	wii
-powerpc/wii/wii_fb.c		optional	wii
-powerpc/wii/wii_gpio.c		optional	wii wiigpio
-powerpc/wii/wii_ipc.c		optional	wii

Modified: projects/release-install-debug/sys/conf/kern.pre.mk
==============================================================================
--- projects/release-install-debug/sys/conf/kern.pre.mk	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/conf/kern.pre.mk	Wed Feb 11 02:02:56 2015	(r278549)
@@ -186,7 +186,7 @@ SYSTEM_DEP+= ${LDSCRIPT}
 MKMODULESENV+=	MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR}
 MKMODULESENV+=	MACHINE_CPUARCH=${MACHINE_CPUARCH}
 MKMODULESENV+=	MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH}
-MKMODULESENV+=	MODULES_EXTRA=${MODULES_EXTRA} WITHOUT_MODULES=${WITHOUT_MODULES}
+MKMODULESENV+=	MODULES_EXTRA="${MODULES_EXTRA}" WITHOUT_MODULES="${WITHOUT_MODULES}"
 .if (${KERN_IDENT} == LINT)
 MKMODULESENV+=	ALL_MODULES=LINT
 .endif

Modified: projects/release-install-debug/sys/conf/options.powerpc
==============================================================================
--- projects/release-install-debug/sys/conf/options.powerpc	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/conf/options.powerpc	Wed Feb 11 02:02:56 2015	(r278549)
@@ -24,7 +24,6 @@ PS3			opt_platform.h
 MAMBO
 PSERIES
 PSIM
-WII			opt_platform.h
 
 SC_OFWFB		opt_ofwfb.h
 

Modified: projects/release-install-debug/sys/dev/malo/if_malo.c
==============================================================================
--- projects/release-install-debug/sys/dev/malo/if_malo.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/dev/malo/if_malo.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -165,7 +165,7 @@ static void
 malo_bar0_write4(struct malo_softc *sc, bus_size_t off, uint32_t val)
 {
 	DPRINTF(sc, MALO_DEBUG_FW, "%s: off 0x%jx val 0x%x\n",
-	    __func__, (intmax_t)off, val);
+	    __func__, (uintmax_t)off, val);
 
 	bus_space_write_4(sc->malo_io0t, sc->malo_io0h, off, val);
 }
@@ -510,9 +510,10 @@ malo_desc_setup(struct malo_softc *sc, c
 	
 	ds = dd->dd_desc;
 	memset(ds, 0, dd->dd_desc_len);
-	DPRINTF(sc, MALO_DEBUG_RESET, "%s: %s DMA map: %p (%lu) -> %p (%lu)\n",
+	DPRINTF(sc, MALO_DEBUG_RESET,
+	    "%s: %s DMA map: %p (%lu) -> 0x%jx (%lu)\n",
 	    __func__, dd->dd_name, ds, (u_long) dd->dd_desc_len,
-	    (caddr_t) dd->dd_desc_paddr, /*XXX*/ (u_long) dd->dd_desc_len);
+	    (uintmax_t) dd->dd_desc_paddr, /*XXX*/ (u_long) dd->dd_desc_len);
 
 	return 0;
 fail2:
@@ -877,10 +878,9 @@ malo_printrxbuf(const struct malo_rxbuf 
 	const struct malo_rxdesc *ds = bf->bf_desc;
 	uint32_t status = le32toh(ds->status);
 	
-	printf("R[%2u] (DS.V:%p DS.P:%p) NEXT:%08x DATA:%08x RC:%02x%s\n"
+	printf("R[%2u] (DS.V:%p DS.P:0x%jx) NEXT:%08x DATA:%08x RC:%02x%s\n"
 	    "      STAT:%02x LEN:%04x SNR:%02x NF:%02x CHAN:%02x"
-	    " RATE:%02x QOS:%04x\n",
-	    ix, ds, (const struct malo_desc *)bf->bf_daddr,
+	    " RATE:%02x QOS:%04x\n", ix, ds, (uintmax_t)bf->bf_daddr,
 	    le32toh(ds->physnext), le32toh(ds->physbuffdata),
 	    ds->rxcontrol, 
 	    ds->rxcontrol != MALO_RXD_CTRL_DRIVER_OWN ?
@@ -896,8 +896,7 @@ malo_printtxbuf(const struct malo_txbuf 
 	uint32_t status = le32toh(ds->status);
 	
 	printf("Q%u[%3u]", qnum, ix);
-	printf(" (DS.V:%p DS.P:%p)\n",
-	    ds, (const struct malo_txdesc *)bf->bf_daddr);
+	printf(" (DS.V:%p DS.P:0x%jx)\n", ds, (uintmax_t)bf->bf_daddr);
 	printf("    NEXT:%08x DATA:%08x LEN:%04x STAT:%08x%s\n",
 	    le32toh(ds->physnext),
 	    le32toh(ds->pktptr), le16toh(ds->pktlen), status,

Modified: projects/release-install-debug/sys/dev/mwl/if_mwl.c
==============================================================================
--- projects/release-install-debug/sys/dev/mwl/if_mwl.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/dev/mwl/if_mwl.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -2056,9 +2056,10 @@ mwl_desc_setup(struct mwl_softc *sc, con
 
 	ds = dd->dd_desc;
 	memset(ds, 0, dd->dd_desc_len);
-	DPRINTF(sc, MWL_DEBUG_RESET, "%s: %s DMA map: %p (%lu) -> %p (%lu)\n",
+	DPRINTF(sc, MWL_DEBUG_RESET,
+	    "%s: %s DMA map: %p (%lu) -> 0x%jx (%lu)\n",
 	    __func__, dd->dd_name, ds, (u_long) dd->dd_desc_len,
-	    (caddr_t) dd->dd_desc_paddr, /*XXX*/ (u_long) dd->dd_desc_len);
+	    (uintmax_t) dd->dd_desc_paddr, /*XXX*/ (u_long) dd->dd_desc_len);
 
 	return 0;
 fail2:
@@ -4688,11 +4689,10 @@ mwl_printrxbuf(const struct mwl_rxbuf *b
 	const struct mwl_rxdesc *ds = bf->bf_desc;
 	uint32_t status = le32toh(ds->Status);
 
-	printf("R[%2u] (DS.V:%p DS.P:%p) NEXT:%08x DATA:%08x RC:%02x%s\n"
+	printf("R[%2u] (DS.V:%p DS.P:0x%jx) NEXT:%08x DATA:%08x RC:%02x%s\n"
 	       "      STAT:%02x LEN:%04x RSSI:%02x CHAN:%02x RATE:%02x QOS:%04x HT:%04x\n",
-	    ix, ds, (const struct mwl_desc *)bf->bf_daddr,
-	    le32toh(ds->pPhysNext), le32toh(ds->pPhysBuffData),
-	    ds->RxControl, 
+	    ix, ds, (uintmax_t)bf->bf_daddr, le32toh(ds->pPhysNext),
+	    le32toh(ds->pPhysBuffData), ds->RxControl, 
 	    ds->RxControl != EAGLE_RXD_CTRL_DRIVER_OWN ?
 	        "" : (status & EAGLE_RXD_STATUS_OK) ? " *" : " !",
 	    ds->Status, le16toh(ds->PktLen), ds->RSSI, ds->Channel,
@@ -4706,8 +4706,7 @@ mwl_printtxbuf(const struct mwl_txbuf *b
 	uint32_t status = le32toh(ds->Status);
 
 	printf("Q%u[%3u]", qnum, ix);
-	printf(" (DS.V:%p DS.P:%p)\n",
-	    ds, (const struct mwl_txdesc *)bf->bf_daddr);
+	printf(" (DS.V:%p DS.P:0x%jx)\n", ds, (uintmax_t)bf->bf_daddr);
 	printf("    NEXT:%08x DATA:%08x LEN:%04x STAT:%08x%s\n",
 	    le32toh(ds->pPhysNext),
 	    le32toh(ds->PktPtr), le16toh(ds->PktLen), status,

Modified: projects/release-install-debug/sys/dev/sound/usb/uaudio.c
==============================================================================
--- projects/release-install-debug/sys/dev/sound/usb/uaudio.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/dev/sound/usb/uaudio.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -111,6 +111,7 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def
     &uaudio_default_channels, 0, "uaudio default sample channels");
 #endif
 
+#define	UAUDIO_IRQS	(8000 / UAUDIO_NFRAMES)	/* interrupts per second */
 #define	UAUDIO_NFRAMES		64	/* must be factor of 8 due HS-USB */
 #define	UAUDIO_NCHANBUFS	2	/* number of outstanding request */
 #define	UAUDIO_RECURSE_LIMIT	255	/* rounds */
@@ -189,7 +190,6 @@ struct uaudio_chan_alt {
 	uint8_t	iface_index;
 	uint8_t	iface_alt_index;
 	uint8_t channels;
-	uint8_t enable_sync;
 };
 
 struct uaudio_chan {
@@ -226,11 +226,12 @@ struct uaudio_chan {
 #define	CHAN_OP_STOP 2
 #define	CHAN_OP_DRAIN 3
 
-	uint8_t last_sync_time;
-	uint8_t last_sync_state;
-#define	UAUDIO_SYNC_NONE 0
-#define	UAUDIO_SYNC_MORE 1
-#define	UAUDIO_SYNC_LESS 2
+	/* USB audio feedback endpoint state */
+	struct {
+		uint16_t time;		/* I/O interrupt count */
+		int16_t constant;	/* sample rate adjustment in Hz */
+		int16_t remainder;	/* current remainder */
+	} feedback;
 };
 
 #define	UMIDI_EMB_JACK_MAX   16		/* units */
@@ -1799,14 +1800,6 @@ uaudio_chan_fill_info_sub(struct uaudio_
 		chan_alt->iface_index = curidx;
 		chan_alt->iface_alt_index = alt_index;
 
-		if (UEP_HAS_SYNCADDR(ed1) && ed1->bSynchAddress != 0) {
-			DPRINTF("Sync endpoint will be used, if present\n");
-			chan_alt->enable_sync = 1;
-		} else {
-			DPRINTF("Sync endpoint will not be used\n");
-			chan_alt->enable_sync = 0;
-		}
-
 		usbd_set_parent_iface(sc->sc_udev, curidx,
 		    sc->sc_mixer_iface_index);
 
@@ -2016,29 +2009,44 @@ uaudio_chan_play_sync_callback(struct us
 		if (temp == 0)
 			break;
 
-		/* correctly scale value */
-
-		temp = (temp * 125ULL) - 64;
+		temp *= 125ULL;
 
 		/* auto adjust */
-
 		while (temp < (sample_rate - (sample_rate / 4)))
 			temp *= 2;
-
+ 
 		while (temp > (sample_rate + (sample_rate / 2)))
 			temp /= 2;
 
-		/* compare */
+		/*
+		 * Some USB audio devices only report a sample rate
+		 * different from the nominal one when they want one
+		 * more or less sample. Make sure we catch this case
+		 * by pulling the sample rate offset slowly towards
+		 * zero if the reported value is equal to the sample
+		 * rate.
+		 */
+		if (temp > sample_rate)
+			ch->feedback.constant += 1;
+		else if (temp < sample_rate)
+			ch->feedback.constant -= 1;
+		else if (ch->feedback.constant > 0)
+			ch->feedback.constant--;
+		else if (ch->feedback.constant < 0)
+			ch->feedback.constant++;
 
-		DPRINTF("Comparing %d < %d\n",
-		    (int)temp, (int)sample_rate);
+		DPRINTF("Comparing %d Hz :: %d Hz :: %d samples drift\n",
+		    (int)temp, (int)sample_rate, (int)ch->feedback.constant);
 
-		if (temp == sample_rate)
-			ch->last_sync_state = UAUDIO_SYNC_NONE;
-		else if (temp > sample_rate)
-			ch->last_sync_state = UAUDIO_SYNC_MORE;
-		else
-			ch->last_sync_state = UAUDIO_SYNC_LESS;
+		/*
+		 * Range check sync constant. We cannot change the
+		 * number of samples per second by more than the value
+		 * defined by "UAUDIO_IRQS":
+		 */
+		if (ch->feedback.constant > UAUDIO_IRQS)
+			ch->feedback.constant = UAUDIO_IRQS;
+		else if (ch->feedback.constant < -UAUDIO_IRQS)
+			ch->feedback.constant = -UAUDIO_IRQS;
 		break;
 
 	case USB_ST_SETUP:
@@ -2082,10 +2090,10 @@ tr_transferred:
 		}
 		chn_intr(ch->pcm_ch);
 
-		/* start SYNC transfer, if any */
-		if (ch->usb_alt[ch->cur_alt].enable_sync != 0) {
-			if ((ch->last_sync_time++ & 7) == 0)
-				usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]);
+		/* start the SYNC transfer one time per second, if any */
+		if (++(ch->feedback.time) >= UAUDIO_IRQS) {
+			ch->feedback.time = 0;
+			usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]);
 		}
 
 	case USB_ST_SETUP:
@@ -2120,21 +2128,22 @@ tr_transferred:
 			}
 
 			if (n == (blockcount - 1)) {
-				switch (ch->last_sync_state) {
-				case UAUDIO_SYNC_MORE:
+				/*
+				 * Update sync remainder and check if
+				 * we should transmit more or less
+				 * data:
+				 */
+				ch->feedback.remainder += ch->feedback.constant;
+				if (ch->feedback.remainder >= UAUDIO_IRQS) {
+					ch->feedback.remainder -= UAUDIO_IRQS;
 					DPRINTFN(6, "sending one sample more\n");
 					if ((frame_len + sample_size) <= mfl)
 						frame_len += sample_size;
-					ch->last_sync_state = UAUDIO_SYNC_NONE;
-					break;
-				case UAUDIO_SYNC_LESS:
+				} else if (ch->feedback.remainder <= -UAUDIO_IRQS) {
+					ch->feedback.remainder += UAUDIO_IRQS;
 					DPRINTFN(6, "sending one sample less\n");
 					if (frame_len >= sample_size)
 						frame_len -= sample_size;
-					ch->last_sync_state = UAUDIO_SYNC_NONE;
-					break;
-				default:
-					break;
 				}
 			}
 
@@ -2452,6 +2461,9 @@ uaudio_chan_start(struct uaudio_chan *ch
 	}
 	usb_proc_explore_unlock(sc->sc_udev);
 
+	/* reset feedback endpoint state */
+	memset(&ch->feedback, 0, sizeof(ch->feedback));
+
 	if (do_start) {
 		usbd_transfer_start(ch->xfer[0]);
 		usbd_transfer_start(ch->xfer[1]);

Modified: projects/release-install-debug/sys/fs/autofs/autofs.c
==============================================================================
--- projects/release-install-debug/sys/fs/autofs/autofs.c	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/fs/autofs/autofs.c	Wed Feb 11 02:02:56 2015	(r278549)
@@ -584,6 +584,34 @@ autofs_ioctl_request(struct autofs_daemo
 }
 
 static int
+autofs_ioctl_done_101(struct autofs_daemon_done_101 *add)
+{
+	struct autofs_request *ar;
+
+	sx_xlock(&autofs_softc->sc_lock);
+	TAILQ_FOREACH(ar, &autofs_softc->sc_requests, ar_next) {
+		if (ar->ar_id == add->add_id)
+			break;
+	}
+
+	if (ar == NULL) {
+		sx_xunlock(&autofs_softc->sc_lock);
+		AUTOFS_DEBUG("id %d not found", add->add_id);
+		return (ESRCH);
+	}
+
+	ar->ar_error = add->add_error;
+	ar->ar_wildcards = true;
+	ar->ar_done = true;
+	ar->ar_in_progress = false;
+	cv_broadcast(&autofs_softc->sc_cv);
+
+	sx_xunlock(&autofs_softc->sc_lock);
+
+	return (0);
+}
+
+static int
 autofs_ioctl_done(struct autofs_daemon_done *add)
 {
 	struct autofs_request *ar;
@@ -658,6 +686,9 @@ autofs_ioctl(struct cdev *dev, u_long cm
 	case AUTOFSREQUEST:
 		return (autofs_ioctl_request(
 		    (struct autofs_daemon_request *)arg));
+	case AUTOFSDONE101:
+		return (autofs_ioctl_done_101(
+		    (struct autofs_daemon_done_101 *)arg));
 	case AUTOFSDONE:
 		return (autofs_ioctl_done(
 		    (struct autofs_daemon_done *)arg));

Modified: projects/release-install-debug/sys/fs/autofs/autofs_ioctl.h
==============================================================================
--- projects/release-install-debug/sys/fs/autofs/autofs_ioctl.h	Wed Feb 11 02:00:49 2015	(r278548)
+++ projects/release-install-debug/sys/fs/autofs/autofs_ioctl.h	Wed Feb 11 02:02:56 2015	(r278549)
@@ -71,6 +71,21 @@ struct autofs_daemon_request {
 	char		adr_options[MAXPATHLEN];
 };
 
+/*
+ * Compatibility with 10.1-RELEASE automountd(8).
+ */
+struct autofs_daemon_done_101 {
+	/*
+	 * Identifier, copied from adr_id.
+	 */
+	int		add_id;
+
+	/*
+	 * Error number, possibly returned to userland.
+	 */
+	int		add_error;
+};
+
 struct autofs_daemon_done {
 	/*
 	 * Identifier, copied from adr_id.
@@ -87,9 +102,15 @@ struct autofs_daemon_done {
 	 * Error number, possibly returned to userland.
 	 */
 	int		add_error;
+
+	/*
+	 * Reserved for future use.
+	 */
+	int		add_spare[7];
 };
 
 #define	AUTOFSREQUEST	_IOR('I', 0x01, struct autofs_daemon_request)
-#define	AUTOFSDONE	_IOW('I', 0x02, struct autofs_daemon_done)
+#define	AUTOFSDONE101	_IOW('I', 0x02, struct autofs_daemon_done_101)
+#define	AUTOFSDONE	_IOW('I', 0x03, struct autofs_daemon_done)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



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