When MAP_STACK_GROWS_{DOWN,UP} are passed to vm_map_insert() set the
corresponding flag(s) in the new map entry.  Previously, the caller was
responsible for setting them after vm_map_insert() returned.

Pass MAP_STACK_GROWS_DOWN to vm_map_insert() from vm_map_growstack() when
extending the stack in the downward direction.

Together these changes slightly simplify the caller's task when creating a
downward growing stack.  In particular, the caller no longer needs to clip
the previous entry, because the new stack entry can't possibly coalesce
with the previous entry.

Reviewed by:	kib
Sponsored by:	EMC / Isilon Storage Division
Trust the state of a power resource that get from a working _STA method
instead of trying to cache it.

Previously, we only trusted the state if we did not have a cached state.
However, once a state was cached, the _STA method was always ignored.
Specifically, once a power resource had been turned on once (e.g.
during resume), the driver assumed it was always on even if _STA said it
was off and never turned it back on.  This prevented the power resource
from being turned back on if a laptop was resumed twice, for example.

To fix, just remove the cached state entirely and always use the results
of _STA.  The loops already skip any resources where _STA fails.

Submitted by:	trasz (initial patch to invoke _ON)
MFC after:	1 week
serial_num and device_id fields are not necessarily null-terminated.

Before this it was impossible to use all 16 bytes of serial number, and
client always got serial number NULL-terminated, that is not required.

MFC after:	2 weeks
Don't dump core when the ELF file has no section headers. The ELF
core files created by gcore are among those.
Eliminate a pointless call to vm_map_clip_start() from vm_map_growstack().
For this call to do anything at all we would have to have two overlapping
map entries.

Submitted by:	kib
Following comments in r242565 add the possibility to specify ecx when
performing cpuid calls.
Add also a new way to specify the level type to cpucontrol(8) as
reported in the manpage.

Sponsored by:	EMC / Isilon storage division
Reviewed by:	bdrewery, gcooper
Testerd by:	bdrewery
Set target->sbp field to valid value when sbp device is created.

The sbp_cam_detach_target can be called from sbp_post_explore function
on the first target that is not really attached and it was written with
the corresponding safety check in place to tolerate that. Unfortunately
the recent locking cleanup did add a locking assertion that tries to
dereference the target->sbp pointer unconditionally, which causes less
than desirable outcome. Since the assertion is useful, just initialize
the target sbp pointer once when sbp device is being initialized instead
of when the target is being attached. This makes assertion work in all
cases and fixes the crash on boot.
Remove an unnecessary kick of the host at the end of transmitting

MFC after:	1 week
Handle multiple calls to rxq_eof for single packet completion

This requires the VMware vmxnet3 device to flip the start of packet
descriptor's generation before the rest of the packet's descriptors
have been loaded into the Rx ring. I've never observed this behavior,
and it seems to make the most sense not to do it this way. But it is
not a lot of work for the driver to handle this situation just in case.

MFC after:	1 week
Increment the pending packets more aggressively for TSO

Assume the number of description used is reasonable value to
increment this otherwise opaque field by.

While here, reduce a minor difference between the legacy and
multiqueue transmit paths.

MFC after:	1 week
Assert that the new entry is inserted into the right location in the
map entries list, and that it does not overlap with the previous and
next entries.

Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
use .Mt to mark up email addresses consistently (part1)

PR:		191174
Submitted by:	Franco Fichtner  <franco@lastsummer.de>
use .Mt to mark up email addresses consistently (part2)

PR:		191174
Submitted by:	Franco Fichtner  <franco@lastsummer.de>
Removed compatibility with pre FreeBSD 2.2 pw_mkdb command
Fix some broken indentattion

PR:		189173
Submitted by:	fullermd@over-yonder.net
MFC after:	1 week
Fix changing the username

PR:		189172
Submitted by:	fullermd@over-yonder.net
MFC after:	1 week
Stop creating /etc/gnats
Remove /etc/gnats from here, too.
Restore the ABI of the cpuctl(4) ioctl request CPUCTL_CPUID, use
separate argument structure with added level_type field for
CPUID_CPUID_COUNT request.

Reviewed by:	attilio (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Honor jails for unbound SCTP sockets when selecting source addresses,
reporting IP-addresses to the peer during the handshake, adding
addresses to the host, reporting the addresses via the sysctl
interface (used by netstat, for example) and reporting the
addresses to the application via socket options.
This issue was reported by Bernd Walter.

MFC after: 3 days
regex: Make use of reallocf().

Use of reallocf is useful in libraries as we are not certain the
application will exit after NULL.

This somewhat reduces portability but if since you are building
this as part of libc it is likely you have our non-standard
reallocf(3) already.

Reviewed by:	ache
MFC after:	5 days