Import from rebasing repo at b78b6b80
Import from rebasing repo at b78b6b80 (new files)
In ARM asm code, ensure that every ENTRY(foo) has a matching END(foo).
The EABI unwind info requires a .fnend for every .fnstart, and newer
binutils will complain about seeing two .fnstart in a row.  This change
allows newer tools to compile our code.

Reported by:	bapt
Reviewed by:	imp
Automatically prefault a limited number of mappings to resident pages in
shmat(2), just like mmap(2).

MFC after:	5 days
Sponsored by:	EMC / Isilon Storage Division
GIC (Cortex A's interrupt controller) supports up to 1020 IRQs.
- Nuke unused sdhci_softc.
- Static'ize sdhci_debug local to sdhci.c.
- Const'ify PCI device description strings.
- Nuke redundant resource ID members from sdhci_pci_softc.
- Nuke unused hw.sdhci_pci.debug tunable.
- Add support for using MSI instead of INTx, controllable via the tunable
  hw.sdhci.enable_msi (defaulting to on) and tested with a RICOH R5CE823 SD
  controller.
- Use NULL instead of 0 for pointers.

MFC after:	3 days
Compute sin(pi*x) without actually doing the pi*x multiplication.
sin_pi(x) is only called for x < 0 and |x| < 2**(p-1) where p is
the precision of x.  The new argument reduction is an optimization
compared to the old code, and it removes a chunk of dead code.
Accuracy tests in the intervals (-21,-20), (-20,-19), ... (-1,0)
show no differences between the old and new code.

Obtained from:	bde
Resync comments about scbus and pass for life after AHCI joined CAM.

Sponsored by: Netflix
Add the reverse part to rule #9. Also change its description in the
netstat(8) output.

MFC after:	1 week
Explicitly free packet on PF_DROP, otherwise a "quick" rule with
"route-to" may still forward it.

PR:		177808
Submitted by:	Kajetan Staszkiewicz <kajetan.staszkiewicz innogames.de>
Sponsored by:	InnoGames GmbH
Make SOCK_RAW sockets to be truly raw, not modifying received and sent
packets at all. Swapping byte order on SOCK_RAW was actually a bug, an
artifact from the BSD network stack, that used to convert a packet to
native byte order once it is received by kernel.

Other operating systems didn't follow this, and later other BSD
descendants fixed this, leaving us alone with the bug. Now it is
clear that we should fix the bug.

In collaboration with:	Olivier Cochard-Labbé <olivier cochard.me>
See also:		https://wiki.freebsd.org/SOCK_RAW
Sponsored by:		Nginx, Inc.
Do not generate unwind info in asm functions if _STANDALONE is defined.
The .fnend op causes the assembler to emit RELOC references to unwind
support functions that don't exist in libstand.
Fix typo (by -> be).

MFC after:	3 days
Fix a tab that somehow became 8 spaces.

Remove parentheses in a return statement to be consistent with the
rest of the file.

Rename sin_pi() in the float version to sin_pif().

Remove large comment that precedes sin_pif().  The comment
duplicates a comment in e_lgamma_r.c where the algorithm
is documented.

Requested by:	bde
Add references to vt(4) to further man-pages.

MFC after:	3 days
Final patches to the tools used to convert syscons keymaps for use with
vt.

MFC after:	3 days
Add vt(4) support to the console initialisation script, specifically:

- Identify the console driver used and print syscons or vt as appropriate.

- If vt is used and a keymap could not be loaded, then try to replace the
  keymap name configured in rc.conf based on a replacement list in this
  script. Warn about the fact, that a syscons keyname is configured and
  report the replacement used under vt.

- If no replacement keymap is found, no keymap is loaded and a warning
  is displayed, which points at the conversion script and allows the
  conversion of keymaps not part of the official distribution.

This patch has been sent to the -hackers list for review, but no comment
has been received, yet. It is tested to work under syscons and vt on my
system (on vt with either the syscons or vt keymap file name in rc.conf).

MFC after:	3 days
Add lock annotations to <sys/cdefs.h>.

Clang has support for annotating mutexes and code that uses mutexes to
validate certain aspects of thread safety:

- Whether acquiring/releasing locks is done properly (e.g., whether you
  unlock a mutex before leaving a function).
- Whether a lock is held while reading/writing data from/to memory.

Analysis is performed at the function level. Functions can be annotated
to indicate they:

- (try to) pick up a lock,
- release a lock,
- can only be called when (not) holding a lock,
- assert that a lock is held.

Variables and structure members can be annotated to indicate that they
are guarded by a certain lock. In C++, these annotations can refer
to both global variables, but also other class/structure members. In C,
it is only possible to refer to global variables.

This change adds wrappers for the annotations used by Clang to
<sys/cdefs.h>. They currently have no effect, but this is on purpose.
This change will be merged back to FreeBSD 9 and 10, which means we can
safely experiment with these annotations on HEAD without making it
harder to port changes back.

Reviewed by:	announced on arch@ and toolchain@
MFC after:	3 weeks
Enable lock annotations on HEAD when using Clang.

MFC after:	never
Add lock annotations to the header files of our threading libraries.

This change extends all of the functions present in the <pthread.h> and
<threads.h> headers to have lock annotations. This will allow Clang to
warn about the following:

- Locking a function twice,
- Unlocking a function without a mutex being locked,
- Forgetting to unlock a mutex before returning,
- Destroying or reinitializing a mutex that is currenty locked,
- Using an unlocked mutex in combination with a condition variable.

Enabling these annotations already allowed me to catch a bug in one of
our userspace tools (r270749).