Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 2015 00:15:03 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r291669 - in projects/cxl_iscsi: cddl/contrib/opensolaris/cmd/plockstat lib/csu/powerpc64 lib/libnandfs libexec/rtld-elf libexec/rtld-elf/powerpc64 sbin/nandfs sbin/newfs_nandfs share/m...
Message-ID:  <201512030015.tB30F3Q1077850@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Thu Dec  3 00:15:03 2015
New Revision: 291669
URL: https://svnweb.freebsd.org/changeset/base/291669

Log:
  Catch up with head, mostly to merge r291665 with the changes in this branch.

Added:
  projects/cxl_iscsi/lib/libnandfs/Makefile.depend
     - copied unchanged from r291665, head/lib/libnandfs/Makefile.depend
  projects/cxl_iscsi/sbin/nandfs/Makefile.depend
     - copied unchanged from r291665, head/sbin/nandfs/Makefile.depend
  projects/cxl_iscsi/sbin/newfs_nandfs/Makefile.depend
     - copied unchanged from r291665, head/sbin/newfs_nandfs/Makefile.depend
  projects/cxl_iscsi/usr.sbin/nandsim/Makefile.depend
     - copied unchanged from r291665, head/usr.sbin/nandsim/Makefile.depend
  projects/cxl_iscsi/usr.sbin/nandtool/Makefile.depend
     - copied unchanged from r291665, head/usr.sbin/nandtool/Makefile.depend
Modified:
  projects/cxl_iscsi/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
  projects/cxl_iscsi/lib/csu/powerpc64/crti.S
  projects/cxl_iscsi/libexec/rtld-elf/Makefile
  projects/cxl_iscsi/libexec/rtld-elf/powerpc64/reloc.c
  projects/cxl_iscsi/libexec/rtld-elf/powerpc64/rtld_start.S
  projects/cxl_iscsi/libexec/rtld-elf/rtld.c
  projects/cxl_iscsi/libexec/rtld-elf/rtld.h
  projects/cxl_iscsi/share/man/man4/cxgbe.4
  projects/cxl_iscsi/share/man/man9/devfs_set_cdevpriv.9
  projects/cxl_iscsi/share/mk/bsd.libnames.mk
  projects/cxl_iscsi/sys/arm/arm/gic.c
  projects/cxl_iscsi/sys/arm/include/resource.h
  projects/cxl_iscsi/sys/boot/powerpc/Makefile.inc
  projects/cxl_iscsi/sys/boot/powerpc/boot1.chrp/Makefile
  projects/cxl_iscsi/sys/conf/files
  projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
  projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h
  projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c
  projects/cxl_iscsi/sys/dev/arcmsr/arcmsr.c
  projects/cxl_iscsi/sys/dev/arcmsr/arcmsr.h
  projects/cxl_iscsi/sys/dev/cxgbe/adapter.h
  projects/cxl_iscsi/sys/dev/cxgbe/common/t4_hw.c
  projects/cxl_iscsi/sys/dev/cxgbe/iw_cxgbe/provider.c
  projects/cxl_iscsi/sys/dev/cxgbe/t4_main.c
  projects/cxl_iscsi/sys/dev/cxgbe/t4_netmap.c
  projects/cxl_iscsi/sys/dev/cxgbe/t4_sge.c
  projects/cxl_iscsi/sys/dev/cxgbe/tom/t4_connect.c
  projects/cxl_iscsi/sys/dev/cxgbe/tom/t4_cpl_io.c
  projects/cxl_iscsi/sys/dev/cxgbe/tom/t4_listen.c
  projects/cxl_iscsi/sys/dev/cxgbe/tom/t4_tom.c
  projects/cxl_iscsi/sys/dev/cxgbe/tom/t4_tom.h
  projects/cxl_iscsi/sys/dev/isp/isp.c
  projects/cxl_iscsi/sys/dev/isp/isp_pci.c
  projects/cxl_iscsi/sys/dev/isp/ispmbox.h
  projects/cxl_iscsi/sys/dev/isp/ispvar.h
  projects/cxl_iscsi/sys/dev/ofw/ofw_bus_subr.c
  projects/cxl_iscsi/sys/dev/ofw/ofw_bus_subr.h
  projects/cxl_iscsi/sys/fs/devfs/devfs_vnops.c
  projects/cxl_iscsi/sys/fs/nfs/nfs_commonport.c
  projects/cxl_iscsi/sys/fs/nfs/nfs_commonsubs.c
  projects/cxl_iscsi/sys/fs/nfs/nfs_var.h
  projects/cxl_iscsi/sys/modules/ath/Makefile
  projects/cxl_iscsi/sys/net/route.c
  projects/cxl_iscsi/sys/netinet/sctp_input.c
  projects/cxl_iscsi/sys/netinet/sctp_output.c
  projects/cxl_iscsi/sys/powerpc/include/asm.h
  projects/cxl_iscsi/sys/powerpc/powerpc/sigcode64.S
  projects/cxl_iscsi/sys/sys/conf.h
  projects/cxl_iscsi/targets/pseudo/userland/Makefile.depend
  projects/cxl_iscsi/targets/pseudo/userland/lib/Makefile.depend
  projects/cxl_iscsi/usr.sbin/pw/pw_user.c
  projects/cxl_iscsi/usr.sbin/pw/tests/pw_lock.sh
Directory Properties:
  projects/cxl_iscsi/   (props changed)
  projects/cxl_iscsi/cddl/   (props changed)
  projects/cxl_iscsi/cddl/contrib/opensolaris/   (props changed)
  projects/cxl_iscsi/sbin/   (props changed)
  projects/cxl_iscsi/share/   (props changed)
  projects/cxl_iscsi/share/man/man4/   (props changed)
  projects/cxl_iscsi/sys/   (props changed)
  projects/cxl_iscsi/sys/boot/   (props changed)
  projects/cxl_iscsi/sys/boot/powerpc/boot1.chrp/   (props changed)
  projects/cxl_iscsi/sys/conf/   (props changed)
  projects/cxl_iscsi/targets/   (props changed)

Modified: projects/cxl_iscsi/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
==============================================================================
--- projects/cxl_iscsi/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c	Thu Dec  3 00:15:03 2015	(r291669)
@@ -515,7 +515,7 @@ getsym(struct ps_prochandle *P, uintptr_
 
 	if (P == NULL || Pxlookup_by_addr(P, addr, name, sizeof (name),
 	    &sym, &info) != 0) {
-		(void) snprintf(buf, size, "%#lx", addr);
+		(void) snprintf(buf, size, "%#lx", (unsigned long)addr);
 		return (0);
 	}
 #ifdef illumos
@@ -537,7 +537,7 @@ getsym(struct ps_prochandle *P, uintptr_
 	size -= len;
 
 	if (sym.st_value != addr)
-		len = snprintf(buf, size, "+%#lx", addr - sym.st_value);
+		len = snprintf(buf, size, "+%#lx", (unsigned long)(addr - sym.st_value));
 
 	if (nolocks && strcmp("libc.so.1", map->pr_mapname) == 0 &&
 	    (strstr("mutex", name) == 0 ||

Modified: projects/cxl_iscsi/lib/csu/powerpc64/crti.S
==============================================================================
--- projects/cxl_iscsi/lib/csu/powerpc64/crti.S	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/lib/csu/powerpc64/crti.S	Thu Dec  3 00:15:03 2015	(r291669)
@@ -26,34 +26,59 @@
 #include <machine/asm.h>
 __FBSDID("$FreeBSD$");
 
+#ifdef _CALL_ELF
+.abiversion _CALL_ELF
+#endif
+
 	.section .init,"ax",@progbits
-	.align	2
+	.p2align	2
 	.globl	_init
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
 	.section ".opd","aw"
-	.align	3
+	.p2align	3
 _init:
 	.quad	.L._init,.TOC.@tocbase,0
 	.previous
 	.type	_init,@function
 
-	.align 4
+	.p2align 4
 .L._init:
+#else
+	.p2align 4
+	.globl	_init
+	.type	_init,@function
+_init:
+	addis	%r2, %r12, (.TOC.-_init)@ha
+	addi	%r2, %r2, (.TOC.-_init)@l
+	.localentry _init, .-_init
+#endif
 	stdu 1,-48(1)
 	mflr 0
 	std 0,64(1)
 
+/* Fini */
 	.section .fini,"ax",@progbits
-	.align	2
+	.p2align	2
 	.globl	_fini
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
 	.section ".opd","aw"
-	.align	3
+	.p2align	3
 _fini:
 	.quad	.L._fini,.TOC.@tocbase,0
 	.previous
 	.type	_fini,@function
 
-	.align 4
+	.p2align 4
 .L._fini:
+#else
+	.p2align 4
+	.globl	_fini
+	.type	_fini,@function
+_fini:
+	addis	%r2, %r12, (.TOC.-_fini)@ha
+	addi	%r2, %r2, (.TOC.-_fini)@l
+	.localentry _fini, .-_fini
+#endif
 	stdu 1,-48(1)
 	mflr 0
 	std 0,64(1)

Copied: projects/cxl_iscsi/lib/libnandfs/Makefile.depend (from r291665, head/lib/libnandfs/Makefile.depend)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/cxl_iscsi/lib/libnandfs/Makefile.depend	Thu Dec  3 00:15:03 2015	(r291669, copy of r291665, head/lib/libnandfs/Makefile.depend)
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+	gnu/lib/csu \
+	gnu/lib/libgcc \
+	include \
+	include/xlocale \
+	lib/${CSU_DIR} \
+	lib/libc \
+	lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif

Modified: projects/cxl_iscsi/libexec/rtld-elf/Makefile
==============================================================================
--- projects/cxl_iscsi/libexec/rtld-elf/Makefile	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/libexec/rtld-elf/Makefile	Thu Dec  3 00:15:03 2015	(r291669)
@@ -13,7 +13,7 @@ SRCS=		rtld_start.S \
 		malloc.c xmalloc.c debug.c libmap.c
 MAN=		rtld.1
 CSTD?=		gnu99
-CFLAGS+=	-Wall -DFREEBSD_ELF -DIN_RTLD
+CFLAGS+=	-Wall -DFREEBSD_ELF -DIN_RTLD -fno-builtin
 CFLAGS+=	-I${SRCTOP}/lib/csu/common
 .if exists(${.CURDIR}/${MACHINE_ARCH})
 RTLD_ARCH=	${MACHINE_ARCH}
@@ -22,7 +22,6 @@ RTLD_ARCH=	${MACHINE_CPUARCH}
 .endif
 CFLAGS+=	-I${.CURDIR}/${RTLD_ARCH} -I${.CURDIR}
 .if ${MACHINE_ARCH} == "powerpc64"
-CFLAGS+=	-mcall-aixdesc
 LDFLAGS+=	-nostdlib -e _rtld_start
 .else
 LDFLAGS+=	-nostdlib -e .rtld_start

Modified: projects/cxl_iscsi/libexec/rtld-elf/powerpc64/reloc.c
==============================================================================
--- projects/cxl_iscsi/libexec/rtld-elf/powerpc64/reloc.c	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/libexec/rtld-elf/powerpc64/reloc.c	Thu Dec  3 00:15:03 2015	(r291669)
@@ -43,11 +43,13 @@
 #include "debug.h"
 #include "rtld.h"
 
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
 struct funcdesc {
 	Elf_Addr addr;
 	Elf_Addr toc;
 	Elf_Addr env;
 };
+#endif
 
 /*
  * Process the R_PPC_COPY relocations
@@ -336,11 +338,14 @@ static int
 reloc_plt_object(Obj_Entry *obj, const Elf_Rela *rela)
 {
 	Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
 	Elf_Addr *glink;
+#endif
 	long reloff;
 
 	reloff = rela - obj->pltrela;
 
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
 	if (obj->priv == NULL)
 		obj->priv = xmalloc(obj->pltrelasize);
 	glink = obj->priv + reloff*sizeof(Elf_Addr)*2;
@@ -351,6 +356,10 @@ reloc_plt_object(Obj_Entry *obj, const E
 	((struct funcdesc *)(where))->env = (Elf_Addr)glink;
 	*(glink++) = (Elf_Addr)obj;
 	*(glink++) = reloff*sizeof(Elf_Rela);
+#else
+	dbg(" reloc_plt_object: where=%p,reloff=%lx,glink=%#lx", (void *)where, reloff, obj->glink);
+	*where = (Elf_Addr)obj->glink + 4*reloff + 32;
+#endif
 
 	return (0);
 }
@@ -416,7 +425,11 @@ reloc_jmpslots(Obj_Entry *obj, int flags
 
 		if (def == &sym_zero) {
 			/* Zero undefined weak symbols */
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
 			bzero(where, sizeof(struct funcdesc));
+#else
+			*where = 0;
+#endif
 		} else {
 			reloc_jmpslot(where, target, defobj, obj,
 			    (const Elf_Rel *) rela);
@@ -436,9 +449,6 @@ Elf_Addr
 reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj,
 	      const Obj_Entry *obj, const Elf_Rel *rel)
 {
-	dbg(" reloc_jmpslot: where=%p, target=%p (%#lx + %#lx)",
-	    (void *)wherep, (void *)target, *(Elf_Addr *)target,
-	    (Elf_Addr)defobj->relocbase);
 
 	/*
 	 * At the PLT entry pointed at by `wherep', construct
@@ -446,6 +456,11 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr
 	 * address.
 	 */
 
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
+	dbg(" reloc_jmpslot: where=%p, target=%p (%#lx + %#lx)",
+	    (void *)wherep, (void *)target, *(Elf_Addr *)target,
+	    (Elf_Addr)defobj->relocbase);
+
 	memcpy(wherep, (void *)target, sizeof(struct funcdesc));
 	if (((struct funcdesc *)(wherep))->addr < (Elf_Addr)defobj->relocbase) {
 		/*
@@ -459,8 +474,14 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr
 		((struct funcdesc *)(wherep))->toc +=
 		    (Elf_Addr)defobj->relocbase;
 	}
+#else
+	dbg(" reloc_jmpslot: where=%p, target=%p", (void *)wherep,
+	    (void *)target);
+
+	*wherep = target;
+#endif
 
-	__asm __volatile("dcbst 0,%0; sync" :: "r"(wherep) : "memory");
+	__asm __volatile("sync" ::: "memory");
 
 	return (target);
 }
@@ -485,6 +506,20 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flag
 void
 init_pltgot(Obj_Entry *obj)
 {
+#if defined(_CALL_ELF) && _CALL_ELF == 2
+	Elf_Addr *pltcall;
+
+	pltcall = obj->pltgot;
+
+	if (pltcall == NULL) {
+		return;
+	}
+
+	pltcall[0] = (Elf_Addr)&_rtld_bind_start; 
+	pltcall[1] = (Elf_Addr)obj;
+
+	__asm __volatile("sync" ::: "memory");
+#endif
 }
 
 void

Modified: projects/cxl_iscsi/libexec/rtld-elf/powerpc64/rtld_start.S
==============================================================================
--- projects/cxl_iscsi/libexec/rtld-elf/powerpc64/rtld_start.S	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/libexec/rtld-elf/powerpc64/rtld_start.S	Thu Dec  3 00:15:03 2015	(r291669)
@@ -82,9 +82,13 @@ _ENTRY(_rtld_start)
 
 	bl      _rtld		/* &_start = _rtld(sp, &exit_proc, &obj_main)*/
 	nop
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
 	ld	%r2,8(%r3)
 	ld	%r11,16(%r3)
 	ld	%r3,0(%r3)
+#else
+	mr	%r12,%r3
+#endif
 	mtlr    %r3
 
 	/*
@@ -106,7 +110,11 @@ _ENTRY(_rtld_start)
  * _rtld_bind_start()
  *
  * Call into the MI binder. This routine is reached via the PLT call cell
- * On entry, %r11 contains a pointer to the (object, relocation) tuple.
+ *
+ * For ELFv1, on entry, %r11 contains a pointer to the (object, relocation)
+ * tuple.
+ *
+ * For ELFv2, %r11 contains an object pointer and %r0 contains the PLT index.
  *
  * Save all registers, call into the binder to resolve and fixup the external
  * routine, and then transfer to the external routine on return.
@@ -114,6 +122,7 @@ _ENTRY(_rtld_start)
 	.globl  _rtld_bind
 
 _ENTRY(_rtld_bind_start)
+	mr	%r12,%r0		# shunt r0 immediately to r12 for ELFv2
 	mflr    %r0
 	std     %r0,16(%r1)		# save lr
 	mfcr    %r0
@@ -121,7 +130,7 @@ _ENTRY(_rtld_bind_start)
 
 	stdu    %r1,-48-12*8(%r1)	# stack space for 8 regs + header
 					#   + 2 save regs
-	std	%r3,64+0*8(%r1)		# save r3-r31
+	std	%r3,64+0*8(%r1)		# save r3-r10 (arguments)
 	std	%r4,64+1*8(%r1)
 	std	%r5,64+2*8(%r1)
 	std	%r6,64+3*8(%r1)
@@ -129,19 +138,27 @@ _ENTRY(_rtld_bind_start)
 	std	%r8,64+5*8(%r1)
 	std	%r9,64+6*8(%r1)
 	std	%r10,64+7*8(%r1)
-	std	%r12,64+8*8(%r1)
 
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
 	ld	%r3,0(%r11)
 	ld	%r4,8(%r11)
+#else
+	mr	%r3,%r11
+	mulli	%r4,%r12,24		/* Multiply index by sizeof(Elf_Rela) */
+#endif
 	bl      _rtld_bind		# target addr = _rtld_bind(obj, reloff)
 	nop
 
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
 	ld	%r2,8(%r3)
 	ld	%r11,16(%r3)
 	ld	%r3,0(%r3)
+#else 
+	mr	%r12,%r3
+#endif
 	mtctr   %r3			# move absolute target addr into ctr
 
-	ld	%r3,64+0*8(%r1)		# restore r3-r31
+	ld	%r3,64+0*8(%r1)		# restore r3-r10
 	ld	%r4,64+1*8(%r1)
 	ld	%r5,64+2*8(%r1)
 	ld	%r6,64+3*8(%r1)
@@ -149,7 +166,6 @@ _ENTRY(_rtld_bind_start)
 	ld	%r8,64+5*8(%r1)
 	ld	%r9,64+6*8(%r1)
 	ld	%r10,64+7*8(%r1)
-	ld	%r12,64+8*8(%r1)
 
 	ld	%r1,0(%r1)		# restore stack
 	ld	%r0,8(%r1)		# restore cr

Modified: projects/cxl_iscsi/libexec/rtld-elf/rtld.c
==============================================================================
--- projects/cxl_iscsi/libexec/rtld-elf/rtld.c	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/libexec/rtld-elf/rtld.c	Thu Dec  3 00:15:03 2015	(r291669)
@@ -1148,7 +1148,7 @@ digest_dynamic1(Obj_Entry *obj, int earl
 #ifdef __mips__
 	case DT_MIPS_LOCAL_GOTNO:
 		obj->local_gotno = dynp->d_un.d_val;
-	    break;
+		break;
 
 	case DT_MIPS_SYMTABNO:
 		obj->symtabno = dynp->d_un.d_val;
@@ -1163,6 +1163,12 @@ digest_dynamic1(Obj_Entry *obj, int earl
 		break;
 #endif
 
+#ifdef __powerpc64__
+	case DT_PPC64_GLINK:
+		obj->glink = (Elf_Addr) (obj->relocbase + dynp->d_un.d_ptr);
+		break;
+#endif
+
 	case DT_FLAGS_1:
 		if (dynp->d_un.d_val & DF_1_NOOPEN)
 		    obj->z_noopen = true;

Modified: projects/cxl_iscsi/libexec/rtld-elf/rtld.h
==============================================================================
--- projects/cxl_iscsi/libexec/rtld-elf/rtld.h	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/libexec/rtld-elf/rtld.h	Thu Dec  3 00:15:03 2015	(r291669)
@@ -187,6 +187,9 @@ typedef struct Struct_Obj_Entry {
     Elf_Word symtabno;		/* Number of dynamic symbols */
     Elf_Word gotsym;		/* First dynamic symbol in GOT */
 #endif
+#ifdef __powerpc64__
+    Elf_Addr glink;		/* GLINK PLT call stub section */
+#endif
 
     const Elf_Verneed *verneed; /* Required versions. */
     Elf_Word verneednum;	/* Number of entries in verneed table */

Copied: projects/cxl_iscsi/sbin/nandfs/Makefile.depend (from r291665, head/sbin/nandfs/Makefile.depend)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/cxl_iscsi/sbin/nandfs/Makefile.depend	Thu Dec  3 00:15:03 2015	(r291669, copy of r291665, head/sbin/nandfs/Makefile.depend)
@@ -0,0 +1,19 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+	gnu/lib/csu \
+	gnu/lib/libgcc \
+	include \
+	include/xlocale \
+	lib/${CSU_DIR} \
+	lib/libc \
+	lib/libcompiler_rt \
+	lib/libnandfs \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif

Copied: projects/cxl_iscsi/sbin/newfs_nandfs/Makefile.depend (from r291665, head/sbin/newfs_nandfs/Makefile.depend)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/cxl_iscsi/sbin/newfs_nandfs/Makefile.depend	Thu Dec  3 00:15:03 2015	(r291669, copy of r291665, head/sbin/newfs_nandfs/Makefile.depend)
@@ -0,0 +1,21 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+	gnu/lib/csu \
+	gnu/lib/libgcc \
+	include \
+	include/xlocale \
+	lib/${CSU_DIR} \
+	lib/libc \
+	lib/libcompiler_rt \
+	lib/libexpat \
+	lib/libgeom \
+	lib/libsbuf \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif

Modified: projects/cxl_iscsi/share/man/man4/cxgbe.4
==============================================================================
--- projects/cxl_iscsi/share/man/man4/cxgbe.4	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/share/man/man4/cxgbe.4	Thu Dec  3 00:15:03 2015	(r291669)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 20, 2014
+.Dd December 2, 2015
 .Dt CXGBE 4
 .Os
 .Sh NAME
@@ -170,6 +170,16 @@ number of CPU cores in the system, which
 .It Va hw.cxgbe.nofldrxq1g
 The number of TOE rx queues to use for a 1Gb port.
 The default is 1.
+.It Va hw.cxgbe.num_vis
+The number of virtual interfaces (VIs) created for each port.
+Each virtual interface creates a separate network interface.
+The first virtual interface on each port is required and represents
+the primary network interface on the port.
+Additional virtual interfaces on a port are named vcxgbe (T4) or
+vcxl (T5) and only use a single rx and tx queue.
+Additional virtual interfaces use a single pair of queues
+for rx and tx as well an additional pair of queues for TOE rx and tx.
+The default is 1.
 .It Va hw.cxgbe.holdoff_timer_idx_10G
 .It Va hw.cxgbe.holdoff_timer_idx_1G
 The timer index value to use to delay interrupts.

Modified: projects/cxl_iscsi/share/man/man9/devfs_set_cdevpriv.9
==============================================================================
--- projects/cxl_iscsi/share/man/man9/devfs_set_cdevpriv.9	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/share/man/man9/devfs_set_cdevpriv.9	Thu Dec  3 00:15:03 2015	(r291669)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 20, 2015
+.Dd December 2, 2015
 .Dt DEVFS_CDEVPRIV 9
 .Os
 .Sh NAME
@@ -36,12 +36,12 @@
 .In sys/param.h
 .In sys/conf.h
 .Bd -literal
-typedef	void (*cdevpriv_dtr_t)(void *data);
+typedef	void d_priv_dtor_t(void *data);
 .Ed
 .Ft int
 .Fn devfs_get_cdevpriv "void **datap"
 .Ft int
-.Fn devfs_set_cdevpriv "void *priv" "cdevpriv_dtr_t dtr"
+.Fn devfs_set_cdevpriv "void *priv" "d_priv_dtor_t *dtr"
 .Ft void
 .Fn devfs_clear_cdevpriv "void"
 .Sh DESCRIPTION

Modified: projects/cxl_iscsi/share/mk/bsd.libnames.mk
==============================================================================
--- projects/cxl_iscsi/share/mk/bsd.libnames.mk	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/share/mk/bsd.libnames.mk	Thu Dec  3 00:15:03 2015	(r291669)
@@ -90,6 +90,7 @@ LIBMENU?=	${DESTDIR}${LIBDIR}/libmenu.a
 LIBMILTER?=	${DESTDIR}${LIBDIR}/libmilter.a
 LIBMP?=		${DESTDIR}${LIBDIR}/libmp.a
 LIBMT?=		${DESTDIR}${LIBDIR}/libmt.a
+LIBNANDFS?=	${DESTDIR}${LIBDIR}/libnandfs.a
 LIBNCURSES?=	${DESTDIR}${LIBDIR}/libncurses.a
 LIBNCURSESW?=	${DESTDIR}${LIBDIR}/libncursesw.a
 LIBNETGRAPH?=	${DESTDIR}${LIBDIR}/libnetgraph.a

Modified: projects/cxl_iscsi/sys/arm/arm/gic.c
==============================================================================
--- projects/cxl_iscsi/sys/arm/arm/gic.c	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/sys/arm/arm/gic.c	Thu Dec  3 00:15:03 2015	(r291669)
@@ -461,9 +461,13 @@ arm_gic_attach(device_t dev)
 		goto cleanup;
 	}
 
-	i = OF_getencprop(ofw_bus_get_node(dev), "interrupt-parent",
-	    &pxref, sizeof(pxref));
-	if (i > 0 && xref == pxref) {
+	/*
+	 * Controller is root if:
+	 * - doesn't have interrupt parent
+	 * - his interrupt parent is this controller
+	 */
+	pxref = ofw_bus_find_iparent(ofw_bus_get_node(dev));
+	if (pxref == 0 || xref == pxref) {
 		if (arm_pic_claim_root(dev, xref, arm_gic_intr, sc,
 		    GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) {
 			device_printf(dev, "could not set PIC as a root\n");
@@ -471,6 +475,12 @@ arm_gic_attach(device_t dev)
 			goto cleanup;
 		}
 	} else {
+		if (sc->gic_res[2] == NULL) {
+			device_printf(dev,
+			    "not root PIC must have defined interrupt\n");
+			arm_pic_unregister(dev, xref);
+			goto cleanup;
+		}
 		if (bus_setup_intr(dev, sc->gic_res[2], INTR_TYPE_CLK,
 		    arm_gic_intr, NULL, sc, &sc->gic_intrhand)) {
 			device_printf(dev, "could not setup irq handler\n");

Modified: projects/cxl_iscsi/sys/arm/include/resource.h
==============================================================================
--- projects/cxl_iscsi/sys/arm/include/resource.h	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/sys/arm/include/resource.h	Thu Dec  3 00:15:03 2015	(r291669)
@@ -42,5 +42,8 @@
 #define	SYS_RES_MEMORY	3	/* i/o memory */
 #define	SYS_RES_IOPORT	4	/* i/o ports */
 #define	SYS_RES_GPIO	5	/* general purpose i/o */
+#ifdef NEW_PCIB
+#define PCI_RES_BUS	6	/* PCI bus numbers */
+#endif
 
 #endif /* !_MACHINE_RESOURCE_H_ */

Modified: projects/cxl_iscsi/sys/boot/powerpc/Makefile.inc
==============================================================================
--- projects/cxl_iscsi/sys/boot/powerpc/Makefile.inc	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/sys/boot/powerpc/Makefile.inc	Thu Dec  3 00:15:03 2015	(r291669)
@@ -2,7 +2,6 @@
 
 .if ${MACHINE_ARCH} == "powerpc64"
 CFLAGS+=	-m32 -mcpu=powerpc
-LDFLAGS+=	-m elf32ppc_fbsd
 .endif
 
 .include "../Makefile.inc"

Modified: projects/cxl_iscsi/sys/boot/powerpc/boot1.chrp/Makefile
==============================================================================
--- projects/cxl_iscsi/sys/boot/powerpc/boot1.chrp/Makefile	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/sys/boot/powerpc/boot1.chrp/Makefile	Thu Dec  3 00:15:03 2015	(r291669)
@@ -12,7 +12,7 @@ SRCS=		boot1.c ashldi3.c syncicache.c
 
 MAN=
 
-CFLAGS= -ffreestanding -msoft-float -Os \
+CFLAGS= -ffreestanding -msoft-float \
 	-I${.CURDIR}/../../common -I${.CURDIR}/../../../ \
 	-D_STANDALONE
 LDFLAGS=-nostdlib -static -Wl,-N

Modified: projects/cxl_iscsi/sys/conf/files
==============================================================================
--- projects/cxl_iscsi/sys/conf/files	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/sys/conf/files	Thu Dec  3 00:15:03 2015	(r291669)
@@ -1058,6 +1058,8 @@ contrib/dev/ath/ath_hal/ar9300/ar9300_st
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
+contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c optional ath_hal | ath_ar9300 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_timer.c optional ath_hal | ath_ar9300 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
 contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c optional ath_hal | ath_ar9300 \

Modified: projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
==============================================================================
--- projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c	Thu Dec  3 00:15:03 2015	(r291669)
@@ -224,6 +224,14 @@ ar9300_attach_freebsd_ops(struct ath_hal
 	ah->ah_isFastClockEnabled	= ar9300_is_fast_clock_enabled;
 	ah->ah_get11nExtBusy	= ar9300_get_11n_ext_busy;
 
+	/* Spectral Scan Functions */
+	ah->ah_spectralConfigure	= ar9300_configure_spectral_scan;
+	ah->ah_spectralGetConfig	= ar9300_get_spectral_params;
+	ah->ah_spectralStart		= ar9300_start_spectral_scan;
+	ah->ah_spectralStop		= ar9300_stop_spectral_scan;
+	ah->ah_spectralIsEnabled	= ar9300_is_spectral_enabled;
+	ah->ah_spectralIsActive		= ar9300_is_spectral_active;
+
 	/* Key cache functions */
 	ah->ah_getKeyCacheSize	= ar9300_get_key_cache_size;
 	ah->ah_resetKeyCacheEntry	= ar9300_reset_key_cache_entry;

Modified: projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h
==============================================================================
--- projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h	Thu Dec  3 00:15:03 2015	(r291669)
@@ -17,7 +17,7 @@
 #define ATH_ANT_DIV_COMB        1       /* Antenna combining */
 #define ATH_SUPPORT_RAW_ADC_CAPTURE     0       /* Raw ADC capture support */
 #define ATH_TRAFFIC_FAST_RECOVER        0       /* XXX not sure yet */
-#define ATH_SUPPORT_SPECTRAL    0       /* Spectral scan support */
+#define ATH_SUPPORT_SPECTRAL    1       /* Spectral scan support */
 #define ATH_BT_COEX             1       /* Enable BT Coex code */
 #define ATH_PCIE_ERROR_MONITOR  0       /* ??? */
 #define ATH_SUPPORT_CRDC        0       /* ??? */

Modified: projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c
==============================================================================
--- projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c	Thu Dec  3 00:15:03 2015	(r291669)
@@ -15,12 +15,14 @@
  */
 #include "opt_ah.h"
 
-#ifdef AH_SUPPORT_AR9300
+//#ifdef AH_SUPPORT_AR9300
 
 #include "ah.h"
 #include "ah_desc.h"
 #include "ah_internal.h"
 
+#include "ar9300_freebsd_inc.h"
+
 #include "ar9300/ar9300phy.h"
 #include "ar9300/ar9300.h"
 #include "ar9300/ar9300reg.h"
@@ -310,7 +312,7 @@ ar9300_configure_spectral_scan(struct at
     u_int32_t val, i;
     struct ath_hal_9300 *ahp = AH9300(ah);
     HAL_BOOL asleep = ahp->ah_chip_full_sleep;
-    int16_t nf_buf[NUM_NF_READINGS];
+    int16_t nf_buf[HAL_NUM_NF_READINGS];
 
     if ((AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) && asleep) {
         ar9300_set_power_mode(ah, HAL_PM_AWAKE, AH_TRUE);
@@ -319,7 +321,7 @@ ar9300_configure_spectral_scan(struct at
     ar9300_prep_spectral_scan(ah);
 
     if (ss->ss_spectral_pri) {
-        for (i = 0; i < NUM_NF_READINGS; i++) {
+        for (i = 0; i < HAL_NUM_NF_READINGS; i++) {
             nf_buf[i] = NOISE_PWR_DBM_2_INT(ss->ss_nf_cal[i]);
         }
         ar9300_load_nf(ah, nf_buf);
@@ -392,11 +394,17 @@ void
 ar9300_get_spectral_params(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss)
 {
     u_int32_t val;
-    HAL_CHANNEL_INTERNAL *chan = AH_PRIVATE(ah)->ah_curchan;
+    HAL_CHANNEL_INTERNAL *chan = NULL;
+    const struct ieee80211_channel *c;
     int i, ichain, rx_chain_status;
     struct ath_hal_9300 *ahp = AH9300(ah);
     HAL_BOOL asleep = ahp->ah_chip_full_sleep;
 
+    c = AH_PRIVATE(ah)->ah_curchan;
+    if (c != NULL)
+        chan = ath_hal_checkchannel(ah, c);
+
+    // XXX TODO: just always wake up all chips?
     if ((AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) && asleep) {
         ar9300_set_power_mode(ah, HAL_PM_AWAKE, AH_TRUE);
     }
@@ -414,7 +422,7 @@ ar9300_get_spectral_params(struct ath_ha
 
     if (chan != NULL) {
         rx_chain_status = OS_REG_READ(ah, AR_PHY_RX_CHAINMASK) & 0x7;
-        for (i = 0; i < NUM_NF_READINGS; i++) {
+        for (i = 0; i < HAL_NUM_NF_READINGS; i++) {
             ichain = i % 3;
             if (rx_chain_status & (1 << ichain)) {
                 ss->ss_nf_cal[i] =
@@ -550,14 +558,16 @@ u_int32_t ar9300_get_spectral_config(str
 int16_t ar9300_get_ctl_chan_nf(struct ath_hal *ah)
 {
     int16_t nf;
+#if 0
     struct ath_hal_private *ahpriv = AH_PRIVATE(ah);
+#endif
 
     if ( (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) == 0) {
         /* Noise floor calibration value is ready */
         nf = MS(OS_REG_READ(ah, AR_PHY_CCA_0), AR_PHY_MINCCA_PWR);
     } else {
         /* NF calibration is not done, return nominal value */
-        nf = ahpriv->nfp->nominal;    
+        nf = AH9300(ah)->nfp->nominal;
     }
     if (nf & 0x100) {
         nf = (0 - ((nf ^ 0x1ff) + 1));
@@ -568,14 +578,16 @@ int16_t ar9300_get_ctl_chan_nf(struct at
 int16_t ar9300_get_ext_chan_nf(struct ath_hal *ah)
 {
     int16_t nf;
+#if 0
     struct ath_hal_private *ahpriv = AH_PRIVATE(ah);
+#endif
 
     if ((OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) == 0) {
         /* Noise floor calibration value is ready */
         nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR_PHY_EXT_MINCCA_PWR);
     } else {
         /* NF calibration is not done, return nominal value */
-        nf = ahpriv->nfp->nominal;    
+        nf = AH9300(ah)->nfp->nominal;
     }
     if (nf & 0x100) {
         nf = (0 - ((nf ^ 0x1ff) + 1));
@@ -583,6 +595,6 @@ int16_t ar9300_get_ext_chan_nf(struct at
     return nf;
 }
 
-#endif
 #endif /* ATH_SUPPORT_SPECTRAL */
+//#endif
 

Modified: projects/cxl_iscsi/sys/dev/arcmsr/arcmsr.c
==============================================================================
--- projects/cxl_iscsi/sys/dev/arcmsr/arcmsr.c	Thu Dec  3 00:10:57 2015	(r291668)
+++ projects/cxl_iscsi/sys/dev/arcmsr/arcmsr.c	Thu Dec  3 00:15:03 2015	(r291669)
@@ -76,6 +76,7 @@
 ** 1.20.00.27   05/06/2013  Ching Huang     Fixed out standing cmd full on ARC-12x4
 ** 1.20.00.28   09/13/2013  Ching Huang     Removed recursive mutex in arcmsr_abort_dr_ccbs
 ** 1.20.00.29   12/18/2013  Ching Huang     Change simq allocation number, support ARC1883
+** 1.30.00.00   11/30/2015  Ching Huang     Added support ARC1203
 ******************************************************************************************
 */
 
@@ -126,15 +127,15 @@ __FBSDID("$FreeBSD$");
 **************************************************************************
 */
 #if __FreeBSD_version >= 500005
-    #include <sys/selinfo.h>
-    #include <sys/mutex.h>
-    #include <sys/endian.h>
-    #include <dev/pci/pcivar.h>
-    #include <dev/pci/pcireg.h>
+	#include <sys/selinfo.h>
+	#include <sys/mutex.h>
+	#include <sys/endian.h>
+	#include <dev/pci/pcivar.h>
+	#include <dev/pci/pcireg.h>
 #else
-    #include <sys/select.h>
-    #include <pci/pcivar.h>
-    #include <pci/pcireg.h>
+	#include <sys/select.h>
+	#include <pci/pcivar.h>
+	#include <pci/pcireg.h>
 #endif
 
 #if !defined(CAM_NEW_TRAN_CODE) && __FreeBSD_version >= 700025
@@ -147,7 +148,7 @@ __FBSDID("$FreeBSD$");
 #define arcmsr_callout_init(a)	callout_init(a);
 #endif
 
-#define ARCMSR_DRIVER_VERSION	"arcmsr version 1.20.00.29 2013-12-18"
+#define ARCMSR_DRIVER_VERSION	"arcmsr version 1.30.00.00 2015-11-30"
 #include <dev/arcmsr/arcmsr.h>
 /*
 **************************************************************************
@@ -181,8 +182,8 @@ static int arcmsr_iop_message_xfer(struc
 static int arcmsr_resume(device_t dev);
 static int arcmsr_suspend(device_t dev);
 static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb);
-static void	arcmsr_polling_devmap(void *arg);
-static void	arcmsr_srb_timeout(void *arg);
+static void arcmsr_polling_devmap(void *arg);
+static void arcmsr_srb_timeout(void *arg);
 static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb);
 #ifdef ARCMSR_DEBUG1
 static void arcmsr_dump_data(struct AdapterControlBlock *acb);
@@ -220,11 +221,11 @@ static device_method_t arcmsr_methods[]=
 	{ 0, 0 }
 #endif
 };
-	
+
 static driver_t arcmsr_driver={
 	"arcmsr", arcmsr_methods, sizeof(struct AdapterControlBlock)
 };
-	
+
 static devclass_t arcmsr_devclass;
 DRIVER_MODULE(arcmsr, pci, arcmsr_driver, arcmsr_devclass, 0, 0);
 MODULE_DEPEND(arcmsr, pci, 1, 1, 1);
@@ -247,38 +248,38 @@ static struct cdevsw arcmsr_cdevsw={
 	};
 #else
 	#define ARCMSR_CDEV_MAJOR	180
-	
+
 static struct cdevsw arcmsr_cdevsw = {
-		arcmsr_open,				/* open     */
-		arcmsr_close,				/* close    */
-		noread,						/* read     */
-		nowrite,					/* write    */
-		arcmsr_ioctl,				/* ioctl    */
-		nopoll,						/* poll     */
-		nommap,						/* mmap     */
-		nostrategy,					/* strategy */
-		"arcmsr",					/* name     */
-		ARCMSR_CDEV_MAJOR,			/* major    */
-		nodump,						/* dump     */
-		nopsize,					/* psize    */
-		0							/* flags    */
+		arcmsr_open,			/* open     */
+		arcmsr_close,			/* close    */
+		noread,				/* read     */
+		nowrite,			/* write    */
+		arcmsr_ioctl,			/* ioctl    */
+		nopoll,				/* poll     */
+		nommap,				/* mmap     */
+		nostrategy,			/* strategy */
+		"arcmsr",			/* name     */
+		ARCMSR_CDEV_MAJOR,		/* major    */
+		nodump,				/* dump     */
+		nopsize,			/* psize    */
+		0				/* flags    */
 	};
 #endif
 /*
 **************************************************************************
 **************************************************************************
 */
-#if __FreeBSD_version < 500005
+#if	__FreeBSD_version < 500005
 	static int arcmsr_open(dev_t dev, int flags, int fmt, struct proc *proc)
 #else
-	#if __FreeBSD_version < 503000
+	#if	__FreeBSD_version < 503000
 	static int arcmsr_open(dev_t dev, int flags, int fmt, struct thread *proc)
 	#else
 	static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc)
 	#endif 
 #endif
 {
-	#if __FreeBSD_version < 503000
+	#if	__FreeBSD_version < 503000
 		struct AdapterControlBlock *acb = dev->si_drv1;
 	#else
 		int	unit = dev2unit(dev);
@@ -293,17 +294,17 @@ static struct cdevsw arcmsr_cdevsw = {
 **************************************************************************
 **************************************************************************
 */
-#if __FreeBSD_version < 500005
+#if	__FreeBSD_version < 500005
 	static int arcmsr_close(dev_t dev, int flags, int fmt, struct proc *proc)
 #else
-	#if __FreeBSD_version < 503000
+	#if	__FreeBSD_version < 503000
 	static int arcmsr_close(dev_t dev, int flags, int fmt, struct thread *proc)
 	#else
 	static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc)
 	#endif 
 #endif
 {
-	#if __FreeBSD_version < 503000
+	#if	__FreeBSD_version < 503000
 		struct AdapterControlBlock *acb = dev->si_drv1;
 	#else
 		int	unit = dev2unit(dev);
@@ -318,17 +319,17 @@ static struct cdevsw arcmsr_cdevsw = {
 **************************************************************************
 **************************************************************************
 */
-#if __FreeBSD_version < 500005
+#if	__FreeBSD_version < 500005
 	static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct proc *proc)
 #else
-	#if __FreeBSD_version < 503000
+	#if	__FreeBSD_version < 503000
 	static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc)
 	#else
 	static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc)
 	#endif 
 #endif
 {
-	#if __FreeBSD_version < 503000
+	#if	__FreeBSD_version < 503000
 		struct AdapterControlBlock *acb = dev->si_drv1;
 	#else
 		int	unit = dev2unit(dev);
@@ -347,7 +348,7 @@ static struct cdevsw arcmsr_cdevsw = {
 static u_int32_t arcmsr_disable_allintr( struct AdapterControlBlock *acb)
 {
 	u_int32_t intmask_org = 0;
-	
+
 	switch (acb->adapter_type) {
 	case ACB_ADAPTER_TYPE_A: {
 			/* disable all outbound interrupt */
@@ -356,10 +357,11 @@ static u_int32_t arcmsr_disable_allintr(
 		}
 		break;
 	case ACB_ADAPTER_TYPE_B: {
+			struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
 			/* disable all outbound interrupt */
-			intmask_org = CHIP_REG_READ32(HBB_DOORBELL, 
-						0, iop2drv_doorbell_mask) & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */
-			CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, 0); /* disable all interrupt */
+			intmask_org = READ_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask)
+						& (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */
+			WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask, 0); /* disable all interrupt */
 		}
 		break;
 	case ACB_ADAPTER_TYPE_C: {
@@ -384,7 +386,7 @@ static u_int32_t arcmsr_disable_allintr(
 static void arcmsr_enable_allintr( struct AdapterControlBlock *acb, u_int32_t intmask_org)
 {
 	u_int32_t mask;
-	
+
 	switch (acb->adapter_type) {
 	case ACB_ADAPTER_TYPE_A: {
 			/* enable outbound Post Queue, outbound doorbell Interrupt */
@@ -394,9 +396,10 @@ static void arcmsr_enable_allintr( struc
 		}
 		break;
 	case ACB_ADAPTER_TYPE_B: {
+			struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
 			/* enable ARCMSR_IOP2DRV_MESSAGE_CMD_DONE */
 			mask = (ARCMSR_IOP2DRV_DATA_WRITE_OK|ARCMSR_IOP2DRV_DATA_READ_OK|ARCMSR_IOP2DRV_CDB_DONE|ARCMSR_IOP2DRV_MESSAGE_CMD_DONE);
-			CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, intmask_org | mask); /*1=interrupt enable, 0=interrupt disable*/
+			WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask, intmask_org | mask); /*1=interrupt enable, 0=interrupt disable*/
 			acb->outbound_int_enable = (intmask_org | mask) & 0x0000000f;
 		}
 		break;
@@ -425,7 +428,7 @@ static u_int8_t arcmsr_hba_wait_msgint_r
 {
 	u_int32_t Index;
 	u_int8_t Retries = 0x00;
-	
+
 	do {
 		for(Index=0; Index < 100; Index++) {
 			if(CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) {
@@ -445,12 +448,13 @@ static u_int8_t arcmsr_hbb_wait_msgint_r
 {
 	u_int32_t Index;
 	u_int8_t Retries = 0x00;
-	
+	struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
+
 	do {
 		for(Index=0; Index < 100; Index++) {
-			if(CHIP_REG_READ32(HBB_DOORBELL, 0, iop2drv_doorbell) & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) {
-				CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt*/
-				CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT);
+			if(READ_CHIP_REG32(0, phbbmu->iop2drv_doorbell) & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) {
+				WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt*/
+				WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT);
 				return TRUE;
 			}
 			UDELAY(10000);
@@ -466,7 +470,7 @@ static u_int8_t arcmsr_hbc_wait_msgint_r
 {
 	u_int32_t Index;
 	u_int8_t Retries = 0x00;
-	
+
 	do {
 		for(Index=0; Index < 100; Index++) {
 			if(CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) {
@@ -486,7 +490,7 @@ static u_int8_t arcmsr_hbd_wait_msgint_r
 {
 	u_int32_t Index;
 	u_int8_t Retries = 0x00;
-	
+
 	do {
 		for(Index=0; Index < 100; Index++) {
 			if(CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE) {
@@ -505,7 +509,7 @@ static u_int8_t arcmsr_hbd_wait_msgint_r
 static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb)
 {
 	int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */
-	
+
 	CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE);
 	do {
 		if(arcmsr_hba_wait_msgint_ready(acb)) {
@@ -522,9 +526,9 @@ static void arcmsr_flush_hba_cache(struc
 static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb)
 {
 	int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */
-	
-	CHIP_REG_WRITE32(HBB_DOORBELL, 
-	0, drv2iop_doorbell, ARCMSR_MESSAGE_FLUSH_CACHE);
+	struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
+
+	WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_FLUSH_CACHE);
 	do {
 		if(arcmsr_hbb_wait_msgint_ready(acb)) {
 			break;
@@ -540,7 +544,7 @@ static void arcmsr_flush_hbb_cache(struc
 static void arcmsr_flush_hbc_cache(struct AdapterControlBlock *acb)
 {
 	int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */
-	
+
 	CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE);
 	CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE);
 	do {
@@ -558,7 +562,7 @@ static void arcmsr_flush_hbc_cache(struc
 static void arcmsr_flush_hbd_cache(struct AdapterControlBlock *acb)
 {
 	int retry_count = 30; /* enlarge wait flush adapter cache time: 10 minute */
-	
+
 	CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE);
 	do {
 		if(arcmsr_hbd_wait_msgint_ready(acb)) {
@@ -600,7 +604,7 @@ static void arcmsr_flush_adapter_cache(s
 static int arcmsr_suspend(device_t dev)
 {
 	struct AdapterControlBlock	*acb = device_get_softc(dev);
-	
+
 	/* flush controller */
 	arcmsr_iop_parking(acb);
 	/* disable all outbound interrupt */
@@ -614,7 +618,7 @@ static int arcmsr_suspend(device_t dev)
 static int arcmsr_resume(device_t dev)
 {
 	struct AdapterControlBlock	*acb = device_get_softc(dev);
-	
+
 	arcmsr_iop_init(acb);
 	return(0);
 }
@@ -627,7 +631,7 @@ static void arcmsr_async(void *cb_arg, u
 	struct AdapterControlBlock *acb;
 	u_int8_t target_id, target_lun;
 	struct cam_sim *sim;

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



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