#
33da4e5b |
| 15-Oct-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Make pty's always come up in echo mode.
|
#
fffc5515 |
| 14-Oct-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Add missing chunk of code to enforce the lock-bits of termios.
This solves the problem where serial consoles suddenly required DCD to be asserted.
Reported by: Randy Bush <randy@psg.com>
|
#
43c72732 |
| 12-Oct-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Don't call driver close unless we have one.
|
#
78c85e8d |
| 05-Oct-2004 |
John Baldwin <jhb@FreeBSD.org> |
Rework how we store process times in the kernel such that we always store the raw values including for child process statistics and only compute the system and user timevals on demand.
- Fix the var
Rework how we store process times in the kernel such that we always store the raw values including for child process statistics and only compute the system and user timevals on demand.
- Fix the various kern_wait() syscall wrappers to only pass in a rusage pointer if they are going to use the result. - Add a kern_getrusage() function for the ABI syscalls to use so that they don't have to play stackgap games to call getrusage(). - Fix the svr4_sys_times() syscall to just call calcru() to calculate the times it needs rather than calling getrusage() twice with associated stackgap, etc. - Add a new rusage_ext structure to store raw time stats such as tick counts for user, system, and interrupt time as well as a bintime of the total runtime. A new p_rux field in struct proc replaces the same inline fields from struct proc (i.e. p_[isu]ticks, p_[isu]u, and p_runtime). A new p_crux field in struct proc contains the "raw" child time usage statistics. ruadd() has been changed to handle adding the associated rusage_ext structures as well as the values in rusage. Effectively, the values in rusage_ext replace the ru_utime and ru_stime values in struct rusage. These two fields in struct rusage are no longer used in the kernel. - calcru() has been split into a static worker function calcru1() that calculates appropriate timevals for user and system time as well as updating the rux_[isu]u fields of a passed in rusage_ext structure. calcru() uses a copy of the process' p_rux structure to compute the timevals after updating the runtime appropriately if any of the threads in that process are currently executing. It also now only locks sched_lock internally while doing the rux_runtime fixup. calcru() now only requires the caller to hold the proc lock and calcru1() only requires the proc lock internally. calcru() also no longer allows callers to ask for an interrupt timeval since none of them actually did. - calcru() now correctly handles threads executing on other CPUs. - A new calccru() function computes the child system and user timevals by calling calcru1() on p_crux. Note that this means that any code that wants child times must now call this function rather than reading from p_cru directly. This function also requires the proc lock. - This finishes the locking for rusage and friends so some of the Giant locks in exit1() and kern_wait() are now gone. - The locking in ttyinfo() has been tweaked so that a shared lock of the proctree lock is used to protect the process group rather than the process group lock. By holding this lock until the end of the function we now ensure that the process/thread that we pick to dump info about will no longer vanish while we are trying to output its info to the console.
Submitted by: bde (mostly) MFC after: 1 month
show more ...
|
#
0cd3cb9a |
| 30-Sep-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Assign a global unit number for the tty slave devices (init/lock) using the new subr_unit.c code.
For now assert Giant in ttycreate() and ttyfree(). It is not obvious that it will ever pay off to l
Assign a global unit number for the tty slave devices (init/lock) using the new subr_unit.c code.
For now assert Giant in ttycreate() and ttyfree(). It is not obvious that it will ever pay off to lock these with anything else.
show more ...
|
#
cf287576 |
| 28-Sep-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Add functions to create and free the "tty-ness" of a serial port in a generic way. This code will allow a similar amount of code to be removed from most if not all serial port drivers.
Add generic
Add functions to create and free the "tty-ness" of a serial port in a generic way. This code will allow a similar amount of code to be removed from most if not all serial port drivers.
Add generic cdevsw for tty devices.
Add generic slave cdevsw for init/lock devices.
Add ttypurge function which wakes up all know generic sleep points in the tty code, and calls into the hw-driver if it provides a method.
Add ttycreate function which creates tty device and optionally cua device. In both cases .init/.lock devices are created as well.
Change ttygone() slightly to also call the hw driver provided purge routine.
Add ttyfree() which will purge and destroy the cdevs.
Add ttyconsole mode for setting console friendly termios on a port.
show more ...
|
#
6f077de5 |
| 24-Sep-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Hold threadcount while throbbing cdevsw in our underlying driver.
This is a bit heavyhanded, and will be simplified once the tty code learns to properly deal with disappearing hw and drivers.
|
#
9e16d666 |
| 18-Sep-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Initialize new ttys a bit more.
Check TS_GONE flag for gone-ness.
|
#
e8d3e080 |
| 17-Sep-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Add ttyopen and ttyclose functions which will do the right stuff for most if not all of our tty drivers in the future.
Centralizing this stuff enables us to remove about 100 lines of almost but not
Add ttyopen and ttyclose functions which will do the right stuff for most if not all of our tty drivers in the future.
Centralizing this stuff enables us to remove about 100 lines of almost but not quite perfectly copy&paste code from each tty driver.
show more ...
|
#
3e6bf9fb |
| 17-Sep-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Add ttyalloc() which in due time will be the successor to ttymalloc(), but without the "struct tty *" argument.
|
#
ad3b9257 |
| 15-Aug-2004 |
John-Mark Gurney <jmg@FreeBSD.org> |
Add locking to the kqueue subsystem. This also makes the kqueue subsystem a more complete subsystem, and removes the knowlege of how things are implemented from the drivers. Include locking around
Add locking to the kqueue subsystem. This also makes the kqueue subsystem a more complete subsystem, and removes the knowlege of how things are implemented from the drivers. Include locking around filter ops, so a module like aio will know when not to be unloaded if there are outstanding knotes using it's filter ops.
Currently, it uses the MTX_DUPOK even though it is not always safe to aquire duplicate locks. Witness currently doesn't support the ability to discover if a dup lock is ok (in some cases).
Reviewed by: green, rwatson (both earlier versions)
show more ...
|
#
672c05d4 |
| 15-Jul-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Preparation commit for the tty cleanups that will follow in the near future:
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 near 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.
show more ...
|
#
911dbd84 |
| 11-Jul-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Introduce ttygone() which indicates that the hardware is detached.
Move dtrwait logic to the generic TTY level.
|
#
cb9ea5f4 |
| 26-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Pick the hotchar out of the tty structure instead of caching private copies.
No current line disciplines have a dynamically changing hotchar, and expecting to receive anything sensible during a chan
Pick the hotchar out of the tty structure instead of caching private copies.
No current line disciplines have a dynamically changing hotchar, and expecting to receive anything sensible during a change in ldisc is insane so no locking of the hotchar field is necessary.
show more ...
|
#
4776c074 |
| 26-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Fix line discipline switching issues: If opening a new ldisc fails, we have to revert to TTYDISC which we know will successfully open rather than try the previous ldisc which might also fail to open.
Fix line discipline switching issues: If opening a new ldisc fails, we have to revert to TTYDISC which we know will successfully open rather than try the previous ldisc which might also fail to open.
Do not let ldisc implementations muck about with ->t_line, and remove code which checks for reopens, it should never happen.
Move ldisc->l_hotchar to tty->t_hotchar and have ldisc implementation initialize it in their open routines. Reset to zero when we enter TTYDISC. ("no" should really be -1 since zero could be a valid hotchar for certain old european mainframe protocols.)
show more ...
|
#
e77b206f |
| 25-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Add two new methods to struct tty: One for manipulating BREAK condition and one for fiddling modem-control signals.
Add generic code to deal with the relevant ioctls if these methods are present.
|
#
075ef102 |
| 24-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
#include <sys/serial.h>
|
#
98de21b6 |
| 24-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Use CTASSERT to enforce the relationship between the new serial port modem definitions and the old definitions from ioctls.
|
#
ec66f15d |
| 22-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES.
|
#
89c9c53d |
| 16-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Do the dreaded s/dev_t/struct cdev */ Bump __FreeBSD_version accordingly.
|
#
1930e303 |
| 11-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Deorbit COMPAT_SUNOS.
We inherited this from the sparc32 port of BSD4.4-Lite1. We have neither a sparc32 port nor a SunOS4.x compatibility desire these days.
|
#
2195e420 |
| 09-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Reference count struct tty.
Add two new functions: ttyref() and ttyrel(). ttymalloc() creates a struct tty with a reference count of one. when ttyrel sees the count go to zero, struct tty is freed
Reference count struct tty.
Add two new functions: ttyref() and ttyrel(). ttymalloc() creates a struct tty with a reference count of one. when ttyrel sees the count go to zero, struct tty is freed.
Hold references for open ttys and for ttys which are controlling terminal for sessions.
Until drivers start using ttyrel(), this commit will make no difference.
show more ...
|
#
5df76176 |
| 07-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Make linesw[] an array of pointers to linedesc instead of an array of linedisc.
|
#
13e84a71 |
| 04-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Centralize the line discipline optimization determination in a function called ttyldoptim().
Use this function from all the relevant drivers.
I belive no drivers finger linesw[] directly anymore, p
Centralize the line discipline optimization determination in a function called ttyldoptim().
Use this function from all the relevant drivers.
I belive no drivers finger linesw[] directly anymore, paving the way for locking and refcounting.
show more ...
|
#
fe3ec622 |
| 04-Jun-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Manual edits to change linesw[]-frobbing to ttyld_*() calls.
|