This change builds kernel tools based on the same assumption as building
the kernel itself:  If building for the same architecture as the build host,
the kernel build assumes that the host toolchain is capable of building the
kernel.  If it's not, "make kernel-toolchain" will bootstrap a new set of
tools that will work.

With this change the same assumptions are made for building kernel tools,
and the existing host toolchain is used to do the build (notably, the build
doesn't link the tools with the legacy libraries, which may not even exist).
If ever for some reason the host toolchain isn't capable of building the
kernel tools, then doing a "make kernel-toolchain" will bootstrap newer
tools to get the job done.

So when built as part of buildworld or kernel-toolchain, the kernel tools
are built using the XMAKE (via BMAKE) commands and environment.  When built
as part of building just the kernel on a same-target host, the tools are
built using the new KTMAKE commands and environment.  What doesn't jump
out at you in the diffs is that the difference between BMAKE and KTMAKE
is that BMAKE contains this magic line which changes how the build is done
because it changes what files get included for .include <bsd.prog.mk> and
other standard includes:

    MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"

and KTMAKE doesn't, and contains this instead:

    TOOLS_PREFIX=${WORLDTMP}

Hopefully this brings the "how to build aicasm with the right toolchain"
saga to a conclusion that works in all usage scenarios that have
historically been supported.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257873 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix extattr(2) MLINKS.

MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257874 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
On XenServer the "halt" message is used instead of "poweroff", which
makes FreeBSD halt but not poweroff (as expected when issuing a
shutdown from the VM manager). Fix this by using the same handler
for both "halt" and "poweroff".

NB: The "halt" signal seems to be used on XenServer only.  The OSS
    Xen toolstack (xl) uses "poweroff" instead.

Submitted by:	Roger Pau Monné
Sponsored by:	Citrix Systems R&D
Reviewed by:	gibbs
MFC after:	2 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257876 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't try to use the 32-bit drti.o unless the data model is explicitly set
to ILP32. Otherwise dtrace -G will attempt to use it on amd64 if it can't
determine which data model to use, which happens when -64 is omitted and
no object files are provided, e.g. with

# dtrace -G -n BEGIN

This would result in a linker error, but now works properly.

Also remove an unnecessary #ifdef.

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257877 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix typo in r256646: We want to generate lists of directories in INDEX-OLD
and INDEX-NEW and compare them, not generate the same list of directories
from INDEX-OLD twice...

Pointy hats to:	cperciva & everybody who didn't proofread EN-13:04 enough


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257879 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add some new driver definitions as part of the chip support updates:

This is a no-op for now!

* Add a new flag value for "there are no extra bits" for some random
  field;

* Add a definition for the maximum number of calibration entries in
  the calibration data cache in iwn_softc.  It's not yet used.

* Add regulatory bands for the 2030 NIC.

Submitted by:	Cedric Gross <cg@cgross.info>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257880 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix AMRR to correctly select the initial rate.

There were two bugs:

* If the initial lowest rate didn't go through the loop at least once,
  the AMRR rate index would be the highest rate in the table
  (eg the rix mapping to MCS15) but rate would stay at the default
  value, namely 0.

  This meant that the initial rate selection would be MCS15 _but_ the
  node ni_txrate value would be MCS0.

* If the node is 11n, then break out of the loop correctly.  Beforehand,
  my initial 11n AMRR commit would immediately exit out as it would
  fail the 11n check, then it would always fall through to the non-11n
  rate which would then see if it was < 36mbit (ie, "72"), which would
  always match.  Hence, it'd always return MCS15.

Tested:

* Intel Centrino 2230 STA (local changes), STA mode
* Intel Wifi 5100, STA


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257881 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Strip out this cruft; people should be making modules with a complete
kernel config environment anyway.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257882 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add support for SIIG x1 pci-e single parallel port card (JJ-E01211-S1)

PR:		kern/182217
Submitted by:	Craig Leres <leres@ee.lbl.gov>
MFC After:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257883 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Change manual string conversion to expand_number

Reviewed by:	adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257884 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add missed DPADD

Reported by:	swildner@DragonflyBSD.org


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257885 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use system libiconv, instead of trying to dlopen() it.

PR:		183153
Submitted by:	Dominic Fandrey <kamikaze bsdforen.de>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257888 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
pkg_install has been removed on 20131031.

Approved by:	portmgr (bdrewery)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257891 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
o Add ONFI signature check.
o Add Micron chip found in Freescale Vybrid Family
  Phytec COSMIC board.

Approved by:	cognet (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257892 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix gcc warnings about casting away const in sys/x86/iommu/intel_drv.c.

Reviewed by:	kib


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257896 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Both vn_close() and VFS_PROLOGUE() evaluate vp->v_mount twice, without
holding the vnode lock; vp->v_mount is checked first for NULL
equiality, and then dereferenced if not NULL.  If vnode is reclaimed
meantime, second dereference would still give NULL.  Change
VFS_PROLOGUE() to evaluate the mp once, convert MNTK_SHARED_WRITES and
MNTK_EXTENDED_SHARED tests into inline functions.

Reviewed by:	alc
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257898 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
If filesystem declares that it supports shared locking for writes, use
shared vnode lock for VOP_PUTPAGES() as well.  The only such
filesystem in the tree is ZFS, and it uses
vnode_pager_generic_putpages(), which performs the pageout with
VOP_WRITE().

Reviewed by:	alc
Discussed with:	avg
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257899 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix (erroneous) gcc warnings about usage of uninitialized variables in
sys/x86/iommu/intel_idpgtbl.c.

Reviewed by:	kib


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257900 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix an NFSv4.1 client specific case where a forced dismount would hang.
The hang occurred in nfsv4_setsequence() when it couldn't find an
available session slot and is fixed by checking for a forced dismount
in progress and just returning for this case.

MFC after:	1 month


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257901 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix gcc warning about an empty device_printf() format string in
sys/x86/iommu/intel_fault.c.

Reviewed by:	kib


git-svn-id: svn+ssh://svn.freebsd.org/base/head@257902 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f