aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cy/cy_isa.c
Commit message (Collapse)AuthorAgeFilesLines
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Revert r317446 and bring back cy(4).John Baldwin2017-04-271-0/+150
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=317509
* Remove the cy(4) driver for Cyclades serial adapters.John Baldwin2017-04-261-150/+0
| | | | | | | | This driver has been disconnected from the build since the new tty layer was introduced in 8.0 and was never updated for new tty. Notes: svn path=/head/; revision=317446
* Replace several bus_alloc_resource() calls using default arguments with ↵Justin Hibbits2016-02-191-5/+5
| | | | | | | | | | | | bus_alloc_resource_any() Since these calls only use default arguments, bus_alloc_resource_any() is the right call. Differential Revision: https://reviews.freebsd.org/D5306 Notes: svn path=/head/; revision=295790
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-2/+2
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* Fixed a panic in the probe. The memory resource was accessed afterBruce Evans2007-01-131-2/+3
| | | | | | | | releasing it. This seems to have worked until a few days ago, but now the memory is unmapped. Notes: svn path=/head/; revision=165996
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129879
* Reduce differences with cy_pci.c: add a description of this file, andBruce Evans2004-05-011-3/+7
| | | | | | | | | don't use too many tabs in declarations. Attempt to complete KNFization of this file (1 more indentation fix). Notes: svn path=/head/; revision=128804
* Adjust pathnames for the move from i386/isa to dev/cy.Bruce Evans2004-05-011-3/+5
| | | | | | | | | Adjust staticness and a variable name for the split of cy.c into cy.c and cy_isa.c. Use the new header required for the split to avoid repeating declarations in cy_pci.c. Notes: svn path=/head/; revision=128800
* Remove bits not related to isa configuration. This file was repo-copiedBruce Evans2004-05-011-2863/+0
| | | | | | | from cy.c. Notes: svn path=/head/; revision=128797
* Converted the isa probe and attach to new-bus so that this driver worksBruce Evans2004-04-051-45/+81
| | | | | | | | | | | | | | | | | | | | | | | | without the (defunct) isa compatibility shims. The new-bus-specific parts are very similar to the ones for the pci probe and attach. This was held up too long waiting for a repo copy to src/sys/dev/cy, so I decided to fix the files in their old place. This gives easier to read and merge diffs anyway. The "count" line in src/sys/conf/files won't be changed until after the repo copy, so old kernel configs that specify a count need not be (and must not be) changed until then. The count is just ignored in the driver. One unfinished detail is dynamic allocation of arrays with <count> and (<count> * 32) entries, and iteration over the arrays. This is now kludged with a fixed count of 10 (up to 10 cards with up to 32 ports each). Prodded by: imp Submitted by: mostly by imp Approved by: imp Notes: svn path=/head/; revision=127885
* Moved initialization of the lock from the (isa) probe function to theBruce Evans2004-04-051-6/+6
| | | | | | | | | | common attach function so that the lock gets initialized in all cases. This fixes breakage of the initialization of the lock in the pci case in rev.1.135 (between the releases of 5.1 and 5.2). The lock is only used in the SMP case, so this bug was not always fatal. Notes: svn path=/head/; revision=127883
* 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-3/+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
* Device megapatch 1/6:Poul-Henning Kamp2004-02-211-2/+0
| | | | | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number. Notes: svn path=/head/; revision=126076
* Fixed breakage of the pci case of the cy driver by the new interruptBruce Evans2003-12-021-31/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | code. Both the driver and the new code were wrong. Driver interrupt handlers are supposed to take "void *vsc" arg, but some including all COMPAT_ISA drivers and the pci part of the cy driver want an "int unit" arg. They got this using bogus casts of function pointers which should have kept working despite their bogusness. However, the new interrupt code doesn't honor requests to pass an arg of ((void *)0), so things are very broken if the arg is actually a representation of unit 0. The fix is to use a normal "void *vsc" arg for the pci case and a wrapper for the COMPAT_ISA case (of the cy driver). This cleans up new-busification of the pci case but takes the COMPAT_ISA case a little further from new-bus. The corresponding bug for the COMPAT_ISA case has already been fixed similarly using a wrapper in compat_isa.c and we need another wrapper just to undo that. Fixed some directly related style bugs (mainly by removing compatibility cruft). cy.c: Fixed an indirectly related old bug in cyattach_common(). A wrong status was returned in the unlikely event that malloc() failed. Approved by: re (scottl) Notes: svn path=/head/; revision=123104
* Restored the call to schedsofttty() (now spelled swi_sched(...)) again.Bruce Evans2003-11-161-14/+19
| | | | | | | | | | | Its restoration in rev.1.102 was mistranslated to the equivalent of setsofttty() in rev.1.105. This increased overheads by causing a context switch to the SWI handler after almost every interrupt. The increase was approx. 50% on a Celeron 366 (from 23 usec to 34 usec per interrupt). Notes: svn path=/head/; revision=122799
* Localized the cy driver's locking.Bruce Evans2003-11-161-23/+20
| | | | Notes: svn path=/head/; revision=122771
* MFsio (sio.c 1.413: cleaned up and fixed setting of speeds in comparam()).Bruce Evans2003-09-271-23/+12
| | | | | | | | | This is just a cleanup here (modulo rev.1.108 of kern/tty.c), since the input speed can be different from to output speed and extra code to handle both speeds naturally handled all cases. Notes: svn path=/head/; revision=120512
* Quick fix for bitrot in locking in the SMP case. cd_getreg() andBruce Evans2003-09-271-4/+24
| | | | | | | | | | | | | cd_setreg() were still using !(read_eflags() & PSL_I) as the condition for the lock hidden by COM_LOCK() (if any) being held. This worked when spin mutexes and/or critical_enter() used hard interrupt disablement, but it has caused recursion on the non-recursive mutex com_mtx since all relevant interrupt disablement became soft. The recursion is harmless unless there are other bugs, but it breaks an invariant so it is fatal if spinlocks are witnessed. Notes: svn path=/head/; revision=120504
* Use __FBSDID().David E. O'Brien2003-06-021-2/+3
| | | | Notes: svn path=/head/; revision=115703
* 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
* Remove #include <sys/dkstat.h>Poul-Henning Kamp2003-02-161-1/+0
| | | | Notes: svn path=/head/; revision=111002
* Change the suser() API to take advantage of td_ucred as well as do aJohn Baldwin2002-04-011-3/+3
| | | | | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@ Notes: svn path=/head/; revision=93593
* Fixed some style bugs in the removal of __P(()). The main ones wereBruce Evans2002-03-231-23/+22
| | | | | | | | | not removing tabs before "__P((", and not outdenting continuation lines to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting and/or rewrap the whole prototype in some cases. Notes: svn path=/head/; revision=93024
* Remove __P.Alfred Perlstein2002-03-201-25/+25
| | | | Notes: svn path=/head/; revision=92765
* Initialize a variable bogusly to avoid a gcc bug that causes a spuriousBruce Evans2002-02-261-0/+3
| | | | | | | warning. Notes: svn path=/head/; revision=91314
* Change the preemption code for software interrupt thread schedules andJohn Baldwin2002-01-051-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mutex releases to not require flags for the cases when preemption is not allowed: The purpose of the MTX_NOSWITCH and SWI_NOSWITCH flags is to prevent switching to a higher priority thread on mutex releease and swi schedule, respectively when that switch is not safe. Now that the critical section API maintains a per-thread nesting count, the kernel can easily check whether or not it should switch without relying on flags from the programmer. This fixes a few bugs in that all current callers of swi_sched() used SWI_NOSWITCH, when in fact, only the ones called from fast interrupt handlers and the swi_sched of softclock needed this flag. Note that to ensure that swi_sched()'s in clock and fast interrupt handlers do not switch, these handlers have to be explicitly wrapped in critical_enter/exit pairs. Presently, just wrapping the handlers is sufficient, but in the future with the fully preemptive kernel, the interrupt must be EOI'd before critical_exit() is called. (critical_exit() can switch due to a deferred preemption in a fully preemptive kernel.) I've tested the changes to the interrupt code on i386 and alpha. I have not tested ia64, but the interrupt code is almost identical to the alpha code, so I expect it will work fine. PowerPC and ARM do not yet have interrupt code in the tree so they shouldn't be broken. Sparc64 is broken, but that's been ok'd by jake and tmm who will be fixing the interrupt code for sparc64 shortly. Reviewed by: peter Tested on: i386, alpha Notes: svn path=/head/; revision=88900
* Modify the critical section API as follows:John Baldwin2001-12-181-71/+56
| | | | | | | | | | | | | | | | | | | | | | - The MD functions critical_enter/exit are renamed to start with a cpu_ prefix. - MI wrapper functions critical_enter/exit maintain a per-thread nesting count and a per-thread critical section saved state set when entering a critical section while at nesting level 0 and restored when exiting to nesting level 0. This moves the saved state out of spin mutexes so that interlocking spin mutexes works properly. - Most low-level MD code that used critical_enter/exit now use cpu_critical_enter/exit. MI code such as device drivers and spin mutexes use the MI wrappers. Note that since the MI wrappers store the state in the current thread, they do not have any return values or arguments. - mtx_intr_enable() is replaced with a constant CRITICAL_FORK which is assigned to curthread->td_savecrit during fork_exit(). Tested on: i386, alpha Notes: svn path=/head/; revision=88088
* Call to cdevsw_add() no longer needed.Poul-Henning Kamp2001-11-041-1/+0
| | | | Notes: svn path=/head/; revision=86008
* KSE Milestone 2Julian Elischer2001-09-121-10/+10
| | | | | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha Notes: svn path=/head/; revision=83366
* Fixed minor numbers when there is more than one cy card.Bruce Evans2001-08-131-6/+15
| | | | | | | | | PR: 19256 Submitted by: initial version by yokota MFC after: 1 week Notes: svn path=/head/; revision=81580
* Use ttymalloc() instead of a static array of `struct tty'. This willBruce Evans2001-08-131-15/+2
| | | | | | | | | | be a regression until `pstat -t' actually understands the results of ttymalloc(). Submitted by: mostly by yokota Notes: svn path=/head/; revision=81576
* Remove unneeded includes of sys/ipl.h and machine/ipl.h.John Baldwin2001-05-151-1/+0
| | | | Notes: svn path=/head/; revision=76650
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inMark Murray2001-05-011-2/+4
| | | | | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations) Notes: svn path=/head/; revision=76166
* Typo fix. s/criticale_t/critical_t/Peter Wemm2001-03-281-1/+1
| | | | Notes: svn path=/head/; revision=74938
* Switch from save/disable/restore_intr() to critical_enter/exit().John Baldwin2001-03-281-99/+78
| | | | Notes: svn path=/head/; revision=74903
* Send the remains (such as I have located) of "block major numbers" toPoul-Henning Kamp2001-03-261-1/+0
| | | | | | | the bit-bucket. Notes: svn path=/head/; revision=74810
* Extend kqueue down to the device layer.Jonathan Lemon2001-02-151-2/+3
| | | | | | | Backwards compatible approach suggested by: peter Notes: svn path=/head/; revision=72521
* RIP <machine/lock.h>.Mark Murray2001-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 Notes: svn path=/head/; revision=72358
* Revert the spin mutex for the cy(4) driver.John Baldwin2001-02-091-69/+152
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=72262
* - Use a spin mutex instead of COM_LOCK, since COM_LOCK is going away.John Baldwin2001-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. Notes: svn path=/head/; revision=72242
* Added used include of <sys/mutex.h>. The SMP case was broken byBruce Evans2001-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). Notes: svn path=/head/; revision=71846
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-2/+1
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Move suser() and suser_xxx() prototypes and a related #define fromPoul-Henning Kamp2000-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>. Notes: svn path=/head/; revision=67893
* - Catch up to new software interrupt code.John Baldwin2000-10-251-3/+3
| | | | | | | | | - Add a missing curly brace. Noticed by: phk Notes: svn path=/head/; revision=67584
* - Overhaul the software interrupt code to use interrupt threads for eachJohn Baldwin2000-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 Notes: svn path=/head/; revision=67551
* Remove unneeded #include <machine/clock.h>Poul-Henning Kamp2000-10-151-1/+0
| | | | Notes: svn path=/head/; revision=67164
* Don't depend on <machine/cpufunc.h> unnecessarily including <machine/lock.h>.Bruce Evans2000-10-121-2/+0
| | | | Notes: svn path=/head/; revision=67023