Fixed documented prototype of kinfo_getproc(3).


git-svn-id: svn://svn.freebsd.org/base/head@247534 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Copy the definition of VM_MAX_AUTOTUNE_MAXUSERS from i386.  (See r242847.)

Tested by:	andrew


git-svn-id: svn://svn.freebsd.org/base/head@247535 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix the zfs_ioctl compat layer to support zfs_cmd size change introduced
in r247265 (ZFS deadman thread). Both new utilities now support the old
kernel and new kernel properly detects old utilities.

For future backwards compatibility, the vfs.zfs.version.ioctl read-only
sysctl has been introduced. With this sysctl zfs utilities will be able
to detect the ioctl interface version of the currently loaded zfs module.

As a side effect, the zfs utilities between r247265 and this revision don't
support the old kernel module. If you are using HEAD newer or equal than
r247265, install the new kernel module (or whole kernel) first.

MFC after:	10 days


git-svn-id: svn://svn.freebsd.org/base/head@247540 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Assign the len field of the netbuf structure to the current length of
a sockaddr.

Obtained from:	NetBSD


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


git-svn-id: svn://svn.freebsd.org/base/head@247551 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make the default implementation of the VOP_VPTOCNP() fail if the
directory entry, matched by the inode number, is ".".

NFSv4 client might instantiate the distinct vnodes which have the same
inode number, since single v4 export can be combined from several
filesystems on the server.  For instance, a case when the nested
server mount point is exactly one directory below the top of the
export, causes directory and its parent to have the same inode number
2.  The vop_stdvptocnp() algorithm then returns "." as the name of the
lower directory.

Filtering out the "." entry with ENOENT works around this behaviour,
the error forces getcwd(3) to fall back to usermode implementation,
which compares both st_dev and st_ino.

Based on the submission by:	rmacklem
Tested by:	rmacklem
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@247560 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Use strdup(9) instead of reimplementing it.
- Use __DECONST instead of strange casts.
- Reduce code duplication and simplify name2oid().

PR:		176373
Submitted by:	Christoph Mallon
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@247561 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Eliminate a redundant #include: machine/pmap.h is already included
through vm/pmap.h.


git-svn-id: svn://svn.freebsd.org/base/head@247564 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Make tables, device ID strings etc const.
- Use NULL instead of 0 for pointers.
- Remove redundant bzero(9)'ing of the softc.
- Remove redundant/unused softc members.
- Don't allocate MSI/MSI-X as RF_SHAREABLE.
- Re-use bus accessor macros instead of duplicating them.
- In bce_miibus_{read,write}_reg(), remove superfluous limiting of the PHY
  address (missed in r213893).

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@247565 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Make tables, device ID strings etc const. This includes #ifdef'ing 0
  aac_command_status_table, which is actually unused since r111532.
  While at it, make aac_if a pointer to the now const interface tables
  instead of copying them over to the softc (this alone already reduces the
  size of aac.ko on amd64 by ~1 KiB).
- Remove redundant softc members.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
- Remove redundant bzero(9)'ing of the softc.
- Use pci_enable_busmaster(9) instead of duplicating it.
- Remove redundant checking for PCIM_CMD_MEMEN (resource allocation will
  just fail).
- Canonicalize the error messages in case of resource allocation failures.
- Add support for using MSI instead of INTx, controllable via the tunable
  hw.aac.enable_msi (defaulting to on).

MFC after:	1 month


git-svn-id: svn://svn.freebsd.org/base/head@247570 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Apparently, r186520 was just wrong and the clock of Oxford OX16PCI958 is
  neither DEFAULT_RCLK * 2 nor DEFAULT_RCLK * 10 but plain DEFAULT_RCLK
  and there's no (open) source indicating otherwise. This was tested with
  an EXSYS EX-41098-2, whose clock is not configurable and identifies as:
  puc0@pci0:5:1:0:        class=0x070200 card=0x06711415 chip=0x95381415 rev=0x01 hdr=0x00
      vendor     = 'Oxford Semiconductor Ltd'
      class      = simple comms
      subclass   = multiport serial

  Note that this exactly matches the card mentioned in PR 129665 so no
  sub-device/sub-vendor based quirking of the latter is possible. So maybe
  we should grow some sort of tunable, in case non-default cards such as
  the latter aren't configurable either (this also wouldn't be the first
  time an allegedly tested commit turns out to be wrong though).
- Make the TiMedia tables const.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@247571 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Remove an unused header.
- Use NULL instead of 0 for pointers.
- Let ofw_pcib_probe() return BUS_PROBE_DEFAULT instead of 0 so specialized
  PCI-PCI-bridge drivers may attach instead.
- Add WARs for PLX Technology PEX 8114 bridges and PEX 8532 switches.
  Ideally, these should live in MI code but at least for the latter we're
  missing the necessary infrastructure there.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@247573 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- In sbbc_pci_attach() just pass the already obtained bus tag and handle
  instead of acquiring these anew.
- Use NULL instead of 0 for pointers.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@247574 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Move reporting of failures to disable RX/TX MAC under bootverbose as at
  least the Saturn chips of 501-6738 cards may fail to do so the first
  time, which isn't fatal though.
  Reported by: Paul Keusemann
- Explain why we don't enable infinite bursts on sparc64.
- Given that these chips support memory write invalidate, make sure that
  it's enabled in the command register. Also make sure that PERR# and
  SERR# assertion is enabled.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@247579 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Reduce lock scope a little.


git-svn-id: svn://svn.freebsd.org/base/head@247584 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFV r247316:
Merge new read-only zfs properties from vendor (illumos)

Illumos ZFS issues:
  3588 provide zfs properties for logical (uncompressed) space used and
       referenced

References:
  https://www.illumos.org/issues/3588

MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@247585 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove unnecessary variables.


git-svn-id: svn://svn.freebsd.org/base/head@247586 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Increase the maximum text size on ARM to 64MiB. Without this clang would be
sent a SIGABRT when it is loaded as it is too large. This is the smallest
power of two MiB value that allows us to execute clang.

While here wrap it in an #ifndef to be consistent with the other
architectures.

Submitted by:	Daisuke Aoyama <aoyama at peach.ne.jp>


git-svn-id: svn://svn.freebsd.org/base/head@247587 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Replace the TDP_NOSLEEPING flag with a counter so that the
THREAD_NO_SLEEPING() and THREAD_SLEEPING_OK() macros can nest.

Reviewed by:	attilio


git-svn-id: svn://svn.freebsd.org/base/head@247588 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Initialize count in order to appease clang.

Submitted by:	delphij


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