aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sab
Commit message (Collapse)AuthorAgeFilesLines
* MFC: Split struct ithd into struct intr_thread and intr_event andJohn Baldwin2006-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | associated changes. More details below: Remove public declarations of variables that were forgotten when they were made static. Revision Changes Path 1.31 +0 -1 src/sys/sys/interrupt.h Make sure the interrupt is masked before processing it, or bad things can happen. Revision Changes Path 1.10 +3 -3 src/sys/arm/arm/intr.c Reorganize the interrupt handling code a bit to make a few things cleaner 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) Revision Changes Path 1.88 +43 -29 src/sys/alpha/alpha/interrupt.c 1.38 +5 -5 src/sys/alpha/isa/isa.c 1.16 +58 -52 src/sys/amd64/amd64/intr_machdep.c 1.6 +1 -1 src/sys/amd64/include/intr_machdep.h 1.16 +2 -2 src/sys/amd64/isa/atpic.c 1.11 +28 -22 src/sys/arm/arm/intr.c 1.462 +2 -2 src/sys/dev/sio/sio.c 1.6 +1 -1 src/sys/dev/uart/uart_kbd_sun.c 1.24 +2 -2 src/sys/dev/uart/uart_tty.c 1.15 +58 -52 src/sys/i386/i386/intr_machdep.c 1.8 +1 -1 src/sys/i386/include/intr_machdep.h 1.21 +2 -2 src/sys/i386/isa/atpic.c 1.52 +32 -25 src/sys/ia64/ia64/interrupt.c 1.180 +3 -2 src/sys/kern/kern_clock.c 1.127 +437 -270 src/sys/kern/kern_intr.c 1.206 +0 -1 src/sys/kern/subr_witness.c 1.6 +3 -3 src/sys/powerpc/include/intr_machdep.h 1.7 +35 -32 src/sys/powerpc/powerpc/intr_machdep.c 1.14 +1 -1 src/sys/sparc64/include/intr_machdep.h 1.24 +43 -36 src/sys/sparc64/sparc64/intr_machdep.c 1.32 +36 -36 src/sys/sys/interrupt.h 1.440 +1 -3 src/sys/sys/proc.h Catch up with interrupt-thread changes. Revision Changes Path 1.32 +1 -1 src/sys/dev/zs/zs.c Catch up with new interrupt handling code. Revision Changes Path 1.16 +3 -3 src/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Catch up with new interrupt handling code. Revision Changes Path 1.162 +2 -2 src/sys/dev/cy/cy.c 1.101 +2 -2 src/sys/dev/rc/rc.c Catch up with new interrupt handling code. Revision Changes Path 1.50 +2 -2 src/sys/dev/cx/if_cx.c 1.41 +1 -1 src/sys/dev/sab/sab.c 1.238 +2 -2 src/sys/pc98/cbus/sio.c Add a swi_remove() function to teardown software interrupt handlers. For now it just calls intr_event_remove_handler(), but at some point it might also be responsible for tearing down interrupt events created via swi_add. Revision Changes Path 1.128 +17 -0 src/sys/kern/kern_intr.c 1.33 +1 -0 src/sys/sys/interrupt.h - Use swi_remove() to teardown swi handlers rather than intr_event_remove_handler(). - Remove tty: prefix from a couple of swi handler names. Revision Changes Path 1.51 +1 -1 src/sys/dev/cx/if_cx.c 1.102 +2 -2 src/sys/dev/rc/rc.c 1.42 +1 -1 src/sys/dev/sab/sab.c 1.25 +1 -1 src/sys/dev/uart/uart_tty.c 1.33 +1 -1 src/sys/dev/zs/zs.c 1.17 +2 -2 src/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Remove a stray return statement in the interrupt dispatch function that caused a premature exit after calling a fast interrupt handler and bypassing a much needed critical_exit() and the scheduling of the interrupt thread for non-fast handlers. In short: unbreak :-) Revision Changes Path 1.53 +0 -1 src/sys/ia64/ia64/interrupt.c If we get a stray interrupt, return after logging it. In the extremely rare case of a stray interrupt to an unregistered source (such as a stray interrupt from the 8259As when using APIC), this could result in a page fault when it tried to walk the list of interrupt handlers to execute INTR_FAST handlers. This bug was introduced with the intr_event changes, so it's not present in 5.x or 6.x. Submitted by: Mark Tinguely tinguely at casselton dot net Revision Changes Path 1.17 +1 -0 src/sys/amd64/amd64/intr_machdep.c 1.16 +1 -0 src/sys/i386/i386/intr_machdep.c Approved by: re (scottl) Notes: svn path=/stable/6/; revision=156543
* Account for ebus(4) defaulting to SYS_RES_MEMORY for memory resourcesMarius Strobl2005-06-041-4/+4
| | | | | | | since ebus.c rev. 1.22. Notes: svn path=/head/; revision=146966
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-062-2/+2
| | | | Notes: svn path=/head/; revision=139749
* Use generic tty code instead of local copies.Poul-Henning Kamp2004-10-121-118/+48
| | | | | | | | | | | New devicename is ttyz{port} No callout devices created. Isn't this driver superseeded by uart(4) anyway ? Notes: svn path=/head/; revision=136459
* Use ttyalloc() instead of ttymalloc(NULL)Poul-Henning Kamp2004-09-171-1/+1
| | | | Notes: svn path=/head/; revision=135367
* - Introduce an ofw_bus kobj-interface for retrieving the OFW node and aMarius Strobl2004-08-121-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subset ("compatible", "device_type", "model" and "name") of the standard properties in drivers for devices on Open Firmware supported busses. The standard properties "reg", "interrupts" und "address" are not covered by this interface because they are only of interest in the respective bridge code. There's a remaining standard property "status" which is unclear how to support properly but which also isn't used in FreeBSD at present. This ofw_bus kobj-interface allows to replace the various (ebus_get_node(), ofw_pci_get_node(), etc.) and partially inconsistent (central_get_type() vs. sbus_get_device_type(), etc.) existing IVAR ones with a common one. This in turn allows to simplify and remove code-duplication in drivers for devices that can hang off of more than one OFW supported bus. - Convert the sparc64 Central, EBus, FHC, PCI and SBus bus drivers and the drivers for their children to use the ofw_bus kobj-interface. The IVAR- interfaces of the Central, EBus and FHC are entirely replaced by this. The PCI bus driver used its own kobj-interface and now also uses the ofw_bus one. The IVARs special to the SBus, e.g. for retrieving the burst size, remain. Beware: this causes an ABI-breakage for modules of drivers which used the IVAR-interfaces, i.e. esp(4), hme(4), isp(4) and uart(4), which need to be recompiled. The style-inconsistencies introduced in some of the bus drivers will be fixed by tmm@ in a generic clean-up of the respective drivers later (he requested to add the changes in the "new" style). - Convert the powerpc MacIO bus driver and the drivers for its children to use the ofw_bus kobj-interface. This invloves removing the IVARs related to the "reg" property which were unused and a leftover from the NetBSD origini of the code. There's no ABI-breakage caused by this because none of these driver are currently built as modules. There are other powerpc bus drivers which can be converted to the ofw_bus kobj-interface, e.g. the PCI bus driver, which should be done together with converting powerpc to use the OFW PCI code from sparc64. - Make the SBus and FHC front-end of zs(4) and the sparc64 eeprom(4) take advantage of the ofw_bus kobj-interface and simplify them a bit. Reviewed by: grehan, tmm Approved by: re (scottl) Discussed with: tmm Tested with: Sun AX1105, AXe, Ultra 2, Ultra 60; PPC cross-build on i386 Notes: svn path=/head/; revision=133589
* 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
* Update for the KDB framework:Marcel Moolenaar2004-07-101-6/+5
| | | | | | | | o Make debugging code conditional upon KDB instead of DDB. o Call kdb_alt_break() instead of db_alt_break(). Notes: svn path=/head/; revision=131917
* Fix build: the return type for t_break changed from int to void.Mark Peek2004-07-011-3/+2
| | | | Notes: svn path=/head/; revision=131410
* Use generic modem control and BREAK ioctl handling. This eliminatedPoul-Henning Kamp2004-06-251-91/+34
| | | | | | | the need for a local ioctl handler. Notes: svn path=/head/; revision=131110
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-4/+4
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Implement the BREAK_TO_DEBUGGER option for sab(4).Joerg Wunsch2004-06-081-0/+11
| | | | Notes: svn path=/head/; revision=130241
* Machine generated patch which changes linedisc calls from accessingPoul-Henning Kamp2004-06-041-4/+4
| | | | | | | | | linesw[] directly to using the ttyld...() functions The ttyld...() functions ar inline so there is no performance hit. Notes: svn path=/head/; revision=130077
* Make the remaining serial drivers call ttyioctl() rather than callingPoul-Henning Kamp2004-06-041-6/+2
| | | | | | | the linedisc directly. Notes: svn path=/head/; revision=130057
* Add missing <sys/module.h> includes currently relying on nested includePoul-Henning Kamp2004-06-031-0/+1
| | | | | | | in <sys/kernel.h> Notes: svn path=/head/; revision=130026
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-3/+3
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* Device megapatch 4/6:Poul-Henning Kamp2004-02-211-1/+2
| | | | | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags. Notes: svn path=/head/; revision=126080
* Device megapatch 3/6:Poul-Henning Kamp2004-02-211-4/+0
| | | | | | | | | | | | | | | Add missing D_TTY flags to various drivers. Complete asserts that dev_t's passed to ttyread(), ttywrite(), ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty pointer. Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default cdevsw methods for D_TTY drivers and remove the explicit initializations in various drivers cdevsw structures. Notes: svn path=/head/; revision=126078
* Fix wrong check.Pawel Jakub Dawidek2004-02-051-1/+1
| | | | | | | Approved by: jake, scottl (mentor) Notes: svn path=/head/; revision=125475
* - Implement selwakeuppri() which allows raising the priority of aSeigo Tanimura2003-11-091-1/+1
| | | | | | | | | | | | | | | | thread being waken up. The thread waken up can run at a priority as high as after tsleep(). - Replace selwakeup()s with selwakeuppri()s and pass appropriate priorities. - Add cv_broadcastpri() which raises the priority of the broadcast threads. Used by selwakeuppri() if collision occurs. Not objected in: -arch, -current Notes: svn path=/head/; revision=122352
* OK, I messed up /dev/console with what I had hoped would be compatPoul-Henning Kamp2003-09-261-1/+1
| | | | | | | code. Convert remaining console drivers and hope for the best. Notes: svn path=/head/; revision=120491
* Use __FBSDID().David E. O'Brien2003-08-241-2/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119419
* s=include <ofw/=include <dev/ofw/= to reflect removal of -I$S/devWarner Losh2003-08-231-1/+1
| | | | Notes: svn path=/head/; revision=119338
* Match "serial" as well as "se".Jake Burkholder2003-03-311-1/+2
| | | | Notes: svn path=/head/; revision=112875
* Note that MAJOR_AUTO is now the default if d_maj is not initialized. ThisPoul-Henning Kamp2003-03-091-1/+0
| | | | | | | | | | | is more robust and prevents the hijacking of /dev/console for the typical mistake. Remove unneeded MAJOR_AUTO uses, it is only needed explicitly now if the driver source has cross-branch compatibility to old releases. Notes: svn path=/head/; revision=112037
* Make nokqfilter() return the correct return value.Poul-Henning Kamp2003-03-031-1/+1
| | | | | | | Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers. Notes: svn path=/head/; revision=111821
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-03-031-14/+10
| | | | | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl) Notes: svn path=/head/; revision=111815
* Use MAJOR_AUTO. GC statically assigned majors.Jake Burkholder2003-02-281-3/+1
| | | | Notes: svn path=/head/; revision=111656
* Change the console interface to pass a "struct consdev *" instead of aPoul-Henning Kamp2003-02-201-4/+4
| | | | | | | | | | | | dev_t to the method functions. The dev_t can still be found at struct consdev *->cn_dev. Add a void *cn_arg element to struct consdev which the drivers can use for retrieving their softc. Notes: svn path=/head/; revision=111194
* Add the sabtty children devices as unordered. Use the unit numbr ofJake Burkholder2003-01-271-5/+4
| | | | | | | | | | | | the sabtty device to create its description so that they will be unique for machines with multiple sab chips. This fixes a panic on machines with an rsc card. Tested by: obrien (e250) Notes: svn path=/head/; revision=109945
* Allow defaulting the console to ttya when it sets to screen and keyboardJake Burkholder2003-01-261-5/+8
| | | | | | | in the prom but no keyboard is plugged in. Notes: svn path=/head/; revision=109844
* Use bus_space_subregion to add offsets to bus handles instead of doingJake Burkholder2003-01-081-2/+4
| | | | | | | it manually. Notes: svn path=/head/; revision=108918
* Sync with zs.Jake Burkholder2003-01-051-239/+179
| | | | | | | | | | - Fix some bogosity with mixing unit numbers and channels, which would only work for one instance of the device. - Use a simpler scheme for input and output queueing. - Use db_alt_break. Notes: svn path=/head/; revision=108698
* Fix compiling without DDB and ALT_BREAK_TO_DEBUGGER.Jake Burkholder2002-12-301-0/+2
| | | | | | | Submitted by: marius@alchemy.franken.de Notes: svn path=/head/; revision=108456
* Setup a default tty mode even if the device is not the console. Don'tJake Burkholder2002-11-181-10/+4
| | | | | | | | | | reset the chip on open if we're not the console. This fixes running a getty on ttya or ttyb if console input and output devices are screen. Notes: svn path=/head/; revision=107042
* Remove some unnecessary code. Make the device description nicer. Add aJake Burkholder2002-11-181-66/+31
| | | | | | | delay in the right place to flush output before switching consoles. Notes: svn path=/head/; revision=107038
* - Add support for ALT_BREAK_TO_DEBUGGER; this is the only reliable way toJake Burkholder2002-11-171-21/+103
| | | | | | | | | | | trigger a breakpoint with this chip. - Fiddle the right bits in the cn input and output routines to disable port interrupts and enable visibility of the masked interrupt status bits. - Register a shutdown final event handler to put the chip back in the mode that the prom expects. Notes: svn path=/head/; revision=107016
* Make this driver work a whole lot better.Jake Burkholder2002-09-081-141/+169
| | | | | | | | | | | | | | | | - Get the initial mode from the prom settings and don't clobber the mode on open. - Copy output into an internal ring buffer instead of accessing the tty outq directly in the interrupt handler. This fixes a problem where garbage would show up in the output stream. - Reset the console port completely and reprogram all the parameters before enabling it. This fixes seemingly random hangs on startup when using a fast interrupt handler. - Add minimal locking in place of spls. - Remove dead code and minor cleanups. Notes: svn path=/head/; revision=103091
* Ported to FreeBSD.Jake Burkholder2002-08-041-582/+487
| | | | Notes: svn path=/head/; revision=101326
* Add Jason L. Wright's driver for the SAB82532 serial chip, found in manyJake Burkholder2002-08-042-0/+1684
sun ultras. Obtained from: OpenBSD Notes: svn path=/head/; revision=101325