Correct the end address of the memory regions.

Pointed out by:	ian
Add support for empty ranges properties within the tree, some vendor
device trees have these, for example the ARM AArch64 Foundation Model.

Sponsored by:	The FreeBSD Foundation
Bump the largest record we can cope with from 1k to 8k. Other users of
the hints file don't have any real limits, and longer records will
need to be written shortly.
Adjust the test of a KASSERT to better match the intent.

This assertion was added in r246213 as a guard against corrupted mbufs
arriving from drivers, the key distinguishing factor of said mbufs being
that they had a negative length. Given we're in a while loop specifically
designed to skip over zero-length mbufs, panicking on a zero-length mbuf
seems incorrect.

No objection from:	kib
Reduce number of places where global control_softc is used.

At some point we may want to have several CTL instances, and that is not
really impossible.

MFC after:	2 weeks
Constify some static data.

MFC after:	2 weeks
Add code to set and reset open-drain mode on the bus when requested.

Submitted by:	Michal Meloun <meloun@miracle.cz>
Rewrap long lines; no functional changes.

Submitted by:	Michal Meloun <meloun@miracle.cz>
Remove support for FreeBSD 7 and really old FreeBSD 8. The classifiers
have been in the base for a while, so the gymnastics here aren't
needed. In addition, the bugs in subr_disk.c have been fixed since
2009, so there's no need for an identical copy of it in the tree
anymore. There's really no need to binary patch g_io_request, so let's
get rid of the code (not compiled in anymore) lest others think it is
a good idea.
Remove comments relevant to 6.x only.
When command and data interrupts have been aggregated together, don't do
the data-completed processing if a command-error interrupt is also asserted.

Reviewed by:	Michal Meloun <meloun@miracle.cz>
Add a new sdhci quirk, SDHCI_QUIRK_WAITFOR_RESET_ASSERTED, to work around
TI OMAP controllers which will return the reset-in-progress bit as zero if
you read the status register too fast after setting the reset bit.

The zero is apparently from a stale snapshot of the internal state presented
in the interface register, and leads to a false indication that the reset
is complete when it either hasn't started yet or is in-progress.  The
workaround is to first loop until the bit is seen as asserted, then do the
normal loop waiting to see it de-asserted.

Submitted by:	Michal Meloun <meloun@miracle.cz>
Log mmc and sd command failures.  Reporting of routine expected errors,
such as timeouts while probing a bus or testing for a feature, is
squelched.  Also, error reporting is limited to 5 events per second,
because when an sdcard goes bad on a low-end embedded board, flooding
the console at high speed isn't helpful.

Original logging code contributed by Michal Meloun, but then I fancied
it up with squelching and ppsratecheck.
Various 8259 device model improvements:

- implement 8259 "polled" mode.
- set 'atpic->sfn' if bit 4 in ICW4 is set during master initialization.
- report error if guest tries to enable the "special mask" mode.

Differential Revision:	https://reviews.freebsd.org/D1328
Reviewed by:		tychon
Reported by:		grehan
Tested by:		grehan
MFC after:		1 week
Replace ctl_min() macro with MIN().

MFC after:	1 week
Cleanup the code.

Reported by:	Coverity
CID:		1232003
Add to sbappendstream_locked() a check against NULL mbuf, like it is done
in sbappend_locked() and sbappendrecord_locked().

This is a quick fix to the panic introduced by r274712.

A proper solution should be to make sosend_generic() avoid calling
pru_send() with NULL mbuf for the protocols that do not understand
control messages. Those protocols that understand control messages,
should be able to receive NULL mbuf, if control is non-NULL.
Report XML parsing errors.

MFC after:	3 days
Report initiator id in portlist XML in more formalized way.

MFC after:	3 days
Increase allowed size of the microcode blob to 32KB.  Some Intel CPU's
updates weight 28KB.

PR:	179523
MFC after:	1 week