Commit Graph

99 Commits

Author SHA1 Message Date
Mike Smith
84685adb57 Return to using disable/enable_intr() for guarding DMA register access.
Mask the read value from the count register in order to return zero correctly
after TC, as per intel datasheet : "If it is not autoinitialised, this
register will have a count of FFFFH after TC"
1997-07-29 05:24:36 +00:00
Mike Smith
f5f607a03e Pedant attack! Use variable names consistent with discourse in
comments.  Remove reduntant extra addition that was unncessary, and
unneeded mask (asuming inb works correctly).

Submitted by:	Stephen McKay <syssgm@dtir.qld.gov.au>
1997-07-28 09:13:11 +00:00
Mike Smith
53f83ec34c Use disable_intr() / read/write_eflags() to ensure that interrupt
handlers don't skew the results of isa_dmastatus.  The function can be
safely called with interrupts disabled.

Submitted by:	Stephen McKay <syssgm@dtir.qld.gov.au>
1997-07-28 07:49:40 +00:00
Mike Smith
a4453045b0 Add isa_dmastatus() for reading the current ISA DMA counter for a
given channel.

Submitted by:	luigi@labinfo.iet.unipi.it (Luigi Rizzo)
1997-07-24 05:27:40 +00:00
Bruce Evans
f71d35e402 Removed unused #includes. 1997-07-20 14:10:18 +00:00
Andrey A. Chernov
d80e841377 Back out my changes with 'conflicts' keyword for IRQs,
sounddriver fixed now.
1997-07-09 17:58:16 +00:00
Steve Passe
293f18dbbf Modified to use merged/renamed functions:
- get_isa_apic_mask() -> isa_apic_mask()
 - get_isa_apic_irq() && get_eisa_apic_irq() -> isa_apic_pin()
1997-06-25 21:00:00 +00:00
Andrey A. Chernov
833bdc932c While deciding to install irq with unneded "conflicts" keyword,
additionly check that intr vector is non-NULL
1997-06-09 00:53:48 +00:00
Andrey A. Chernov
7f533ff73f Add safety check in case "conflicts" keyword specified more times than
needed
1997-06-08 17:15:31 +00:00
Andrey A. Chernov
1886f4968c Make "conflicts" keyword work again 1997-06-08 16:43:37 +00:00
Doug Rabson
683523378c Move interrupt handling code from isa.c to a new file. This should make
isa.c (slightly) more portable and will make my life developing the really
portable version much easier.

Reviewed by:	peter, fsmp
1997-06-02 08:19:06 +00:00
Peter Wemm
5400ed3b2f Include file updates.. <machine/spl.h> -> <machine/ipl.h>, add
<machine/ipl.h> to those files that were depending on getting SWI_*
implicitly via <machine/cpufunc.h>
1997-05-31 09:27:31 +00:00
Steve Passe
4fd20a6b2a Added code to manage the local and io APICs as structures. 1997-05-29 05:56:12 +00:00
Peter Wemm
6b19c20ba5 remove opt_smp.h, minor style police 1997-05-29 04:55:39 +00:00
Stefan Eßer
4c9340d45c Add support for shared interrupts to the kernel. This code is meant
be (eventually) architecture independent. It provides an emulation
of the ISA interrupt registration function register_intr(), but that
function does no longer manipulated the interrupt controller and
interrupt descriptor table, but calls the architecture dependent
function setup_icu() for that purpose.

After the ISA/EISA bus code has been modified to directly call the new
interrupt registartion functions (intr_create() and intr_connect()),
the emulation of register_intr() should be dropped.

The C level interrupt handler function should take a (void*) argument,
and the function pointer type (inthand2_t) should defined in some  other
place than isa_device.h.

This commit is a pre-requisite for the removal of the PCI specific shared
interrupt code.

Reviewed by:    dfr,bde
1997-05-26 14:42:24 +00:00
Steve Passe
08896efb1a Code to handle SMP/APIC_IO mapping of ISA INTs to APIC pins above IRQ15.
- doesn't break my system.
 - NOT yet verified on the affected motherboard.

Stifle an annoying dma_start busy message for the sound cards.

Submitted by:	"John S. Dyson" <toor@dyson.iquest.net>
1997-05-05 22:56:13 +00:00
Steve Passe
34e63b4cd7 removed all the TEST_UPPERPRIO crud. 1997-04-28 01:08:47 +00:00
Steve Passe
296bffc9c0 informal discussion between Bruce Evans <bde@zeta.org.au>,
Peter Wemm <peter@spinner.DIALix.COM>, Steve Passe <smp@csn.net>

removed all the IPI_INTS code.
made the XFAST_IPI32 code default, renaming Xfastipi32 to Xinvltlb.
cleanup of i386/isa/isa_device.h to eliminate SMP dependancies:
  made the id_irq member of struct isa_device an u_int.
  made the id_drq member of struct isa_device an int.
  removed all other '#ifdefs' concerning SMP & APIC_IO.
removed SMP/APIC_IO dependancies from if_ze.c.
1997-04-27 21:18:59 +00:00
Peter Wemm
477a642cee Man the liferafts! Here comes the long awaited SMP -> -current merge!
There are various options documented in i386/conf/LINT, there is more to
come over the next few days.

The kernel should run pretty much "as before" without the options to
activate SMP mode.

There are a handful of known "loose ends" that need to be fixed, but
have been put off since the SMP kernel is in a moderately good condition
at the moment.

This commit is the result of the tinkering and testing over the last 14
months by many people.  A special thanks to Steve Passe for implementing
the APIC code!
1997-04-26 11:46:25 +00:00
Andrey A. Chernov
e5df661c83 Remove recently commited support for iobase == -2 ("port none")
is is really probe routine task (return -1 for no ports)
1997-03-28 01:02:17 +00:00
Andrey A. Chernov
e4960ae4f5 Replace more verbose "at <not configured>" with less verbose "at ?",
we don't need much attention here, because this diagnostic printed first
and then card will be configured.
1997-03-25 03:29:40 +00:00
Andrey A. Chernov
70b57d05df Follow config intention for iobase:
print "at <not configured>" for iobase == -1 (autodetect not happens)
and not print anything for iobase == -2 (none)
Old code treat this two special config numbers as big port numbers.
1997-03-25 03:13:05 +00:00
Peter Wemm
6875d25465 Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.
1997-02-22 09:48:43 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Nate Williams
7323d74ac0 Changed magic # 0xa0000 -> ISA_HOLE_START since it's now defined. 1997-01-08 05:56:55 +00:00
Bruce Evans
e8e87818d1 Fixed pessimized (short) i/o port types. 1996-10-08 21:08:18 +00:00
Bruce Evans
b568ea4e01 Removed more devconf leftovers. 1996-09-10 23:31:13 +00:00
Poul-Henning Kamp
bfbb029d87 Remove devconf, it never grew up to be of any use. 1996-09-06 23:09:20 +00:00
Bruce Evans
c673fe98d7 Added #include of <machine/md_var.h>. This will be needed when
some declarations are moved from <machine/cpufunc.h> to better
places.
1996-06-25 20:31:01 +00:00
Poul-Henning Kamp
f8845af0db First pass at cleaning up macros relating to pages, clusters and all that. 1996-05-02 10:43:17 +00:00
Justin T. Gibbs
1d7ded8adf Change the devconf description from "ISA or EISA bus" to "ISA bus" now
that we have eisaconf.
1996-04-20 21:22:32 +00:00
Bruce Evans
3745f80a48 Moved AUTO_EOI_[12] and most sio and pcvt options out of the makefile. 1996-04-11 21:18:49 +00:00
Sujal Patel
1dce4e5d60 Add a lock for DMA Channels to prevent two devices from using the same DMA
channel at the same time.  The functions isa_dma_acquire() and
isa_dma_release() should be used in all ISA drivers which call isa_dmastart().
This can be used more generally to register the usage of DMA channels in
any driver, but it is required for drivers using isa_dmastart() and friends.

Clean up sanity checks, error messages, etc.
Remove isa_dmadone_nobounce(), it is no longer needed

Reviewed by:	bde
1996-04-08 19:38:57 +00:00
Bruce Evans
3157adc8af Removed now-unused #includes of <machine/cpu.h>. They were for bootverbose
being declared in the wrong place.
1996-04-07 17:32:42 +00:00
Justin T. Gibbs
58a8ca6a4d Cleanse the SCSI subsystem of its internally defined types
u_int32, u_int16, u_int8, int32, int16, int8.
	Use the system defined *_t types instead.
1996-03-10 07:04:48 +00:00
Jordan K. Hubbard
3873c27840 Don't print DMA busy messages - the sound code apparently runs
afoul of this without actually providing useful information and
works nonetheless.
Submitted by:	Jim Lowe <james@miller.cs.uwm.edu>
1996-03-10 02:10:27 +00:00
Bruce Evans
dd87702a51 Allocate DMA bounce buffers only when requested by drivers. Only the
fd and wt drivers need bounce buffers, so this normally saves 32K-1K
of kernel memory.

Keep track of which DMA channels are busy.  isa_dmadone() must now be
called when DMA has finished or been aborted.

Panic for unallocated and too-small (required) bounce buffers.

fd.c:
There will be new warnings about isa_dmadone() not being called after
DMA has been aborted.

sound/dmabuf.c:
isa_dmadone() needs more parameters than are available, so temporarily
use a new interface isa_dmadone_nobounce() to avoid having to worry
about panics for fake parameters.  Untested.
1996-01-27 02:33:48 +00:00
Bruce Evans
227b8bf258 Cleaned up unused #includes and some other historical cruft.
Sorted and KNFised declarations.
1996-01-27 01:56:30 +00:00
Poul-Henning Kamp
c92a064d21 Reinstate AUTO_EOI_1. This did break suspend/resume on some portables.
In particular mine.  We may want to make it a negative option to
keep GENERIC sane, ie NO_AUTO_EOI_1.
1996-01-19 23:38:07 +00:00
David Greenman
e8636c6c19 Made "AUTO_EOI_1" standard. auto-EOI on the master ICU is a documented
feature of the ICU. auto-EOI on the slave is not safe, however, so it
remains an option. Killed religious FASTER_NOP when writing the ICU.

Reviewed by:	bde
1995-12-23 16:53:57 +00:00
David Greenman
2838c9682a Implemented a (sorely needed for years) double fault handler to catch stack
overflows.
It sure would be nice if there was an unmapped page between the PCB and
the stack (and that the size of the stack was configurable!). With the
way things are now, the PCB will get clobbered before the double fault
handler gets control, making somewhat of a mess of things. Despite this,
it is still fairly easy to poke around in the overflowed stack to figure
out the cause.
1995-12-19 14:30:50 +00:00
David Greenman
efeaf95a41 Untangled the vm.h include file spaghetti. 1995-12-07 12:48:31 +00:00
Bruce Evans
bf7141134e Quick fix for stat_imask and intr_mask[8] not having the RTC interrupt
bit set.  I broke stat_imask in Dec 1994 and update_intr_masks() has
copied the breakage to intr_mask[8] since Mar 1995.  This can cause
the RTC to stop interrupting in rare cases (under loads heavy enough
for a new RTC interrupt to occur at a critical time just before Xintr8
finishes handling the previous one) and may have caused worse problems.
1995-11-20 13:24:18 +00:00
Poul-Henning Kamp
4b2af45f4b Mega commit for sysctl.
Convert the remaining sysctl stuff to the new way of doing things.
the devconf stuff is the reason for the large number of files.
Cleaned up some compiler warnings while I were there.
1995-11-20 12:42:39 +00:00
Justin T. Gibbs
67e1bd423c Remove old eisaconf cruft from the eisa files. The old eisaconf kludged
in here to do some conflict detection.  The new code doesn't do conflict
detection yet, but it will be implemented in another way.

aic7770.c moved to i386/eisa
1995-11-05 04:45:16 +00:00
Peter Wemm
7dbdd057a4 We no longer need the spltty() == splimp() hack if PPP is configured into
the kernel.  ppp_tty.c goes to some lengths to minimise the inter-layer
calling (including a soft ISR).  ppp_tty.c takes care of the soft masking
that was needed still.

(I've discovered that bugs in this area show up within an hour if the
masking was not correct.. :-}  This combination has proven stable on
specialix serial ports, although there was some concern about the softtty
parts of sio/cy and netisr colliding - but Bruce has fixed that now)
1995-10-31 21:03:57 +00:00
Bruce Evans
f9dd61a448 Only allow `sensitive' devices for displays in find_display(). This is
a quick fix for syscons deciding not to become the console because it
thinks another tty device has priority.
1995-10-22 15:07:43 +00:00
David Greenman
d69caef5ed Killed isa_allocphysmem() and isa_freephysmem(). They are completely used
functions. This file is disgusting; the isa DMA stuff is especially bad and
should be rewritten.
1995-09-15 03:10:06 +00:00
Bruce Evans
e7451974bb Make pcvt and syscons live in the same kernel. If both are enabled, then
the first one in the config has priority.  They can be switched using
userconfig().

i386/i386/conf.c:
Initialize the shared syscons/pcvt cdevsw entry to `nx'.

Add cdevsw registration functions.

Use devsw functions of the correct type if they exist.

i386/i386/cons.c:
Add renamed syscons entry points to constab.

i386/i386/cons.h:
Declare the renamed syscons entry points.

i386/i386/machdep.c:
Repeat console initialization after userconfig() in case the current
console has become wrong.  This depends on cn functions not wiring down
anything important.

sys/conf.h:
Declare new functions.

i386/isa/isa.[ch]:
Add a function to decide which display driver has priority.  Should be
done better.

i386/isa/syscons.c:
Rename pccn* -> sccn*.

Initialize CRTC start address in case the previous driver has moved it.

i386/isa/syscons.c, i386/isa/pcvt/*
Initialize the bogusly shared variable Crtat dynamically in case the
stored value was changed by the previous driver.

Initialize cdevsw table from a template.

Don't grab the console if another display driver has priority.

i386/isa/syscons.h, i386/isa/pcvt/pcvt_hdr.h:
Don't externally declare now-static cdevsw functions.

i386/isa/pcvt/pcvt_hdr.h:
Set the sensitive hardware flag so that pcvt doesn't always have lower
priority than syscons.  This also fixes the "stupid" detection of the
display after filling the display with text.

i386/isa/pcvt/pcvt_out.c:
Don't be confused the off-screen cursor offset 0xffff set by syscons.

kern/subr_xxx.c:
Add enough nxio/nodev/null devsw functions of the correct type for syscons
and pcvt.
1995-09-10 21:36:12 +00:00
Rodney W. Grimes
9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00