Fixup ld.so TLS free() issues on VARIANT 1 found by libc malloc.

TLS was initially written for machine VARIANT 2 (i.e. amd64),
support for VARIANT 1 (i.e. arm) was only added later.  The code
in the "free TLS memory" path assumed to be VARIANT 2, so the
memory freed and pointers used were not right.

ok drahn@
Mindblowing whitespace fixes

Because we are also able to produce top-notch whitespace fixes.

No binary change.
wsdisplay_switch: only wait on resume if waitok.

Introduced by me a good while ago. Seen by jy-p when he hit a resume
hang (likely in wsdisplay_resume) and tried to vt switch.

haesbaert agreed with the fix.
Add MNT_SNAPSHOT flag.

Allow it to be passed to VFS_MOUNT and cleared afterwards. Adapt mount(8).

ok pedro@ patrick@ oga@
Implement tmpfs snapshot support.

The future purpose of tmpfs snapshots is to be used in a special device driver
that allows us to use snapshots as a ramdisk.

Snapshots can be created like this:

    # mount -t tmpfs -u -o snapshot /path/to/snapshot /mnt

Note that the snapshot file must reside on a different mountpoint than the one
which is to be dumped.

They may be mounted like this:

    # mount -t tmpfs /path/to/snapshot /mnt

written by pedro@ and me

ok patrick@; eye-balled by oga@
Teach file(1) about tmpfs snapshots.

ok pedro@ patrick@
Add regression tests for tmpfs snapshots.

ok pedro@ patrick@
Define PT_BITRIG_TMPFS_RAMDISK.

This segment type will be used to indicate the presence of an embedded
tmpfs ramdisk in a kernel ELF image.

ok natano@ patrick@ oga@
Add rdconfig.

rdconfig is a tool to embed a tmpfs file system image inside the kernel.
It can also be used to inspect the boot time memory requirements of a
kernel image.

Unhooked from the main build for now.

ok natano@ patrick@; glanced at by oga@
Replace misleading comment with an accurate one.

Replace misleading comment about the virtual address space of the
kernel (probably copied verbatim from i386 code?) with an accurate one.

input from and ok hshoexer@genua

ok patrick@ oga@
Add BAPIV_RAMDISK.

Add BAPIV_RAMDISK, a flag to indicate that the boot loader program has
provided the kernel with information regarding a loaded tmpfs ramdisk.

ok natano@ patrick@ oga@
Check for BAPIV_RAMDISK and set eramdisk.

When starting the kernel, check whether BAPIV_RAMDISK was passed by the
boot loader program, and set the 'eramdisk' pointer accordingly.

ok natano@ patrick@ oga@
Add FS_TMPFS.

Add FS_TMPFS, a disklabel type to denote tmpfs ramdisks. Silly, but
that's how disklabel rolls.

ok natano@ patrick@ oga@
Introduce pmap_is_direct_mapped(va)

Available on all PMAP_DIRECT archs.  This interface can be used to check
if a virtual address is direct-mapped or not.

This patch implements pmap_is_direct_mapped for  all direct archs.

ok pedro@ patrick@
Add tmpfsrd(4) (to be renamed, hopefully).

Add tmpfsrd(4), a pseudo-device that fakes a one-shot block device for
mounting tmpfs ramdisks. TODO: Free ramdisk memory once the device
detaches.

ARM bits by patrick@.

Man page by natano@.

ok natano@ patrick@ oga@
Tweak image loading code; no functional change

Use different variables to hold the size of the program header table and
the section header table, in preparation for upcoming changes.

ok patrick@
Keep the program header table for longer

Change where free() is called on the program header table when loading
the kernel. Keep it around for a bit longer, since it will be needed by
upcoming changes.

ok patrick@
Add MARK_RAMDISK.

Add MARK_RAMDISK to the list of marks passed from the boot loader
program to the kernel. The purpose of this mark is to indicate where the
end of a mapped ramdisk is.

ok natano@ patrick@ oga@
When booting, look for and load ramdisk.

Look for PT_BITRIG_TMPFS_RAMDISK segments when booting the kernel and
map them at the very end of the image, after symbols. Remember where the
end of the ramdisk is and set MARK_RAMDISK accordingly.

ok natano@ patrick@ oga@
Switch to the new boot argument API.

Switch to the new boot argument API, including the end of a loaded
ramdisk (MARK_RAMDISK) in the list of arguments passed to the kernel.

ok natano@ patrick@ oga@