Remove TARGET_BIG_ENDIAN which should have been removed previously.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232897 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Improve ZFS exporting functionality, only export pools which are on a
specific device we happen to be writing to. This fixes an issue when
running pc-sysinstall on a running system which needs ZFS and the main
disk gets exported.

Submitted by:	kris
Obtained from:	PC-BSD


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232898 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add the ability to use a varity of ZFS dataset options.
While here fix a bug causing zpools with /tmp mount-points to fail

Submitted by:	kris
Obtained from:	PC-BSD


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232899 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use gpart "-a" flag to 4k alignment.

Submitted by:	kris
Obtained from:	PC-BSD


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232901 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a kernel-toolchains target like the toolchains target, but building only
the parts of the toolchain necessary to build kernels.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232907 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sysinstall was removed from usr.sbin/Makefile in r225937.  Because per-arch
Makefiles were split out in this directory and others in userland, it makes it
quite easy to miss per-arch conditionals when changing something generally.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232908 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Note two shortcomings of GDB on MIPS that should be addressed.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232910 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix crunchide on MIPS with other than the O32 ABI.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232911 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Correctly (I hope) deallocate the if_arge RX buffer ring on arge_stop().

I had some interesting hangs until I realised I should try flushing the
DDR FIFO register and lo and behold, hangs stopped occuring.

I've put in a few DDR flushes here and there in case people decide to
reuse some of these functions.  It's very very likely they're almost
all superflous.

To test:

* Connect to a network with a _lot_ of broadcast traffic
* Do this:
  # while true; do ifconfig arge0 down; ifconfig arge0 up; done

This fixes the mbuf exhaustion that has been reported when the interface
state flaps up/down.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232912 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't build kernel.tramp on Octeon.  Probably building it should be opt-in
not opt-out, but I don't know enough about which ports need it to get the
defaults right.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232913 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix link status handling on if_arge upon system boot to allow bootp/NFS to
function.

From the submitter:

This patch fixes an issue I encountered using an NFS root with an
ar71xx-based MikroTik RouterBoard 450G on -current where the kernel fails
to contact a DHCP/BOOTP server via if_arge when it otherwise should be able
to.  This may be the same issue that Monthadar Al Jaberi reported against
an RSPRO on 6 March, as the signature is the same:

%%%

DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
.
.
.
DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
arge0: initialization failed: no memory for rx buffers
DHCP/BOOTP timeout for server 255.255.255.255
arge0: initialization failed: no memory for rx buffers

%%%

The primary issue that I found is that the DHCP/BOOTP message that
bootpc_call() is sending never makes it onto the wire, which I believe is
due to the following:

- Last December, a change was made to the ifioctl that bootpc_call() uses
to adjust the netmask around the sosend().

- The new ioctl (SIOCAIFADDR) performs an if_init when invoked, whereas the
old one (SIOCSIFNETMASK) did not.

- if_arge maintains its own sense of link state in sc->arge_link_status.

- On a single-phy interface, sc->arge_link_status is initialized to 0 in
arge_init_locked().

- sc->arge_link_status remains 0 until a phy state change notification
causes arge_link_task to run, notice the link is up, and set it to 1.

- The inits caused by the ifioctls in bootpc_call are reinitializing the
interface, but not the phy, so sc->arge_link_status goes to 0 and remains
there.

- arge_start_locked() always sees sc->arge_link_status == 0 and returns
without queuing anything.

The attached patch changes arge_init_locked() such that in the single-phy
case, instead of initializing sc->arge_link_status to 0, it runs
arge_link_task() to set it according to the current phy state.  This change
has allowed my setup to mount an NFS root successfully.

Submitted by:	Patrick Kelsey <kelsey@ieee.org>
Reviewed by:	juli


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232914 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove some files not used by the FreeBSD kernel which have been adding quite
a bit of bloat to the kernel source tree's size.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232915 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove a now unneeded ARGE_UNLOCK().

Whilst I'm here, remove a couple blank lines.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232916 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Rewrite thread CPU usage percentage math to not depend on periodic calls
with HZ rate through the sched_tick() calls from hardclock().

Potentially it can be used to improve precision, but now it is just minus
one more reason to call hardclock() for every HZ tick on every active CPU.
SCHED_4BSD never used sched_tick(), but keep it in place for now, as at
least SCHED_FBFS existing in patches out of the tree depends on it.

MFC after:	1 month


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232917 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use NULL instead of 0


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232918 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add kern.eventtimer.activetick tunable/sysctl, specifying whether each
hardclock() tick should be run on every active CPU, or on only one.

On my tests, avoiding extra interrupts because of this on 8-CPU Core i7
system with HZ=10000 saves about 2% of performance. At this moment option
implemented only for global timers, as reprogramming per-CPU timers is
too expensive now to be compensated by this benefit, especially since we
still have to regularly run hardclock() on at least one active CPU to
update system uptime. For global timer it is quite trivial: timer runs
always, but we just skip IPIs to other CPUs when possible.

Option is enabled by default now, keeping previous behavior, as periodic
hardclock() calls are still used at least to implement setitimer(2) with
ITIMER_VIRTUAL and ITIMER_PROF arguments. But since default schedulers don't
depend on it since r232917, we are much more free to experiment with it.

MFC after:	1 month


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232919 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Some formatting for r232919.

Submitted by:	pluknet


git-svn-id: svn+ssh://svn.freebsd.org/base/head@232920 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use rt_numfibs variable instead of compile-time RT_NUMFIBS.

Reviewed by:    glebius (previous version)
Approved by:    kib(mentor), ae(mentor)


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

Approved by:	dim (mentor)


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

Approved by:	dim (mentor)


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