Use the actual credentials to create the /dev/nmdm* devices.This lets plain users create nmdm pairs, which is useful amongstother things for running retro-computing emulators etc.
Extract eventfilter declarations to sys/_eventfilter.hThis allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces hea
Extract eventfilter declarations to sys/_eventfilter.hThis allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces headerpollution substantially.EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .cfiles into appropriate headers (e.g., sys/proc.h, powernv/opal.h).As a side effect of reduced header pollution, many .c files and headers nolonger contain needed definitions. The remainder of the patch addressesadding appropriate includes to fix those files.LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required bysys/mutex.h since r326106 (but silently protected by header pollution priorto this change).No functional change (intended). Of course, any out of tree modules thatrelied on header pollution for sys/eventhandler.h, sys/lock.h, orsys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped.
show more ...
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 3-Clause license.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 3-Clause license.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.Special thanks to Wind River for providing access to "The Duke ofHighlander" tool: an older (2014) run over FreeBSD tree was useful as astarting point.
Renumber copyright clause 4Renumber cluase 4 to 3, per what everybody else did when BSD grantedthem permission to remove clause 3. My insistance on keeping the samenumbering for legal reasons is
Renumber copyright clause 4Renumber cluase 4 to 3, per what everybody else did when BSD grantedthem permission to remove clause 3. My insistance on keeping the samenumbering for legal reasons is too pedantic, so give up on that point.Submitted by: Jan Schaumann <[email protected]>Pull Request: https://github.com/freebsd/freebsd/pull/96
Fix issue with nmdm and leading zeros in device name.The nmdm code enforces a number between the 'nmdm' and 'A|B' portionsof the device name. This is then used as a unit number, and sprintf'dback
Fix issue with nmdm and leading zeros in device name.The nmdm code enforces a number between the 'nmdm' and 'A|B' portionsof the device name. This is then used as a unit number, and sprintf'dback into the tty name. If leading zeros were used in the name,the created device name is different than the string used for theclone-open (e.g. /dev/nmdm0001A will result in /dev/nmdm1A).Since unit numbers are no longer required with the updated ttycode, there seems to be no reason to force the string to be anumber. The fix is to allow an arbitrary string between'nmdm' and 'A|B', within the constraints of devfs names. This allowsall existing user of numeric strings to continue to work, and alsoallows more meaningful names to be used, such as bhyve VM names.Tested on amd64, i386 and ppc64.Reported by: Dave SmithPR: 192281Reviewed by: neel, glebiusPhabric: D729MFC after: 3 days
Make nmdm(4) destroy devices when both sides of a pair are disconnected.This makes it possible to kldunload nmdm.ko when there are no users of it.Reviewed by: kibSponsored by: Nginx, Inc.
Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.This means that their use is restricted to a single C file.
- Remove an unnecessary memory barrier from an atomic op.- Use the per-softc mutex to protect the softc data in the callout routine rather than letting it run without any locks whatsoever.
Last minute TTY API change: remove mutex argument from tty_alloc().I don't want people to override the mutex when allocating a TTY. It hasto be there, to keep drivers like syscons happy. So I'm cr
Last minute TTY API change: remove mutex argument from tty_alloc().I don't want people to override the mutex when allocating a TTY. It hasto be there, to keep drivers like syscons happy. So I'm creating atty_alloc_mutex() which can be used in those cases. tty_alloc_mutex()should eventually be removed.The advantage of this approach, is that we can just remove a function,without breaking the regular API in the future.
Make nmdm(4) use MPSAFE callouts.For some reason the nmdm(4) driver doesn't use CALLOUT_MPSAFE, eventhough we live in the MPSAFE TTY era. Add the CALLOUT_MPSAFE flags.System survives.
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.The last half year I've been working on a replacement TTY layer for theFreeBSD kernel. The new TTY layer was designed to improve
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.The last half year I've been working on a replacement TTY layer for theFreeBSD kernel. The new TTY layer was designed to improve the following:- Improved driver model: The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers. If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver.- Improved hotplugging: With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc). The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly.- Improved performance: One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters.Upgrading should be quite straightforward. Unlike previous versions,existing kernel configuration files do not need to be changed, exceptwhen they reference device drivers that are listed in UPDATING.Obtained from: //depot/projects/mpsafetty/...Approved by: philip (ex-mentor)Discussed: on the lists, at BSDCan, at the DevSummitSponsored by: Snow B.V., the Netherlandsdcons(4) fixed by: kan
Don't enforce unique device minor number policy anymore.Except for the case where we use the cloner library (clone_create() andfriends), there is no reason to enforce a unique device minor number
Don't enforce unique device minor number policy anymore.Except for the case where we use the cloner library (clone_create() andfriends), there is no reason to enforce a unique device minor numberpolicy. There are various drivers in the source tree that allocate unrpools and such to provide minor numbers, without using them themselves.Because we still need to support unique device minor numbers for thecloner library, introduce a new flag called D_NEEDMINOR. All cdevsw'sthat are used in combination with the cloner library should be markedwith this flag to make the cloning work.This means drivers can now freely use si_drv0 to store their own flagsand state, making it effectively the same as si_drv1 and si_drv2. Westill keep the minor() and dev2unit() routines around to make drivershappy.The NTFS code also used the minor number in its hash table. We shouldnot do this anymore. If the si_drv0 field would be changed, it would nolonger end up in the same list.Approved by: philip (mentor)
Call ttyld_close() in nmdmclose() to ensure that nmdm(4)closes line discipline installed onto /dev/nmdmX device.Reviewed by: julianApproved by: re (hrs)MFC after: 3 days
Sweep kernel replacing suser(9) calls with priv(9) calls, assigningspecific privilege names to a broad range of privileges. These mayrequire some future tweaking.Sponsored by: nCircle
Sweep kernel replacing suser(9) calls with priv(9) calls, assigningspecific privilege names to a broad range of privileges. These mayrequire some future tweaking.Sponsored by: nCircle Network Security, Inc.Obtained from: TrustedBSD ProjectDiscussed on: arch@Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
Use ttyalloc() instead of ttymalloc()
Merge the dev_clone and dev_clone_cred event handlers into a singleevent handler, dev_clone, which accepts a credential argument.Implementors of the event can ignore it if they're not interested,a
Merge the dev_clone and dev_clone_cred event handlers into a singleevent handler, dev_clone, which accepts a credential argument.Implementors of the event can ignore it if they're not interested,and most do. This avoids having multiple event handler types andfall-back/precedence logic in devfs.This changes the kernel API for /dev cloning, and may affect thirdparty packages containg cloning kernel modules.Requested by: phkMFC after: 3 days
Explicitly hold a reference to the cdev we have just cloned. Thiscloses the race where the cdev was reclaimed before it ever made itback to devfs lookup.
If CDSR_OFLOW (stty dsrflow) is enabled on one or both sides of anull-modem tty device emulate the speed settings faithfully.The speed is emulated independently for the two directions, usingthe s
If CDSR_OFLOW (stty dsrflow) is enabled on one or both sides of anull-modem tty device emulate the speed settings faithfully.The speed is emulated independently for the two directions, usingthe slower of the local sides ispeed and the remote sides ospeed.The emulated speed takes settings of bits/char, parity and stopbitinto account.Inspired by: The BSD-DK Editor Celebrity Deathmatch Contest
Start each of the license/copyright comments with /*-, minor shuffle of lines
#include of <sys/vnode.h> not necesary.
Add new function ttyinitmode() which sets our systemwide defaultmodes on a tty structure.Both the ".init" and the current settings are initialized allowingthe function to be used both at attach a
Add new function ttyinitmode() which sets our systemwide defaultmodes on a tty structure.Both the ".init" and the current settings are initialized allowingthe function to be used both at attach and open time.The function takes an argument to decide if echoing should be enabled.Echoing should not be enabled for regular physical serial portsunless they are consoles, in which case they should be configuredby ttyconsolemode() instead.Use the new function throughout.
Preparation commit for the tty cleanups that will follow in the nearfuture:rename ttyopen() -> tty_open() and ttyclose() -> tty_close().We need the ttyopen() and ttyclose() for the new generic c
Preparation commit for the tty cleanups that will follow in the nearfuture:rename ttyopen() -> tty_open() and ttyclose() -> tty_close().We need the ttyopen() and ttyclose() for the new generic cdevswfunctions for tty devices in order to have consistent naming.
Add modemcontrol support for DTR and DCD.Tested by: ambrisko
Second half of the dev_t cleanup.The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev()Various minor adjustments including handling of userland access to ke
Second half of the dev_t cleanup.The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev()Various minor adjustments including handling of userland access to kernelspace struct cdev etc.
Do the dreaded s/dev_t/struct cdev */Bump __FreeBSD_version accordingly.
123