summaryrefslogtreecommitdiff
path: root/sys/kern/tty_subr.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename `tty_subr.c' to `subr_clist.c'.Ed Schouten2008-05-271-699/+0
| | | | | | | | | | | | | | | Because clists are also used outside the TTY layer, rename the file containing the clist routines to something more accurate. The mpsafetty TTY layer doesn't use clists. It uses its own buffers, which also implement the unbuffered copying to userspace. We cannot simply remove the clist routines then, because this would break various drivers that are present within the kernel. Approved by: philip (mentor) Notes: svn path=/head/; revision=179353
* Move TTY unrelated bits out of <sys/tty.h>.Ed Schouten2008-05-231-3/+5
| | | | | | | | | | | | | | | | | | | For some reason, the <sys/tty.h> header file also contains routines of the clists and console that are used inside the TTY layer. Because the clists are not only used by the TTY layer (example: various input drivers), we'd better move the entire clist programming interface into <sys/clist.h>. Also remove a declaration of nonexistent variable. The <sys/tty.h> header also contains various definitions for the console code (tty_cons.c). Also move these to <sys/cons.h>, because they are not implemented inside the TTY layer. While there, create separate malloc pools for the clist and console code. Approved by: philip (mentor) Notes: svn path=/head/; revision=179246
* In keeping with style(9)'s recommendations on macros, use a ';'Robert Watson2008-03-161-1/+1
| | | | | | | | | | | | after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr. MFC after: 1 month Discussed with: imp, rink Notes: svn path=/head/; revision=177253
* /* -> /*- for copyright notices, minor format tweaks as necessaryWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139804
* Preparation commit for the tty cleanups that will follow in the nearPoul-Henning Kamp2004-07-151-2/+2
| | | | | | | | | | | | future: rename ttyopen() -> tty_open() and ttyclose() -> tty_close(). We need the ttyopen() and ttyclose() for the new generic cdevsw functions for tty devices in order to have consistent naming. Notes: svn path=/head/; revision=132226
* Revert stuff which accidentally ended up in the previous commit.Poul-Henning Kamp2003-07-221-1/+1
| | | | Notes: svn path=/head/; revision=117879
* Don't attempt to inline large functions mb_alloc() and mb_free(),Poul-Henning Kamp2003-07-221-1/+1
| | | | | | | | | it more than doubles the text size of this file. GCC has wisely ignored us on this previously Notes: svn path=/head/; revision=117878
* Use __FBSDID().David E. O'Brien2003-06-111-2/+3
| | | | Notes: svn path=/head/; revision=116182
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-2/+2
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-2/+2
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-1/+1
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* Remove __P.Alfred Perlstein2002-03-191-5/+5
| | | | Notes: svn path=/head/; revision=92723
* Make cblock_alloc_cblocks() spell its own nameYaroslav Tykhiy2001-03-271-1/+1
| | | | | | | | | correctly in its warning message. PR: kern/7693 Notes: svn path=/head/; revision=74846
* Fix typo: seperate -> separate.Jeroen Ruigrok van der Werven2001-02-061-1/+1
| | | | | | | Seperate does not exist in the english language. Notes: svn path=/head/; revision=72091
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Quiet warnings on an Alpha. CBSIZE has long type and causes the otherPeter Wemm1999-07-011-3/+5
| | | | | | | ints to promote to long. Notes: svn path=/head/; revision=48408
* Cast pointers to uintptr_t/intptr_t instead of to u_long/long,Bruce Evans1998-07-151-13/+13
| | | | | | | | | | respectively. Most of the longs should probably have been u_longs, but this changes is just to prevent warnings about casts between pointers and integers of different sizes, not to fix poorly chosen types. Notes: svn path=/head/; revision=37649
* Support compiling with `gcc -ansi'.Bruce Evans1998-04-151-3/+3
| | | | Notes: svn path=/head/; revision=35210
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.Poul-Henning Kamp1997-10-121-2/+2
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=30354
* Don't include <sys/ioctl.h> in the kernel. Stage 1: don't includeBruce Evans1997-03-241-2/+1
| | | | | | | | it when it is not used. In most cases, the reasons for including it went away when the special ioctl headers became self-sufficient. Notes: svn path=/head/; revision=24203
* Try a no-wait malloc first in clist_alloc_cblocks(). If this fails, thenBruce Evans1997-03-051-2/+7
| | | | | | | | | complain and blunder on. Should be in 2.2, preferably with a better fix. Notes: svn path=/head/; revision=23411
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Attached simple external ddb commands `show rtc', `show pgrpdump'Bruce Evans1996-09-141-5/+4
| | | | | | | | and `show cbstat'. The pgrpdump code was previously controlled by `#ifdef DEBUG'. Notes: svn path=/head/; revision=18297
* Killed sections 3 and 4 of my copyright as I don't agree with it (I believeDavid Greenman1996-04-081-7/+25
| | | | | | | | it to be unnecessarily restrictive). For tty_subr.c, update to my standard copyright. Notes: svn path=/head/; revision=15129
* Convert DDB to new-style option.Garrett Wollman1996-01-041-1/+2
| | | | Notes: svn path=/head/; revision=13228
* Fixed staticization of DDB functions.Bruce Evans1995-12-141-2/+2
| | | | Notes: svn path=/head/; revision=12844
* A Major staticize sweep. Generates a couple of warnings that I'll dealPoul-Henning Kamp1995-12-141-4/+4
| | | | | | | | | with later. A number of unused vars removed. A number of unused procs removed or #ifdefed. Notes: svn path=/head/; revision=12819
* Put cbstat() under #ifdef DDBPoul-Henning Kamp1995-11-201-4/+3
| | | | Notes: svn path=/head/; revision=12422
* Make putc and b_to_q deal with clists with no reserved blocks in a morePeter Wemm1995-11-021-13/+5
| | | | | | | | | | | | civilised manner than panicing. This only happens as a result of another state botch somewhere else, eg: from a tty driver calling putc or b_to_q on a closed device. Apparently, it's also been implicated in a panic with a status (^T) event on ptys. This change should pretty well be in it's final form now. Notes: svn path=/head/; revision=12007
* Clean up the previous commit I did on this file.Peter Wemm1995-11-011-5/+9
| | | | | | | | The Jury has not reached a verdict yet on this approach - a better fix may be thought of, but for now this works. Notes: svn path=/head/; revision=12000
* Make a putc()/b_to_q() to a clist that hasn't had cblocks reservedPeter Wemm1995-10-311-5/+15
| | | | | | | | | | | | | | non-fatal. I've make it return an appropriate error to the caller instead of panic()ing. Handling an error condition is inherently more friendly than exploding the kernel.. :-) The new behavior is a little closer to traditional clists, potentially making porting a little simpler. Suggested by: bde (many months ago, I've been using this for a while..) Notes: svn path=/head/; revision=11962
* Fix clist limits. They were usually one too low. E.g., for a limit ofBruce Evans1995-10-251-7/+15
| | | | | | | | | | | | | | | | | | | TTYHOG = 1024 bytes, 10 cblocks were reserved. This was thought to provide 10 * CBSIZE = 1080 bytes of buffering, but if the head pointer is at the end of a cblock, then it only provides 1 + 9 * CBSIZE = 973 bytes of buffering. This caused serious data loss for ptys because the flow control is deterministic and requires at least TTYHOG bytes of buffering. For ttys, if input flow control is used then there is usually enough slop in the high watermark to avoid problems, and if input flow control isn't used then a limit of 973 is not much different from a limit of 1024. Add prototypes. Continue cleaning up new init stuff. Notes: svn path=/head/; revision=11788
* Fixed init functions argument type - caddr_t -> void *. Fixed a couple ofDavid Greenman1995-09-091-4/+4
| | | | | | | compiler warnings. Notes: svn path=/head/; revision=10653
* Reviewed by: julian with quick glances by bruce and othersJulian Elischer1995-08-281-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: terry (terry lambert) This is a composite of 3 patch sets submitted by terry. they are: New low-level init code that supports loadbal modules better some cleanups in the namei code to help terry in 16-bit character support some changes to the mount-root code to make it a little more modular.. NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able to test those cases.. certainly mounting root of disk still works just fine.. mfs should work but is untested. (tomorrows task) The low level init stuff includes a total rewrite of init_main.c to make it possible for new modules to have an init phase by simply adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can be added to the kernel without editing any other files other than the 'files' file. Notes: svn path=/head/; revision=10358
* Optimize the zeroing of quotes. b_to_q() was always taking about 20% ofBruce Evans1995-07-111-32/+46
| | | | | | | | its time zeroing quotes although quotes are not very common. E.g., there are never any quotes in output queues. Notes: svn path=/head/; revision=9486
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-3/+3
| | | | Notes: svn path=/head/; revision=8876
* Fix cblock starvation bugs by reserving enough cblocks for minimalBruce Evans1994-11-261-64/+127
| | | | | | | | | | | | operation of each clist. Limit the growth of each clist. Clists can only grow larger than the reserved minimum if there are free cblocks in a shared pool. The size of this pool is now fixed (this could be improved). The reserved and maximum sizes are more carefully allocated for slip and ppp, depending on the mtu. A maximum MTU of 16384 is now enforced for ppp. Notes: svn path=/head/; revision=4825
* Don't attempt to free null cblocks. There may be less to free thanBruce Evans1994-10-301-1/+3
| | | | | | | | normal due to cblock resource starvation or malloc() failing when the device is opened. Notes: svn path=/head/; revision=4010
* While in the real world, I had a bad case of being swapped out for a lot ofPoul-Henning Kamp1994-09-251-3/+3
| | | | | | | | | | | cycles. While waiting there I added a lot of the extra ()'s I have, (I have never used LISP to any extent). So I compiled the kernel with -Wall and shut up a lot of "suggest you add ()'s", removed a bunch of unused var's and added a couple of declarations here and there. Having a lap-top is highly recommended. My kernel still runs, yell at me if you kernel breaks. Notes: svn path=/head/; revision=3098
* Removed prototype for cblock_alloc_cblocks (and moved it into tty.h).David Greenman1994-09-131-3/+1
| | | | Notes: svn path=/head/; revision=2733
* Added $Id$David Greenman1994-08-021-0/+5
| | | | Notes: svn path=/head/; revision=1817
* Don't panic if we can't malloc a cblock...just print a console messageDavid Greenman1994-05-291-2/+4
| | | | | | | and be happy. Notes: svn path=/head/; revision=1624
* Completed version of my clist management code. Requires hooks in tty.cDavid Greenman1994-05-271-71/+249
| | | | | | | | for adding and removing cblocks from the cfreelist queue (to give them back to malloc). I'll add those tomorrow. Notes: svn path=/head/; revision=1588
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.Rodney W. Grimes1994-05-251-100/+328
| | | | | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman Notes: svn path=/head/; revision=1549
* BSD 4.4 Lite Kernel SourcesRodney W. Grimes1994-05-241-0/+159
Notes: svn path=/head/; revision=1541