Fix panic in CTL caused by trying to free invalid pointers passed
by the userland process via the IOCTL interface.

Reviewed by:	ken@


git-svn-id: svn://svn.freebsd.org/base/head@240948 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make the updates of the tid ring buffer' head and tail pointers
explicit by moving them into separate statements from the buffer
element accesses.

Requested by:	jhb
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@240951 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Start to clean up the lpc initarm as it also uses FDT.


git-svn-id: svn://svn.freebsd.org/base/head@240952 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use arm_dump_avail_init to build the dump_avail array


git-svn-id: svn://svn.freebsd.org/base/head@240953 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Teach getent(1) to look up a hostname and find IPv6 addresses.

PR:	bin/161548
Submitted by:	matthew


git-svn-id: svn://svn.freebsd.org/base/head@240954 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge recent vendor changes in ZFS.

Illumos issued covered:
2811 missing implementation: zfs send -r
3139 zdb dies when it tries to determine path of unlinked file
3189 kernel panic in ZFS test suite during hotspare_onoffline_004_neg
3208 moving zpool cross-endian results in incorrect user/group accounting

References:
  https://www.illumos.org/issues/ + [issue_id]

Obtained from:	illumos (vendor/illumos, vendor/illumos-sys)
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240955 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Create the new initarm_ functions to reduce the diff to the other FDT
versions of initarm


git-svn-id: svn://svn.freebsd.org/base/head@240956 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Grab the mfi_config_lock while performing a MFI_DCMD_CFG_FOREIGN_IMPORT
request on behalf of a user utility.

Submitted by:	Steven Hartland  killing multiplay co uk
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240962 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove FreeBSD 4.x compat shims.  Verified by md5.


git-svn-id: svn://svn.freebsd.org/base/head@240963 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Create led(4) device nodes mapped to isci(4) SGPIO locate LEDs.

Device nodes are in the format /dev/led/isci.busX.portY.locate.

Sponsored by:	Intel
Requested by:	Paul Maulberger <paul dot maulberger at gmx dot de>
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240965 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a COMPILER_FEATURES variable that is set in bsd.compiler.mk.

When the compiler is clang add c++11 to COMPILER_FEATURES.

When the compiler supports c++11, default to building libc++.  This will
not impact the compliation of programs, but will make it easier for
users with clang compiled systems to test libc++ by passing -stdlib=libc++
to their c++ compliations.


git-svn-id: svn://svn.freebsd.org/base/head@240966 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
 - Allow cross-architecture builds with 'generate-release.sh', which
   is set by specifying '-a <arch>'.  (Only supported for i386 on amd64
   and powerpc on powerpc64 currently).
 - Change how textproc/docproj is installed:
   o Attempt to install from pkg(8);
   o Fall back to pkg_add(1) if pkg(8) installation is not
     successful;
   o Fall back to installing from ports as last resort.
 - Ensure the script is run by root[1].
 - Get OSVERSION from param.h[1].

Provided by:	glebius [1]
Reviewed by:	nwhitehorn, kensmith
Approved by:	kensmith
MFC After:	2 weeks
X-Needs-MFC:	r240586, r240587, r240588


git-svn-id: svn://svn.freebsd.org/base/head@240967 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge similar fixes from 223198 from igb to ixgbe:
- Use a dedicated task to handle deferred transmits from the if_transmit
  method instead of reusing the existing per-queue interrupt task.
  Reusing the per-queue interrupt task could result in both an interrupt
  thread and the taskqueue thread trying to handle received packets on a
  single queue resulting in out-of-order packet processing and lock
  contention.
- Don't define ixgbe_start() at all where if_transmit is used.

Tested by:	Vijay Singh
Reviewed by:	jfv
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240968 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make sure the DWC OTG host mode channels are given enough time to disable.


git-svn-id: svn://svn.freebsd.org/base/head@240969 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Make C11 atomic macros usable in expressions:
  - Replace do-while statements with void expressions.
  - Wrap __asm statements in statement expressions.
- Make the macros function-like:
  - Evaluate all arguments exactly once.
  - Make sure there's a sequence point between evaluation of the arguments
    and the function body. Arguments should be evaluated before any memory
    barriers.
- Fix use of __atomic_is_lock_free built-in. It requires the address of
  an atomic variable as second argument. Use this built-in on clang as
  well because clang's __c11_atomic_is_lock_free only takes the size of the
  variable into account.
- In atomic_exchange_explicit put the barrier before instead of after the
  __sync_lock_test_and_set call.

Reviewed by:	theraven


git-svn-id: svn://svn.freebsd.org/base/head@240970 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- In the bridge_enqueue() do success/error accounting for
  each fragment, not only once.
- In the GRAB_OUR_PACKETS() macro do increase if_ibytes.


git-svn-id: svn://svn.freebsd.org/base/head@240971 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
find: Do not pass fd to save current directory to child processes.

This removes one of the two wrongly passed file descriptors. The other one
appears to be from fts(3).

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240973 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
atrun: Do not assume that MAXLOGNAME <= 100.

The reserved space for fmt was exactly sufficient for a two-digit value of
MAXLOGNAME - 1.

PR:		bin/171815
Submitted by:	Jeremy Huddleston Sequoia
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240974 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/master'