Commit graph

18831 commits

Author SHA1 Message Date
Eitan Adler 6058f7207a example cdev: use make_dev_s
Make use of make_dev_s in the example cdev. While here, fix warnings.

Reviewed by:	rpokala
2018-01-26 04:24:39 +00:00
Ed Maste 5436aaae64 vt: add Ctrl+/ key mapping
This matches Xorg's handling of Ctrl+/ and may be useful as a tmux
escape.

PR:		212197
Submitted by:	martin at sugioarto.com
Tested by:	Arshan Khanifar <arshankhanifar_gmail.com>
MFC after:	2 weeks
Relnotes:	Yes
2018-01-25 21:13:42 +00:00
Warner Losh d3de39bff0 Bump .Dd date for c99 change 2018-01-25 15:55:58 +00:00
Warner Losh 88c53cfda1 Add info about c99 designationed initializers.
Differential Revision: https://reviews.freebsd.org/D13975
2018-01-25 15:42:21 +00:00
Ed Maste 5bb40331f6 uefi.8: describe architecture-specific default path
Sponsored by:	The FreeBSD Foundation
2018-01-25 14:36:47 +00:00
Ed Maste 084f772fb4 Install uefi.8 also on arm64
Our standard boot method for arm64 is via UEFI, so install the man page
that describes the boot process.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-01-25 13:51:20 +00:00
Li-Wen Hsu c676c939e2 Fix manual page install on non-amd64
Reviewed by:	emaste, imp
Differential Revision:	https://reviews.freebsd.org/D14038
2018-01-25 05:15:44 +00:00
Ed Maste 88df3117b3 Add efi.8 as a man page link to uefi.8
FreeBSD and industry has been inconsistent in the use of UEFI and EFI.
They are essentially just different versions of the same specification
and are often used interchangeably.  Make it easier for users to find
information by making efi(8) an alias for uefi(8).

Reported by:	imp, jhb
2018-01-24 21:39:40 +00:00
Ed Maste 9f747dc6dc uefi.8: add .Xr cross references to new efi tools 2018-01-24 21:26:01 +00:00
Ed Maste e30f16baf2 uefi.8: note that UEFI and EFI are used interchangeably 2018-01-24 21:20:24 +00:00
Ed Maste e20102cdda uefi.8: update HISTORY and remove incomplete AUTHORS
- EFI support appeared in 5.0 for ia64
- arm64 UEFI support added in 11.0

The AUTHORS section included the folks responsible for the bulk of the
work to bring UEFI support to amd64, but missed those who did the
original work on ia64, the initial port to i386, the ports to arm64 and
arm, and have generally maintained and improved general UEFI support
since then.  It's unwieldly to include everyone and would quickly become
outdated again anyhow, so just remove the AUTHORS section.

Reviewed by:	manu
Discussed with:	jhb
Differential Revision:	https://reviews.freebsd.org/D14033
2018-01-24 21:11:35 +00:00
Conrad Meyer bd555da94b malloc(9): Change nominal size to size_t to match standard C
No functional change -- size_t matches unsigned long on all platforms.

Reported by:	bde
Discussed with:	jhb
Sponsored by:	Dell EMC Isilon
2018-01-24 19:37:18 +00:00
Xin LI 593ff55396 Document how to load nmdm(4) from a kernel module.
Submitted by:	kevlo
MFC after:	2 weeks
2018-01-23 03:36:49 +00:00
Poul-Henning Kamp 59e6efefac Add skeleton manual page for bcm283x_pwm
(Feel free to improve this)
2018-01-22 07:43:54 +00:00
Kyle Evans b37f6c9805 Add libregex, connect it to the build
libregex is a regex(3) implementation intended to feature GNU extensions and
any other non-POSIX compliant extensions that are deemed worthy.

These extensions are separated out into a separate library for the sake of
not cluttering up libc further with them as well as not deteriorating the
speed (or lack thereof) of the libc implementation.

libregex is implemented as a build of the libc implementation with LIBREGEX
defined to distinguish this from a libc build. The reasons for
implementation like this are two-fold:

1.) Maintenance- This reduces the overhead induced by adding yet another
regex implementation to base.

2.) Ease of use- Flipping on GNU extensions will be as simple as linking
against libregex, and POSIX-compliant compilations can be guaranteed with a
REG_POSIX cflag that should be ignored by libc/regex and disables extensions
in libregex. It is also easier to keep REG_POSIX sane and POSIX pure when
implemented in this fashion.

Tests are added for future functionality, but left disconnected for the time
being while other testing is done.

Reviewed by:	cem (previous version)
Differential Revision:	https://reviews.freebsd.org/D12934
2018-01-22 02:44:41 +00:00
Eitan Adler 7e2c40ffa9 termcap: add xterm-termite
Obtained from:	DragonFly
MFC After:	1 week
2018-01-20 22:24:45 +00:00
Edward Tomasz Napierala 8e06491a4e Add sysctls to control device side USB identifiers. This makes it
possible to change string and numeric vendor and product identifiers,
as well as anything else there might be to change for a particular
device side template, eg the MAC address.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D13920
2018-01-20 13:58:34 +00:00
Landon J. Fuller a225321fbc bhnd/bwn(4): Define a bhnd(4) softmodem device class for the v.90 modem
codec core, and mark the core as unpopulated on all BCM4306 bwn(4) devices.

Sponsored by:	The FreeBSD Foundation
2018-01-19 22:43:08 +00:00
Warner Losh 4e617d8cb9 No need for the zero width space now that I put the comma in. 2018-01-18 22:23:16 +00:00
Warner Losh 36a910fba3 Make igor happier with this file:
o Don't use contractions.
o Add common after e.g. where needed
2018-01-18 22:20:30 +00:00
Kyle Evans db180ae55c stand: Add /boot/overlays to allow separation of overlays from base FDT
This matches directory structure used commonly in Linux-land, and it's
cleaner than mixing overlays into the existing module paths. Overlays are
still mixed in by specifying fdt_overlays in loader.conf(5).

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D13922
2018-01-18 04:58:54 +00:00
Baptiste Daroussin 27522b2c36 Update pciids to 2018.01.14
MFC after:	3 days
2018-01-17 13:25:41 +00:00
Kyle Evans bab65a8418 wsp(4): Update to reflect new sysctl from r314467
r314467 introduced hw.usb.wsp.enable_single_tap_clicks to enable/disable
single-tap left click behavior. Update the man page to reflect the new
sysctl.

PR:		196624
MFC after:	3 days
X-MFC-With:	r314467
2018-01-15 21:53:33 +00:00
Peter Grehan c81e664e74 The vmm(4) man page is conditional on MK_BHYVE.
Submitted by:	kevlo
2018-01-15 04:52:12 +00:00
Eitan Adler da24a5e5be vmm(4): add to Makefile
r326281 added the vmm man page, but it needs to be installed.

PR:	205705
2018-01-14 20:30:58 +00:00
Kyle Evans a9f41deff6 Introduce aw_syscon(4) for earlier attachment
Attaching syscon_generic earlier than BUS_PASS_DEFAULT makes it more
difficult for specific syscon drivers to attach to the syscon node and to
get ordering right. Further discussion yielded the following set of
decisions:

- Move syscon_generic to BUS_PASS_DEFAULT
- If a platform needs a syscon with different attach order or probe
behavior, it should subclass syscon_generic and match on the SoC specific
compat string
- When we come across a need for a syscon that attaches earlier but only
specifies compatible = "syscon", we should create a syscon_exclusive driver
that provides generic access but probes earlier and only matches if "syscon"
is the only compatible. Such fdt nodes do exist in the wild right now, but
we don't really use them at the moment.

Additionally:

- Any syscon provider that has needs any more complex than a spinlock solely
for syscon access and a single memory resource should subclass syscon
directly rather than attempting to subclass syscon_generic or add complexity
to it. syscon_generic's attach/detach methods may be made public should the
need arise to subclass it with additional attach/detach behavior.

We introduce aw_syscon(4) that just subclasses syscon_generic but probes
earlier to meet our requirements for if_awg and implements #2 above for this
specific situation. It currently only matches a64/a83t/h3 since these are
the only platforms that really need it at the time being.

Discussed with:	ian
Reviewed by:	manu, andrew, bcr (manpages, content unchanged since review)
Differential Revision:	https://reviews.freebsd.org/D13793
2018-01-13 18:46:31 +00:00
Pedro F. Giffuni e50584405c Add SPDX identifier for the example license.
For project files we should use the -FreeBSD prefix but for this example
assume it is going to be used for some general purpose.

Submitted by:	kevlo
2018-01-13 18:28:30 +00:00
Ed Maste 1383b97864 Revert r327823, Enable ld.lld as bootstrap linker by default on i386
There's a report of some regression in ports.  Revert for now for an
exp run for this change in isolation (previous lld exp run also included
switching the linker used for ports to lld).

Also revert the src.conf.5 regeneration in r327824.

Reported by:	antoine
Sponsored by:	The FreeBSD Foundation
2018-01-13 04:00:55 +00:00
Bryan Drewery 2e07e232a2 Add a hack to disable AUTO_OBJ for 'old style' kernel builds.
Another solution would be to extend the Makefile.sys.inc idea, or a .no_obj
file, to more places but I would rather keep that limited to the top-level
build for now to not impact performance (statting a file in every make call)
or to bring unintended side-effects.

Reported by:	jhb, imp
Sponsored by:	Dell EMC Isilon
2018-01-12 01:09:41 +00:00
Mark Johnston aeb8ee1709 Add mallocarray.9 to malloc.9's MLINKS.
X-MFC with:	r327674
2018-01-11 16:41:03 +00:00
Ed Maste 02cdaef069 regen src.conf.5 after r327823, WITH_LLD_BOOTSTRAP for i386
Sponsored by:	The FreeBSD Foundation
2018-01-11 14:21:07 +00:00
Ed Maste 973c4efb9d Enable ld.lld as bootstrap linker by default on i386
Akin to r327783 for amd64.  lld has been usable for amd64 for quite some
time, but a couple of issues remained that affected i386.  These were
recently addressed upstream in lld and merged into FreeBSD (r326831,
r326879, r326897, r326957), so we can now use ld.lld on i386 as well.

Similarly to amd64 this change enables lld only as the bootstrap linker
(used to link the kernel and userland libraries and executables), while
GNU ld.bfd is still installed as /usr/bin/ld and used for ports builds.

The ports collection is essentially ready to use lld as the system
linker for amd64, but many ports still have trouble with lld on i386,
because lld defaults to -ztext, disallowing relocations against readonly
segments.  Thus switching the system linker (WITH_LLD_IS_LD) will happen
later on a per-arch basis.

Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2018-01-11 14:03:05 +00:00
Conrad Meyer 0a8edd1cad malloc.9: Fix minor typo from rewording in r327796
Sponsored by:	Dell EMC Isilon
2018-01-10 22:20:49 +00:00
Conrad Meyer c02fc9607a mallocarray(9): panic if the requested allocation would overflow
Additionally, move the overflow check logic out to WOULD_OVERFLOW() for
consumers to have a common means of testing for overflowing allocations.
WOULD_OVERFLOW() should be a secondary check -- on 64-bit platforms, just
because an allocation won't overflow size_t does not mean it is a sane size
to request.  Callers should be imposing reasonable allocation limits far,
far, below overflow.

Discussed with:	emaste, jhb, kp
Sponsored by:	Dell EMC Isilon
2018-01-10 21:49:45 +00:00
Ed Maste 737afa08a4 regen src.conf.5 after r327783, WITH_LLD_BOOTSTRAP default
(I missed the Reviewed by and review link from r327783.)

Reviewed by:	brooks, dim, bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D13827
2018-01-10 20:36:16 +00:00
Ed Maste 93b7a1c153 Enable ld.lld as bootstrap linker by default on amd64
For some time we have been planning to migrate to LLVM's lld linker.
Having a man page was the last blocking issue for using ld.lld to link
the base system kernel + userland, now addressed by r327770.  Link the
kernel and userland libraries and binaries with ld.lld by default, for
additional test coverage.

This has been a long time in the making.  On 2013-04-13 I submitted an
upstream tracking issue in LLVM PR 23214: [META] Using LLD as FreeBSD's
system linker.  Since then 85 individual issues were identified, and
submitted as dependencies.  These have been addressed along with two
and a half years of other lld development and improvement.

I'd like to express deep gratitude to upstream lld developers Rui
Ueyama, Rafael Espindola, George Rimar and Davide Italiano.  They put in
substantial effort in addressing the issues we found affecting
FreeBSD/amd64.

To revert to using ld.bfd as the bootstrap linker, in /etc/src.conf set

    WITHOUT_LLD_BOOTSTRAP=yes

If you need to set this, please follow up with a PR or post to the
freebsd-toolchain mailing list explaining how default WITH_LLD_BOOTSTRAP
failed for your use case.

Note that GNU ld.bfd is still installed as /usr/bin/ld, and will still
be used for linking ports.  ld.lld can be installed as /usr/bin/ld by
setting in /etc/src.conf

    WITH_LLD_IS_LLD=yes

A followup commit will set WITH_LLD_IS_LD by default, possibly after
Clang/LLVM/lld 6.0 is merged to FreeBSD.

Release notes:	Yes
Sponsored by:	The FreeBSD Foundation
2018-01-10 20:28:01 +00:00
Ed Maste 782df3ed34 src.conf.5: regen after r325692 and r326888
Sponsored by:	The FreeBSD Foundation
2018-01-10 18:15:00 +00:00
Konstantin Belousov f489be8de9 Fix year.
Noted by:	oshogbo
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2018-01-09 16:28:45 +00:00
Mark Johnston 78f57a9cde Generalize the gzio API.
We currently use a set of subroutines in kern_gzio.c to perform
compression of user and kernel core dumps. In the interest of adding
support for other compression algorithms (zstd) in this role without
complicating the API consumers, add a simple compressor API which can be
used to select an algorithm.

Also change the (non-default) GZIO kernel option to not enable
compressed user cores by default. It's not clear that such a default
would be desirable with support for multiple algorithms implemented,
and it's inconsistent in that it isn't applied to kernel dumps.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D13632
2018-01-08 21:27:41 +00:00
Kristof Provost fd91e076c1 Introduce mallocarray() in the kernel
Similar to calloc() the mallocarray() function checks for integer
overflows before allocating memory.
It does not zero memory, unless the M_ZERO flag is set.

Reviewed by:	pfg, vangyzen (previous version), imp (previous version)
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D13766
2018-01-07 13:21:01 +00:00
Kyle Evans 92e80162f3 aw_sid(4): Add support for Allwinner H3
The sid controller on the H3 is generally identical in location, size, and
efuse offset to the a64 and the a83t. The main difference is that the H3 has
a silicon bug that sometimes causes the rootkey (at least) to be garbled
unless first read by the prctl registers.

This device is currently not in our DTS and, as of now, is not yet present
in mainline Linux DTS.

Tested on:	OrangePi One
2018-01-07 04:59:28 +00:00
Konstantin Belousov f3c588e171 Document kern.smp.disabled tunable.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2018-01-06 16:29:00 +00:00
Jason Unovitch 96de913b77 Remove myself from ports-secteam
I will be moving on to other life commitments this year and will not have
the time to support contributions as a ports committer, if able, until life
settles at the end of the year.

Discussed with:	portmgr
2018-01-04 17:58:48 +00:00
Navdeep Parhar 218c5b2115 cxgbe(4): Add a knob to enable/disable PCIe relaxed ordering. Disable it by
default when running on Intel CPUs.

This is a crude fix for the performance issues alluded to in these Linux commits:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=87e09cdec4dae08acdb4aa49beb793c19d73e73e
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a99b646afa8a02571ea298bedca6592d818229cd

MFC after:	1 week
Sponsored by:	Chelsio Communications
2018-01-03 19:24:57 +00:00
Eitan Adler b5381607d7 bsd-family-tree: revert r327333
bsd-family-tree should only contain projects that have had actual
releases.

Requested by:	core
2018-01-03 03:46:28 +00:00
Mike Karels d626b50b9d make SW_WATCHDOG dynamic
Enable the hardclock-based watchdog previously conditional on the
SW_WATCHDOG option whenever hardware watchdogs are not found, and
watchdogd attempts to enable the watchdog. The SW_WATCHDOG option
still causes the sofware watchdog to be enabled even if there is a
hardware watchdog. This does not change the other software-based
watchdog enabled by the --softtimeout option to watchdogd.

Note that the code to reprime the watchdog during kernel core dumps is
no longer conditional on SW_WATCHDOG. I think this was previously a bug.

Reviewed by:	imp alfred bjk
MFC after:	1 week
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D13713
2018-01-03 00:56:30 +00:00
Kyle Evans 0316d48587 aw_sid: Add man page for this driver
Reviewed by:	manu, bjk (both earlier version), brueffer (manpages)
Differential Revision:	https://reviews.freebsd.org/D13720
2018-01-02 14:54:54 +00:00
Warner Losh 133d84f4d1 Be less verbose and more precise. 2018-01-01 19:04:40 +00:00
Warner Losh a1895a9244 Add note that assert.h may be included multiple times
with and without NDEBUG defined.
2018-01-01 18:59:11 +00:00
Warner Losh c40f7c0583 assert(3) appeared first in the 7th Edition Unix, not the 6th, at
least according to the extant distributions preserved at tuhs.org.

Obtained from: http://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/include/assert.h
2018-01-01 18:55:13 +00:00