Add new USB API to get the port path of a USB device.

MFC after:	2 weeks
Requested by:	emaste @


git-svn-id: svn://svn.freebsd.org/base/head@250201 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Allow the default USB template to be specified at compile time.


git-svn-id: svn://svn.freebsd.org/base/head@250202 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Always install pmc.foo(3) manpages.

There is no point in hiding, e.g. pmc.xscale(3) from a developer running
on amd64, when the target arch in question will probably never have
manual pages installed at all.

Reviewed by:	sbruno, hiren


git-svn-id: svn://svn.freebsd.org/base/head@250203 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add some defines to limit USB memory usage in reduced memory systems.


git-svn-id: svn://svn.freebsd.org/base/head@250204 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Always put space before the comma before ##__VA_ARGS__ due to subtle compiler
differences.


git-svn-id: svn://svn.freebsd.org/base/head@250205 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix uninitialized warning in mps

Reviewed by:	pjd (mentor)
Approved by:	pjd (mentor)
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@250206 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Add more defines to limit USB memory usage and number of allocations
in reduced memory systems.

- Split allocation and freeing of the configuration descriptor into a separate
function, so that the configuration descriptor can be made fixed size
to save memory allocations. This applies for both device and host mode.


git-svn-id: svn://svn.freebsd.org/base/head@250207 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Tune support for removable media in da driver:
 - remove DA_FLAG_SAW_MEDIA flag, almost opposite to DA_FLAG_PACK_INVALID,
using the last instead.
 - allow opening device with no media present, reporting zero media size
and non-zero sector size, as geom/notes suggests.  That allow to read
device attributes and potentially do other things, not related to media.


git-svn-id: svn://svn.freebsd.org/base/head@250208 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove the STANDARDS section.
querylocale is not part of IEEE Std 1003.1-2008.

MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@250209 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove an extra comma.


git-svn-id: svn://svn.freebsd.org/base/head@250210 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Also, add a missing period.


git-svn-id: svn://svn.freebsd.org/base/head@250211 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix compile warning.


git-svn-id: svn://svn.freebsd.org/base/head@250212 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sh: Improve error handling in read builtin:

* If read -t times out, return status as if interrupted by SIGALRM
  (formerly 1).
* If a trapped signal interrupts read, return status 128+sig (formerly 1).
* If [EINTR] occurs but there is no trap, retry the read (for example
  because of a SIGWINCH in interactive mode).
* If a read error occurs, write an error message and return status 2.

As before, a variable assignment error returns 2 and discards the remaining
data read.


git-svn-id: svn://svn.freebsd.org/base/head@250214 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Allow building clang on older FreeBSD releases, where log2() does not
exist yet.  With this change, I have verified that building head on
8.1-RELEASE works.

Noticed by:	Ryan Stone <rysto32@gmail.com>


git-svn-id: svn://svn.freebsd.org/base/head@250217 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
cxgbe/tom: Do not use M_PROTO1 to mark rx zero-copy mbufs as special.
All the M_PROTOn flags are clobbered when an mbuf is appended to the
socket buffer.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@250218 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix two bugs in the current NUMA-aware allocation code:
- vm_phys_alloc_freelist_pages() can be called by vm_page_alloc_freelist()
  to allocate a page from a specific freelist.  In the NUMA case it did not
  properly map the public VM_FREELIST_* constants to the correct backing
  freelists, nor did it try all NUMA domains for allocations from
  VM_FREELIST_DEFAULT.
- vm_phys_alloc_pages() did not pin the thread and each call to
  vm_phys_alloc_freelist_pages() fetched the current domain to choose
  which freelist to use.  If a thread migrated domains during the loop
  in vm_phys_alloc_pages() it could skip one of the freelists.  If the
  other freelists were out of memory then it is possible that
  vm_phys_alloc_pages() would fail to allocate a page even though pages
  were available resulting in a panic in vm_page_alloc().

Reviewed by:	alc
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@250219 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix FIONREAD on regular files.  The computed result was being ignored and
it was being passed down to VOP_IOCTL() where it promptly resulted in
ENOTTY due to a missing else for the past 8 years.  While here, use a
shared vnode lock while fetching the current file's size.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@250220 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
cxgbe: Switch to a better way to install firmware.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@250221 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sh: Remove racy test case for read builtin.

This test case sometimes fails because of an EINTR-related race condition.
Fixing this race condition likely requires an extra system call per byte,
which would make the read builtin even slower than it already is, or very
complicated trickery. Therefore, remove the test case for now.


git-svn-id: svn://svn.freebsd.org/base/head@250222 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Similar to 233760 and 236717, export some more useful info about the
kernel-based POSIX semaphore descriptors to userland via procstat(1) and
fstat(1):
- Change sem file descriptors to track the pathname they are associated
  with and add a ksem_info() method to copy the path out to a
  caller-supplied buffer.
- Use the fo_stat() method of shared memory objects and ksem_info() to
  export the path, mode, and value of a semaphore via struct kinfo_file.
- Add a struct semstat to the libprocstat(3) interface along with a
  procstat_get_sem_info() to export the mode and value of a semaphore.
- Teach fstat about semaphores and to display their path, mode, and value.

MFC after:	2 weeks


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