summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
Commit message (Collapse)AuthorAgeFilesLines
* utime/stime.tv_sec are elapsed times, not relative to 1970. We canpeter2001-11-171-4/+4
| | | | | safely print them as longs. Even if ^T overflows after a process has accumulated 68 years of user or system time, it is no big deal.
* You cannot cast a time_t to quad_t and printf it with %lld. quad_t ispeter2001-11-161-2/+2
| | | | 64 bits, not long long.
* o Move suser() calls in kern/ to using suser_xxx() with an explicitrwatson2001-11-011-4/+4
| | | | | | | | | credential selection, rather than reference via a thread or process pointer. This is part of a gradual migration to suser() accepting a struct ucred instead of a struct proc, simplifying the reference and locking semantics of suser(). Obtained from: TrustedBSD Project
* Make ttyprintf() of tv_sec value type agnostic.dillon2001-10-291-4/+4
|
* KSE Milestone 2julian2001-09-121-8/+19
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Fix a warning on alpha (real problem) and make pstat -t work as a bonus.peter2001-09-101-1/+1
| | | | | | 'struct tty' was out of sync in user and kernel due to dev_t/udev_t mixups. This takes advantage of the fact that dev_t changes type in userland, so it isn't too pretty.
* Export the tk_nin and tk_nout variables (number of tty input/outputtmm2001-08-041-0/+4
| | | | characters) as sysctls (kern.tty_nin and kern.tty_nout).
* Unifdef DEV_SNP; snp(4) no longer requires these ugly hacks.dd2001-05-221-27/+0
| | | | Silence by: -hackers, -audit
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-1/+2
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Grab the process lock while calling psignal and before calling psignal.jhb2001-03-071-2/+8
|
* implement OCRNL, ONOCR, and ONLRETassar2001-03-041-1/+11
| | | | Obtained from: NetBSD
* Fix tab breakage from last commit.jlemon2001-02-171-2/+2
| | | | Spotted by: bde
* Extend kqueue down to the device layer.jlemon2001-02-151-0/+89
| | | | Backwards compatible approach suggested by: peter
* Change and clean the mutex lock interface.bmilekic2001-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* Turn '#if NSNP > 0' into an option.peter2001-01-291-6/+6
|
* - Catch up to proc flag changes.jhb2001-01-241-2/+3
| | | | - Assert sched_lock is held in proc_compare.
* - All of proc_compare needs sched_lock, so hold it for the for loop thatjhb2001-01-201-40/+20
| | | | | | | | | | calls it rather than obtaining and releasing it a lot in proc_compare. - Collect all of the data gathering and stick it just after the proc_compare loop. This way, we only have to grab sched_lock once now when handling SIGINFO. All the printf's are done after the values are calculated. Submitted mostly by: bde
* Be more careful with sched_lock in the SIGINFO handler. Specifically, dojhb2001-01-201-10/+21
| | | | | | | | not hold sched_lock while calling ttyprintf(). If we are on a serial console, then ttyprintf() will end up getting the sio lock, resulting in a lock order violation. Noticed by: des
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-2/+1
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Protect p_stat with sched_lock.jhb2000-12-021-0/+12
|
* Kernel support for erase2 character.jkh2000-11-281-3/+12
| | | | Submitted by: Rui Pedro Mendes Salgueiro <rps@mat.uc.pt>
* 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
OpenPOWER on IntegriCloud