Commit graph

241722 commits

Author SHA1 Message Date
Warner Losh 0dd16fd9d1 Move to using newvers -c instead of VARS_ONLY=1
Use newvers.sh -c to get the copyright, and newvers.sh -V RELDATE to
get the release date.

Differential Revision: https://reviews.freebsd.org/D19849
2019-05-23 17:19:05 +00:00
Warner Losh 02e2acce1d Convert freebsd-version to using -v
newvers.sh has supported a variable setting only mode, use that in
preference to grep to future proof this script from changes there.

Differential Revision: https://reviews.freebsd.org/D19849
2019-05-23 17:19:00 +00:00
Warner Losh 5f8363315e Convert amd newvers to using newvers.sh -v.
Rather than the tedious and error-prone grep of sys/conf/newvers.sh,
use the new -v arg to dig out the data that's desired.

Differential Revision: https://reviews.freebsd.org/D19849
2019-05-23 17:18:56 +00:00
Warner Losh 9afea54ac5 Implement "VARS_ONLY=1" via special command line args
Add -v to print TYPE REVISION BRANCH RELEASE VERSION RELDATE variables
Add -V var to print var's value
	Both of these in ${var}="${val}" format suitable for
		eval $(sh newvers.sh -v)
	in shell scripts / makefiles.
Add -c to print the copyright / license comment text only.

Document these, and remove soon-to-be obsolete comment.

Minor code motion as well bunded here to put functions after
VARS_ONLY and command line argument parsing.

Differential Revision: https://reviews.freebsd.org/D19849
2019-05-23 17:18:48 +00:00
Ian Lepore 7a038f29d9 Rename IICBUS_FDT_PNPINFO -> IICBUS_FDT_PNP_INFO because all the other
existing pnpinfo-related macros right now use PNP_INFO, not PNPINFO.
2019-05-23 16:03:30 +00:00
Ian Lepore db63d25160 Use the new FDTCOMPAT_PNP_INFO() macro to define SPIBUS_FDT_PNP_INFO().
Also rename SPIBUS_PNP_INFO -> SPIBUS_FDT_PNP_INFO because there could be
other kinds of pnpinfo for other (non-fdt) bus attachments.
2019-05-23 15:59:50 +00:00
Warner Losh ad018aa4da Add warning that the PNP info has to follow the module declaration.
Due to how the linker.hints file is laid out, we'll associate the pnp
info with the wrong module if the module declaration comes after the
pnp info. Until that limiation is removed, we need to have this
ordering. Ideally, we'd also enforce the ordering somehow, but I've
come up with no way to do that yet...
2019-05-23 15:53:41 +00:00
Ian Lepore 06cd525fe3 Add pnpinfo for icee(4) on fdt systems. 2019-05-23 15:51:51 +00:00
Ian Lepore b609a55345 Define macros making it easier to define bus-specific pnpinfo for FDT systems.
Pnpinfo is bus-specific and requires the bus name. The FDTCOMPAT_PNP_INFO()
macro makes it easier to define new FDT-based pnpinfo for busses other than
simplebus.

Differential Revision:	https://reviews.freebsd.org/D20382
2019-05-23 15:47:30 +00:00
Konstantin Belousov 537aac3c09 Use int for the getopt() result.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-05-23 15:00:15 +00:00
Konstantin Belousov 5f4592e46f Add posixshmcontrol(1), an utility to manipulate posix shared memory segments.
See usage for the command line structure.  Man page will come shortly.

Reviewed by:	jilles, tmunro
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D20258
2019-05-23 14:33:01 +00:00
Ian Lepore ecb53c096d Release the bus-recovery gpio pins in detach(), so that unload then
reload of the module works without "pin already allocated" errors.
2019-05-23 14:21:23 +00:00
Emmanuel Vadot d0ba99d943 etcupdate: Add missing directory when building the tree
Missed in 348151

Reported by:	lwshu, ci
2019-05-23 14:05:42 +00:00
Ian Lepore 721e81adce Mark i2c slave devices busy while they own the bus.
Many i2c slave drivers are in modules that can be unloaded.  If they detach
while IO is in progress the bus would be hung forever.  Conversely,
lower-layer drivers (iicbus and the hardware driver) also live in modules
and other kinds of bad things happen if they get detached while IO is in
progress.  Because device_busy() propagates up to parents, marking the slave
device busy while it owns the bus solves both kinds of problems that come
with detaching i2c devices while IO is in progress.
2019-05-23 14:02:39 +00:00
Andriy Gapon f28ecf2b63 add mrsas_shutdown method
It should be safer to flush controller and disk caches on the shutdown.
And to gracefully shut down the controller as well.
It seems that the Linux driver has been doing that for a long time.

Discussed with:	scottl
Reviewed by:	imp, Sumit Saxena <sumit.saxena@broadcom.com>
		(both earlier version)
MFC after:	3 weeks
Sponsored by:	Panzura
Differential Revision: https://reviews.freebsd.org/D19817
2019-05-23 12:51:13 +00:00
Konstantin Belousov 56d0e33e7a Add a kern.ipc.posix_shm_list sysctl.
The sysctl provides the listing on named linked posix shared memory
segments existing in the system.

Reuse shm_fill_kinfo() for filling individual struct kinfo_file.
Remove unneeded lock around reading of shmfd->shm_mode.

Reviewed by:	jilles, tmunro
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D20258
2019-05-23 12:35:40 +00:00
Konstantin Belousov e4b7754848 Report ref count of the backing object as st_nlink for posix shm fd.
Unless there are transient references to the object, the ref count is
equal to the number of the shared memory segment mappings plus one.

Reviewed by:	jilles, tmunro
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D20258
2019-05-23 12:27:45 +00:00
Konstantin Belousov bc2d137acb Make pack_kinfo() available for external callers.
Reviewed by:	jilles, tmunro
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D20258
2019-05-23 12:25:03 +00:00
Andriy Gapon 999d5a34e7 gpioled: fix the manual page update in r348154
MFC after:	2 weeks
2019-05-23 11:35:00 +00:00
Andriy Gapon 694d36403f gpioled: update the manual page after r348153
MFC after:	2 weeks
2019-05-23 11:21:27 +00:00
Andriy Gapon 211bd53a18 gpioled: add a new hint for initial state
hint.gpioled.%d.state determines the initial state of the LED when the
driver takes control over it:
  0 - the LED is off
  1 - the LED is on
 -1 - the LED is kept as it was

While here, add a module version declaration.

MFC after:	2 weks
2019-05-23 11:15:22 +00:00
Andriy Gapon 70b152cb3c Add USB ID for CP2112
This is a curious small widget for which I might write a driver.
It is bridge between USB HID interface and I2C interface plus some
GPIO pins.

MFC after:	 2 weeks
2019-05-23 11:06:38 +00:00
Emmanuel Vadot 6f4c12f301 etcupdate: Fix -p after the move of the passwd related files
Since PREWORLD_FILES only contain files that needs to be copied into /etc
copy directly those files there.

Reported by:	many
2019-05-23 07:59:16 +00:00
Emmanuel Vadot 39fb10372c pkgbase: Remove etc/zfs from being packaged
This is an empty directory and it cause a FreeBSD-zfs package to
be created when we don't need one.

Reviewed by:	bapt
2019-05-23 06:53:59 +00:00
Xin LI 880c6c1b06 Delete unneeded #include <sys/inflate.h> from sys/mips.
PR:		229763
Submitted by:	Yoshihiro Ota <ota at j.email.ne.jp>
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D20190
2019-05-23 05:17:18 +00:00
Justin Hibbits 702818d200 powerpc/mpc85xx: Use the proper (EREF) form of writing to DBCR0
DBCR0, according to the Freescale EREF, is guaranteed to be updated, and
changes take effect, after an isync plus change of MSR[DE] from 0 to 1.
Otherwise it's guaranteed to be updated "eventually".  Use the expected
synchronization sequence to write it for resetting.

This prevents "Reset failed" from being printed immediately before the CPU
resets.

MFC after:	2 weeks
2019-05-23 03:47:25 +00:00
Justin Hibbits 72e58595b1 powerpc/booke: It helps to set variables before using them
Actually set the source and destination VA's before using them.  Fixes a
bizarre panic on 32-bit Book-E.  Not sure why this wasn't caught by the
compiler.
2019-05-23 03:40:48 +00:00
Doug Moore 73f1145140 Fix typo from r348128: _func__ -> __func__
Reported by: LINT
2019-05-23 02:10:41 +00:00
Ian Lepore 9c6dc2fec5 Remove accidentally-added blank line; the style throughout this file
is to use no whitespace between a comment block and the code it describes.
2019-05-23 01:49:08 +00:00
Ian Lepore a2119d62c0 Handle the driftfile option correctly when ntpd_flags is empty.
The logic I originally wrote to detect whether a driftfile option was in the
set of flags was based on the result of removing the pattern *flag* being an
empty string.  That didn't handle the case where the string was empty to
begin with.  Doh!  So now it also specifically checks for an empty string.

The result of the bad check was that ntpd would run without a driftfile, but
it would do so only if it was running as root instead of the non-priveleged
ntpd user, which isn't a typical case.  Ntpd runs fine without a driftfile,
although it does take it longer to stabilize the clock frequency at startup.

Reported by:	avg@
Pointy hat:	ian@
MFC after:	some testing
2019-05-23 01:41:49 +00:00
Conrad Meyer c63f1e21da Decode and name additional x86 feature bits
These are all enumerated in Intel's ISA extension reference, 37th ed.

Sponsored by:	Dell EMC Isilon
2019-05-22 23:22:36 +00:00
Doug Moore fa581662af Cleanups made necessary by r348115, or reactions to it:
1. Change size_t to vm_size_t in some places.
2. Rename vm_map_entry_resize_free to drop the _free part.
3. Fix whitespace errors.
4. Fix screwups in patch-conflict-management that left out important
changes related to growing and shrinking objects.

Reviewed by: alc
Approved by: kib (mentor)
2019-05-22 23:11:16 +00:00
Kyle Evans 55ece394c2 bectl(8): add description for create subcommand
In commit r345845, a portion of documentation for the create subcommand was
removed. Specifically, for creating a snapshot of an existing boot
environment. bectl even has a test-case for this functionality.

Removing the sub-command description was discussed in PR 235850.

This patch brings back the second "create" description that was originally
in place. Albeit, with a few wording/clarifying changes.

Submitted by:	Rob Fairbanks <rob.fx907 gmail com>
Reviewed by:	kevans
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D20249
2019-05-22 23:07:40 +00:00
Ian Lepore 134399fcde Add pnp info to the imx_i2c driver. 2019-05-22 21:47:26 +00:00
Conrad Meyer 26c4978843 save-entropy(8), rc.d/random: Set nodump flag
Tag saved entropy files as "nodump," to signal that the files should not be
backed up by dump(8) or other automated backup software that honors the file
flag.

Do not produce an error if the target file resides on a filesystem that does
not support file flags (e.g., msdos /boot).

Reviewed by:	delphij
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D20358
2019-05-22 21:47:17 +00:00
Alexander V. Chernikov 563ab4e400 Fix gateway setup for the interface routes.
Currently rinit1() and its IPv6 counterpart
  nd6_prefix_onlink_rtrequest() uses dummy null_sdl gateway address
  during route insertion and change it afterwards. This behaviour
  brings complications to the routing stack and the users of its
  upcoming notification system.

This change fixes both rinit1() and nd6_prefix_onlink_rtrequest()
  by filling in proper gateway in the beginning. It does not change any
  of the userland notifications as in both cases, they happen after
  the insertion and fixup process (rt_newaddrmsg_fib() and nd6_rtmsg()).

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D20328
2019-05-22 21:20:15 +00:00
Ian Lepore a30555576c Add a new 'tr' (transfer) mode to i2c(8) to support more i2c controllers.
Some i2c controller hardware does not provide a way to do individual START,
REPEAT-START and STOP actions on the i2c bus.  Instead, they can only do
a complete transfer as a single operation.  Typically they can do either
START-data-STOP or START-data-REPEATSTART-data-STOP.  In the i2c driver
framework, this corresponds to the iicbus_transfer method.  In the userland
interface they are initiated with the I2CRDWR ioctl command.

These changes add a new 'tr' mode which can be specified with the '-m'
command line option.  This mode should work on all hardware; when an i2c
controller driver doesn't directly support the iicbus_transfer method,
code in the i2c driver framework uses the lower-level START/REPEAT/STOP
methods to implement the transfer.  After this new mode has gotten some
testing on various hardware, the 'tr' mode should probably become the
new default mode.

PR:		189914
2019-05-22 21:06:10 +00:00
Alexander Motin 83d0c3846d Allocate buffers smaller then ABD chunk size as linear.
This allows to reduce memory waste by letting UMA to put multiple small
buffers into one memory page slab.  The page sharing means that UMA
may not be able to free memory page when some of buffers are freed, but
alternatively memory used by that buffer would just be wasted from the
beginning.

This change follows alike change in ZoL, but unlike Linux (according to
my understanding of it from comments) FreeBSD never shares slabs bigger
then one memory page, so this should be even less invasive then there.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2019-05-22 18:43:48 +00:00
Doug Moore 1895f5202a Passing a parameter to vm_map_entry_resize_free that describes the
amount of resizing reduces the number of functions changing the vm_map
invariants regarding the max_free field of map entries.

Reviewed by: markj (mentor)
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20356
2019-05-22 17:40:54 +00:00
Niclas Zeising f9039ad43e Fix ObsoleteFiles after ethernet driver removal
Fix OpsoleteFiles.inc after removal of ethernet drivers.  The drivers have
manual pages, and manual pages are generally stored compressed, with a .gz
suffix, but this is not reflected in ObsoleteFiles and make delete-old fails
to remove them.

Approved by:	brooks
Sponsored by:	B3 Init
Differential Revision:	https://reviews.freebsd.org/D20351
2019-05-22 16:59:22 +00:00
Alan Somers 6a5074a375 Update VFS_FHTOVP(9) with the flags argument
Revison 222167 added a new argument to VFS_FHTOVP. This revision updates the
man page to match.

Reviewed by:	rmacklem
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20323
2019-05-22 16:24:39 +00:00
Leandro Lupori 0632bb89db Fix PPC64 kernel build with clang8 + lld8
This patch fixes the following lld link errors:

- unsupported dynamic relocations on read-only sections
- out-of-range TOC references

Submitted by:	git_bdragon.rtk0.net
Reviewed by:	jhibbits, luporl
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D19352
2019-05-22 15:56:41 +00:00
Alexander Motin 0a3b1d8090 Simplify math added in r310524.
Should be no functional change.

Reported by:	danfe
MFC after:	1 week
2019-05-22 15:39:35 +00:00
Alexander Motin 9c91a26579 Fix condition broken at r345815.
Reported by:	danfe
MFC after:	3 days
2019-05-22 15:25:10 +00:00
Andrew Gallatin 18f9bb6fe0 x86 MCA: introduce MCA hooks for different vendor implementations
This is needed for AMD SMCA processors, as SMCA uses different
MSR address for access MCA banks.

Use IA32 specific msr_ops as defualt, and use SMCA-specific msr_ops
when on an SMCA-enabled processor

Submitted by:	chandu from amd dot com
Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D18055
2019-05-22 13:44:15 +00:00
Andriy Gapon 804838e126 acpi_hpet: restore support for timers defined only in HPET table
This fixes a regress introduced in r339754.
After that change the code required that there is a HPET device
in the ACPI namespace.
The problem has been noticed on an PC Engines apu2 system.

While here, fix a small formatting issue.
2019-05-22 08:30:03 +00:00
Emmanuel Vadot d3bb120822 pkgbase: Really move login.access
Messed up with git->svn r348102
2019-05-22 07:41:58 +00:00
Emmanuel Vadot 43fb1e3e4b pkgbase: Really move termcap.small
Messed up with git->svn in r348101
2019-05-22 07:41:20 +00:00
Emmanuel Vadot 19dad0edbe pkgbase: Really move rc.sendmail
Messed up with git->svn in r348100
2019-05-22 07:40:39 +00:00
Emmanuel Vadot 410304e347 pkgbase: Really move rc.bsdextended
Messed up with git->svn in r348099
2019-05-22 07:39:59 +00:00