Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Oct 2015 07:22:08 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r288540 - in projects/release-pkg: . contrib/netbsd-tests/lib/libc/sys etc/etc.aarch64 games release/arm sbin/init sbin/ipf/ipftest share/mk sys/arm/arm sys/arm/broadcom/bcm2835 sys/arm...
Message-ID:  <201510030722.t937M8fd062289@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Sat Oct  3 07:22:07 2015
New Revision: 288540
URL: https://svnweb.freebsd.org/changeset/base/288540

Log:
  Remerge as previous one was broken

Added:
  projects/release-pkg/usr.bin/caesar/
     - copied from r288493, head/usr.bin/caesar/
  projects/release-pkg/usr.bin/factor/
     - copied from r288493, head/usr.bin/factor/
  projects/release-pkg/usr.bin/fortune/
     - copied from r288493, head/usr.bin/fortune/
  projects/release-pkg/usr.bin/grdc/
     - copied from r288493, head/usr.bin/grdc/
  projects/release-pkg/usr.bin/morse/
     - copied from r288493, head/usr.bin/morse/
  projects/release-pkg/usr.bin/number/
     - copied from r288493, head/usr.bin/number/
  projects/release-pkg/usr.bin/pom/
     - copied from r288493, head/usr.bin/pom/
  projects/release-pkg/usr.bin/primes/
     - copied from r288493, head/usr.bin/primes/
  projects/release-pkg/usr.bin/random/
     - copied from r288493, head/usr.bin/random/
  projects/release-pkg/usr.bin/truss/aarch64-fbsd.c
     - copied unchanged from r288493, head/usr.bin/truss/aarch64-fbsd.c
  projects/release-pkg/usr.bin/truss/amd64-cloudabi64.c
     - copied unchanged from r288493, head/usr.bin/truss/amd64-cloudabi64.c
  projects/release-pkg/usr.bin/truss/amd64cloudabi64.conf
     - copied unchanged from r288493, head/usr.bin/truss/amd64cloudabi64.conf
  projects/release-pkg/usr.sbin/Makefile.arm64
     - copied unchanged from r288493, head/usr.sbin/Makefile.arm64
Deleted:
  projects/release-pkg/games/
Modified:
  projects/release-pkg/Makefile.inc1
  projects/release-pkg/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c
  projects/release-pkg/etc/etc.aarch64/ttys
  projects/release-pkg/release/arm/BANANAPI.conf
  projects/release-pkg/release/arm/CUBIEBOARD.conf
  projects/release-pkg/release/arm/CUBIEBOARD2.conf
  projects/release-pkg/sbin/init/init.c
  projects/release-pkg/sbin/ipf/ipftest/Makefile
  projects/release-pkg/share/mk/meta.stage.mk
  projects/release-pkg/sys/arm/arm/machdep.c
  projects/release-pkg/sys/arm/arm/vm_machdep.c
  projects/release-pkg/sys/arm/broadcom/bcm2835/bcm2836_mp.c
  projects/release-pkg/sys/arm/include/atomic-v4.h
  projects/release-pkg/sys/arm/include/atomic-v6.h
  projects/release-pkg/sys/arm/include/atomic.h
  projects/release-pkg/sys/arm/mv/mpic.c
  projects/release-pkg/sys/arm64/arm64/exception.S
  projects/release-pkg/sys/arm64/arm64/pmap.c
  projects/release-pkg/sys/cam/ctl/ctl.c
  projects/release-pkg/sys/cam/ctl/ctl_private.h
  projects/release-pkg/sys/cam/ctl/ctl_tpc.c
  projects/release-pkg/sys/dev/acpica/acpi.c
  projects/release-pkg/sys/dev/drm2/i915/i915_gem_execbuffer.c
  projects/release-pkg/sys/kern/kern_shutdown.c
  projects/release-pkg/sys/kern/subr_sbuf.c
  projects/release-pkg/sys/kern/vfs_default.c
  projects/release-pkg/sys/net80211/ieee80211_crypto_ccmp.c
  projects/release-pkg/sys/net80211/ieee80211_crypto_tkip.c
  projects/release-pkg/sys/net80211/ieee80211_crypto_wep.c
  projects/release-pkg/sys/sys/systm.h
  projects/release-pkg/targets/pseudo/bootstrap-tools/Makefile
  projects/release-pkg/targets/pseudo/stage/Makefile
  projects/release-pkg/usr.bin/Makefile
  projects/release-pkg/usr.bin/truss/Makefile
  projects/release-pkg/usr.bin/truss/syscall.h
  projects/release-pkg/usr.bin/truss/syscalls.c
  projects/release-pkg/usr.sbin/bhyve/pci_virtio_net.c
  projects/release-pkg/usr.sbin/ctld/ctl.conf.5
  projects/release-pkg/usr.sbin/ctld/ctld.c
  projects/release-pkg/usr.sbin/ctld/ctld.h
  projects/release-pkg/usr.sbin/kldxref/kldxref.c
  projects/release-pkg/usr.sbin/rpc.yppasswdd/yppasswdd_server.c
Directory Properties:
  projects/release-pkg/   (props changed)
  projects/release-pkg/sbin/   (props changed)
  projects/release-pkg/share/   (props changed)
  projects/release-pkg/sys/   (props changed)
  projects/release-pkg/targets/   (props changed)
  projects/release-pkg/usr.sbin/bhyve/   (props changed)

Modified: projects/release-pkg/Makefile.inc1
==============================================================================
--- projects/release-pkg/Makefile.inc1	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/Makefile.inc1	Sat Oct  3 07:22:07 2015	(r288540)
@@ -61,9 +61,6 @@ SUBDIR=	${SUBDIR_OVERRIDE}
 .else
 SUBDIR=	lib libexec
 SUBDIR+=bin
-.if ${MK_GAMES} != "no"
-SUBDIR+=games
-.endif
 .if ${MK_CDDL} != "no"
 SUBDIR+=cddl
 .endif
@@ -1409,7 +1406,7 @@ legacy:
 _bt=		_bootstrap-tools
 
 .if ${MK_GAMES} != "no"
-_strfile=	games/fortune/strfile
+_strfile=	usr.bin/fortune/strfile
 .endif
 
 .if ${MK_GCC} != "no" && ${MK_CXX} != "no"

Modified: projects/release-pkg/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c
==============================================================================
--- projects/release-pkg/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c	Sat Oct  3 07:22:07 2015	(r288540)
@@ -53,6 +53,8 @@ run(int n, ...)
 	va_start(va, n);
 #if defined(__FreeBSD__) && defined(__amd64__)
 	for (i = 0; i < 5; i++) {
+#elif defined(__FreeBSD__) && defined(__aarch64__)
+	for (i = 0; i < 7; i++) {
 #else
 	for (i = 0; i < 9; i++) {
 #endif
@@ -116,6 +118,10 @@ ATF_TC_BODY(setcontext_link, tc)
 		/* FreeBSD/amd64 only permits up to 6 arguments. */
 		makecontext(&uc[i], (void *)run, 6, i,
 			0, 1, 2, 3, 4);
+#elif defined(__FreeBSD__) && defined(__aarch64__)
+		/* FreeBSD/arm64 only permits up to 8 arguments. */
+		makecontext(&uc[i], (void *)run, 8, i,
+			0, 1, 2, 3, 4, 5, 6);
 #else
 		makecontext(&uc[i], (void *)run, 10, i,
 			0, 1, 2, 3, 4, 5, 6, 7, 8);

Modified: projects/release-pkg/etc/etc.aarch64/ttys
==============================================================================
--- projects/release-pkg/etc/etc.aarch64/ttys	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/etc/etc.aarch64/ttys	Sat Oct  3 07:22:07 2015	(r288540)
@@ -29,7 +29,7 @@
 # when going to single-user mode.
 console	none				unknown	off secure
 #
-ttyv0	"/usr/libexec/getty Pc"		xterm	off  secure
+ttyv0	"/usr/libexec/getty Pc"		xterm	onifconsole  secure
 # Virtual terminals
 ttyv1	"/usr/libexec/getty Pc"		xterm	off  secure
 ttyv2	"/usr/libexec/getty Pc"		xterm	off  secure
@@ -41,9 +41,9 @@ ttyv7	"/usr/libexec/getty Pc"		xterm	off
 #ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.
-ttyu0	"/usr/libexec/getty std.9600"	vt100	on  secure
-ttyu1	"/usr/libexec/getty std.9600"	dialup	off secure
-ttyu2	"/usr/libexec/getty std.9600"	dialup	off secure
-ttyu3	"/usr/libexec/getty std.9600"	dialup	off secure
+ttyu0	"/usr/libexec/getty 3wire"	vt100	onifconsole  secure
+ttyu1	"/usr/libexec/getty 3wire"	vt100	onifconsole  secure
+ttyu2	"/usr/libexec/getty 3wire"	vt100	onifconsole  secure
+ttyu3	"/usr/libexec/getty 3wire"	vt100	onifconsole  secure
 # Dumb console
 dcons	"/usr/libexec/getty std.9600"	vt100	off secure

Modified: projects/release-pkg/release/arm/BANANAPI.conf
==============================================================================
--- projects/release-pkg/release/arm/BANANAPI.conf	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/release/arm/BANANAPI.conf	Sat Oct  3 07:22:07 2015	(r288540)
@@ -22,10 +22,8 @@ arm_install_uboot() {
 	UBOOT_FILES="u-boot.img"
 	FATMOUNT="${DESTDIR%${KERNEL}}/fat"
 	UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
-	chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/sunxi-spl.bin \
-		of=/dev/${mddev} bs=1k seek=8
-	chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
-		of=/dev/${mddev} bs=1k seek=40 conv=notrunc,sync
+	chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/u-boot-sunxi-with-spl.bin \
+		of=/dev/${mddev} bs=1k seek=8 conv=sync
 	chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
 	chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
 	chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}

Modified: projects/release-pkg/release/arm/CUBIEBOARD.conf
==============================================================================
--- projects/release-pkg/release/arm/CUBIEBOARD.conf	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/release/arm/CUBIEBOARD.conf	Sat Oct  3 07:22:07 2015	(r288540)
@@ -21,10 +21,8 @@ arm_install_uboot() {
 	UBOOT_FILES="u-boot.img"
 	FATMOUNT="${DESTDIR%${KERNEL}}/fat"
 	UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
-	chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/sunxi-spl.bin \
-		of=/dev/${mddev} bs=1k seek=8
-	chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
-		of=/dev/${mddev} bs=1k seek=40 conv=notrunc,sync
+	chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/u-boot-sunxi-with-spl.bin \
+		of=/dev/${mddev} bs=1k seek=8 conv=sync
 	chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
 	chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
 	chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}

Modified: projects/release-pkg/release/arm/CUBIEBOARD2.conf
==============================================================================
--- projects/release-pkg/release/arm/CUBIEBOARD2.conf	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/release/arm/CUBIEBOARD2.conf	Sat Oct  3 07:22:07 2015	(r288540)
@@ -22,10 +22,8 @@ arm_install_uboot() {
 	UBOOT_FILES="u-boot.img"
 	FATMOUNT="${DESTDIR%${KERNEL}}/fat"
 	UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
-	chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/sunxi-spl.bin \
-		of=/dev/${mddev} bs=1k seek=8
-	chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
-		of=/dev/${mddev} bs=1k seek=40 conv=notrunc,sync
+	chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/u-boot-sunxi-with-spl.bin \
+		of=/dev/${mddev} bs=1k seek=8 conv=sync
 	chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
 	chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
 	chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}

Modified: projects/release-pkg/sbin/init/init.c
==============================================================================
--- projects/release-pkg/sbin/init/init.c	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sbin/init/init.c	Sat Oct  3 07:22:07 2015	(r288540)
@@ -1487,6 +1487,15 @@ static state_func_t
 death(void)
 {
 	session_t *sp;
+	int block, blocked;
+	size_t len;
+
+	/* Temporarily block suspend. */
+	len = sizeof(blocked);
+	block = 1;
+	if (sysctlbyname("kern.suspend_blocked", &blocked, &len,
+	    &block, sizeof(block)) == -1)
+		blocked = 0;
 
 	/*
 	 * Also revoke the TTY here.  Because runshutdown() may reopen
@@ -1503,6 +1512,11 @@ death(void)
 	/* Try to run the rc.shutdown script within a period of time */
 	runshutdown();
 
+	/* Unblock suspend if we blocked it. */
+	if (!blocked)
+		sysctlbyname("kern.suspend_blocked", NULL, NULL,
+		    &blocked, sizeof(blocked));
+
 	return (state_func_t) death_single;
 }
 

Modified: projects/release-pkg/sbin/ipf/ipftest/Makefile
==============================================================================
--- projects/release-pkg/sbin/ipf/ipftest/Makefile	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sbin/ipf/ipftest/Makefile	Sat Oct  3 07:22:07 2015	(r288540)
@@ -32,15 +32,19 @@ CLEANFILES+=	ipnat.tab.c ipnat.tab.h
 CLEANFILES+=	ippool_y.c ippool_l.c
 CLEANFILES+=	ippool.tab.c ippool.tab.h
 
-ipnat_y.c: ipnat_y.y
+ipnat.tab.c ipnat.tab.h: ipnat_y.y
 	${YACC} -b ipnat -d ${.ALLSRC}
+
+ipnat_y.c: ipnat.tab.c
 	sed -e 's/yy/ipnat_yy/g' \
 	    -e 's/y.tab.c/ipnat_y.c/' \
 	    -e s/\"ipnat_y.y\"/\"..\\/tools\\/ipnat_y.y\"/ \
 	    ipnat.tab.c > ${.TARGET}
+
+ipnat_y.h: ipnat.tab.h
 	sed -e 's/yy/ipnat_yy/g' \
 	    -e 's/y.tab.h/ipnat_y.h/' \
-	    ipnat.tab.h > ${.TARGET:.c=.h}
+	    ipnat.tab.h > ${.TARGET}
 
 ipnat_y.h: ipnat_y.c
 
@@ -54,13 +58,17 @@ ipnat_l.h: lexer.h
 	sed -e 's/yy/ipnat_yy/g' \
 	    ${.ALLSRC} > ${.TARGET}
 
-ippool_y.c: ippool_y.y
+ippool.tab.c ippool.tab.h: ippool_y.y
 	${YACC} -b ippool -d ${.ALLSRC}
+
+ippool_y.c: ippool.tab.c
 	sed -e 's/yy/ippool_yy/g' \
 	    -e 's/"ippool_y.y"/"..\/tools\/ippool_y.y"/' \
 	    ippool.tab.c > ${.TARGET}
+
+ippool_y.h: ippool.tab.h
 	sed -e 's/yy/ippool_yy/g' \
-	    ippool.tab.h > ${.TARGET:.c=.h}
+	    ippool.tab.h > ${.TARGET}
 
 ippool_y.h: ippool_y.c
 
@@ -74,13 +82,17 @@ ippool_l.h: lexer.h
 	sed -e 's/yy/ippool_yy/g' \
 	    ${.ALLSRC} > ${.TARGET}
 
-ipf_y.c: ipf_y.y
+ipf.tab.c ipf.tab.h: ipf_y.y
 	${YACC} -b ipf -d ${.ALLSRC}
+
+ipf_y.c: ipf.tab.c
 	sed -e 's/yy/ipf_yy/g' \
 	    -e 's/"ipf_y.y"/"..\/tools\/ipf_y.y"/' \
 		ipf.tab.c > ${.TARGET}
+
+ipf_y.h: ipf.tab.h
 	sed -e 's/yy/ipf_yy/g' \
-		ipf.tab.h > ${.TARGET:.c=.h}
+		ipf.tab.h > ${.TARGET}
 
 ipf_y.h: ipf_y.c
 

Modified: projects/release-pkg/share/mk/meta.stage.mk
==============================================================================
--- projects/release-pkg/share/mk/meta.stage.mk	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/share/mk/meta.stage.mk	Sat Oct  3 07:22:07 2015	(r288540)
@@ -237,10 +237,11 @@ stage_as.$s:	.dirdep
 CLEANFILES += ${STAGE_TARGETS} stage_incs stage_includes
 
 # stage_*links usually needs to follow any others.
-.for t in ${STAGE_TARGETS:N*links:O:u}
-.ORDER: $t stage_links
-.ORDER: $t stage_symlinks
+.if !empty(STAGE_SETS) && !empty(STAGE_TARGETS:Nstage_links)
+.for s in ${STAGE_SETS:O:u}
+stage_links.$s: ${STAGE_TARGETS:Nstage_links:O:u}
 .endfor
+.endif
 
 # make sure this exists
 staging:

Modified: projects/release-pkg/sys/arm/arm/machdep.c
==============================================================================
--- projects/release-pkg/sys/arm/arm/machdep.c	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sys/arm/arm/machdep.c	Sat Oct  3 07:22:07 2015	(r288540)
@@ -1069,7 +1069,7 @@ init_proc0(vm_offset_t kstack)
 		(thread0.td_kstack + kstack_pages * PAGE_SIZE) - 1;
 	thread0.td_pcb->pcb_flags = 0;
 	thread0.td_pcb->pcb_vfpcpu = -1;
-	thread0.td_pcb->pcb_vfpstate.fpscr = VFPSCR_DN | VFPSCR_FZ;
+	thread0.td_pcb->pcb_vfpstate.fpscr = VFPSCR_DN;
 	thread0.td_frame = &proc0_tf;
 	pcpup->pc_curpcb = thread0.td_pcb;
 }

Modified: projects/release-pkg/sys/arm/arm/vm_machdep.c
==============================================================================
--- projects/release-pkg/sys/arm/arm/vm_machdep.c	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sys/arm/arm/vm_machdep.c	Sat Oct  3 07:22:07 2015	(r288540)
@@ -134,7 +134,7 @@ cpu_fork(register struct thread *td1, re
 	pcb2->pcb_regs.sf_sp = STACKALIGN(td2->td_frame);
 
 	pcb2->pcb_vfpcpu = -1;
-	pcb2->pcb_vfpstate.fpscr = VFPSCR_DN | VFPSCR_FZ;
+	pcb2->pcb_vfpstate.fpscr = VFPSCR_DN;
 
 	tf = td2->td_frame;
 	tf->tf_spsr &= ~PSR_C;

Modified: projects/release-pkg/sys/arm/broadcom/bcm2835/bcm2836_mp.c
==============================================================================
--- projects/release-pkg/sys/arm/broadcom/bcm2835/bcm2836_mp.c	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sys/arm/broadcom/bcm2835/bcm2836_mp.c	Sat Oct  3 07:22:07 2015	(r288540)
@@ -182,6 +182,8 @@ pic_ipi_read(int i)
 		if (val == 0)
 			return (0);
 		ipi = ffs(val) - 1;
+		BSWR4(MBOX0CLR_CORE(cpu), 1 << ipi);
+		dsb();
 		return (ipi);
 	}
 	return (0x3ff);
@@ -190,12 +192,6 @@ pic_ipi_read(int i)
 void
 pic_ipi_clear(int ipi)
 {
-	int cpu;
-
-	cpu = PCPU_GET(cpuid);
-	dsb();
-	BSWR4(MBOX0CLR_CORE(cpu), 1 << ipi);
-	wmb();
 }
 
 void

Modified: projects/release-pkg/sys/arm/include/atomic-v4.h
==============================================================================
--- projects/release-pkg/sys/arm/include/atomic-v4.h	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sys/arm/include/atomic-v4.h	Sat Oct  3 07:22:07 2015	(r288540)
@@ -439,4 +439,37 @@ atomic_subtract_long(volatile u_long *p,
 	atomic_subtract_32((volatile uint32_t *)p, v);
 }
 
+/*
+ * ARMv5 does not support SMP.  For both kernel and user modes, only a
+ * compiler barrier is needed for fences, since CPU is always
+ * self-consistent.
+ */
+static __inline void
+atomic_thread_fence_acq(void)
+{
+
+	__compiler_membar();
+}
+
+static __inline void
+atomic_thread_fence_rel(void)
+{
+
+	__compiler_membar();
+}
+
+static __inline void
+atomic_thread_fence_acq_rel(void)
+{
+
+	__compiler_membar();
+}
+
+static __inline void
+atomic_thread_fence_seq_cst(void)
+{
+
+	__compiler_membar();
+}
+
 #endif /* _MACHINE_ATOMIC_H_ */

Modified: projects/release-pkg/sys/arm/include/atomic-v6.h
==============================================================================
--- projects/release-pkg/sys/arm/include/atomic-v6.h	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sys/arm/include/atomic-v6.h	Sat Oct  3 07:22:07 2015	(r288540)
@@ -596,4 +596,32 @@ atomic_store_rel_long(volatile u_long *p
 #undef ATOMIC_ACQ_REL
 #undef ATOMIC_ACQ_REL_LONG
 
+static __inline void
+atomic_thread_fence_acq(void)
+{
+
+	dmb();
+}
+
+static __inline void
+atomic_thread_fence_rel(void)
+{
+
+	dmb();
+}
+
+static __inline void
+atomic_thread_fence_acq_rel(void)
+{
+
+	dmb();
+}
+
+static __inline void
+atomic_thread_fence_seq_cst(void)
+{
+
+	dmb();
+}
+
 #endif /* _MACHINE_ATOMIC_V6_H_ */

Modified: projects/release-pkg/sys/arm/include/atomic.h
==============================================================================
--- projects/release-pkg/sys/arm/include/atomic.h	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sys/arm/include/atomic.h	Sat Oct  3 07:22:07 2015	(r288540)
@@ -82,34 +82,6 @@ atomic_store_long(volatile u_long *dst, 
 	*dst = src;
 }
 
-static __inline void
-atomic_thread_fence_acq(void)
-{
-
-	dmb();
-}
-
-static __inline void
-atomic_thread_fence_rel(void)
-{
-
-	dmb();
-}
-
-static __inline void
-atomic_thread_fence_acq_rel(void)
-{
-
-	dmb();
-}
-
-static __inline void
-atomic_thread_fence_seq_cst(void)
-{
-
-	dmb();
-}
-
 #define atomic_clear_ptr		atomic_clear_32
 #define atomic_set_ptr			atomic_set_32
 #define atomic_cmpset_ptr		atomic_cmpset_32

Modified: projects/release-pkg/sys/arm/mv/mpic.c
==============================================================================
--- projects/release-pkg/sys/arm/mv/mpic.c	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sys/arm/mv/mpic.c	Sat Oct  3 07:22:07 2015	(r288540)
@@ -378,10 +378,14 @@ int
 pic_ipi_read(int i __unused)
 {
 	uint32_t val;
+	int ipi;
 
 	val = MPIC_CPU_READ(mv_mpic_sc, MPIC_IN_DRBL);
-	if (val)
-		return (ffs(val) - 1);
+	if (val) {
+		ipi = ffs(val) - 1;
+		MPIC_CPU_WRITE(mv_mpic_sc, MPIC_IN_DRBL, ~(1 << ipi));
+		return (ipi);
+	}
 
 	return (0x3ff);
 }
@@ -389,10 +393,6 @@ pic_ipi_read(int i __unused)
 void
 pic_ipi_clear(int ipi)
 {
-	uint32_t val;
-
-	val = ~(1 << ipi);
-	MPIC_CPU_WRITE(mv_mpic_sc, MPIC_IN_DRBL, val);
 }
 
 #endif

Modified: projects/release-pkg/sys/arm64/arm64/exception.S
==============================================================================
--- projects/release-pkg/sys/arm64/arm64/exception.S	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sys/arm64/arm64/exception.S	Sat Oct  3 07:22:07 2015	(r288540)
@@ -131,45 +131,51 @@ __FBSDID("$FreeBSD$");
 2:
 .endm
 
-handle_el1h_sync:
+ENTRY(handle_el1h_sync)
 	save_registers 1
 	mov	x0, sp
 	bl	do_el1h_sync
 	restore_registers 1
 	eret
+END(handle_el1h_sync)
 
-handle_el1h_irq:
+ENTRY(handle_el1h_irq)
 	save_registers 1
 	mov	x0, sp
 	bl	arm_cpu_intr
 	restore_registers 1
 	eret
+END(handle_el1h_irq)
 
-handle_el1h_error:
+ENTRY(handle_el1h_error)
 	brk	0xf13
+END(handle_el1h_error)
 
-handle_el0_sync:
+ENTRY(handle_el0_sync)
 	save_registers 0
 	mov	x0, sp
 	bl	do_el0_sync
 	do_ast
 	restore_registers 0
 	eret
+END(handle_el0_sync)
 
-handle_el0_irq:
+ENTRY(handle_el0_irq)
 	save_registers 0
 	mov	x0, sp
 	bl	arm_cpu_intr
 	do_ast
 	restore_registers 0
 	eret
+END(handle_el0_irq)
 
-handle_el0_error:
+ENTRY(handle_el0_error)
 	save_registers 0
 	mov	x0, sp
 	bl	do_el0_error
 	brk	0xf23
 	1: b 1b
+END(handle_el0_error)
 
 .macro	vempty
 	.align 7

Modified: projects/release-pkg/sys/arm64/arm64/pmap.c
==============================================================================
--- projects/release-pkg/sys/arm64/arm64/pmap.c	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sys/arm64/arm64/pmap.c	Sat Oct  3 07:22:07 2015	(r288540)
@@ -243,6 +243,16 @@ static void _pmap_unwire_l3(pmap_t pmap,
     struct spglist *free);
 static int pmap_unuse_l3(pmap_t, vm_offset_t, pd_entry_t, struct spglist *);
 
+/*
+ * These load the old table data and store the new value.
+ * They need to be atomic as the System MMU may write to the table at
+ * the same time as the CPU.
+ */
+#define	pmap_load_store(table, entry) atomic_swap_64(table, entry)
+#define	pmap_set(table, mask) atomic_set_64(table, mask)
+#define	pmap_load_clear(table) atomic_swap_64(table, 0)
+#define	pmap_load(table) (*table)
+
 /********************/
 /* Inline functions */
 /********************/
@@ -277,7 +287,7 @@ pmap_l1_to_l2(pd_entry_t *l1, vm_offset_
 {
 	pd_entry_t *l2;
 
-	l2 = (pd_entry_t *)PHYS_TO_DMAP(*l1 & ~ATTR_MASK);
+	l2 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l1) & ~ATTR_MASK);
 	return (&l2[pmap_l2_index(va)]);
 }
 
@@ -287,7 +297,7 @@ pmap_l2(pmap_t pmap, vm_offset_t va)
 	pd_entry_t *l1;
 
 	l1 = pmap_l1(pmap, va);
-	if ((*l1 & ATTR_DESCR_MASK) != L1_TABLE)
+	if ((pmap_load(l1) & ATTR_DESCR_MASK) != L1_TABLE)
 		return (NULL);
 
 	return (pmap_l1_to_l2(l1, va));
@@ -298,7 +308,7 @@ pmap_l2_to_l3(pd_entry_t *l2, vm_offset_
 {
 	pt_entry_t *l3;
 
-	l3 = (pd_entry_t *)PHYS_TO_DMAP(*l2 & ~ATTR_MASK);
+	l3 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l2) & ~ATTR_MASK);
 	return (&l3[pmap_l3_index(va)]);
 }
 
@@ -308,7 +318,7 @@ pmap_l3(pmap_t pmap, vm_offset_t va)
 	pd_entry_t *l2;
 
 	l2 = pmap_l2(pmap, va);
-	if (l2 == NULL || (*l2 & ATTR_DESCR_MASK) != L2_TABLE)
+	if (l2 == NULL || (pmap_load(l2) & ATTR_DESCR_MASK) != L2_TABLE)
 		return (NULL);
 
 	return (pmap_l2_to_l3(l2, va));
@@ -326,19 +336,19 @@ pmap_get_tables(pmap_t pmap, vm_offset_t
 	l1p = pmap_l1(pmap, va);
 	*l1 = l1p;
 
-	if ((*l1p & ATTR_DESCR_MASK) == L1_BLOCK) {
+	if ((pmap_load(l1p) & ATTR_DESCR_MASK) == L1_BLOCK) {
 		*l2 = NULL;
 		*l3 = NULL;
 		return (true);
 	}
 
-	if ((*l1p & ATTR_DESCR_MASK) != L1_TABLE)
+	if ((pmap_load(l1p) & ATTR_DESCR_MASK) != L1_TABLE)
 		return (false);
 
 	l2p = pmap_l1_to_l2(l1p, va);
 	*l2 = l2p;
 
-	if ((*l2p & ATTR_DESCR_MASK) == L2_BLOCK) {
+	if ((pmap_load(l2p) & ATTR_DESCR_MASK) == L2_BLOCK) {
 		*l3 = NULL;
 		return (true);
 	}
@@ -348,16 +358,6 @@ pmap_get_tables(pmap_t pmap, vm_offset_t
 	return (true);
 }
 
-/*
- * These load the old table data and store the new value.
- * They need to be atomic as the System MMU may write to the table at
- * the same time as the CPU.
- */
-#define	pmap_load_store(table, entry) atomic_swap_64(table, entry)
-#define	pmap_set(table, mask) atomic_set_64(table, mask)
-#define	pmap_load_clear(table) atomic_swap_64(table, 0)
-#define	pmap_load(table) (*table)
-
 static __inline int
 pmap_is_current(pmap_t pmap)
 {
@@ -799,11 +799,11 @@ pmap_extract(pmap_t pmap, vm_offset_t va
 	 */
 	l2p = pmap_l2(pmap, va);
 	if (l2p != NULL) {
-		l2 = *l2p;
+		l2 = pmap_load(l2p);
 		if ((l2 & ATTR_DESCR_MASK) == L2_TABLE) {
 			l3p = pmap_l2_to_l3(l2p, va);
 			if (l3p != NULL) {
-				l3 = *l3p;
+				l3 = pmap_load(l3p);
 
 				if ((l3 & ATTR_DESCR_MASK) == L3_PAGE)
 					pa = (l3 & ~ATTR_MASK) |
@@ -852,23 +852,25 @@ retry:
 vm_paddr_t
 pmap_kextract(vm_offset_t va)
 {
-	pd_entry_t *l2;
+	pd_entry_t *l2p, l2;
 	pt_entry_t *l3;
 	vm_paddr_t pa;
 
 	if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) {
 		pa = DMAP_TO_PHYS(va);
 	} else {
-		l2 = pmap_l2(kernel_pmap, va);
-		if (l2 == NULL)
+		l2p = pmap_l2(kernel_pmap, va);
+		if (l2p == NULL)
 			panic("pmap_kextract: No l2");
-		if ((*l2 & ATTR_DESCR_MASK) == L2_BLOCK)
-			return ((*l2 & ~ATTR_MASK) | (va & L2_OFFSET));
+		l2 = pmap_load(l2p);
+		if ((l2 & ATTR_DESCR_MASK) == L2_BLOCK)
+			return ((l2 & ~ATTR_MASK) |
+			    (va & L2_OFFSET));
 
-		l3 = pmap_l2_to_l3(l2, va);
+		l3 = pmap_l2_to_l3(l2p, va);
 		if (l3 == NULL)
 			panic("pmap_kextract: No l3...");
-		pa = (*l3 & ~ATTR_MASK) | (va & PAGE_MASK);
+		pa = (pmap_load(l3) & ~ATTR_MASK) | (va & PAGE_MASK);
 	}
 	return (pa);
 }
@@ -1242,11 +1244,11 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t 
 				return (NULL);
 			}
 		} else {
-			pdpg = PHYS_TO_VM_PAGE(*l1 & ~ATTR_MASK);
+			pdpg = PHYS_TO_VM_PAGE(pmap_load(l1) & ~ATTR_MASK);
 			pdpg->wire_count++;
 		}
 
-		l2 = (pd_entry_t *)PHYS_TO_DMAP(*l1 & ~ATTR_MASK);
+		l2 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l1) & ~ATTR_MASK);
 		l2 = &l2[ptepindex & Ln_ADDR_MASK];
 		pmap_load_store(l2, VM_PAGE_TO_PHYS(m) | L2_TABLE);
 		PTE_SYNC(l2);
@@ -1738,7 +1740,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva
 		if (l2 == NULL)
 			continue;
 
-		l3_paddr = *l2;
+		l3_paddr = pmap_load(l2);
 
 		/*
 		 * Weed out invalid mappings.
@@ -1805,7 +1807,7 @@ pmap_remove_all(vm_page_t m)
 	pv_entry_t pv;
 	pmap_t pmap;
 	pt_entry_t *l3, tl3;
-	pd_entry_t *l2;
+	pd_entry_t *l2, tl2;
 	struct spglist free;
 
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
@@ -1817,7 +1819,9 @@ pmap_remove_all(vm_page_t m)
 		PMAP_LOCK(pmap);
 		pmap_resident_count_dec(pmap, 1);
 		l2 = pmap_l2(pmap, pv->pv_va);
-		KASSERT((*l2 & ATTR_DESCR_MASK) == L2_TABLE,
+		KASSERT(l2 != NULL, ("pmap_remove_all: no l2 table found"));
+		tl2 = pmap_load(l2);
+		KASSERT((tl2 & ATTR_DESCR_MASK) == L2_TABLE,
 		    ("pmap_remove_all: found a table when expecting "
 		     "a block in %p's pv list", m));
 		l3 = pmap_l2_to_l3(l2, pv->pv_va);
@@ -1837,7 +1841,7 @@ pmap_remove_all(vm_page_t m)
 		 */
 		if (pmap_page_dirty(tl3))
 			vm_page_dirty(m);
-		pmap_unuse_l3(pmap, pv->pv_va, *l2, &free);
+		pmap_unuse_l3(pmap, pv->pv_va, tl2, &free);
 		TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
 		m->md.pv_gen++;
 		free_pv_entry(pmap, pv);
@@ -1883,7 +1887,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
 			va_next = eva;
 
 		l2 = pmap_l1_to_l2(l1, sva);
-		if (l2 == NULL || (*l2 & ATTR_DESCR_MASK) != L2_TABLE)
+		if (l2 == NULL || (pmap_load(l2) & ATTR_DESCR_MASK) != L2_TABLE)
 			continue;
 
 		if (va_next > eva)
@@ -2345,7 +2349,7 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva
 				continue;
 			if ((pmap_load(l3) & ATTR_SW_WIRED) == 0)
 				panic("pmap_unwire: l3 %#jx is missing "
-				    "ATTR_SW_WIRED", (uintmax_t)*l3);
+				    "ATTR_SW_WIRED", (uintmax_t)pmap_load(l3));
 
 			/*
 			 * PG_W must be cleared atomically.  Although the pmap
@@ -2836,7 +2840,7 @@ retry_pv_loop:
 		}
 		l3 = pmap_l3(pmap, pv->pv_va);
 retry:
-		oldl3 = *l3;
+		oldl3 = pmap_load(l3);
 		if ((oldl3 & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) {
 			if (!atomic_cmpset_long(l3, oldl3,
 			    oldl3 | ATTR_AP(ATTR_AP_RO)))
@@ -2879,7 +2883,7 @@ pmap_ts_referenced(vm_page_t m)
 	pv_entry_t pv, pvf;
 	pmap_t pmap;
 	struct rwlock *lock;
-	pd_entry_t *l2;
+	pd_entry_t *l2p, l2;
 	pt_entry_t *l3;
 	vm_paddr_t pa;
 	int cleared, md_gen, not_cleared;
@@ -2912,12 +2916,14 @@ retry:
 				goto retry;
 			}
 		}
-		l2 = pmap_l2(pmap, pv->pv_va);
-		KASSERT((*l2 & ATTR_DESCR_MASK) == L2_TABLE,
+		l2p = pmap_l2(pmap, pv->pv_va);
+		KASSERT(l2p != NULL, ("pmap_ts_referenced: no l2 table found"));
+		l2 = pmap_load(l2p);
+		KASSERT((l2 & ATTR_DESCR_MASK) == L2_TABLE,
 		    ("pmap_ts_referenced: found an invalid l2 table"));
-		l3 = pmap_l2_to_l3(l2, pv->pv_va);
+		l3 = pmap_l2_to_l3(l2p, pv->pv_va);
 		if ((pmap_load(l3) & ATTR_AF) != 0) {
-			if (safe_to_clear_referenced(pmap, *l3)) {
+			if (safe_to_clear_referenced(pmap, pmap_load(l3))) {
 				/*
 				 * TODO: We don't handle the access flag
 				 * at all. We need to be able to set it in
@@ -2931,8 +2937,8 @@ retry:
 				 * them is wasted effort. We do the
 				 * hard work for unwired pages only.
 				 */
-				pmap_remove_l3(pmap, l3, pv->pv_va,
-				    *l2, &free, &lock);
+				pmap_remove_l3(pmap, l3, pv->pv_va, l2,
+				    &free, &lock);
 				pmap_invalidate_page(pmap, pv->pv_va);
 				cleared++;
 				if (pvf == pv)

Modified: projects/release-pkg/sys/cam/ctl/ctl.c
==============================================================================
--- projects/release-pkg/sys/cam/ctl/ctl.c	Sat Oct  3 07:21:27 2015	(r288539)
+++ projects/release-pkg/sys/cam/ctl/ctl.c	Sat Oct  3 07:22:07 2015	(r288540)
@@ -781,9 +781,9 @@ alloc:
 	msg->hdr.nexus.targ_lun = lun->lun;
 	msg->hdr.nexus.targ_mapped_lun = lun->lun;
 	msg->lun.flags = lun->flags;
-	msg->lun.pr_generation = lun->PRGeneration;
+	msg->lun.pr_generation = lun->pr_generation;
 	msg->lun.pr_res_idx = lun->pr_res_idx;
-	msg->lun.pr_res_type = lun->res_type;
+	msg->lun.pr_res_type = lun->pr_res_type;
 	msg->lun.pr_key_count = lun->pr_key_count;
 	i = 0;
 	if (lun->lun_devid) {
@@ -1085,9 +1085,9 @@ ctl_isc_lun_sync(struct ctl_softc *softc
 		/* If peer is primary and we are not -- use data */
 		if ((lun->flags & CTL_LUN_PRIMARY_SC) == 0 &&
 		    (lun->flags & CTL_LUN_PEER_SC_PRIMARY)) {
-			lun->PRGeneration = msg->lun.pr_generation;
+			lun->pr_generation = msg->lun.pr_generation;
 			lun->pr_res_idx = msg->lun.pr_res_idx;
-			lun->res_type = msg->lun.pr_res_type;
+			lun->pr_res_type = msg->lun.pr_res_type;
 			lun->pr_key_count = msg->lun.pr_key_count;
 			for (k = 0; k < CTL_MAX_INITIATORS; k++)
 				ctl_clr_prkey(lun, k);
@@ -5101,6 +5101,13 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi
 		ctl_set_reservation_conflict(ctsio);
 		goto bailout;
 	}
+
+	/* SPC-3 exceptions to SPC-2 RESERVE and RELEASE behavior. */
+	if (lun->flags & CTL_LUN_PR_RESERVED) {
+		ctl_set_success(ctsio);
+		goto bailout;
+	}
+
 	lun->flags |= CTL_LUN_RESERVED;
 	lun->res_idx = residx;
 	ctl_set_success(ctsio);
@@ -5130,7 +5137,7 @@ ctl_start_stop(struct ctl_scsiio *ctsio)
 
 			residx = ctl_get_initindex(&ctsio->io_hdr.nexus);
 			if (ctl_get_prkey(lun, residx) == 0 ||
-			    (lun->pr_res_idx != residx && lun->res_type < 4)) {
+			    (lun->pr_res_idx != residx && lun->pr_res_type < 4)) {
 
 				ctl_set_reservation_conflict(ctsio);
 				ctl_done((union ctl_io *)ctsio);
@@ -7540,7 +7547,7 @@ retry:
 			goto retry;
 		}
 
-		scsi_ulto4b(lun->PRGeneration, res_keys->header.generation);
+		scsi_ulto4b(lun->pr_generation, res_keys->header.generation);
 
 		scsi_ulto4b(sizeof(struct scsi_per_res_key) *
 			     lun->pr_key_count, res_keys->header.length);
@@ -7571,7 +7578,7 @@ retry:
 
 		res = (struct scsi_per_res_in_rsrv *)ctsio->kern_data_ptr;
 
-		scsi_ulto4b(lun->PRGeneration, res->header.generation);
+		scsi_ulto4b(lun->pr_generation, res->header.generation);
 
 		if (lun->flags & CTL_LUN_PR_RESERVED)
 		{
@@ -7614,7 +7621,7 @@ retry:
 			scsi_u64to8b(ctl_get_prkey(lun, lun->pr_res_idx),
 			    res->data.reservation);
 		}
-		res->data.scopetype = lun->res_type;
+		res->data.scopetype = lun->pr_res_type;
 		break;
 	}
 	case SPRI_RC:     //report capabilities
@@ -7624,7 +7631,8 @@ retry:
 
 		res_cap = (struct scsi_per_res_cap *)ctsio->kern_data_ptr;
 		scsi_ulto2b(sizeof(*res_cap), res_cap->length);
-		res_cap->flags2 |= SPRI_TMV | SPRI_ALLOW_5;
+		res_cap->flags1 = SPRI_CRH;
+		res_cap->flags2 = SPRI_TMV | SPRI_ALLOW_5;
 		type_mask = SPRI_TM_WR_EX_AR |
 			    SPRI_TM_EX_AC_RO |
 			    SPRI_TM_WR_EX_RO |
@@ -7659,7 +7667,7 @@ retry:
 			goto retry;
 		}
 
-		scsi_ulto4b(lun->PRGeneration, res_status->header.generation);
+		scsi_ulto4b(lun->pr_generation, res_status->header.generation);
 
 		res_desc = &res_status->desc[0];
 		for (i = 0; i < CTL_MAX_INITIATORS; i++) {
@@ -7671,7 +7679,7 @@ retry:
 			    (lun->pr_res_idx == i ||
 			     lun->pr_res_idx == CTL_PR_ALL_REGISTRANTS)) {
 				res_desc->flags = SPRI_FULL_R_HOLDER;
-				res_desc->scopetype = lun->res_type;
+				res_desc->scopetype = lun->pr_res_type;
 			}
 			scsi_ulto2b(i / CTL_MAX_INIT_PER_PORT,
 			    res_desc->rel_trgt_port_id);
@@ -7760,11 +7768,11 @@ ctl_pro_preempt(struct ctl_softc *softc,
 				ctl_est_ua(lun, i, CTL_UA_REG_PREEMPT);
 			}
 			lun->pr_key_count = 1;
-			lun->res_type = type;
-			if (lun->res_type != SPR_TYPE_WR_EX_AR
-			 && lun->res_type != SPR_TYPE_EX_AC_AR)
+			lun->pr_res_type = type;
+			if (lun->pr_res_type != SPR_TYPE_WR_EX_AR &&
+			    lun->pr_res_type != SPR_TYPE_EX_AC_AR)
 				lun->pr_res_idx = residx;
-			lun->PRGeneration++;
+			lun->pr_generation++;
 			mtx_unlock(&lun->lun_lock);
 
 			/* send msg to other side */
@@ -7834,7 +7842,7 @@ ctl_pro_preempt(struct ctl_softc *softc,
 			ctl_done((union ctl_io *)ctsio);
 			return (CTL_RETVAL_COMPLETE);
 		}
-		lun->PRGeneration++;
+		lun->pr_generation++;
 		mtx_unlock(&lun->lun_lock);
 
 		/* send msg to other side */
@@ -7900,19 +7908,19 @@ ctl_pro_preempt(struct ctl_softc *softc,
 					ctl_clr_prkey(lun, i);
 					lun->pr_key_count--;
 					ctl_est_ua(lun, i, CTL_UA_REG_PREEMPT);
-				} else if (type != lun->res_type
-					&& (lun->res_type == SPR_TYPE_WR_EX_RO
-					 || lun->res_type ==SPR_TYPE_EX_AC_RO)){
+				} else if (type != lun->pr_res_type &&
+				    (lun->pr_res_type == SPR_TYPE_WR_EX_RO ||
+				     lun->pr_res_type == SPR_TYPE_EX_AC_RO)) {
 					ctl_est_ua(lun, i, CTL_UA_RES_RELEASE);
 				}
 			}
-			lun->res_type = type;
-			if (lun->res_type != SPR_TYPE_WR_EX_AR
-			 && lun->res_type != SPR_TYPE_EX_AC_AR)
+			lun->pr_res_type = type;
+			if (lun->pr_res_type != SPR_TYPE_WR_EX_AR &&
+			    lun->pr_res_type != SPR_TYPE_EX_AC_AR)
 				lun->pr_res_idx = residx;
 			else
 				lun->pr_res_idx = CTL_PR_ALL_REGISTRANTS;
-			lun->PRGeneration++;
+			lun->pr_generation++;
 			mtx_unlock(&lun->lun_lock);
 
 			persis_io.hdr.nexus = ctsio->io_hdr.nexus;
@@ -7949,7 +7957,7 @@ ctl_pro_preempt(struct ctl_softc *softc,
 				ctl_done((union ctl_io *)ctsio);
 		        	return (1);
 			}
-			lun->PRGeneration++;
+			lun->pr_generation++;
 			mtx_unlock(&lun->lun_lock);
 
 			persis_io.hdr.nexus = ctsio->io_hdr.nexus;
@@ -7993,9 +8001,9 @@ ctl_pro_preempt_other(struct ctl_lun *lu
 			}
 
 			lun->pr_key_count = 1;
-			lun->res_type = msg->pr.pr_info.res_type;
-			if (lun->res_type != SPR_TYPE_WR_EX_AR
-			 && lun->res_type != SPR_TYPE_EX_AC_AR)
+			lun->pr_res_type = msg->pr.pr_info.res_type;
+			if (lun->pr_res_type != SPR_TYPE_WR_EX_AR &&
+			    lun->pr_res_type != SPR_TYPE_EX_AC_AR)
 				lun->pr_res_idx = msg->pr.pr_info.residx;
 		} else {
 		        for (i = 0; i < CTL_MAX_INITIATORS; i++) {
@@ -8017,20 +8025,20 @@ ctl_pro_preempt_other(struct ctl_lun *lu
 				ctl_clr_prkey(lun, i);
 				lun->pr_key_count--;
 				ctl_est_ua(lun, i, CTL_UA_REG_PREEMPT);
-			} else if (msg->pr.pr_info.res_type != lun->res_type
-				&& (lun->res_type == SPR_TYPE_WR_EX_RO
-				 || lun->res_type == SPR_TYPE_EX_AC_RO)) {
+			} else if (msg->pr.pr_info.res_type != lun->pr_res_type
+			    && (lun->pr_res_type == SPR_TYPE_WR_EX_RO ||
+			     lun->pr_res_type == SPR_TYPE_EX_AC_RO)) {
 				ctl_est_ua(lun, i, CTL_UA_RES_RELEASE);
 			}
 		}
-		lun->res_type = msg->pr.pr_info.res_type;
-		if (lun->res_type != SPR_TYPE_WR_EX_AR
-		 && lun->res_type != SPR_TYPE_EX_AC_AR)
+		lun->pr_res_type = msg->pr.pr_info.res_type;
+		if (lun->pr_res_type != SPR_TYPE_WR_EX_AR &&
+		    lun->pr_res_type != SPR_TYPE_EX_AC_AR)
 			lun->pr_res_idx = msg->pr.pr_info.residx;
 		else
 			lun->pr_res_idx = CTL_PR_ALL_REGISTRANTS;
 	}
-	lun->PRGeneration++;
+	lun->pr_generation++;
 
 }
 
@@ -8212,9 +8220,9 @@ ctl_persistent_reserve_out(struct ctl_sc
 				lun->flags &= ~CTL_LUN_PR_RESERVED;
 				lun->pr_res_idx = CTL_PR_NO_RESERVATION;
 
-				if ((lun->res_type == SPR_TYPE_WR_EX_RO
-				  || lun->res_type == SPR_TYPE_EX_AC_RO)
-				 && lun->pr_key_count) {
+				if ((lun->pr_res_type == SPR_TYPE_WR_EX_RO ||
+				     lun->pr_res_type == SPR_TYPE_EX_AC_RO) &&
+				    lun->pr_key_count) {
 					/*
 					 * If the reservation is a registrants
 					 * only type we need to generate a UA
@@ -8230,15 +8238,15 @@ ctl_persistent_reserve_out(struct ctl_sc
 						    CTL_UA_RES_RELEASE);
 					}
 				}
-				lun->res_type = 0;
+				lun->pr_res_type = 0;
 			} else if (lun->pr_res_idx == CTL_PR_ALL_REGISTRANTS) {
 				if (lun->pr_key_count==0) {
 					lun->flags &= ~CTL_LUN_PR_RESERVED;
-					lun->res_type = 0;
+					lun->pr_res_type = 0;
 					lun->pr_res_idx = CTL_PR_NO_RESERVATION;
 				}
 			}
-			lun->PRGeneration++;
+			lun->pr_generation++;
 			mtx_unlock(&lun->lun_lock);
 
 			persis_io.hdr.nexus = ctsio->io_hdr.nexus;
@@ -8257,7 +8265,7 @@ ctl_persistent_reserve_out(struct ctl_sc
 			if (ctl_get_prkey(lun, residx) == 0)
 				lun->pr_key_count++;
 			ctl_set_prkey(lun, residx, sa_res_key);
-			lun->PRGeneration++;
+			lun->pr_generation++;
 			mtx_unlock(&lun->lun_lock);
 
 			persis_io.hdr.nexus = ctsio->io_hdr.nexus;
@@ -8286,7 +8294,7 @@ ctl_persistent_reserve_out(struct ctl_sc
 			 */
 			if ((lun->pr_res_idx != residx
 			  && lun->pr_res_idx != CTL_PR_ALL_REGISTRANTS)
-			 || lun->res_type != type) {
+			 || lun->pr_res_type != type) {
 				mtx_unlock(&lun->lun_lock);
 				free(ctsio->kern_data_ptr, M_CTL);
 				ctl_set_reservation_conflict(ctsio);
@@ -8306,7 +8314,7 @@ ctl_persistent_reserve_out(struct ctl_sc
 				lun->pr_res_idx = CTL_PR_ALL_REGISTRANTS;
 
 			lun->flags |= CTL_LUN_PR_RESERVED;
-			lun->res_type = type;
+			lun->pr_res_type = type;
 
 			mtx_unlock(&lun->lun_lock);
 
@@ -8341,7 +8349,7 @@ ctl_persistent_reserve_out(struct ctl_sc
 			goto done;
 		}

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



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