Home | History | Annotate | Download | only in kern
History log of /src/sys/kern/tty_tty.c
RevisionDateAuthorComments
 1.41  23-May-2020  ad Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.40  25-Jul-2014  dholland branches: 1.40.8; 1.40.18;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.39  16-Mar-2014  dholland branches: 1.39.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.38  24-Jun-2010  hannken branches: 1.38.8; 1.38.18; 1.38.22;
Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.37  24-Apr-2008  ad branches: 1.37.2; 1.37.22; 1.37.24;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
 1.36  26-Nov-2007  pooka branches: 1.36.14; 1.36.16;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
 1.35  03-Apr-2007  hannken branches: 1.35.8; 1.35.10; 1.35.16;
Remove calls to now obsolete vn_start_write() and vn_finished_write().
 1.34  09-Mar-2007  ad branches: 1.34.2; 1.34.4;
- Make the proclist_lock a mutex. The write:read ratio is unfavourable,
and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.
 1.33  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.32  09-Feb-2007  ad branches: 1.32.2;
Merge newlock2 to head.
 1.31  01-Nov-2006  yamt remove some __unused from function parameters.
 1.30  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.29  23-Jul-2006  ad branches: 1.29.4; 1.29.6;
Use the LWP cached credentials where sane.
 1.28  14-May-2006  elad integrate kauth.
 1.27  01-Mar-2006  yamt branches: 1.27.2; 1.27.4; 1.27.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.
 1.26  11-Dec-2005  christos branches: 1.26.2; 1.26.4; 1.26.6;
merge ktrace-lwp.
 1.25  08-Dec-2005  thorpej Use ANSI function decls, sprinkle static.
 1.24  26-Feb-2005  perry branches: 1.24.4; 1.24.10;
nuke trailing whitespace
 1.23  15-Oct-2003  hannken branches: 1.23.8; 1.23.10;
Add the gating of system calls that cause modifications to the underlying
file system.
The function vfs_write_suspend stops all new write operations to a file
system, allows any file system modifying system calls already in progress
to complete, then sync's the file system to disk and returns. The
function vfs_write_resume allows the suspended write operations to
complete.

From FreeBSD with slight modifications.

Approved by: Frank van der Linden <fvdl@netbsd.org>
 1.22  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.21  29-Jun-2003  fvdl branches: 1.21.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.20  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.19  23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.18  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.17  12-Nov-2001  lukem branches: 1.17.8;
add RCSIDs
 1.16  30-Mar-2000  augustss branches: 1.16.6; 1.16.8; 1.16.10; 1.16.12;
Get rid of register declarations.
 1.15  01-Mar-1998  fvdl branches: 1.15.14;
Merge with Lite2 + local changes
 1.14  07-Sep-1996  mycroft Implement poll(2).
 1.13  30-Mar-1996  christos Eliminate kern_conf.h
 1.12  04-Feb-1996  christos First pass at prototyping
 1.11  30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.10  29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.9  12-May-1994  cgd upgrade to 4.4-Lite's tty code. our bug fixes included, some might need GC.
 1.8  04-May-1994  cgd Rename a lot of process flags.
 1.7  18-Dec-1993  mycroft Canonicalize all #includes.
 1.6  24-Nov-1993  deraadt don't permit TIOCSCTTY on /dev/tty, or kernel recursion happens
from Lars Fredriksen <ludvig!lars@wixer.bga.com>
 1.5  27-Jun-1993  andrew branches: 1.5.4;
ANSIfications - removed all implicit function return types and argument
definitions. Ensured that all files include "systm.h" to gain access to
general prototypes. Casts where necessary.
 1.4  22-May-1993  cgd add include of select.h if necessary for protos, or delete if extraneous
 1.3  20-May-1993  cgd add $Id$ strings, and clean up file headers where necessary
 1.2  18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.3  01-Mar-1998  fvdl Import 4.4BSD-Lite2
 1.1.1.2  01-Mar-1998  fvdl Import 4.4BSD-Lite for reference
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.4.2  24-Nov-1993  deraadt update to main branch
 1.5.4.1  14-Nov-1993  mycroft Canonicalize all #includes.
 1.15.14.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.16.12.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.16.10.2  18-Sep-2001  fvdl Various changes to make cloning devices possible:

* Add an extra argument (struct vnode **) to VOP_OPEN. If it is
not NULL, specfs will create a cloned (aliased) vnode during
the call, and return it there. The caller should release and
unlock the original vnode if a new vnode was returned. The
new vnode is returned locked.

* Add a flag field to the cdevsw and bdevsw structures.
DF_CLONING indicates that it wants a new vnode for each
open (XXX is there a better way? devprop?)

* If a device is cloning, always call the close entry
point for a VOP_CLOSE.


Also, rewrite cons.c to do the right thing with vnodes. Use VOPs
rather then direct device entry calls. Suggested by mycroft@

Light to moderate testing done an i386 system (arch doesn't matter
though, these are MI changes).
 1.16.10.1  07-Sep-2001  thorpej Commit my "devvp" changes to the thorpej-devvp branch. This
replaces the use of dev_t in most places with a struct vnode *.

This will form the basic infrastructure for real cloning device
support (besides being architecurally cleaner -- it'll be good
to get away from using numbers to represent objects).
 1.16.8.4  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.16.8.3  21-Feb-2002  jdolecek cttykqfilter(): explain why 'curproc' here is fine, and remove XXXLUKEM comment
 1.16.8.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.8.1  08-Sep-2001  thorpej Add kqueue support to "/dev/tty".
 1.16.6.3  11-Nov-2002  nathanw Catch up to -current
 1.16.6.2  17-Sep-2002  nathanw Catch up to -current.
 1.16.6.1  14-Nov-2001  nathanw Catch up to -current.
 1.17.8.1  16-May-2002  gehenna Add the character device switch.
 1.21.2.6  11-Dec-2005  christos Sync with head.
 1.21.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.21.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.21.2.2  03-Aug-2004  skrll Sync with HEAD
 1.21.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.23.10.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.23.8.1  29-Apr-2005  kent sync with -current
 1.24.10.2  18-Nov-2005  yamt - associate read-ahead context to vnode, rather than file.
- revert VOP_READ prototype.
 1.24.10.1  15-Nov-2005  yamt - setup/cleanup readahead context.
- adapt to the new VOP_READ prototype.
 1.24.4.5  07-Dec-2007  yamt sync with head
 1.24.4.4  03-Sep-2007  yamt sync with head.
 1.24.4.3  26-Feb-2007  yamt sync with head.
 1.24.4.2  30-Dec-2006  yamt sync with head.
 1.24.4.1  21-Jun-2006  yamt sync with head.
 1.26.6.2  01-Jun-2006  kardel Sync with head.
 1.26.6.1  22-Apr-2006  simonb Sync with head.
 1.26.4.1  09-Sep-2006  rpaulo sync with head
 1.26.2.1  31-Dec-2005  yamt uio_segflg/uio_lwp -> uio_vmspace.
 1.27.6.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.27.4.2  06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.27.4.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.27.2.2  11-Aug-2006  yamt sync with head
 1.27.2.1  24-May-2006  yamt sync with head.
 1.29.6.2  10-Dec-2006  yamt sync with head.
 1.29.6.1  22-Oct-2006  yamt sync with head
 1.29.4.2  31-Jan-2007  ad - Have callers to mi_switch() drop the kernel lock.
- Fix a deadlock and some typos.
- Unbreak ptrace().
 1.29.4.1  17-Nov-2006  ad Checkpoint work in progress.
 1.32.2.2  15-Apr-2007  yamt sync with head.
 1.32.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.34.4.1  11-Jul-2007  mjf Sync with head.
 1.34.2.1  10-Apr-2007  ad Sync with head.
 1.35.16.1  08-Dec-2007  mjf Sync with HEAD.
 1.35.10.1  09-Jan-2008  matt sync with HEAD
 1.35.8.1  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.36.16.1  18-May-2008  yamt sync with head.
 1.36.14.2  02-Jun-2008  mjf Sync with HEAD.
 1.36.14.1  29-Mar-2008  mjf - etc/devfsd.conf: Add some rules to give nodes like /dev/tty and
/dev/null better default modes, i.e. 0666.

- sbin/init: Run devfsd -s before going to multiuser.

- sys/arch: Provide arm32, i386, sparc with a mem_init() function to request
device nodes for /dev/null, /dev/zero, etc.

- sys/dev: Convert rnd, wd, agp, raid, cd, sd, wsdisplay, wskbd, wsmouse,
wsmux, tty, bpf, swap to devfs New World Order.

- sys/fs/devfs: Make the visibility attribute of device nodes configurable.
Also provide a function to mount a devfs on boot.

- sys/kern: Add a new boot flag, -n. This disables devfs support. Unless
the -n flag is specified the kernel will mount a devfs file
system on boot.
 1.37.24.1  03-Jul-2010  rmind sync with head
 1.37.22.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.37.2.1  11-Aug-2010  yamt sync with head.
 1.38.22.1  18-May-2014  rmind sync with head
 1.38.18.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.38.8.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.39.2.1  10-Aug-2014  tls Rebase.
 1.40.18.2  29-Apr-2017  pgoyette Remove more unnecessary #include for sys/localcount.h
 1.40.18.1  27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.40.8.3  26-Jul-2016  pgoyette Rename LOCALCOUNT_INITIALIZER to DEVSW_MODULE_INIT. This better describes
what we're doing, and why.
 1.40.8.2  19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.40.8.1  18-Jul-2016  pgoyette Rump drivers are always installed via devsw_attach() so we need to
always allocate a 'struct localcount' for these drivers whenever they
are built as modules.

RSS XML Feed