Vendor import of llvm release_31 final r156748:
http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_31/final@156748
Vendor import of clang release_31 final r156748:
http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_31/final@156748
Vendor import of llvm release_31 r156863 (the actual 3.1 release):
http://llvm.org/svn/llvm-project/llvm/branches/release_31@156863
Vendor import of clang release_31 r156863 (the actual 3.1 release):
http://llvm.org/svn/llvm-project/cfe/branches/release_31@156863
Add missing FAILED event to g_raid_subdisk_event2str() to print it properly
in debug messages.

Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
Fix spelling.

MFC after:	2 weeks
Style.

MFC after:	2 weeks
Add new device method to free the automatically
allocated softc structure which is returned by
device_get_softc(). This method can be used to
easily implement softc refcounting. This can be
desirable when the softc has memory references
which are controlled by userspace handles for
example.

This solves the problem of blocking the caller
of device_detach() for a non-deterministic time.

Discussed with:	kib, ed
MFC after:	2 weeks
Switch unit management in UCOM to unrhdr.

Extend the callback table of UCOM to include a
"ucom_free" function pointer which is called when
all refs on a UCOM super structure is gone.

Implement various helper functions to handle
refcounting and draining on the UCOM super
structure.

Implement macro which can be used in device
drivers to avoid module unload before all
pending TTY references are gone.

The UCOM API is backwards compatible after this
change and device drivers require no changes
to function with this change. Only a recompilation
of UCOM device drivers is required. The FreeBSD
version has been bumped in that regard.

Discussed with:	kib, ed
MFC after:	2 weeks
Take advantage of new UCOM and bus functionality so that
the device_detach() function doesn't block on UCOM device
drivers until the TTY handle is closed by the userspace
application. This is implemented by a postpone of the
softc free where the UCOM structures reside until the
TTY references are gone.

Discussed with:	kib, ed
MFC after:	2 weeks
Remove unused structure field.

MFC after:	2 weeks
Style.

MFC after:	2 weeks
sched_rr_interval() seems always returned period in hz ticks, but same
always it was used as rate.  Fix use side units to period in hz ticks.
Always initialize sc_ekey, because as of r238116 it is always used.

If GELI provider was created on FreeBSD HEAD r238116 or later (but before this
change), it is using very weak keys and the data is not protected.
The bug was introduced on 4th July 2012.

One can verify if its provider was created with weak keys by running:

	# geli dump <provider> | grep version

If the version is 7 and the system didn't include this fix when provider was
initialized, then the data has to be backed up, underlying provider overwritten
with random data, system upgraded and provider recreated.

Reported by:	Fabian Keil <fk@fabiankeil.de>
Tested by:	Fabian Keil <fk@fabiankeil.de>
Discussed with:	so
MFC after:	3 days
Some minor tunings/cleanups inspired by bde@ after previous commits:
 - remove extra dynamic variable initializations;
 - restore (4BSD) and implement (ULE) hogticks variable setting;
 - make sched_rr_interval() more tolerant to options;
 - restore (4BSD) and implement (ULE) kern.sched.quantum sysctl, a more
user-friendly wrapper for sched_slice;
 - tune some sysctl descriptions;
 - make some style fixes.
tvtohz will print out an error message if a negative value is given
to it, avoid this problem by detecting timeout earlier.

Reported by: pho
Don't use C++ comments.
Update comments about setting PLLA and refernce the tables in the
datasheet that express the limits.
Correct the PLLA setting functions and centralize.
Move the decoding of the swi instruction to the syscall function. With the
ARM EABI the syscall value will be moved to a register to ease adding thumb
support. When this happens decoding of the instruction will no longer be
required.