summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
Commit message (Collapse)AuthorAgeFilesLines
* Fixed a misplaced ifdef that prevented npx.c building without "device isa"bde2004-02-131-1/+1
| | | | | | | | | ISA. npx has few isa dependencies, but it does unconditional outb()'s to the isa bus in the !SMP case, and it attaches to isa if "device isa" is configured in order to support PNP-ISA. The ifdef for the latter was misplaced. PR: 62595
* Fix a typo in kan's last commit: cnavaiable() -> cnavailable()roam2004-02-051-1/+1
|
* Eliminate global cons_unavailable flag and replace it by the statuskan2004-02-053-4/+7
| | | | | bit maintained on a per-device basis. Single variable is inadequate on machines running with multiple consoles enabled.
* Revert the skipping of segment register reloads as it appears to actuallyjhb2004-02-031-4/+1
| | | | | be a pessimization on non Pentium4 CPUs. More importantly, it is buggy as it can cause GPF's when using APM or vm86.
* Optimize the i386 interrupt entry code to not reload the segment registersjhb2004-01-281-1/+4
| | | | | | | if they already contain the correct kernel selectors. Reviewed by: peter Suggested by: peter
* Fix a long-standing bug that had been introduced in rev 1.24 with thejoerg2004-01-071-1/+4
| | | | | | replacement of struct proc by struct thread. This bug could cause a NULL pointer dereferencation under certain circumstances (e. g. while running /etc/rc.d/pcvt).
* - Use i8259A register defines from shared sys/dev/ic/i8259.h rather thanjhb2004-01-062-67/+20
| | | | | | from the i386-specific icu.h. - Replace PC98 magic numbers with equivalent register define values along with comments about PC-98 "quirks".
* First part of the removal of drivers for hardware that isn't relevantimp2003-12-071-633/+0
| | | | | | | | | | | | or whose drivers haven't even compiled for years. The loran hardware was very unique, and only a few copies of it ever existed. It used the old COMPAT_ISA_DRIVER and when the author was contacted, he indicated that he had no intention of ever updating this driver and it was no longer relevant to the FreeBSD world and can be removed without impact to anybody. Approved by: phk
* Remove cx in its old location.imp2003-12-034-3199/+0
| | | | Approved by: re@ <scottl>
* Fixed breakage of the pci case of the cy driver by the new interruptbde2003-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)
* Add a special check for a stray IRQ 7 or IRQ 15 to see if it is actuallyjhb2003-11-191-0/+22
| | | | | | | a spurious interrupt from one of the 8259As. If so, don't log it as a stray IRQ, but just silently ignore it. Approved by: re (rwatson)
* - Add counts to the ATPIC interrupt sources and point the ATPIC interruptjhb2003-11-191-6/+17
| | | | | | | | | | | source count pointers at them so that intr_execute_handlers() won't choke when it tries to handle an unregisterd ATPIC interrupt source. - Install the low-level ATPIC interrupt handlers when we first program the ATPIC in atpic_startup() rather than at SI_SUB_INTR. This is only necessary to work around buggy code that enables interrupts too early in the boot process (namely, the vm86 code). Approved by: re (rwatson)
* Restored the call to schedsofttty() (now spelled swi_sched(...)) again.bde2003-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).
* Localized the cy driver's locking.bde2003-11-161-23/+20
|
* Always install IDT entries for ATPIC interrupt sources. The APIC nojhb2003-11-141-10/+3
| | | | | | | longer uses these interrupt vectors for its ISA interrupt pins, so these entries will not be overwritten. If we get a spurious interrupt from the ATPIC when using the APIC, it will be treated as a stray interrupt instead of causing a panic.
* "opt_auto_eoi.h" is not used here anymore. See atpic.c.peter2003-11-141-2/+0
|
* Replace magic numbers with macros for i8259A register constants. Stilljhb2003-11-141-9/+10
| | | | need the ICW4 bits for PC98 though.
* - Bring in constants for 8259A registers from amd64 with some updatedjhb2003-11-141-2/+57
| | | | | | comments from NetBSD's dev/ic/i8259A.h. These bits really belong in a file of the same name as well, but this will do for now. - Axe unused HWI_MASK.
* Don't disable the TSC with statclock_disable.phk2003-11-131-9/+9
|
* - Move manipulation of td_intr_nesting_level out of assembly interruptjhb2003-11-123-73/+24
| | | | | | | | | | | | | | | | | | | vector stubs and into the C functions they call. - Move disabling and EOIing of interrupt sources out of PIC driver entry points and into intr_execute_handlers(). Intr_execute_handlers() only disables a source for an interrupt if it is a stray interrupt or has threaded handlers. Sources with fast handlers no longer disable (mask) the source while executing the handlers. - Move the setting of clkintr_pending into intr_execute_handlers() and set the variable for any interrupt source with a vector of 0. (Should only be true for IRQ 0.) This fixes clkintr_pending in the NO_MIXED_MODE case. - Implement lapic_eoi() and use it to implement ioapic_eoi_source(). - Rename atpic_sched_ithd() to atpic_handle_intr() since it is used to handle all atpic interrupts and not just threaded ones. Inspired by: peter's changes to amd64 in p4 (1) Requested by: bde (2)
* - Implement selwakeuppri() which allows raising the priority of atanimura2003-11-096-6/+6
| | | | | | | | | | | | | 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
* Use a wrapper around the driver interrupt handler. The wrapper accepts thejhb2003-11-041-3/+10
| | | | | | | | | isa_device pointer as its argument and uses that to call the driver's interrupt handler passing the unit number as its argument. This should fix COMPAT_OLDISA devices with a unit number of 0. Reviewed by: peter Reported by: bde
* Fix LINTnyan2003-11-042-1/+2
|
* Fix to support pc98.nyan2003-11-041-0/+6
|
* Split pc98 support into pc98/pc98/nmi.c.nyan2003-11-041-22/+1
|
* Remove remaining bits of old interrupt and APIC code.jhb2003-11-036-1470/+0
|
* Catch up to interrupt code changes.jhb2003-11-032-2/+0
|
* - Export doreti as a global symbol.jhb2003-11-031-108/+0
| | | | | - Don't include isa/vector.s. Each PIC driver's entry points now live in their own standalone files.
* New APIC support code:jhb2003-11-032-219/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The apic interrupt entry points have been rewritten so that each entry point can serve 32 different vectors. When the entry is executed, it uses one of the 32-bit ISR registers to determine which vector in its assigned range was triggered. Thus, the apic code can support 159 different interrupt vectors with only 5 entry points. - We now always to disable the local APIC to work around an errata in certain PPros and then re-enable it again if we decide to use the APICs to route interrupts. - We no longer map IO APICs or local APICs using special page table entries. Instead, we just use pmap_mapdev(). We also no longer export the virtual address of the local APIC as a global symbol to the rest of the system, but only in local_apic.c. To aid this, the APIC ID of each CPU is exported as a per-CPU variable. - Interrupt sources are provided for each intpin on each IO APIC. Currently, each source is given a unique interrupt vector meaning that PCI interrupts are not shared on most machines with an I/O APIC. That mapping for interrupt sources to interrupt vectors is up to the APIC enumerator driver however. - We no longer probe to see if we need to use mixed mode to route IRQ 0, instead we always use mixed mode to route IRQ 0 for now. This can be disabled via the 'NO_MIXED_MODE' kernel option. - The npx(4) driver now always probes to see if a built-in FPU is present since this test can now be performed with the new APIC code. However, an SMP kernel will panic if there is more than one CPU and a built-in FPU is not found. - PCI interrupts are now properly routed when using APICs to route interrupts, so remove the hack to psuedo-route interrupts when the intpin register was read. - The apic.h header was moved to apicreg.h and a new apicvar.h header that declares the APIs used by the new APIC code was added.
* Add the new atpic(4) driver for the 8259A master and slave PICs. Byjhb2003-11-033-225/+498
| | | | | | | | | | | | default we provide 16 interrupt sources for IRQs 0 through 15. However, if the I/O APIC driver has already registered sources for any of those IRQs then we will silently fail to register our own source for that IRQ. Note that i386/isa/icu.h is now specific to the 8259A and no longer contains any info relevant to APICs. Also note that fast interrupts no longer use a separate entry point. Instead, both fast and threaded interrupts share the same entry point which merely looks up the appropriate source and passes control to intr_execute_handlers().
* Move the NMI handling code out to its own file.jhb2003-11-031-586/+2
|
* Remove soon to be obsolete file to break kernel build while the newjhb2003-11-031-716/+0
| | | | interrupt code comes in.
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-315-18/+14
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* There is no way to enter the attach routine twice with the same softcbrooks2003-10-301-18/+16
| | | | | | | without a detach call in between so don't try to deal with that possiability. This is a diff-reduction commit for the upcoming if_xname conversion.
* Don't forget to load %es with the kernel data segment selector inbde2003-10-161-0/+3
| | | | | | | | | | | Xcpustop(). %es is used in at least the call to savectx() when savectx() calls bcopy(), so not loading it was fatal if a stop IPI interrupts user mode. This reduces bugs starting and stopping CPUs for debuggers. CPUs are stopped mainly in kdb_trap() and cpu_reset(). At reset time there is a good chance that all the CPUs are in the kernel, so the bug was probably harmless then.
* Add a workaround for the fact that the priv field was removed fromdfr2003-10-161-4/+18
| | | | | struct driver. We were the last user of that field (and we are scheduled for demolition) so there wasn't much point in keeping it.
* MFsio (sio.c 1.413: cleaned up and fixed setting of speeds in comparam()).bde2003-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.
* Quick fix for bitrot in locking in the SMP case. cd_getreg() andbde2003-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.
* Initialize cn_name, ignore cn_dev.phk2003-09-261-1/+1
|
* Per TRB vote: restore the aquire_timer0 and associated goo. This willimp2003-09-241-2/+146
| | | | | | | | be gone in FreeBSD 6, so put BURN_BRIDGES around it. The TRB also felt that if something better comes along sooner, it can be used to replace this code. Delayed by: BSDcon and subsequent disk crash.
* Add constants for entries in the IDT and use those instead of magicjhb2003-09-101-4/+5
| | | | numbers.
* clock.c:bde2003-09-071-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Quick fix for calling DELAY() for ddb input in some (atkbd-based) console drivers. ddb must not use any normal locks, but DELAY() normally calls getit() which needs clock_lock. One problem with using normal locks in ddb is that deadlock is possible, but deadlock on clock_lock is unlikely becaluse clock_lock is bogusly recursive, apparently just to hide the problem of ddb using it. The i8254 clock hardware has mostly write-only registers so it is important for it to use a lock that gives exclusive access. (atkbd hardware is also unfriendly to reentrant software but that problem is more local and already solved.) I mostly saw the symptoms of the bug caused by unlocking in getit() running cpu_unpend(). cpu_unpend() should not be called while in ddb and Debugger() calls for failing assertions about this caused a breakpoint within ddb. ddb must also not call getit() because ddb may be being used to step through clock initialization code that has stopped or otherwise mangled the clock. If the clock is stopped, then getit() always returns the same value and DELAY() takes forever if it trusts getit(). The quick fix is implement DELAY(n) as (n * timer_freq / 1000000) inb(0x84)'s if ddb is active. machdep.c: Don't permit recursion on clock_lock.
* Mark the isa compat shims for BURN_BRIDGES for 6.0peter2003-09-052-0/+12
|
* Clean up some antique stuff. We do not support Weitek FPUs etc, and neverpeter2003-09-051-10/+0
| | | | did.
* Fix compile error.nyan2003-08-251-1/+1
|
* Even though this driver says it is broken, fix the location of the pciimp2003-08-231-2/+2
| | | | include files.
* Give timecounters a numeric quality field.phk2003-08-161-1/+2
| | | | | | | | | | | | | | | | A timecounter will be selected when registered if its quality is not negative and no less than the current timecounters. Add a sysctl to report all available timecounters and their qualities. Give the dummy timecounter a solid negative quality of minus a million. Give the i8254 zero and the ACPI 1000. The TSC gets 800, unless APM or SMP forces it negative. Other timecounters default to zero quality and thereby retain current selection behaviour.
* remove acquire_timer0() and release_timer0() and related stuff.phk2003-08-151-134/+2
|
* As warned: Initiate deorbit burn for the pcaudio driver.phk2003-08-151-563/+0
|
* Add or correct range checking of signal numbers in system calls andnectar2003-08-101-0/+2
| | | | | | | | | ioctls. In the particular case of ptrace(), this commit more-or-less reverts revision 1.53 of sys_process.c, which appears to have been erroneous. Reviewed by: iedowse, jhb
OpenPOWER on IntegriCloud