Replace all uses of the vm page queues lock by a r/w lock that is private
to this pmap.

Tested by:	Ian Lepore
Use better variable naming.

MFC after:	1 month
Essentially revert r239912.  The amr_periodic function hadn't been armed in
over 10 years and was dead code; the previous revision exposed it as such to
CLANG.  The solution is to cull the whole thing.
Heavily optimize the case of small RX packets of 160 bytes or less.  For
this case, allocate a plain mbuf and copy the frame into it, then send the
copy up the stack, leaving the original mbuf+cluster in place in the
receive ring for immediate re-use.  This saves a trip through 2 of the
3 zones of the compound mbuf allocator, a trip through busdma, and a trip
through the 1 of the 3 mbuf destructors.  For our load at Netflix, this can
lower CPU consumption by as much as 20%.  The copy algorithm is based on
investigative work from Luigi Rizzo earlier in the year.

Reviewed by:	jfv
Obtained from:	Netflix
Add a global MD macro for the VIS block size instead of duplicating
it and using magic values all over the place.

MFC after:	1 week
Add a -h flag similar to the -h flag for ln to force mv(1) to treat a
symbolic link to a directory for the target as a symbolic link instead of
a directory.  This makes it possible to atomically update a symbolic
link using rename().

Reviewed by:	gj
MFC after:	2 weeks
Remove trailing whitespace.
Mdoc fixes.
Relicense ac(8).

Though the license of the original ac(8) source code provides many
liberties, we are already somewhat violating it. The license requires us
to clearly comment any modifications to the source code, as the original
authors of course do not want to get bug reports for modified versions
of ac(8). This is something we have not done consistently.

The need for such a license clause has become less over time. It is very
unlikely that end users will contact the original authors, as the
copyright is from 1994. I contacted both the copyright holders. They
responded in a timely fashion and were more than willing to relicense it
to a 2-clause BSD license. To address any concerns about bug reports
going to the original authors instead of me, add my own name and email
address to the copyright statements as well.

MFC after:		1 month
Special thanks to:	Christopher Demetriou and Simon Gerraty
Add common rules for building firmware object files (NORMAL_FW to run
uudecode, and NORMAL_FWO to use ld to build the .fwo file) and use those
instead of explicit ld/uudecode invocations in sys/conf/files.  Apart from
increasing readability, this makes it possible to adjust the flags used for
firmware objects in one place.

MFC after:	2 weeks
The implied source variable (.IMPSRC) didn't actually work in my previous
commit.  Change this to use .ALLSRC instead, but be careful to only use
the .fw file for NORMAL_FWO to ignore opt_global.h.
Similar to how r171350 fixed linking of kernel modules containing
firmware objects by adding --no-warn-mismatch to the linker flags,
add --no-warn-mismatch when linking firmware objects (*.fwo) as
well as to the link of the main kernel file.  This permits firmware
modules to be statically linked into an ia64 kernel.
Minor mdoc fixes.
Work around several warnings from clang in the xfs filesystem, when
linking it statically into the kernel.  With our gcc in base there are
no warnings, so also remove the WERROR= from the module makefile.

Noted by:	Eir Nym <eirnym@gmail.com>
MFC after:	1 week
Properly enable Clang-style atomics when available.

In addition to testing against cxx_atomic, we must check c_atomic. The
former is only set when building C++ code. Also use __has_extension
instead of __has_feature. This allows us to use the atomics outside of
C11.

Reported by:	Ariane van der Steldt <ariane stack nl>
PR:		threads/170073
Also relicense the ac(8) man page.

MFC after:	1 month
Discussed with:	Simon Gerraty and Chris Demetriou
Fix a twelve year old bug in readelf: when process_dynamic_segment()
encounters a DT_RUNPATH entry, the global dynamic_info[] array is
overrun, causing some other global variable to be overwritten.

In my testcase, this was the section_headers variable, leading to
segfaults or jemalloc assertions when it was freed later on.

Thanks to Koop Mast for providing samples of a few "bad" .so files.

MFC after:	1 week
Bring some changes from Bull's NFSv4 libtirpc implementation.

We especifically ignored the glibc compatibility changes
but this should help interaction with Solaris and Linux.
____

Fixed infinite loop in svc_run()
author	Steve Dickson
Tue, 10 Jun 2008 12:35:52 -0500 (13:35 -0400)
Fixed infinite loop in svc_run()
____

__rpc_taddr2uaddr_af() assumes the netbuf to always have a
non-zero data. This is a bad assumption and can lead to a
seg-fault. This patch adds a check for zero length and returns
NULL when found.
author	Steve Dickson
Mon, 27 Oct 2008 11:46:54 -0500 (12:46 -0400)
____

Changed clnt_spcreateerror() to return clearer
and more concise error messages.
author	Steve Dickson
Thu, 20 Nov 2008 08:55:31 -0500 (08:55 -0500)
____

Converted all uid and gid variables of the type uid_t and gid_t.
author	Steve Dickson
Wed, 28 Jan 2009 12:44:46 -0500 (12:44 -0500)
____

libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed

These fields in the rpcbind GETADDR call are being passed uninitialized
to CLNT_CALL. In the case of x86_64 at least, this usually leads to a
segfault. On x86, it sometimes causes segfaults and other times causes
garbage to be sent on the wire.

rpcbind generally ignores the r_owner field for calls that come in over
the wire, so it really doesn't matter what we send in that slot. We just
need to send something. The reference implementation from Sun seems to
send a blank string. Have ours follow suit.
author	Jeff Layton
Fri, 13 Mar 2009 11:44:16 -0500 (12:44 -0400)
____

libtirpc: be sure to free cl_netid and cl_tp

When creating a client with clnt_tli_create, it uses strdup to copy
strings for these fields if nconf is passed in. clnt_dg_destroy frees
these strings already. Make sure clnt_vc_destroy frees them in the same
way.

author	Jeff Layton
Fri, 13 Mar 2009 11:47:36 -0500 (12:47 -0400)

Obtained from:	Bull GNU/Linux NFSv4 Project
MFC after:	3 weeks
Introduce a new software PTE flag that indicates whether the mapping is
for a managed page.

Tested by:	jchandra
Fix the PHY / CRC error bug in the AR5212 HAL, which apparently also pops
up on (at least) the AR5413.

The 30 second summary - if a CRC error frame comes in during PHY error
processing, that CRC bit will be set for all subsequent frames until
a non-CRC error frame is processed.

So to allow for accurate PHY error processing (Radar, and ANI on the AR5212
HAL chips) just tag the frame as being both CRC and PHY - let the driver
decide what to do with it.

PR:		kern/169362