summaryrefslogtreecommitdiffstats
path: root/sys/dev/sio
Commit message (Collapse)AuthorAgeFilesLines
* - Use bus_setup_intr() and bus_teardown_intr() to register device driverjhb2006-02-221-2/+2
| | | | | | | | | | interrupt handlers rather than BUS_SETUP_INTR() and BUS_TEARDOWN_INTR(). Uses of the BUS_*() versions in the implementation of foo_intr methods in bus drivers were not changed. Mostly this just means that some drivers might start printing diagnostic messages like [FAST] when appropriate as well as honoring mpsafenet=0. - Fix two more of the ppbus drivers' identify routines to function correctly in the mythical case of a machine with more than one ppbus.
* Use __DEVOLATILE to cast conspeed.imp2005-12-071-1/+1
|
* Reorganize the interrupt handling code a bit to make a few things cleanerjhb2005-10-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and increase flexibility to allow various different approaches to be tried in the future. - Split struct ithd up into two pieces. struct intr_event holds the list of interrupt handlers associated with interrupt sources. struct intr_thread contains the data relative to an interrupt thread. Currently we still provide a 1:1 relationship of events to threads with the exception that events only have an associated thread if there is at least one threaded interrupt handler attached to the event. This means that on x86 we no longer have 4 bazillion interrupt threads with no handlers. It also means that interrupt events with only INTR_FAST handlers no longer have an associated thread either. - Renamed struct intrhand to struct intr_handler to follow the struct intr_foo naming convention. This did require renaming the powerpc MD struct intr_handler to struct ppc_intr_handler. - INTR_FAST no longer implies INTR_EXCL on all architectures except for powerpc. This means that multiple INTR_FAST handlers can attach to the same interrupt and that INTR_FAST and non-INTR_FAST handlers can attach to the same interrupt. Sharing INTR_FAST handlers may not always be desirable, but having sio(4) and uhci(4) fight over an IRQ isn't fun either. Drivers can always still use INTR_EXCL to ask for an interrupt exclusively. The way this sharing works is that when an interrupt comes in, all the INTR_FAST handlers are executed first, and if any threaded handlers exist, the interrupt thread is scheduled afterwards. This type of layout also makes it possible to investigate using interrupt filters ala OS X where the filter determines whether or not its companion threaded handler should run. - Aside from the INTR_FAST changes above, the impact on MD interrupt code is mostly just 's/ithread/intr_event/'. - A new MI ddb command 'show intrs' walks the list of interrupt events dumping their state. It also has a '/v' verbose switch which dumps info about all of the handlers attached to each event. - We currently don't destroy an interrupt thread when the last threaded handler is removed because it would suck for things like ppbus(8)'s braindead behavior. The code is present, though, it is just under #if 0 for now. - Move the code to actually execute the threaded handlers for an interrrupt event into a separate function so that ithread_loop() becomes more readable. Previously this code was all in the middle of ithread_loop() and indented halfway across the screen. - Made struct intr_thread private to kern_intr.c and replaced td_ithd with a thread private flag TDP_ITHREAD. - In statclock, check curthread against idlethread directly rather than curthread's proc against idlethread's proc. (Not really related to intr changes) Tested on: alpha, amd64, i386, sparc64 Tested on: arm, ia64 (older version of patch by cognet and marcel)
* Eliminate two unused arguments to ttycreate().phk2005-10-161-1/+1
|
* 'PC Card' instead of other variantsimp2005-09-221-2/+2
|
* Last change to this file actually removed the oldcard compat code.imp2005-09-191-2/+1
| | | | This change removes one last K&Rism.
* Make sure that we call if_free(ifp) after bus_teardown_intr. Since weimp2005-09-191-21/+9
| | | | | | | could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call.
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-295-5/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Oops, revert a commit that snuck in with the earlier critical sectionjhb2005-04-051-1/+0
| | | | | | changes. Noticed by: bde
* Divorce critical sections from spinlocks. Critical sections as denoted byjhb2005-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | critical_enter() and critical_exit() are now solely a mechanism for deferring kernel preemptions. They no longer have any affect on interrupts. This means that standalone critical sections are now very cheap as they are simply unlocked integer increments and decrements for the common case. Spin mutexes now use a separate KPI implemented in MD code: spinlock_enter() and spinlock_exit(). This KPI is responsible for providing whatever MD guarantees are needed to ensure that a thread holding a spin lock won't be preempted by any other code that will try to lock the same lock. For now all archs continue to block interrupts in a "spinlock section" as they did formerly in all critical sections. Note that I've also taken this opportunity to push a few things into MD code rather than MI. For example, critical_fork_exit() no longer exists. Instead, MD code ensures that new threads have the correct state when they are created. Also, we no longer try to fixup the idlethreads for APs in MI code. Instead, each arch sets the initial curthread and adjusts the state of the idle thread it borrows in order to perform the initial context switch. This change is largely a big NOP, but the cleaner separation it provides will allow for more efficient alternative locking schemes in other parts of the kernel (bare critical sections rather than per-CPU spin mutexes for per-CPU data for example). Reviewed by: grehan, cognet, arch@, others Tested on: i386, alpha, sparc64, powerpc, arm, possibly more
* Simplify the "and if we're in the debugger, don't use locks" logic,rwatson2005-02-081-9/+5
| | | | | | correcting some misthinking. Discussed with (really this time): bde
* When entering siocnputc() with (kdb_active), don't acquire (orrwatson2005-02-031-5/+9
| | | | | | | | | | | release) the sio spin mutex, as use of synchronization primitives in the debugger can result in substantial problems. With this patch in place entering the debugger via a serial console is made substantially more reliable. MFC after: 1 week Tested by: kris Discussed with: bde
* puc handles this card, so remove it from here.imp2005-01-111-1/+0
| | | | PR: 48468
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-062-2/+2
|
* Remove local hacks to set flags now that the device probe does this for us.njl2004-10-141-4/+0
| | | | | | | Tested on every device except sio_pci and the pc98 fd.c. Perhaps something similar should be done for the "disabled" hints also. MFC after: 2 weeks
* Use generic tty code instead of local stuff.phk2004-10-131-521/+79
| | | | NB: device names are now consistent: {cua,tty}d$(port)[.lock,.init]
* Use ttyconsolemode() to set the console tty modes.phk2004-10-121-8/+1
|
* MFpc98: Check a pointer is NULL, remove unused variable.nyan2004-09-201-3/+4
|
* Fix an issue with ng_tty which (ab)used the tty->t_sc field which isphk2004-09-171-4/+6
| | | | | | reserved for the device drivers: Add a t_lsc field for line discipline private use.
* Use ttyalloc() instead of ttymalloc(NULL)phk2004-09-171-1/+1
|
* Allocate tty at attach time rather than open time.phk2004-09-161-49/+43
| | | | | | | | Use the init/lock*in/out fields in struct tty and remove them from our softc. Use tty->t_sc to find out softc when convenient. Mostly OK'ed by: bde
* If you insert a pccard modem and then eject it, you get a panic. Thisimp2004-07-221-1/+2
| | | | | | | happens because the sio device was never opened and com->tp is therefore NULL. ttygone can't swallow a NULL, so guard against that possibility. Other places in this function make similar checks, so I believe this is correct.
* Preparation commit for the tty cleanups that will follow in the nearphk2004-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.
* Introduce ttygone() which indicates that the hardware is detached.phk2004-07-111-38/+5
| | | | Move dtrwait logic to the generic TTY level.
* Update for the KDB framework. Sanitize the alpha console code now thatmarcel2004-07-101-209/+76
| | | | | | | | | | | | | | | | | | it's in the way even more. Basicly: remove all alpha specific console support from gfb(4), sio(4) and syscons(4). Rewrite the alpha console initialization to be identical to all other platforms. In a nutshell: call cninit(). The platform specific code now only sets or clears RB_SERIAL and thus automaticly causes the right console to be selected. sio.c: o Replace the remote GDB hacks and use the GDB debug port interface instead. o Make debugging code conditional upon KDB instead of DDB. o Call kdb_alt_break() instead of db_alt_break(). o Call kdb_enter() instead of breakpoint(). o Remove the ugly compatibility of using the console as the debug port.
* Define the tty methods as typedefs.phk2004-06-301-3/+2
| | | | | | Change the return type for t_break to void. Add t_ioctl (more about this later).
* - Shorten the names for the TTY related swi interrupt handlers as thejhb2004-06-281-2/+2
| | | | | | | | 'tty:' prefix is largely redundant. - Fix the priority of the low-priority TTY SWIs that are hung off of the softclock thread. Submitted by: bde (2)
* Guard against us having no tty pointer.phk2004-06-271-1/+2
|
* Pick the hotchar out of the tty structure instead of caching privatephk2004-06-261-6/+5
| | | | | | | | 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.
* Use generic support for modemcontrol and BREAK ioctls.phk2004-06-251-79/+64
|
* Remove the TIOCDCDTIMESTAMP option.phk2004-06-221-12/+0
| | | | | The RFC-2783 PPS-API (<sys/timepps.h>) provides better and more configurable service.
* Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES.phk2004-06-211-0/+4
|
* Give control devices their own cdevsw{} so that we can eliminate themphk2004-06-211-51/+111
| | | | | | from the trafic functions. Do not use com_addr() when we don't need it.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-6/+6
| | | | Bump __FreeBSD_version accordingly.
* Deorbit COMPAT_SUNOS.phk2004-06-111-2/+2
| | | | | 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.
* Add an entry to the PCI ID list to support the serial interface on thewpaul2004-06-071-0/+1
| | | | | | Broadcom 802.11g/GPRS CardBus card. Submitted by: Yann Berthier yb at sainte-barbe dot org
* Centralize the line discipline optimization determination in a functionphk2004-06-041-24/+4
| | | | | | | | | 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.
* Manual edits to change linesw[]-frobbing to ttyld_*() calls.phk2004-06-041-2/+2
|
* Machine generated patch which changes linedisc calls from accessingphk2004-06-041-8/+8
| | | | | | linesw[] directly to using the ttyld...() functions The ttyld...() functions ar inline so there is no performance hit.
* Make the remaining serial drivers call ttyioctl() rather than callingphk2004-06-041-8/+3
| | | | the linedisc directly.
* There is no need to explicitly call the stop function. In all likelyhoodphk2004-06-011-1/+0
| | | | ->l_close() did it and ttyclose certainly will.
* There is no need to explicitly call ttwakeup() and ttwwakeup() afterphk2004-06-011-2/+0
| | | | | ttyclose() has been called. It's already been done once by ttyclose, and probably once by the line-discipline too.
* ttyclose() increments t_gen. Remove redundant increments in drivers.phk2004-06-011-1/+0
|
* Fix disordering of pccarddevs.h noticed by bde. Also remove a fewimp2004-05-271-2/+2
| | | | | | redundant includes and fix some of the include disordering. Submitted by: bde
* Move to generating pccarddevs.h on the fly, both for the kernel andimp2004-05-261-1/+1
| | | | | | | the modules. Also generate usbdevs.h automatically now, but a non-kernel file is stopping that at the moment.
* Remove new options and my prevention of system freeze when the sio probeambrisko2004-05-031-76/+49
| | | | | | | returns okay when HW probe fails. This happens when comconsole flag is set but VGA console is used instead. Back out requested by: bde (He will be looking at other solutions from scratch)
* Some enhancements and bug fix.ambrisko2004-04-301-49/+76
| | | | | | | | | | | | | | | | | | - Define option FORCECONSPEED to force the serial console to be CONSPEED. I've run into a lot of boards in which the detect for prior speed doesn't work and ends up with broken console since it is at the wrong speed. - If a serial port is marked as a console, but console=vidconsole and if the serial ports doesn't exist it will be probed and attached at a 8250 chip. Then writes to that will freeze the system. - Add an option flags 0x400000 to mark this as a potential comconsole in-case the one flaged with 0x10 does not exist in the system. This makes it easier to deploy on systems with one or two serial ports. Obtained from: IronPort
* Remove the sio EBus attachment, which never worked with an unpatchedtmm2004-04-301-114/+0
| | | | | driver because sio(4) uses ISA-specific functions. uart(4) has full support for the respective hardware and should be used instead.
* Back out last bad commit (again!)imp2004-04-071-12/+1
|
* Remove advertising clause from University of California Regent'simp2004-04-073-13/+12
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
OpenPOWER on IntegriCloud