summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/cy.c
Commit message (Collapse)AuthorAgeFilesLines
* Extend kqueue down to the device layer.jlemon2001-02-151-2/+3
| | | | Backwards compatible approach suggested by: peter
* RIP <machine/lock.h>.markm2001-02-111-1/+21
| | | | | | | Some things needed bits of <i386/include/lock.h> - cy.c now has its own (only) copy of the COM_(UN)LOCK() macros, and IMASK_(UN)LOCK() has been moved to <i386/include/apic.h> (AKA <machine/apic.h>). Reviewed by: jhb
* Revert the spin mutex for the cy(4) driver.jhb2001-02-091-69/+152
| | | | Requested by: bde
* - Use a spin mutex instead of COM_LOCK, since COM_LOCK is going away.jhb2001-02-091-165/+83
| | | | | | The same name from the sio(4) driver was used and an appropriate dictionary item added at the top to reduce diffs. - Catch up to the new swi API.
* Added used include of <sys/mutex.h>. The SMP case was broken bybde2001-01-301-0/+1
| | | | | | incompletely converting simplelocks to mutexes (COM_LOCK() is supposed to hide the SMP locking internals, but it now depends on mutex interfaces being visible).
* 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>
* Move suser() and suser_xxx() prototypes and a related #define fromphk2000-10-291-1/+0
| | | | | | | | | <sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>.
* - Catch up to new software interrupt code.jhb2000-10-251-3/+3
| | | | | | - Add a missing curly brace. Noticed by: phk
* - Overhaul the software interrupt code to use interrupt threads for eachjhb2000-10-251-15/+16
| | | | | | | | | | | | | | | | | | | type of software interrupt. Roughly, what used to be a bit in spending now maps to a swi thread. Each thread can have multiple handlers, just like a hardware interrupt thread. - Instead of using a bitmask of pending interrupts, we schedule the specific software interrupt thread to run, so spending, NSWI, and the shandlers array are no longer needed. We can now have an arbitrary number of software interrupt threads. When you register a software interrupt thread via sinthand_add(), you get back a struct intrhand that you pass to sched_swi() when you wish to schedule your swi thread to run. - Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit more intuitive. Also, prefix all the members of struct intrhand with 'ih_'. - Make swi_net() a MI function since there is now no point in it being MD. Submitted by: cp
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Don't depend on <machine/cpufunc.h> unnecessarily including <machine/lock.h>.bde2000-10-121-2/+0
|
* Use schedsofttty() again (SMPng casualty with intentionally wrong fixbde2000-10-081-5/+1
| | | | | | | in rev.1.101). Made this file compile again after move of stuff from <machine.ipl.h> to <sys/ipl.h>.
* Make LINT link.phk2000-09-161-0/+4
| | | | cy driver is broken post SMPng.
* Make LINT compile.phk2000-09-161-1/+1
|
* Major update to the way synchronization is done in the kernel. Highlightsjasone2000-09-071-53/+144
| | | | | | | | | | | | | | | 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
* Mass update of isa drivers using compatability shims to usepeter2000-05-281-1/+10
| | | | COMPAT_ISA_DRIVER() so that we can get rid of the evil isa_compat.h table.
* Clean up some more loose ends..peter2000-01-231-1/+1
| | | | | | | | isa_device->id_ri_flags and RI_FAST were not implemented and did nothing. The two drivers that were mistakenly thinking this was working were cy.c and loran.c - these should be converted to newbus. GC (garbage collect) isa_device->id_alive GC userconfig.c references to isa_device->id_scsiid (!).
* Introduce ttyread() and ttywrite() which do the canonical thing.phk1999-09-281-19/+1
| | | | | | Use them in many tty drivers. Reviewed by: julian, bde
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-5/+0
| | | | | | | | 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-26/+10
| | | | | | | | | | | | | | | | | | | | | 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
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-29/+7
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* Really fix cy-driver-related panics when SMP is configured. Rev.1.88 onlybde1999-06-041-3/+5
| | | | | | fixed half the problem. Tested by: Michael Scott Boers <mboers@datacompusa.com>
* Simplify cdevsw registration.phk1999-05-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* This commit should be a extensive NO-OP:phk1999-05-301-7/+21
| | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
* Don't call disable_intr() when interrupts are already disabled, sincebde1999-05-281-3/+6
| | | | | | | disable_intr() does non-recursive locking in the SMP case. This should fix cy-driver-related panics when SMP is configured. Broken in: rev.1.73 (3.1 and -current)
* Suser() simplification:phk1999-04-271-4/+4
| | | | | | | | | | | | | | | | | | | 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.
* YAMFsio.c (1.227-1.228: set up input buffering dynamically).bde1999-02-041-116/+189
|
* Use suser() to check for super user rather than examining cr_uid directly.phk1999-01-301-2/+3
| | | | | | Use TTYDEF_SPEED rather than 9600 a couple of places. Reviewed by: bde, with a few grumbles.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-281-27/+27
| | | | kernel compile
* Unspammed includes in <machine/cpufunc.h> in the !SMP case. Partiallybde1999-01-081-1/+4
| | | | unspammed them in the SMP case.
* Flush the fifos at the correct place in cyopen(). Various thingsbde1998-12-241-31/+17
| | | | | | | | | | | in cyopen() were done in a different order than in sioopen(), partly to (ab)use a side effect of comparam() and partly because I didn't understand what the reset was doing (it flushes the fifos). This turned out to be more than a cosmetic problem. Flushing the fifos quite late is good for discarding input that arrived while the line state was being initialized, and in the cy driver it also seems to reduce a problem with input that arrived long ago during the previous close (the UART loses sync too easily and for too long).
* Wait for channel commands to complete after issuing the commands.bde1998-12-191-15/+29
| | | | | | | | | | The optimisation of only waiting before issuing new commands is obviously invalid in general and it caused many errors in NIST-PCTS. I think the errors were mostly for characters sent with the wrong parity, etc., after a half complete tcsetattr(). Use microtime() instead of a magic loop count to limit the wait. The wait is a busy-wait :-( and normally takes about 500 usec.
* Flush the tx fifo in cystop(). Now ttyflush() (and thus tcflush(3))bde1998-12-171-3/+4
| | | | | | | | | | almost works properly. Unfortunately, there is no way to flush the rx fifo without resetting the channel, which also flushes the tx fifo. We avoid resetting even when both fifos need to be flushed, since resetting seems to cause the rx to lose sync if it is done while data is arriving. Reminded by: NIST-PCTS
* Fixed handling of BREAK in input. BREAK was not being converted into anbde1998-12-171-3/+7
| | | | | | escape sequence in the `-ignbrk -brkint parmrk' case. Found by: NIST-PCTS
* Oops, this should have been in the previous commit (ensure atomic updatebde1998-12-171-1/+3
| | | | of com->cor[1]).
* Implemented sending of BREAKs. This is quite complicated because thebde1998-12-171-14/+165
| | | | | | | | hardware is interrupt-driven to a fault and sending a BREAK requires mode switching. Always running in the BREAK-capable mode as in PR 8318 would double the overhead for sending \0's. Reminded by: PR 8318
* Fixed sloppy clearing of TS_BUSY. Don't clear it until the transmitterbde1998-11-281-12/+71
| | | | | | | | | is completely empty. There is an interrupt for output completion. It is painful to use, but polling method used in the corresponding fix in sio.c (rev.1.152) can't be used because there is no status bit for transmitter-empty. Now ttywait() works right. Reminded by: NIST-PCTS
* Merge from sio.c rev.1.163:bde1998-11-281-2/+2
| | | | | | | Don't call timeout() for DTR wakeup if the relevant timeout is already active. This fixes "timeout table full" panics when sufficiently many cyopen()s are interrupted while they are sleeping waiting for the timeout to expire.
* Untangled the Cyclades offsets a little. CY16_RESET and CY_CLEAR_INTRbde1998-11-231-8/+8
| | | | | | | | | were half of their physical offsets for ISA and 1/4 of their physical offsets for PCI, while all other Cyclades offsets were physical/1 for ISA and physical/2 for PCI. Logically wrong macros were used to scale CY16_RESET and CY_CLEAR_INTR to the correct physical offsets. Fixed some style bugs (mostly long lines).
* Reduce i/o overheads by not preserving the channel access register inbde1998-11-221-113/+130
| | | | | | | interrupt handlers. Instead, load and use it atomically as necessary. This reduces mode switching overhead for "polled" mode interrupt handling from 5 i/o's to 3 (per service type, per port) so that polled mode is only slightly more inefficient than "interrupt" mode.
* Initialize isa_devtab entries for interrupt handlers in individualbde1998-10-221-1/+3
| | | | | | | device drivers, not in ioconf.c. Use a different hack in isa_device.h so that a new config(8) is not required yet. pc98 parts approved by: kato
* Added D_TTY to the cdevswitch flags for all tty drivers. This is requiredbde1998-08-231-4/+5
| | | | | | | | | for the Lite2 fix for always returning EIO in dead_read(). Cleaned up the cdevswitch initializers for all tty drivers. Removed explicit calls to ttsetwater() from all (tty) drivers. ttsetwater() is now called centrally for opens, not just for parameter changes.
* Fixed devfs initialization which I broke in the previous commit.bde1998-08-201-10/+10
| | | | Fixed an old name and disorder in the sio dictionary.
* Enabled dynamically sized tty input buffers (with enough bufferingbde1998-08-191-9/+10
| | | | | | | | | | | | for 1 second's worth of input) and larger tty output buffers. The interrupt-level buffers are still too small for speeds above 115200 bps (only a little too small for 230400 bps if RTS flow control is enabled). Don't call ttsetwater() explicitly in open(). It is now called for the TTYDISC l_open() and should be static. Don't attempt to register the cdevsw more than once.
* Cleaned up previous commit, mainly by moving repetitive calculationsbde1998-08-131-113/+62
| | | | | | | | | of invariants to cyattach(). Fixed minor bugs: - cyparam() returned without restoring the ipl in the error cases. This was harmless because cyparam() is always called at spltty(). - one check for "rev. J or higher" actually checked for precisely rev. J.
* Updated for not-so-new version of Cyclom-Y boards (with 60MHz clock andbde1998-08-131-39/+119
| | | | | | | swapped RTS/DTR). Merge the vendor's modification of the 2.2.6-release version into -current for reference. Will be cleaned up in next commit. Obtained from: ftp://ftp.cyclades.com/pub/cyclades/cyclom-y/freebsd/2.2.6/cyy226.tar.gz
* Register tty software interrupt handlers at run time using register_swi()bde1998-08-111-15/+11
| | | | | | | instead of at compile time using ifdefs. Use _swi_null instead of dummycamisr. CAM and dpt should call register_swi() instead of hacking on ihandlers[] directly.
* Fixed sign extension bugs awoken by changing speed_t to an unsignedbde1998-07-291-2/+4
| | | | | | | type. 19200, 1200 and other relatively uninteresting speeds were broken. Submitted by: Rob Mallory <rmallory@qualcomm.com>
* Changed %n to %r in devfs name format strings. %n has almost gone away.bde1998-07-151-7/+7
|
OpenPOWER on IntegriCloud