summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
Commit message (Collapse)AuthorAgeFilesLines
* Major update to the way synchronization is done in the kernel. Highlightsjasone2000-09-071-1/+2
| | | | | | | | | | | | | | | include: * Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The alpha port is still in transition and currently uses both.) * Per-CPU idle processes. * Interrupts are run in their own separate kernel threads and can be preempted (i386 only). Partially contributed by: BSDi (BSD/OS) Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.phk2000-07-041-1/+1
| | | | Pointed out by: bde
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:phk2000-07-031-1/+1
| | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
* Back out the previous change to the queue(3) interface.jake2000-05-261-1/+1
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-1/+1
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Move t_timeout initializing to ttyregisterache2000-05-011-1/+1
| | | | Pointed-by: bde
* Set t_timeout to its default sysctl value only once in ttyopenache2000-05-011-1/+3
| | | | | | Initialize t_timeout to -1 for this reason Pointed-by: bde
* Add sysctl variable to set initial drainwait timeout on ttyopen, default toache2000-04-301-1/+5
| | | | 5 minutes
* Add default 5min timeout for output drain to stop hanging on exit or in otherache2000-04-271-0/+2
| | | | places when connection dropped
* Fix a bug where SIGIO was not being delivered to a process requestingarchie2000-04-051-0/+2
| | | | | | | async I/O when a tty device became writable. PR: kern/8324 Submitted by: Don Lewis <Don.Lewis@tsc.tdk.com>
* Back out previous commit; it was premature.archie2000-01-281-57/+0
|
* When an attempt to install a line discipline fails, check forarchie2000-01-281-0/+57
| | | | | known KLD's that might support it, and load the KLD if found. Currently the list includes SLIPDISC, PPPDISC, and NETGRAPHDISC.
* This is a partial commit of the patch from PR 14914:phk1999-11-161-2/+2
| | | | | | | | | | | | | Alot of the code in sys/kern directly accesses the *Q_HEAD and *Q_ENTRY structures for list operations. This patch makes all list operations in sys/kern use the queue(3) macros, rather than directly accessing the *Q_{HEAD,ENTRY} structures. This batch of changes compile to the same object files. Reviewed by: phk Submitted by: Jake Burkholder <jake@checker.org> PR: 14914
* sigset_t change (part 2 of 5)marcel1999-09-291-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------- The core of the signalling code has been rewritten to operate on the new sigset_t. No methodological changes have been made. Most references to a sigset_t object are through macros (see signalvar.h) to create a level of abstraction and to provide a basis for further improvements. The NSIG constant has not been changed to reflect the maximum number of signals possible. The reason is that it breaks programs (especially shells) which assume that all signals have a non-null name in sys_signame. See src/bin/sh/trap.c for an example. Instead _SIG_MAXSIG has been introduced to hold the maximum signal possible with the new sigset_t. struct sigprop has been moved from signalvar.h to kern_sig.c because a) it is only used there, and b) access must be done though function sigprop(). The latter because the table doesn't holds properties for all signals, but only for the first NSIG signals. signal.h has been reorganized to make reading easier and to add the new and/or modified structures. The "old" structures are moved to signalvar.h to prevent namespace polution. Especially the coda filesystem suffers from the change, because it contained lines like (p->p_sigmask == SIGIO), which is easy to do for integral types, but not for compound types. NOTE: kdump (and port linux_kdump) must be recompiled. Thanks to Garrett Wollman and Daniel Eischen for pressing the importance of changing sigreturn as well.
* Introduce ttyread() and ttywrite() which do the canonical thing.phk1999-09-281-0/+29
| | | | | | Use them in many tty drivers. Reviewed by: julian, bde
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-0/+8
| | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags
* This patch clears the way for removing a number of tty relatedphk1999-09-251-32/+4
| | | | | | | | | | | | | | | | | | | | | fields in struct cdevsw: d_stop moved to struct tty. d_reset already unused. d_devtotty linkage now provided by dev_t->si_tty. These fields will be removed from struct cdevsw together with d_params and d_maxio Real Soon Now. The changes in this patch consist of: initialize dev->si_tty in *_open() initialize tty->t_stop remove devtotty functions rename ttpoll to ttypoll a few adjustments to these changes in the generic code a bump of __FreeBSD_version add a couple of FreeBSD tags
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Enable ttymalloc().phk1999-08-081-9/+6
|
* Add new sysctl "kern.ttys" which return all the struct tty's which havephk1999-08-081-1/+33
| | | | | | been registered with ttyregister(). register ptys with ttyregister().
* Don't call calcru() on a swapped-out process. calcru() access p_stats, whichdt1999-05-221-8/+11
| | | | is in U-area.
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-081-6/+6
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* Add sufficient braces to keep egcs happy about potentially ambiguouspeter1999-05-061-4/+5
| | | | if/else nesting.
* Suser() simplification:phk1999-04-271-5/+5
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Introduce machine-dependent macro pgtok() to convert page count to numberluoqi1999-02-191-2/+1
| | | | | of kilobytes. Its definition for each architecture could be optimized to avoid potential numerical overflows.
* Hide access to vmspace:vm_pmap with inline function vmspace_pmap(). Thisluoqi1999-02-191-7/+2
| | | | | | | is the preparation step for moving pmap storage out of vmspace proper. Reviewed by: Alan Cox <alc@cs.rice.edu> Matthew Dillion <dillon@apollo.backplane.com>
* Use suser() to check for super user rather than examining cr_uid directly.phk1999-01-301-3/+3
| | | | | | Use TTYDEF_SPEED rather than 9600 a couple of places. Reviewed by: bde, with a few grumbles.
* Fix warnings related to -Wall -Wcast-qualdillon1999-01-281-2/+2
|
* Split DIAGNOSTIC -> DIAGNOSTIC, INVARIANTS, and INVARIANT_SUPPORT aseivind1999-01-081-5/+3
| | | | | | | | | discussed on -hackers. Introduce 'KASSERT(assertion, ("panic message", args))' for simple check + panic. Reviewed by: msmith
* Backed out the FIOASYNC fix in rev.1.108. fcntl(fd, F_SETFL, flags)bde1998-12-081-2/+1
| | | | | | | | depends on the bug. It does an FIOASYNC ioctl to sync the setting of the O_ASYNC "file" flag with drivers even if the setting hasn't changed. PR: 9003
* Move stime declaration to main block, otherwise can left uninitializedache1998-12-071-2/+3
| | | | | in rare cases. Found by: Eivind Eklund <eivind@yes.no>
* Fixed some missing cases in the check for ioctls that involve modification.bde1998-11-221-8/+25
| | | | | | | | | | | | | | | | | | | | | Many (mostly machine-dependent ones) are still missing. NIST-PCTS found this bug for all the ioctls used to implement the POSIX tc* functions (TIOCCBRK, TIOCDRAIN, TIOCSPGRP, TIOCSBRK, TIOCSTART and TIOCSTOP), and I found FIOASYNC, TIOCCONS, TIOCEXCL, TIOCHPCL, TIOCNXCL, TIOCSCTTY and TIOCSDRAINWAIT by inspection. TIOCSPGRP was ifdefed out for some reason. Handle tcsetattr()'s historical speed conversions correctly and more centrally: - don't store speeds of 0 in the final termios struct. Drivers can now depend on tp->t_ispeed and tp->t_ospeed giving the actual speed. Applications can now depend on tcgetattr() being POSIX.1 conformant. - convert from a proposed input speed of 0 to the proposed output speed (except if that is 0, convert to the current output speed). Drivers can now depend on the proposed input speed being nonzero. - don't reject negative speeds. Negative speeds can't happen now that speed_t is unsigned, and rejecting invalid speeds is a bug - tcsetattr() is supposed to succeed if it can "perform any of the requested actions", so it shouldn't fail in practice.
* Installed the second patch attached to kern/7899 with some changes suggestedtruckman1998-11-111-3/+24
| | | | | | | | | | | | | | | | by bde, a few other tweaks to get the patch to apply cleanly again and some improvements to the comments. This change closes some fairly minor security holes associated with F_SETOWN, fixes a few bugs, and removes some limitations that F_SETOWN had on tty devices. For more details, see the description on the PR. Because this patch increases the size of the proc and pgrp structures, it is necessary to re-install the includes and recompile libkvm, the vinum lkm, fstat, gcore, gdb, ipfilter, ps, top, and w. PR: kern/7899 Reviewed by: bde, elvind
* A limit of 200000 for the output buffer high watermark was excessive,bde1998-08-191-11/+3
| | | | | | | | | since (hardware) ttys have too low a bandwidth to benefit significantly from large buffers. Use twice the old limit for the new-default case and 8 times the old limit for the driver-specifies-watermark case. Nothing uses these cases yet. Removed related debugging code.
* Fixed printf format errors.bde1998-07-111-7/+7
|
* This commit fixes various 64bit portability problems required fordfr1998-06-071-2/+3
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Fixed stale references to hzto() in comments.bde1998-05-171-3/+3
|
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* Set the input and output buffer sizes and the input buffer watermarksbde1998-03-071-39/+71
| | | | | | | dynamically depending on the line speed(s). This should give the old sizes and watermarks until drivers are changed. Display the input watermarks in pstat and sicontrol.
* Make COMPAT_43 and COMPAT_SUNOS new-style options.eivind1997-12-161-1/+2
|
* Use ENOIOCTL instead of -1 (= ERESTART) for tty ioctls that arebde1997-12-061-2/+2
| | | | | not handled at a particular level. This fixes mainly restarting of interrupted TIOCDRAINs and TIOCSETA{W,F}s.
* Remove a bunch of variables which were unused both in GENERIC and LINT.phk1997-11-071-2/+1
| | | | Found by: -Wunused
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-1/+3
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Extend to use poll backend. If memory serves correctly, most of this waspeter1997-09-141-22/+22
| | | | | | | adapted from NetBSD.. However, there are some differences in the tty system that are big enough to cause their code to not fit comfortably. Obtained from: NetBSD (I think)
* Removed unused #includes.bde1997-09-021-5/+1
|
* Don't include <sys/ioctl.h> in the kernel. Stage 5: includebde1997-03-241-2/+5
| | | | | | <sys/ioctl_compat.h> and sometimes <sys/filio.h> instead of <sys/ioctl.h> in tty-related files. <sys/ttycom.h> is still usually imported bogusly via <sys/termios.h>.
* Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.bde1997-03-231-2/+2
| | | | | Fixed everything that depended on getting fcntl.h stuff from the wrong place. Most things don't depend on file.h stuff at all.
* Fixed some invalid (non-atomic) accesses to `time', mostly ones of thebde1997-03-221-7/+3
| | | | | | form `tv = time'. Use a new function gettime(). The current version just forces atomicicity without fixing precision or efficiency bugs. Simplified some related valid accesses by using the central function.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-1/+1
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
OpenPOWER on IntegriCloud