Add missing copyright notice.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251650 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use direct custom implementations instead of g_handleattr() for CFI and NAND
d_getattr().  Since these drivers use disk(9) KPI and not directly GEOM, use
of that function means KPI layering violation, causing extra g_io_deliver()
call for the request.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251651 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add new script to run release builds.  The script is heavily based upon
the release/generate-release.sh script by nwhitehorn.

This script can use optional configuration file to override defaults,
making running multiple serialzied builds with different specific
configurations or architecture-specific tunings quite easy.

Sample overrideable options are included in the release.conf.sample
file.

Approved by:	kib (mentor)
MFC After:	2 weeks
X-MFC-To:	stable/9 only


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251652 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make CAM return and GEOM DISK pass through new GEOM::lunid attribute.

SPC-4 specification states that serial number may be property of device,
but not a specific logical unit.  People reported about FC storages using
serial number in that way, making it unusable for purposes of LUN multipath
detection.  SPC-4 states that designators associated with logical unit from
the VPD page 83h "Device Identification" should be used for that purpose.
Report first of them in the new attribute in such preference order: NAA,
EUI-64, T10 and SCSI name string.

While there, make GEOM DISK properly report GEOM::ident in XML output also
using d_getattr() method, if available.  This fixes serial numbers reporting
for SCSI disks in `geom disk list` output and confxml.

Discussed with:	gibbs, ken
Sponsored by:	iXsystems, Inc.
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251654 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Migrate the LNA mixing diversity machinery from the AR9285 HAL to the driver.

The AR9485 chip and AR933x SoC both implement LNA diversity.
There are a few extra things that need to happen before this can be
flipped on for those chips (mostly to do with setting up the different
bias values and LNA1/LNA2 RSSI differences) but the first stage is
putting this code into the driver layer so it can be reused.

This has the added benefit of making it easier to expose configuration
options and diagnostic information via the ioctl API.  That's not yet
being done but it sure would be nice to do so.

Tested:

* AR9285, with LNA diversity enabled
* AR9285, with LNA diversity disabled in EEPROM


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251655 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Set the antenna "config group" field.

The reference HAL pushes a config group parameter to the driver layer
to inform it which particular chip behaviour to implement.

This particular value tags it as an AR9285.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251656 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Tie in the LNA diversity configuration functions into the HAL.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251657 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Turn DIAGNOSTICs to INVARIANTS in ext2fs.

This is done to be consistent with what other filesystems and
particularly ffs already does (see r173464).

MFC after:	5 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251658 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use CAM_DIR_NONE for requests without data.
Wrong values there confuse some drivers.

MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251659 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Clean up swapfile memory disk on shutdown

Make the md unit number configurable so that it can be predicted

PR:		bin/168544
Submitted by:	wblock (based on)
Approved by:	kevlo


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251660 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Replicate r242422 from ata(4) to mvs(4):
Only four specific ATA PIO commands transfer several sectors per DRQ block
(interrupt).  All other ATA PIO commands transfer one sector or 512 bytes
at one time.  Hardcode these exceptions in mvs(4) with ATA_CAM option.
This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.
Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251661 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Upgrade our copy of llvm/clang to 3.3 release.

Release notes are still in the works, these will follow soon.

MFC after:	1 month


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251662 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix build after r251654.


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

2012-05-21  Jim Ingham <jingham@apple.com>

      * dwarf2read.c (process_die): Handle DW_TAG_rvalue_reference_type.
      (read_type_die): Ditto.
      (dwarf_tag_name): Ditto.

      * elf/dwarf2.h: Add DW_TAG_rvalue_reference_type.

Obtained from:	Apple, gdb-1820


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

2011-11-14  Jim Ingham  <jingham@apple.com>

        * dwarf2read.c (read_type_die): Handle DW_TAG_unspecified_type.
        (read_tag_unspecified_type): New function, add a type for the
        DW_TAG_unspecified_type die.

Obtained from:	Apple, gdb-1752


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251667 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Turn libc.so into an ld script rather than a symlink pointing to the
real shared object and libssp_nonshared.a.

This was the last showstopper that prevented from enabling SSP for ports
by default.  portmgr@ performed a buildworld which showed no significant
breakage with this patch.

Details:

On i386 for PIC objects, gcc uses the __stack_chk_fail_local hidden
symbol instead of calling __stack_chk_fail directly [1].  This happen
not only with our gcc-4.2.1 but also with the latest gcc-4.8.  If you
want the very nasty details, see [2].

OTOH the problem doesn't exist on other architectures.  It also doesn't
exist with Clang as the latter will somehow manage to create the
function in the object file at compile time (contrary to only
referencing it through a symbol that will be brought in at link time).

In a perfect world, when an object file is compiled with
-fstack-protector, it will be linked into a binary or a DSO with this
same flag as well, so GCC will add libssp_nonshared.a to the linker
command-line.  Unfortunately, we don't control softwares in ports and we
may have such broken DSO.  This is the whole point of this patch.

You can reproduce the problem on i386 by compiling a source file into an
object file with "-fstack-protector-all -fPIE" and linking it
into a binary without "-fstack-protector".

This ld script automatically proposes libssp_nonshared.a along with the
real libc DSO to the linker.  It is important to understand that the
object file contained in this library will be pulled in the resulting
binary _only if_ the linker notices one of its symbols is needed (i.e.
one of the SSP symbol is missing).

A theorical performance impact could be when compiling, but my testing
showed less than 0.1% of difference.

[1] For 32-bit code gcc saves the PIC register setup by using
    __stack_chk_fail_local hidden function instead of calling
    __stack_chk_fail directly.  See comment line 19460 in:
    src/contrib/gcc/config/i386/i386.c

[2] When compiling a source file to an object file, if you use something
    which is external to the compilation unit, GCC doesn't know yet if
    this symbol will be inside or outside the DSO.  So it expects the
    worst case and routes the symbol through the GOT, which means
    additional space and extra relocation for rtld(1).

    Declaring a symbol has hidden tells GCC to use the optimal route (no
    GOT), but on the other hand this means the symbol has to be provided
    in the same DSO (namely libssp_nonshared.a).

    On i386, GCC actually uses an hidden symbol for SSP in PIC objects
    to save PIC register setup, as said in [1].

PR:		ports/138228
PR:		ports/168010
Reviewed by:	kib, kan


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251668 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Renumber clauses to reduce diffs to other versions

NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3,
so follow suit to make comparison easier.


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

Reviewed by:	rpaulo


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251673 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a typo: s/KLSI/CATC/


git-svn-id: svn+ssh://svn.freebsd.org/base/head@251674 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Return HAL_ANT_VARIABLE for now, until it's unstubbed.

This is needed by the slow antenna diversity logic for the AR9485/AR9462
as it's only engaged if the TX diveristy is set to VARIABLE.


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