Commit Graph

2307 Commits

Author SHA1 Message Date
Eivind Eklund
7b778b5e61 Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.
This introduce an xxxFS_BOOT for each of the rootable filesystems.
(Presently not required, but encouraged to allow a smooth move of option *FS
to opt_dontuse.h later.)

LFS is temporarily disabled, and will be re-enabled tomorrow.
1998-01-24 02:54:56 +00:00
John Dyson
50ce7ff499 Add better support for larger I/O clusters, including larger physical
I/O.  The support is not mature yet, and some of the underlying implementation
needs help.  However, support does exist for IDE devices now.
1998-01-24 02:01:46 +00:00
Kazutaka YOKOTA
6c401d343f - Add binary compatibility support for obsolete console/mouse ioctls
so that existing programs which were compiled before the introduction
  of the new mouse code and use these ioctls will run unmodified.

Suggested by msmith.
1998-01-20 03:37:27 +00:00
Paul Traina
61584b4680 Fix misleading comment about major # 1998-01-16 22:43:33 +00:00
Paul Traina
aaf862068b Bring in IDE ATAPI floppy support.
This is Junichi's v1.0 driver.

NOTE: Major device numbers have been changed to avoid conflict with other
      FreeBSD 3.0 devices.  The new numbers should be considered "official."
      This driver is still considered "beta" quality, although we have been
      playing with it.  Please submit bugs to junichi and myself.

Submitted by:	junichi@astec.co.jp
1998-01-16 22:13:07 +00:00
KATO Takenori
8f856e3156 Synchronize with NetBSD/pc98 based on NetBSD/i386 version 1.3G patch
level 117.

Reviewed by:	Naofumi Honda <honda@Kururu.math.sci.hokudai.ac.jp>
1998-01-16 11:32:13 +00:00
Philippe Charnier
85dace5d59 Add rcsid. Remove unused vars. Use err(3) and change exit(-1). 1998-01-16 07:20:34 +00:00
Justin T. Gibbs
99117bb6ec Addition of splsoftvm and a VM SWI to handle bus dma related callbacks.
This SWI may be useful for other, defered, VM tasks.
1998-01-15 07:34:01 +00:00
KATO Takenori
d81278e36e Fix typo. 1998-01-14 08:08:42 +00:00
Kazutaka YOKOTA
4d76195ef5 Fix illegal numeric expressions: 08 and 09. 1998-01-12 23:54:51 +00:00
Julian Elischer
ad26ea348f Add some devfs entries
(patch origianlly from luigi)
1998-01-12 03:45:58 +00:00
Julian Elischer
eae4f847a7 add devfs entries for a few more syscons devices (e.g. sysmouse) 1998-01-12 03:28:36 +00:00
KATO Takenori
a424913c23 Added PnP I/O port address of NEC PC-98.
Submitted by:	Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp>
1998-01-10 07:41:43 +00:00
Kazutaka YOKOTA
363f670991 - Produce the accent letter if the user hits the accent key twice.
(accent_key + space does still print the accent letter too, as in
  the previous commit.)
  Requested by a couple of users.
- Clear the accent flag when the next_screen key is pressed.
- Added some comment lines regarding accent key processing.
1998-01-09 09:06:55 +00:00
Eivind Eklund
1d5e9e2255 Make INET a proper option.
This will not make any of object files that LINT create change; there
might be differences with INET disabled, but hardly anything compiled
before without INET anyway.  Now the 'obvious' things will give a
proper error if compiled without inet - ipx_ip, ipfw, tcp_debug.  The
only thing that _should_ work (but can't be made to compile reasonably
easily) is sppp :-(

This commit move struct arpcom from <netinet/if_ether.h> to
<net/if_arp.h>.
1998-01-08 23:42:31 +00:00
John-Mark Gurney
6cc3943ff0 update the AWE32 wave table driver to Iwai's 0.4.2c version. This also
includes the patches to make it work under -current from Randall Hopper.

Remove the old AWE driver.
1998-01-08 23:13:22 +00:00
Atsushi Murai
844451dc95 1. Supporting a bogus 16550A compatible PCMCIA CARD stuffs
- IIR_TXRDY is never off even if reading a IIR register.
    - Know as PIAFS "Palido 321S", "DC-*S" oemed by Sharp corp.

 2. Omiting a restrict probing if it's already probed by pccardd.
    Note: Define a new id_flags as follows

           0x40000 - NO PROBE (Already probed as serial)
           0x80000 - Has a bogus IIR_TXRDY register

	Sato Junichi <junichi@astec.co.jp>
	Nrihiro Kumagai <kuma@slab.tnr.sharp.co.jp>
	Hirao Tetsuya <ai.cs.fujitsu.co.jp>
	Toshiharu Asai <asai@mbc.infoshere.or.jp>
	Shin'ya Kumabuchi <kumabu@t3.rim.or.jp>
        Freebsd-users-jp@jp.freebsd.org
	bsd-nomads@ai.cs.fujitsu.co.jp
1998-01-08 04:53:43 +00:00
Kazutaka YOKOTA
a3bd3dac25 Added accent (dead) key support to syscons and kbdcontrol.
With a keymap with accent key definitions loaded to syscons, you press
an accent key followed by a regular letter key to produce an accented
letter.  Press an accent key followed by the space bar to get the
accent letter itself.

Code is based on the ideas and work by jmrueda@diatel.upm.es and
totii@est.is.

PR: i386/4016

console.h
- Defined structures and constants for accent (dead) keys.

syscons.c, kbdtables.h
- When an accent key is pressed, set the corresponding index to
  `accents'.  If the next key is the space key, produce the accent char
  itself.  Otherwise search the accent key map entry, indexed by
  `accents', for a matching pair of a regular char and an accented char.
- Added ioctl functions to set and get the accent key map (PIO_DEADKEYMAP
  and GIO_DEADKEYMAP).
1998-01-07 08:40:34 +00:00
Jamil J. Weatherbee
b3add67273 documentation changes. 1998-01-06 09:27:37 +00:00
Bruce Evans
d35d7514ac Removed unused #includes. 1998-01-01 12:41:44 +00:00
Bruce Evans
82d86d3750 Moved the SMP declarations of INTREN() and INTRDIS() to the correct header,
i.e., the same header as corresponding non-SMP #defines.
1998-01-01 08:47:17 +00:00
Poul-Henning Kamp
0f12aa9ffd More cleanup relating to our use of the TSC.
Look in the cpu_feature (CPUID output) to see if we have it.
1997-12-28 17:33:10 +00:00
Poul-Henning Kamp
d46e059f94 wash, sort and put in order various nits from the i586_ctr -> tsc
commit.

Pointed out by: bde
1997-12-28 13:36:09 +00:00
Bruce Evans
88754aaf0e Fixed initialization of the divisor latch. We depended on siocnopen()
initializing it for the (usual) (siocniobase != 0) case, but
siocnopen() doesn't initialize it if the latch registers already
have the correct values.
1997-12-28 06:36:35 +00:00
Bruce Evans
abee4d9808 YAMFsio.c (always call ttwwakeup() before returning from comstart()). 1997-12-28 06:23:03 +00:00
Bruce Evans
e932603093 Always call ttwwakeup() before returning from comstart(). It isn't
necessary to call it when the tty layer's output state has not been
changed, but siostop() sometimes changes the TS_BUSY state and then
calls comstart() mainly for its side effect of calling ttwwakeup().
1997-12-28 06:20:47 +00:00
Bruce Evans
ab9bca19b8 Removed unnecessary (and broken) wakeup code in rpstart(). There is no
need to do it directly, since ttwwakeup() is always called just before
returning from rpstart().  The brokenness was waking up the wrong address
after clearing TS_SO_OLOWAT.  It's not clear how processes waiting for
output to drain below low water ever got woken up.

Found by:	when I fixed longstanding warts in output watermark
		handling, this was the only driver that knew too much
		(anything) about the watermarks
1997-12-28 05:45:07 +00:00
Jordan K. Hubbard
43b651a5e7 Change major number to match the one actually used (whoops!).
Submitted by:	Steve Gericke <steveg@comtrol.com>
1997-12-26 23:11:13 +00:00
Poul-Henning Kamp
71f461f86a Rename "i586_ctr" to "tsc" (both upper and lower case instances).
Fix a couple of printfs too.

Warning: This changes the names of a couple of kernel options!
1997-12-26 20:42:37 +00:00
Stefan Eßer
8277ac255e Make the class code checks in function pci_cfgcheck less strict.
It failed to recognize the PCI bus in a system that had only an
old chip-set (class code 000000) and a Cyclom multiport serial
card on PCI bus 0, but no VGA card or disk or network controller.

PR:		i386/5300
Submitted by:	Nickolay N. Dudorov <nnd@itfs.nsk.su>
1997-12-20 09:04:25 +00:00
Eivind Eklund
5591b823d1 Make COMPAT_43 and COMPAT_SUNOS new-style options. 1997-12-16 17:40:42 +00:00
Eivind Eklund
430df5f4b7 Throw options IPX, IPXIP and IPTUNNEL into opt_ipx.h.
The #ifdef IPXIP in netipx/ipx_if.h is OK (used from ipx_usrreq.c and
ifconfig.c only).

I also fixed a typo IPXTUNNEL -> IPTUNNEL (and #ifdef'ed out the code
inside, as it never could have compiled - doh.)
1997-12-15 20:31:25 +00:00
Tor Egge
5c623cb649 Add support for low resolution SMP kernel profiling.
- A nonprofiling version of s_lock (called s_lock_np) is used
    by mcount.

  - When profiling is active, more registers are clobbered in
    seemingly simple assembly routines. This means that some
    callers needed to save/restore extra registers.

  - The stack pointer must have space for a 'fake' return address
    in idle, to avoid stack underflow.
1997-12-15 02:18:35 +00:00
Peter Wemm
5eaf45f67b I've been using these tweaks to enable the sound driver to talk to the
(mutant) Crystal CSS4236 chip on the Intel PR440FX SMP motherboard.

XXX this uses some rather ugly PnP bootstrap code that is *NOT* compatable
with 'controller pnp0' or *ANY* other PnP devices.  If you use some other
PnP devices, enabling css0 will burn your house down. :-]  The
"simplified" PnP init sequence directly blats your config(8) settings onto
the chip.  I'm pretty sure 'css0' will conflict with 'mss0', this whole
area desperately needs a cleanup.

I have been using the following with some success on the PR440FX:
controller   snd0
device css0  at isa? port 0x534 irq 5 drq 1 flags 0x08 vector adintr
device opl0  at isa? port 0x388
device mpu0  at isa? port 0x330 irq 10 vector mpuintr
1997-12-12 14:08:50 +00:00
Jamil J. Weatherbee
6aa5dc4099 eliminated a previously unnoticde compile warning about use of
__inline, not good to use anyway ?!?!!
1997-12-09 12:41:13 +00:00
Jamil J. Weatherbee
4fdababa9f the alog.c file respectively, added in wrong order by accident 1997-12-09 12:07:50 +00:00
Steve Passe
baf41202ca The improvements to clock statistics by Tor Egge
Wrappered and enabled by the define BETTER_CLOCK (on by default in smpyests.h)

apic_vector.s also contains a small change I (smp) made to eliminate
the double level INT problem.  It seems stable, but I haven't the tools
in place to prove it fixes the problem.

Reviewed by:	smp@csn.net
Submitted by:	Tor Egge <Tor.Egge@idi.ntnu.no>
1997-12-08 22:59:39 +00:00
Kazutaka YOKOTA
c6d1bed112 - Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
  Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
  MieMouse, Logitech MouseMan+, FirstMouse+

- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.

- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.

- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.

- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.

/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
  and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
  Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.

/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
  to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON.  Use button bits
  defined in `mouse.h' instead.

/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
  features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones.  Most important
  of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
  While the output level remains zero, the output from the `psm' driver is
  in the standard PS/2 mouse format (three bytes long).  When the level
  is set to one, the `psm' driver will send data in the extended format.
  At the level two the driver uses the format which is native to the
  connected mouse is used. (Meaning that the output from the device is
  passed to the caller as is, unmodified.)  The `psm'  driver will pass
  such extended data format as is to the caller if the output level is
  two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
  (PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
  Acceleration ratio is now specified by the kernel configuration flags
  stated above.  Sync check logic is refined and now standard.
  The sync check can be turned off by the new kernel configuration flags
  PSM_CONFIG_NOCHECKSYNC (0x100).  PSM_EMULATION has been of little use.
- Summer clean up :-)  Removed unused code and obsolete comments.

/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
  Most importantly, the MOUSE_SETLEVEL ioctl will change the
  output format from the 5 byte format to the new, extended format
  so that the caller can take advantage of Z axis movement and additional
  buttons.
- Use constants defined in `mouse.h' rather than magic numbers.

/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
  ioctls defined in `mouse.h'.  Most importantly, the MOUSE_SETLEVEL
  ioctl will change the `sysmouse' output format from the MouseSystems
  5 byte format to the new, extended format so that the caller can
  take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
  single click action of the right button in the virtual console.  The
  left button double click will select a word under the mouse pointer.
  The triple click will select a line and the single click of the right
  button will extend the selected region to the current position of
  the mouse pointer.  This will make the cut/paste support more compatible
  with xterm.

/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
Bruce Evans
df1c78063c Use ENOIOCTL instead of -1 (= ERESTART) for diskslice ioctls that are
not handled at a particular level.
1997-12-06 14:27:56 +00:00
Bruce Evans
239b7b699e Use ENOIOCTL instead of -1 (= ERESTART) for tty ioctls that are
not handled at a particular level.  This fixes mainly restarting
of interrupted TIOCDRAINs and TIOCSETA{W,F}s.
1997-12-06 13:25:01 +00:00
Andrey A. Chernov
a76d828674 Attach messages: remove unneded newlines and add
missing conf_printf
1997-12-06 07:48:22 +00:00
KATO Takenori
4ec099d2b3 Use the argmument `port' instead of hard coded address in atapi_probe.
Submitted by:	kura@melchior.q.t.u-tokyo.ac.jp (Tomohiko Kurahashi)
1997-12-04 13:15:16 +00:00
Poul-Henning Kamp
ab3f746966 In all such uses of struct buf: 's/b_un.b_addr/b_data/g' 1997-12-02 21:07:20 +00:00
John-Mark Gurney
857c08d17c fix a few style nites...
make isa_dmacascade, isa_dmastart, isa_dmadone, and find_isadev MUCH
easier to be found by starting them at the beginging of the line...

remove braces inside of ifdef RESOURCE_CHECK... found by % in vi...
1997-11-30 09:44:28 +00:00
KATO Takenori
ead6305baa Recognize 3C569 network interface when `PC98' is defined.
Submitted by:	HAMADA Naoki <hamada@astec.co.jp>
1997-11-27 12:59:46 +00:00
Mark Murray
61ca849927 From the author:
Here are the remanding changes required to support the Ensoniq
Soundscape using FreeBSD 3.0-current.

Notes:

  1) ad1848_init already has code to detect if DMA_DUPLEX should
     be set so it is not necessary (and is in fact a mistake) to
     hard code setting it.  Not all soundcards (i.e. the current
     sscape driver) are capable of using DMA_DUPLEX.

  2) The other changes are hopefully self explanatory.  Feel free
     to let me know if you need additional information.

Submitted by:	john@feith.com (John Wehle)
1997-11-25 19:30:38 +00:00
Søren Schmidt
0690c6fe58 Move the hardware currsor off screen when getting back from an
unknown mode.
Fix warning on uninitialized var.
1997-11-25 12:44:44 +00:00
Bruce Evans
043e37feab Added a sysctl (machdep.cputime_clock) to select the clock used by
"high resolution" profiling.  The available clocks are:
- the i8254 clock
- on non-SMP i586's and i686's: the TSC
- on systems with I586_PMC_GUPROF configured, and PERFMON configured
  and available: all the performance counters.
This is unfinshed (there are problems with locking out the PERFMON
device driver, and with losing calibration after switching the clock),
but better than static configuration or writing to kmem.

Changed ifdefs to avoid generating code for non-working option
combinations.
1997-11-24 18:16:23 +00:00
Amancio Hasty
b237a8422d Fixed poll related problem which was exhibited by running
amp (audio mpeg player) and with cards such as SB.
1997-11-24 07:31:20 +00:00
Amancio Hasty
6eca7bce6c Fixed an acquired dma problem with respect to sb cards only. 1997-11-23 22:49:50 +00:00
Amancio Hasty
f8f6afaf7c minor code clean up to sb_dsp.c and fix compile error with uart6850.c 1997-11-23 20:31:20 +00:00
Amancio Hasty
0a8fa5851f Missing part of my last sb_dsp.c sb16_dsp.c commit. 1997-11-23 19:05:01 +00:00
Amancio Hasty
26ed678ef9 Fixed acquired dma channel problem. 1997-11-23 07:35:06 +00:00
John-Mark Gurney
60dc9be97b update of Luigi's sound drivers...
this updates to 971117 plus a small sb change that was after that release..
1997-11-23 07:03:21 +00:00
Bruce Evans
cc8ae84672 Moved splhigh()/spl0() calls from isa_configure() to configure() so that
there is a natural place to initialize `safepri' in a future commit.
Spinoffs:
- spl0() gets called in the unlikely event that isa is not configured.
- configure() has better control over enabling interrupts.
- it is now less unclear that interrupts aren't actually enabled early.
  Rev.1.48 of autoconf.c seems to have done the opposite of what was
  intended - moving the isa_configure() call delayed the spl0() side
  effect.
Added some comments about the bogons.  Removed the splhigh() call since
it is a no-op.
1997-11-21 18:14:02 +00:00
Kazutaka YOKOTA
10974dbd20 Make comp_vgaregs() less strict about VGA register values when
checking the BIOS video mode paramter table.  Now syscons uses the
parameter table even if some bits in the table are different from the
current VGA register settings.

Even if comp_vgaregs() finds that the BIOS video parameter table looks
totally unfamiliar to it, syscons allows the user to change the
current video mode to some modes which are based on the VGA 80x25
mode. They are VGA 80x30, VGA 80x50, VGA 80x60. In this case the user
will be warned, during boot, that video mode switching is only
paritally supported on his machine.

PR: bin/4477
1997-11-21 11:37:07 +00:00
Kazutaka YOKOTA
358e851a59 Fix for a PS/2 mouse model from MouseSystems. It now appears that
this mouse can correctly operate only in the high resolution mode.

If the mouse pointer jumps to the top or left edge or the top-left
corner of the screen, try defining PSM_MSCKLUDGE in the kernel
configuration file. This option will put the mouse in the high
resolution mode during device initialization.
1997-11-21 11:36:21 +00:00
Nate Williams
133c8c2f49 - Renamed <pccard/card.h> -> <pccard/cardinfo.h>.
Forgotten by:		me
Reminded by:		Bruce
1997-11-20 15:48:41 +00:00
Bruce Evans
4a162126e5 Removed unused #includes.
Fixed bugs in rev.1.35:
- nonblocking mode was per-device instead of per-file.
- lots of style bugs.
1997-11-18 16:01:15 +00:00
Bruce Evans
f2a6e0bc19 Get select stuff by including <sys/select.h> instead of <sys/proc.h>,
and don't include <sys/fcntl.h>.  (The select -> poll changes replaced
fcntl macros by poll macros.)

Use <machine/*.h> instead of <i386/include/*.h>.

Fail the probe instead of crashing in the unlikely event that malloc()
fails.
1997-11-18 12:21:32 +00:00
Bruce Evans
8318e21b25 Don't #include <i386/isa/isa_device.h>. It is now a prerequisite. 1997-11-18 11:47:04 +00:00
Bruce Evans
9b54c25692 Removed unused #includes.
Fixed #include order.  <i386/isa/isa_device.h> will soon be a prerequisite
for <i386/isa/pnp.h>.  Including both in alphebetical order gets this
right naturally.
1997-11-18 11:45:26 +00:00
Bruce Evans
e0605ebd12 Removed an unused #included.
Ifdefed #includes that are not used in the SMP case.
1997-11-18 11:32:31 +00:00
Bruce Evans
3b29bc9d27 Get select stuff by #including <sys/select.h> instead of <sys/proc.h>. 1997-11-18 11:30:10 +00:00
Bruce Evans
41d022ae9c Removed #unused includes.
Added a used #include (don't depend on yet to be fixed namespace pollution).
1997-11-18 11:16:56 +00:00
Bruce Evans
494bc6f09d Removed code for the !KERNEL case. It hasn't been maintained for 4
years and gives a "laugh"able number of compile-time errors (see the
comment).  main() just printed the struct sizes.  This can be done
better by compiling with -g and reading off the sizes from the stabs.

Sorted #includes.

Fixed an unsigned vs signed comparison.
1997-11-18 10:56:41 +00:00
Andrey A. Chernov
811be69f59 Restore diagnostic fix spammed after merging 1997-11-16 06:23:29 +00:00
Mark Murray
b41c00fa66 Fix conflicts. 1997-11-10 18:31:35 +00:00
Bruce Evans
326b780b04 Fixed chip_offsets[] which I broke in rev.1.53. The offsets aren't
actually offsets, they are offsets scaled by dividing by 2^cy_align.
I use different values for cy_align since the -current values are
unnaturally scaled, so I need different offsets, and the wrong
offsets got committed.

Reported by:	nnd@itfs.nsk.su (N.Dudorov)
1997-11-10 15:46:33 +00:00
Poul-Henning Kamp
0abc78a697 Rename some local variables to avoid shadowing other local variables.
Found by: -Wshadow
1997-11-07 09:21:01 +00:00
Poul-Henning Kamp
4a11ca4e29 Remove a bunch of variables which were unused both in GENERIC and LINT.
Found by:	-Wunused
1997-11-07 08:53:44 +00:00
Søren Schmidt
b113690ced Oops, forgot to count non-changer drives..
Broken by: sos
Reported by: phk
1997-11-05 21:32:00 +00:00
Andrey A. Chernov
dc185d2298 Do not print config details twice (first variant comes from isa)
Format config messages properly (with initial snd0: prefix)
1997-11-05 00:23:26 +00:00
Poul-Henning Kamp
89d664b2dc dk_altport is initialized in wdprobe(), but not in wdattach(), this
breaks wdreset(), wdunwedge() &c &c.

Should be examined in detail by:	dyson
1997-11-04 09:28:54 +00:00
Nate Williams
241fe562b4 - MF22: (I reversed these). Simplify code. 1997-11-02 21:26:14 +00:00
David Greenman
12a5bd8bcf Sigh, kill setting of 0WS...it breaks more machines than it fixes. 1997-11-02 07:12:52 +00:00
Mark Murray
415d4cb37a Bring our sound sources up to the level of Amancio's latest-and-greatest.
This corresponds to Voxware 3.5-alpha-<something> and Amancio's guspnp21.
There was a bit of a FUBAR during the commmit, so not all files are
mentioned in this commit's mail.

X-rant:	I have just started to _*HATE*_ CVS...
1997-10-31 17:25:35 +00:00
John-Mark Gurney
faac9650a5 This updates Luigi's sound code to the basic code in snd971023...
changes:
    o rip the old select from his distribution to prevent extra pollution
    o the code now uses audio dma, helps reduce clicks
    o improved card support, should work in full duplex on sb16 cards
    o add better voxware ioctl support pointed out by Joao Carlos Mendes
       Luis <jonny@coppe.ufrj.br>
    o remove an unused file that I included for more complete history
    o and MANY other changes

I have personally tested this code with a CS4237 based card and an AWE32
(non-PnP).  Both cards worked fine in 8bit and 16bit mode.
1997-10-31 12:24:28 +00:00
Mark Murray
1fa24a09c7 Upgrade the sound sources to Amancio Hasty's latest-and-greatest.
This is based on Voxware 3.5, and corresponds to Amancio's `guspnp21'.

Bug reports to Amancio, please!
1997-10-31 06:30:22 +00:00
Søren Schmidt
cac2057a29 First cut at supporting multi-CD CDROM drives (changers).
Very rudimentary, lots of error checks missing, but it works.
Dont do an ls on two different CD's though, it will eat your
changer mechanism for lunch :), this clearly needs some more
thought. Until then this will enable those with changers to
mount their multible CD's and doing "sensible" work....

Thanks to Andrew Gordon <arg@arg1.demon.co.uk> for donating a drive
(a NEC CDR-C251 4x4) that makes this possible to develop.
1997-10-29 22:11:00 +00:00
Nate Williams
be8e398409 - Make sure we include <sys/kernel.h> to pick up the definitions of DATA_SET()
Noticed by:	bde
1997-10-29 15:54:19 +00:00
John Polstra
0e5e974182 The previous change added a use of the DATA_SET macro, but forgot
to define it by including <sys/kernel.h>.  That broke PC-CARD
support for this driver, producing the dreaded "device allocation
failed" message.  Surprisingly, the missing include caused only
two compiler warnings.  The compilation still "succeeded" anyway.
1997-10-29 00:51:50 +00:00
Bruce Evans
55b211e3af Removed unused #includes. 1997-10-28 15:59:26 +00:00
Bruce Evans
7f47cf2f4a Don't include <machine/cputypes.h> or declare cputype/class interfaces
in <machine/cpu.h>.  Moved the declarations to <machine/cputypes.h>.
Fixed style bugs in the moved code.  Fixed everything that depended on
the nested include.  Don't include <machine/cpu.h> (in the changed files)
unless something in it is used directly.
1997-10-28 11:43:57 +00:00
Joerg Wunsch
03940bd636 Move the EP_ID_PORT out to 0x110, so it doesn't conflict with other port
usage at 0x100.  Quoted Justin's quotation from the manual as well, to
explain the technical background.

PR:		kern/4559
Submitted by:	Stephen J. Roznowski <sjr@home.net>
1997-10-27 06:15:10 +00:00
Bill Fenner
cca13d34b9 Fix a comment about multicast; since the Etherlink III has no
multicast filter the driver will never learn how to program it.
1997-10-27 00:02:33 +00:00
Nate Williams
075a76a29e - Instead of relying on a functional call to register PCARD-capable drivers,
use a Linker Set.  Note, if a driver is loaded as an LKM  if will have
  to use the function call, but since none of the existing drivers
  are loadable, this made things cleaner and boot messages nicer.

Obtained from:	PAO-970616
1997-10-26 21:08:42 +00:00
Kazutaka YOKOTA
4372a2b476 - Slightly change the way the border color register is updated so that
flicker won't occur when set_border() is called.

- Properly restore the border color when switching virtual consoles.

Pointed out by: tony@dell.com
OKed by: sos
1997-10-26 07:36:13 +00:00
Nate Williams
8bb7a8fc95 - Functional changes to PCCARD support.
* Kill individual drivers 'suspend' routines, since there's no simple/safe
   way to suspend/resume a card w/out going through the complete probe
   at initialization time.
 * Default to using the apm_pccard_resume sysctl code, which basically
   pretends the card was removed, and then re-inserted.  Suspend/resume
   is now 'emulated' with a fake insert/removal.  (Hence we no longer
   need the driver-specific suspend routines.)
1997-10-26 04:54:16 +00:00
Nate Williams
e7e437dbfa - Do a bunch of gratuitous changes intended to make the code easier to
follow.
 * Rename/reorder all of the pccard structures, change many of the member
   names to be descriptive, and follow more closely other 'bus' drivers
   naming schemes.
 * Rename a bunch of parameter and local variable names to be more
   consistant in the code.
 * Renamed the PCCARD 'crd' device to be the 'card' device
 * KNF and make the code consistant where it was obvious.
 * ifdef'd out some unused code
1997-10-26 04:36:24 +00:00
Kazutaka YOKOTA
38c6184fd5 Reject unreasonable values passed to CONS_HISTORY ioctl. It did not
check the value and caused kernel panic when a large value was given.

- Move the configuration option SC_HISTORY_SIZE from syscons.h to
syscons.c.
- Define the maximum total number of history lines of all consoles.
It is SC_HISTORY_SIZE*MAXCONS or 1000*MAXCONS; whichever is larger.
CONS_HISTORY will allow the user to set the history size up to
SC_HISTORY_SIZE unconditionally (or the current height of the console
if it is larger than SC_HISTORY_SIZE). If the user requests a larger
buffer, it will be granted only if the total number of all allocated
history lines and the requested number of lines won't exceed the maximum.
- Don't free the previous history buffer and leave the history buffer
pointer holding a invalid pointer. Set the pointer to NULL first, then
free the buffer.

PR: bin/4592
1997-10-23 03:23:50 +00:00
Nate Williams
549019305f - PCCARD support to the much maligned SCSI driver. This gives up support
for a couple of external CD's (notably the Sony PRD-650).

Note: In order to get my CD recognized, I had to configure the CD under
      Win95, but it seems to work now even if I turn it off.

Submitted by:	PAO [minor mods by me]
1997-10-21 17:57:31 +00:00
Joerg Wunsch
0722d6aba3 Introduce a device flags value of 0x1 to always pretend a 1.44 MB
floppy drive #0, regardless of what the CMOS says.  This is intended
as a bandaid for those plagued with Compaq's idea to not announce the
floppy drive on their `Aero' notebook.

Using the device flags is not very nice (in particular since they
aren't per-drive but per-controller), but still looks a lot better to
me than the disgusting guesswork hack that was recently posted to
-hackers.

Doc update will follow shortly.
1997-10-19 13:12:02 +00:00
Kazutaka YOKOTA
63f87bd194 Rename MOUSE_GETINFO to MOUSE_GETHWINFO. The name collided with the one
in console.h.
Pointed out by bde.
1997-10-19 10:45:18 +00:00
Joerg Wunsch
d37346eefb Make all the documented (in pcvt(4)) options supported options. While
i was at it, do no longer insist on `PCVT_FREEBSD' being declared in
the config file, but default it to a reasonable value.

More cleanup to follow, but this part is safe for RELENG_2_2, too.
1997-10-18 10:59:47 +00:00
Joerg Wunsch
3529601895 Hide a silly ``unknown board type'' message behind bootverbose. The
``ie0: not found'' message is sufficient as a default.
1997-10-15 10:09:24 +00:00
Jun-ichiro itojun Hagino
7c66fb14b3 if_ep.c clarification/simplification.
- irq = 9 problem (PR 4693)
- mbuf chaining oddity fixed. (PR 4693)
- trailer protocol has gone. (PR 4693)
- removed mbuf kludge, we got higher performance. (PR 4693)
- some indentation fixes

I'm sorry that I couldn't make a 2.2.5-RELEASE deadline.

PR:		4693
Reviewed by:	babkin@hq.icb.chel.su
Submitted by:	hamada@tom-yam.or.jp
1997-10-14 06:56:09 +00:00
Steve Passe
58e63a06b4 Disable the TEST_CIL code till I can commit the complete solution.
Noticed by:	Peter Wemm <peter@netplex.com.au>
1997-10-13 00:01:53 +00:00
Poul-Henning Kamp
a1c995b626 Last major round (Unless Bruce thinks of somthing :-) of malloc changes.
Distribute all but the most fundamental malloc types.  This time I also
remembered the trick to making things static:  Put "static" in front of
them.

A couple of finer points by:	bde
1997-10-12 20:26:33 +00:00
Jordan K. Hubbard
43990fb0dc Back out my LALT -> META change until we figure out a way to make it
work sympathetically with the function keys.
1997-10-12 19:57:49 +00:00
Søren Schmidt
d6d578d040 Fix bug when using DEVFS, drives on second controller sisn't appear
in the device filesystem.

Submitted by:	Andre Albsmeier <Andre.Albsmeier@mchp.siemens.de>
1997-10-12 16:22:01 +00:00
Jordan K. Hubbard
02630e3d73 Allow "foo0: disabled, not probed" message to stay, but make it conditional
on bootverbose so that those who _really wanna know_ still can.
Compromise suggested by:	joerg
1997-10-12 08:31:41 +00:00
Jordan K. Hubbard
116851ffa3 Change default keymap (I left all the international ones alone) so
that LALT is META by default.  This will make the emacs users happy.
Approved by: sos
1997-10-10 10:32:53 +00:00
Gene Stark
87737c5d85 Fixed spot in twintr() where tw_control and TWC_SYNC were used instead
of tw_zcport and tw_zcmask.  Could cause problems for people who use
pin 12 for sync.
1997-10-06 04:43:46 +00:00
David Greenman
bcedb8707e Backed out part of a previous change: don't set ZWS on '790 chips; it has
shown to be harmful in that it results in the card not being detected
properly on warmboot due to the station address failing to be read
correctly from the NVRAM.
1997-10-03 16:26:15 +00:00
Søren Schmidt
3bd724f2b3 Add a new keyboard mode K_CODE. Returns a single byte for each key
much like the scancode mode.
However the keys that (for no good reason) returns extension codes
etc, are translated into singlebyte codes.
Needed by libvgl.  This makes life ALOT easier, also the XFree86
folks could use this.
1997-10-01 20:46:29 +00:00
Steve Passe
33be7322dc Fixed a foobar on my part that broke non-SMP kernels. (I need some sleep...) 1997-09-29 05:32:02 +00:00
Steve Passe
10de100e2e Screwed the debug for the cil deadlock, another 3 hours down the tubes... 1997-09-29 00:04:33 +00:00
Steve Passe
c2d4a15648 Added a couple short-term debugs and a fix to the SPIN_MAX variable.
Debugs are an attempt to ferret out the PUSHDOWN_LEVEL_3 deadlock.
1997-09-28 19:34:48 +00:00
Justin T. Gibbs
643b3d0cf2 Fix a serious bug I introduced while adding in support for CAM interrupts.
It seems I didn't count my 0's properly when adding the new masks into
icu_vector.s pushing SWI_AST_MASK off the end of the array and screwing
up the indexing for SWI_CLOCK_MASK.

Fix the bug icu_vector.s and also reformat the code in both icu_vector.s and
apic_vector.s so that it will be much harder to make the same mistake in
the future.

Submitted by:	Bruce Evans <bde@zeta.org.au>
1997-09-28 19:30:01 +00:00
Stephen McKay
a2575e01e8 Add a small hack to support the strange antics of the Unisys ELI 4003. This
machine generates an NMI for each floating point error, just like an old XT.
Since it is ISA only, reading the EISA status port yields 0xff, which would
give a spurious EISA panic.  The simplest thing to do is to ignore the 0xff.
1997-09-28 15:48:34 +00:00
Steve Passe
39a3d94ba8 Added a missing comma for the INTR_SPL case. 1997-09-27 20:07:58 +00:00
Joerg Wunsch
91f7577b37 Hide the `no magic' babble behind bootverbose, since it has proven to
be too much magic for 99.9 % of the users.
1997-09-27 15:34:34 +00:00
Mike Smith
3d29b3509d The previous commit broke support for the Pro/10; detect which sort of
card we are using and calculate the IRQ accordingly.
1997-09-26 17:17:43 +00:00
Jun-ichiro itojun Hagino
be83a6fab3 tiny update of ESC sequence parser.
- some addition of comments (for readability)
- iso-2022 G0 designation support.  This does almost nothing.  Just for
  avoiding garbled screen when got "ESC ( B".
  (how about G1/2/3 designation? I'm not sure)
1997-09-26 15:27:55 +00:00
Justin T. Gibbs
27651b7faa Fix a call to timeout that wasn't properly saving it's callout handle.
Submitted by:	 durian@plutotech.com
1997-09-23 22:14:43 +00:00
Justin T. Gibbs
ee573943a2 Add a missing bufq_init call. The original code never initialized it's
buffer queue so I missed this when I changed buf_queue_head.

This probably fixes Soren's problem too, but he never mentioned
which CD driver he was using. 8-)

Submitted by:	dave adkins <adkin003@tc.umn.edu>
1997-09-22 22:58:08 +00:00
Justin T. Gibbs
30153f33ba restore a line I accidentally deleted with my callout changes.
Submitted by:	bde@FreeBSD.org
1997-09-22 18:04:42 +00:00
KATO Takenori
6936988f22 Update for changes in the callout interface. 1997-09-22 12:25:31 +00:00
Justin T. Gibbs
3544218335 Update for changes in the callout interface. 1997-09-21 21:43:54 +00:00
Justin T. Gibbs
2ee1f005b0 soundcard.c:
Update for changes in the callout interface.

sequencer.c:
	Add a paren that seems to have gone missing.
1997-09-21 21:43:35 +00:00
Justin T. Gibbs
02a199102d aha1542.c aic6360.c cy.c fd.c ft.c
if_ie.c if_wl.c if_zp.c isa.c isa_device.h
labpc.c mcd.c ncr5380.c scd.c seagate.c si.c
sio.c tw.c ultra14f.c wcd.c wd.c:

	Update for changes in the callout interface.

apic_vector.s icu_vector.s ipl.s ipl_funcs.c:

	Add CAM software/hardware interrupt support.
1997-09-21 21:41:49 +00:00
Peter Wemm
71eed6962e Recognize the CS4326 on the Intel PR440FX motherboard. (It works just like
the normal CS4326 except that it's had it's ID's tweaked for some reason)
Also mark the device as alive in the attach routine so that the pnp system
doesn't think the attach failed.
1997-09-21 03:27:51 +00:00
Peter Wemm
dbe8d08328 Fix a comment-within-a-comment 1997-09-21 03:21:34 +00:00
Peter Wemm
f0a7d5305e Accept FIOASYNC (like the old sound driver) since it's generated by
kern_descrip.c when the user does an fcntl(.., F_SETFL, ...).
1997-09-21 03:20:36 +00:00
John Dyson
e871e61fcf Addition of support of the slightly rogue Promise IDE interface(Dyson), support
of multiple PCI IDE controllers(Dyson), and some updates and cleanups from
John Hood, who originally made our IDE DMA stuff work :-).

I have run tests with 7 IDE drives connected to my system, all in DMA
mode, with no errors.  Modulo any bugs, this stuff makes IDE look
really good (within it's limitations.)

Submitted by:	John Hood <cgull@smoke.marlboro.vt.us>
1997-09-20 07:41:58 +00:00
Peter Wemm
ab71361364 Adjust the #ifdef KERNEL so that pnp_cinfo is available for sbin/dset.c
Other ways around this might be to #define KERNEL in dset.c for the
"i386/isa/pnp.h" include.
1997-09-20 06:26:28 +00:00
John-Mark Gurney
6a796ce0a1 teach sio how to attach to isa PnP cards. This is mainly for use with
internal modems.  Currently detects a USR modem, and a couple Supra
modems...  vendor id's for sio capabile cards welcomed...

document new option EXTRA_SIO that will increase sio's internal data
structures to support X more serial ports...  these are used by the
PnP part of sio for attaching...  If you don't have it specified, it
will default to 2...  This is defaulted to 0 if you don't have PnP
compiled into your kernel...

also document that if you set the PnP flags (pnp x flags y) to 0x1 that
the modem will be refused to be recognized by the sio driver... this
is for people that want the traditional isa driver to probe and attach
the modem... (for keeping legacy sio numbering)
1997-09-19 15:25:49 +00:00
John-Mark Gurney
77509afdf3 teach pnp to keep isa_device structs around, and teach isa.c how to scan
these structs for conflics...

it still exist that two PnP cards can colide, but this is up to the user
to make sure it doesn't happen...

other modifications to pnp.c to format output properly, and hide more
output behind bootverbose flag...

fix some bugons in pnp.h that would of made it difficult for inclusion
in external programs (for import of pnpinfo)
1997-09-19 15:20:25 +00:00
John-Mark Gurney
a63406129a wrap kernel interface in #ifdef KERNEL/#endif
hide more verbosity behind bootverbose

make it so that it doesn't emit as many warnings durning compiling...
1997-09-18 08:04:13 +00:00
John-Mark Gurney
f2ae16ee38 update Luigi's driver to poll interface (Peter, you might want to check
that I've done this properly, it does work though :) )...

a few minor fixes to code

part-Submitted-by:	Luigi
1997-09-18 07:47:03 +00:00
Tor Egge
d66c374f58 Enable the FIFO on enhanced floppy controllers. This reduces the
number of dma overruns/underruns for systems under heavy dma load.
As a side effect, broken enhanced floppy controllers that sometimes
don't detect dma overruns/underruns will give less errors.

Reviewed by:	j@uriah.heep.sax.de (J Wunsch)
1997-09-17 20:16:17 +00:00
Joerg Wunsch
d2fb48929a Make FDC_DEBUG a supported option.
Hide the bogus FDC ``chip type'' display behind a (mostly) undocumented
option, since people started to trust the bogus claim.  Once we're going
to handle 2.88 MB controllers, we have to redo the chip detection, by
now just leave it hidden.
1997-09-16 07:45:45 +00:00
John-Mark Gurney
6b4b86e517 remove redudant decls from this header file (used for 2.2.x compat) 1997-09-15 07:34:49 +00:00
John-Mark Gurney
f7fdb354ff add some preprocessor lines to prevent both controler snd0 and
device pcm0 from being loaded into the kernel at the same time.  As
this generates compilation errors, I just error out.

Requested-by: Jordan
1997-09-15 06:35:13 +00:00
John-Mark Gurney
b7da7b3e2a Import of Luigi Rizzo's sound code. For more information about the driver
check out the README that is included.

Submitted by:	Luigi Rizzo <luigi@labinfo.iet.unipi.it>
1997-09-14 21:42:12 +00:00
Joerg Wunsch
acb902182f Fix the broken VT_WAITACTIVE ioctl for the case where the third arg
was 0.

PR:		4164
Submitted by:	Joe Traister <traister@mojozone.org>

While i was at it, also fixed a broken return value for the VT_RELDISP
ioctl, iff the third arg was legally VT_TRUE, but the destination
screen was in process mode so the actual switch had to be deferred.
This was breaking the ability to directly toggle between two X servers
running on two VTs, since the server getting the bogus error return
was running wild, and competing with the other one for the hardware.
(Sigh, this was a very long-standing bug.)
1997-09-14 19:01:01 +00:00
Peter Wemm
35b8b2ddab Update select -> poll in drivers. 1997-09-14 03:19:42 +00:00
Peter Wemm
ea8ef05f7e Update select -> poll.
I am not particularly happy with this stuff, I have no way to test it.
1997-09-14 03:12:54 +00:00
Joerg Wunsch
cae6f73ac2 Revert the logic behind my last change, and use a function called
`is_physical_memory()' now for the decision whether to dump some
region of memory or not.

Suggested by:	davidg
1997-09-13 16:12:15 +00:00
Mike Smith
0e1fcae272 Support Intel EtherExpress Pro 10+
PR:		kern/4335
Reviewed by:	Stephen Roznowski (sjr@home.net)
1997-09-12 08:30:57 +00:00
Joerg Wunsch
e0b78e19f2 Do not ever try to coredump adapter memory regions.
PR:		4486
Submitted by:	tegge@idi.ntnu.no (Tor Egge)

Implement a function is_adapter_memory() in order to determine what
should nto be dumped at all.  Currently, only populated with the ``ISA
memory hole''.  Adapter regions of other busses should be added.
1997-09-10 12:31:40 +00:00
David Greenman
dab47f02cf Change the address for the low end of what we permit from c0000 down
to a0000 so that people can put their cards in the middle of their
video memory if they want. :-)
1997-09-10 00:17:39 +00:00
John-Mark Gurney
2daf730067 add the plug-and-play code into current...
This code has been submitted by Luigi Rizzo <luigi@labinfo.iet.unipi.it>,
based on work done by Sujal Patel.

This currnetly doesn't provide the ability to register the port address
of PnP cards assigned a PnP driver.  As there aren't any PnP capible
drivers yet, this isn't much of a problem.

The code allows you, through USERCONFIG, configure what the cards port
bases, irqs, and dma's are like.  Currently there isn't support to view
what cards are in the sytem.

It successfully configures my PnP Internal Modem and sio then sees the
card as a normal isa device.

man page will be committed shortly.

Approved-by: jkh
Submitted-by: Luigi Rizzo
1997-09-09 12:31:58 +00:00
David Greenman
7dfe7bef0b Added a check for the ISA memory address range being valid. Fixes PR#835. 1997-09-08 20:00:21 +00:00
David Greenman
6514ad5540 Turn on the 0WS option for 16bit cards. Newer machines insert enough
delay that without this the performance is unacceptable. The 83C690,
83C790, and 83C795 chips which this affects are all designed to work
with 0 waitstates in 16bit mode.
Also cleaned up the toggling of 16bit access mode that occurs during
normal operation; the previous code may not have done the right thing
in all cases.
1997-09-08 10:27:09 +00:00
Peter Wemm
421f9ee1ef Change an assemble-time divide into a shift. Under binutils-2.8 gas in elf
mode, the slash is a comment leader, while under non-elf it is a divide
symbol (what a concept! :-).  Theoretically, #APP/#NO_APP can change this
but that doesn't seem to mesh too well with macros and line continuation.
1997-09-08 06:40:58 +00:00
Steve Passe
20233f27f4 General cleanup of the lock pushdown code. They are grouped and enabled
from machine/smptests.h:

#define PUSHDOWN_LEVEL_1
#define PUSHDOWN_LEVEL_2
#define PUSHDOWN_LEVEL_3
#define PUSHDOWN_LEVEL_4_NOT
1997-09-07 22:04:09 +00:00
Bruce Evans
da8ac9bcd1 Include kernel.h instead of declaring "extern int hz". 1997-09-07 04:21:25 +00:00
Wolfgang Helbig
59c98c07d3 Enable A law encoding.
Enable A law encoding.
1997-09-06 17:39:06 +00:00
Wolfgang Helbig
312ae708cd Enable A law encoding. 1997-09-06 17:38:29 +00:00
Kazutaka YOKOTA
9d6218d088 Add a new compile option SC_HISTORY_SIZE to specify the history buffer
size in terms of lines (instead of bytes).  When changing video mode
in ioctl SW_XXX commands, syscons checks scp->history_size and
allocate a history buffer at least as large as the new screen size.
(This was unnecessary before, because HISTORY_SIZE was as large as 100
lines and this is bigger than the maximum screen size: 60 lines).
Similar adjustment is done in ioctl CONS_HISTORY command too.

PR: kern/4169
Reviewed by: sos
1997-09-04 23:01:06 +00:00
Søren Schmidt
1f7727a963 Upgrade of EIDE DMA support, Johns comments:
* lots of fixes to error handling-- mostly works now
* improve DMA timing config for Triton chipsets-- PIIX4 and UDMA drive
  still untested
* generally improve DMA config in many ways-- mostly cleanup
* clean up boot-time messages
* rewrite PRD generation algorithm
* first wd timeout is now longer, to handle drive spinup

Submitted by: John Hood <cgull@smoke.marlboro.vt.us>
1997-09-04 18:49:53 +00:00
Søren Schmidt
44b9771a14 1) Changed the volume to be a little louder.
2) Added a non_blocking flag to the write routine.
 3) Added a 3rd buffer (actually a ring buffer would be better)

Submitted by: Jim Lowe <james@miller.cs.uwm.edu>
1997-09-03 19:08:05 +00:00
Bruce Evans
ef4ce80f95 Cleaned up revs 1.36-1.40 (mainly disordered declarations, non-bogus
indentation (it is supposed to be bogus to match sio.c), and long lines).
1997-09-03 01:50:24 +00:00
Steve Passe
010e669615 Removed the "globl" nature of the vec array. This was left over from the
time when icu.s was common between UP and SMP.  It is not necessary for UP
and thus can be removed from icu_ipl.s.
1997-09-02 19:40:13 +00:00
Bruce Evans
4d1d4912ae Added used #include - don't depend on <sys/mbuf.h> including
<sys/malloc.h> (unless we only use the bogusly shared M*WAIT flags).
1997-09-02 01:19:47 +00:00
Steve Passe
1de995bb1f General cleanup of the sub-system locking macros.
Eliminated the RECURSIVE_MPINTRLOCK.
clock.c and microtime use clock_lock.
sio.c and cy.c use com_lock.

Suggestions by:	Bruce Evans <bde@zeta.org.au>
1997-09-01 07:45:37 +00:00
Bruce Evans
0ec3217356 Removed unused #includes. 1997-09-01 02:08:42 +00:00
Bruce Evans
6f7319427a Fixed absolute pathnames in #includes. 1997-09-01 01:57:27 +00:00
Steve Passe
adc91a77c1 Created a private simple_lock to control accesses to com data structs
and hardware.
There is now another simple_lock around clock data/hardware accesses in
clock.c and microtime.s.  It is my belief that this is the only area
sio/cy might stumble into during an unblocked INTerrupt.  Thus I separated
the sio/cy code from the generic disable_intr()/enable_intr() routines.

Controlled by smptests.h: USE_COMLOCK, ON by default.
1997-08-31 03:17:18 +00:00
Steve Passe
78292efeef Another round of lock pushdown.
Add a simplelock to deal with disable_intr()/enable_intr() as used in UP kernel.
UP kernel expects that this is enough to guarantee exclusive access to
regions of code bracketed by these 2 functions.
Add a simplelock to bracket clock accesses in clock.c: clock_lock.

Help from:	Bruce Evans <bde@zeta.org.au>
1997-08-30 08:08:10 +00:00
Steve Passe
34162fc615 Support for the new FAST_HI algorithm, enabled.
Preliminary support for the INTR_SIMPLELOCK algorithm, disabled.
Note that this code is NOT ready.
1997-08-29 18:45:23 +00:00
Jordan K. Hubbard
b9c72653a1 Patch for 3.0: #include <sys/fcntl.h> instead of <sys/ioctl.h> 1997-08-28 15:23:10 +00:00
Jordan K. Hubbard
866595c01c ISA driver for Comtrol Rocketport serial cards. No PCI probe stub
was submitted to me.
Submitted by:	Amir Farah <amir@comtrol.com>
1997-08-28 12:19:05 +00:00
KATO Takenori
27cb053198 Moved include files which are independent of bs driver. 1997-08-28 09:23:57 +00:00
Mike Smith
1b0b864911 Add prototype for isa_dmastop() 1997-08-28 03:37:46 +00:00
Mike Smith
67fb1e6a0c Here is a patch to alleviate the current problem with the dma interface
and the sound driver which uses auto dma.

The  dma interface functionality remains however it now checks
to see if a dma is operating in auto dma mode and if so it bypasses
the busy flag check . I have modified the sound driver 3.5  to
adjust for this new behavior and tested it under FreeBSD 3.0 -current

This patch also includes the new function isa_dmastop.

Submitted by:	Amancio Hasty <hasty@rah.star-gate.com>
1997-08-28 03:36:40 +00:00
Bruce Evans
8e5aa32a09 Fixed pedantic syntax error (trailing comma in enum). 1997-08-25 23:31:05 +00:00
Bruce Evans
7c941b1013 Removed more abuses of timeout_func_t. 1997-08-25 23:28:58 +00:00
Bruce Evans
0cb69e7a49 Removed unused misplaced definition of TIMER_FREQ.
Use less-magic numbers in the definition of HISTORY_SIZE.
1997-08-25 23:21:55 +00:00
Bruce Evans
f438d8b44e Fixed reversed arguments and poor formatting and comments for OUT*.
The reversals were doubled except in comments so there was no problem
at runtime.
1997-08-25 23:17:33 +00:00
Bruce Evans
72e81c1a11 Fixed some not-so-recently broken indentation.
Fixed pedantic syntax error (trailing comma in enum).
1997-08-25 23:06:29 +00:00
Bruce Evans
70df00b826 Fixed some not-so-recently broken indentation.
Fixed pedantic syntax error (trailing comma in enum).
1997-08-25 22:58:29 +00:00
Bruce Evans
ccea0a158a Check for irq conflicts even if conflicts are allowed. Conflicting
irqs can't work (at best, the first one attached wins).  It used to
be necessary to skip this check because of bogus irqs in the sound
drivers, but the sound drivers have been fixed, except possibly the
OSS ones.
1997-08-25 22:52:59 +00:00
Bruce Evans
c77b8656bb Fixed type mismatch for a (low quality interface) function with an
arg of type u_short (just write the function in ANSI C like most
other functions in this file instead of fixing the interface or
depending on a gcc feature).
1997-08-25 22:34:25 +00:00
Bruce Evans
ca56099a40 Police 4.4Lite #include style. 1997-08-25 22:28:57 +00:00
Bruce Evans
fe18edae06 Fixed type mismatch for a (low quality interface) function with an arg
of type u_char (break K&R support instead of fixing the interface or
depending on a gcc feature).
1997-08-25 22:23:46 +00:00
Steve Passe
8ee0110a44 A clean fix for the spl "deadlock before smp_active" problem.
Added a new variable, 'bsp_apic_ready', which is set as soon as the bootstrap
CPU has initialized its local APIC.  Conditionalize the GENSPLR functions
to call ss_lock ONLY after bsp_apic_ready is TRUE;  This should prevent
any problems with races between the time the 1st AP becomes ready and the
time smp_active is set.
1997-08-24 20:33:32 +00:00
Steve Passe
e49f6a7c8d Fix a deadlock caused by one of the spl functions being called before
ss_lock() can run.

Noticed by:	dave adkins <adkin003@gold.tc.umn.edu>
1997-08-24 17:26:37 +00:00
Steve Passe
886e789627 The last of the encapsolation of cpl/spl/ipending things into a critical
region protected by the simplelock 'cpl_lock'.

Notes:

 - this code is currently controlled on a section by section basis with
   defines in machine/param.h.  All sections are currently enabled.

 - this code is not as clean as I would like, but that can wait till later.

 - the "giant lock" still surrounds most instances of this "cpl region".
   I still have to do the code that arbitrates setting cpl between the
   top and bottom halves of the kernel.

 - the possibility of deadlock exists, I am committing the code at this
   point so as to exercise it and detect any such cases B4 the "giant lock"
   is removed.
1997-08-24 00:05:37 +00:00
Bruce Evans
b1037dcd53 #include <machine/limits.h> explicitly in the few places that it is required. 1997-08-21 20:33:42 +00:00
Steve Passe
e6b54a1659 Get le_intr decl from sys/conf.h 1997-08-21 09:01:00 +00:00
Steve Passe
e59a7e77e2 Forward declaration for the intr routine, avoids compiler warning. 1997-08-21 07:55:10 +00:00
Philippe Charnier
40d5099441 Revert my previous commit about using CS_SECURE macro.
Requested by:	Bruce.
1997-08-21 06:33:04 +00:00
Steve Passe
f2cf811ca6 Fixed a warning about undefined isa_irq_pending(). (UP kernel only) 1997-08-21 06:16:12 +00:00
Steve Passe
b3e4e390f6 Moved the COM_LOCK and COM_UNLOCK macros to machine/param.h. 1997-08-21 05:47:25 +00:00
Steve Passe
201ef2f3f3 Another boo-boo, this file defines cil. 1997-08-21 05:19:26 +00:00
Steve Passe
4a73d99f7e Made PEND_INTS default.
Made NEW_STRATEGY default.
Removed misc. old cruft.

Centralized simple locks into mp_machdep.c
Centralized simple lock macros into param.h

More cleanup in the direction of making splxx()/cpl MP-safe.
1997-08-21 05:08:25 +00:00
Steve Passe
a2c1225d0e Attempt to make cy.c MP-safe.
I have no way of testing this one, first SMP/cy user please let me know...
It is my belief that sio and cy are the only FAST_INTR() ISRs.  If this
is a bad assumption please educate me.
1997-08-20 06:16:44 +00:00
Steve Passe
7b185ef809 Preperation for moving cpl into critical region access.
Several new fine-grained locks.
New FAST_INTR() methods:
 - separate simplelock for FAST_INTR, no more giant lock.
 - FAST_INTR()s no longer checks ipending on way out of ISR.
sio made MP-safe (I hope).
1997-08-20 05:25:48 +00:00
Philippe Charnier
15f3549108 Use CS_SECURE macro.
Reviewed by:	John Dyson
1997-08-18 06:58:59 +00:00
Mike Smith
cc11e361c3 Minor ppc_data structure tweak.
Submitted by:	Nicolas Souchu <Nicolas.Souchu@prism.uvsq.fr>
1997-08-16 14:07:26 +00:00
Mike Smith
676465394a ISA Parallel-Port Bus chipset driver.
Submitted by:	Nicolas Souchu <Nicolas.Souchu@prism.uvsq.fr>
1997-08-14 14:01:36 +00:00
Steve Price
1393383a2e Add parentheses because == has higher precedence than &.
PR:		i386/4225
Submitted by:	Frank MacLachlan <fpm@n2.net>
1997-08-13 02:40:06 +00:00
Steve Passe
a5e8237d2a Oops, fix breakage to UP kernel. 1997-08-10 21:18:01 +00:00
Steve Passe
e7802310d2 Added trap specific lock calls: get_fpu_lock, etc.
All resolve to the GIANT_LOCK at this time, it is purely a logical partitioning.
1997-08-10 20:59:07 +00:00
Steve Passe
6354231eaa Added 'lock' instruction before 3 places that update ipending.
This may or may not fix the "high IO freezes SMP kernel" problem.
1997-08-09 19:40:28 +00:00
Søren Schmidt
8bce501fd0 Fix the checks for screenborder for the mousepointer. 1997-08-09 19:24:03 +00:00
Julian Elischer
63fe995cb4 Teach both disk drivers how to cope with a hardware watchdog
while dumping core.. I'm tired of getting 1/2 of a core-dump

conditional on -DHW_WDOG for now
this will migrate to 2.2 as that's where I need it.
1997-08-09 01:44:25 +00:00
John Dyson
48a09cf276 VM86 kernel support.
Work done by BSDI, Jonathan Lemon <jlemon@americantv.com>,
	Mike Smith <msmith@gsoft.com.au>, Sean Eric Fagan <sef@kithrup.com>,
	and probably alot of others.
Submitted by:	Jnathan Lemon <jlemon@americantv.com>
1997-08-09 00:04:06 +00:00
Søren Schmidt
a1af9248eb Yeah I'm back hacking syscons !!
Add support for MODEX 320x240x256color with "unchained" adressing, giving
access to all 256K on all VGA's, those with that much memory that is :)

Also make sysmouse use the right resolution in graphics modes.
1997-08-08 22:52:30 +00:00
Steve Passe
9d37772f68 Added include of intr_machdep.h to eliminate compiler warning for APIC_IO. 1997-08-04 19:12:54 +00:00
John Dyson
8ee6f26a8c Make the WD code work on my P6DNF running on the SMP code. It appears
that there was an "early" interrupt, and this checks for it.
1997-08-04 05:26:49 +00:00
Mike Smith
0948846d9e Reinstate some of the previous fixes which were clobbered in r1.6. 1997-08-02 05:19:32 +00:00
Mike Smith
10731762e6 Significant bugfix and upgrade for the Wavelan (wl) driver.
This now includes code to handle the 2.4GHz WaveModem-based cards.

Submitted by:	Jim Binkley <jrb@cs.pdx.edu>
1997-08-01 03:36:12 +00:00
Steve Passe
e9e75c4e9a Fixed imen alignment.
Submitted by:	Bruce Evans <bde@zeta.org.au>
1997-07-31 17:28:56 +00:00
Steve Passe
d1283d9c9d Converted the TEST_LOPRIO code to default.
removed PEND_INTS 1st try
direct call to MPtrylock
1997-07-31 05:42:06 +00:00
Søren Schmidt
8b8a0b53b1 Add support for busmaster DMA on some PCI IDE chipsets.
I changed a few bits here and there, mainly renaming wd82371.c
to ide_pci.c now that it's supposed to handle different chipsets.

It runs on my P6 natoma board with two Maxtor drives, and also
on a Fujitsu machine I have at work with an Opti chipset and
a Quantum drive.

Submitted by:cgull@smoke.marlboro.vt.us <John Hood>

Original readme:

*** WARNING ***

This code has so far been tested on exactly one motherboard with two
identical drives known for their good DMA support.

This code, in the right circumstances, could corrupt data subtly,
silently, and invisibly, in much the same way that older PCI IDE
controllers do.  It's ALPHA-quality code; there's one or two major
gaps in my understanding of PCI IDE still.  Don't use this code on any
system with data that you care about; it's only good for hack boxes.
Expect that any data may be silently and randomly corrupted at any
moment.  It's a disk driver.  It has bugs.  Disk drivers with bugs
munch data.  It's a fact of life.

I also *STRONGLY* recommend getting a copy of your chipset's manual
and the ATA-2 or ATA-3 spec and making sure that timing modes on your
disk drives and IDE controller are being setup correctly by the BIOS--
because the driver makes only the lamest of attempts to do this just
now.

*** END WARNING ***

that said, i happen to think the code is working pretty well...

WHAT IT DOES:

this code adds support to the wd driver for bus mastering PCI IDE
controllers that follow the SFF-8038 standard.  (all the bus mastering
PCI IDE controllers i've seen so far do follow this standard.)  it
should provide busmastering on nearly any current P5 or P6 chipset,
specifically including any Intel chipset using one of the PIIX south
bridges-- this includes the '430FX, '430VX, '430HX, '430TX, '440LX,
and (i think) the Orion '450GX chipsets.  specific support is also
included for the VIA Apollo VP-1 chipset, as it appears in the
relabeled "HXPro" incarnation seen on cheap US$70 taiwanese
motherboards (that's what's in my development machine).  it works out
of the box on controllers that do DMA mode2; if my understanding is
correct, it'll probably work on Ultra-DMA33 controllers as well.
it'll probably work on busmastering IDE controllers in PCI slots, too,
but this is an area i am less sure about.

it cuts CPU usage considerably and improves drive performance
slightly.  usable numbers are difficult to come by with existing
benchmark tools, but experimentation on my K5-P90 system, with VIA
VP-1 chipset and Quantum Fireball 1080 drives, shows that disk i/o on
raw partitions imposes perhaps 5% cpu load.  cpu load during
filesystem i/o drops a lot, from near 100% to anywhere between 30% and
70%.  (the improvement may not be as large on an Intel chipset; from
what i can tell, the VIA VP-1 may not be very efficient with PCI I/O.)
disk performance improves by 5% or 10% with these drives.

real, visible, end-user performance improvement on a single user
machine is about nil. :) a kernel compile was sped up by a whole three
seconds.  it *does* feel a bit better-behaved when the system is
swapping heavily, but a better disk driver is not the fix for *that*
problem.

THE CODE:

this code is a patch to wd.c and wd82371.c, and associated header
files.  it should be considered alpha code; more work needs to be
done.

wd.c has fairly clean patches to add calls to busmaster code, as
implemented in wd82371.c and potentially elsewhere (one could imagine,
say, a Mac having a different DMA controller).

wd82371.c has been considerably reworked: the wddma interface that it
presents has been changed (expect more changes), many bugs have been
fixed, a new internal interface has been added for supporting
different chipsets, and the PCI probe has been considerably extended.

the interface between wd82371.c and wd.c is still fairly clean, but
i'm not sure it's in the right place.  there's a mess of issues around
ATA/ATAPI that need to be sorted out, including ATAPI support, CD-ROM
support, tape support, LS-120/Zip support, SFF-8038i DMA, UltraDMA,
PCI IDE controllers, bus probes, buggy controllers, controller timing
setup, drive timing setup, world peace and kitchen sinks.  whatever
happens with all this and however it gets partitioned, it is fairly
clear that wd.c needs some significant rework-- probably a complete
rewrite.

timing setup on disk controllers is something i've entirely punted on.
on my development machine, it appears that the BIOS does at least some
of the necessary timing setup.  i chose to restrict operation to
drives that are already configured for Mode4 PIO and Mode2 multiword
DMA, since the timing is essentially the same and many if not most
chipsets use the same control registers for DMA and PIO timing.

does anybody *know* whether BIOSes are required to do timing setup for
DMA modes on drives under their care?

error recovery is probably weak.  early on in development, i was
getting drive errors induced by bugs in the driver; i used these to
flush out the worst of the bugs in the driver's error handling, but
problems may remain.  i haven't got a drive with bad sectors i can
watch the driver flail on.

complaints about how wd82371.c has been reindented will be ignored
until the FreeBSD project has a real style policy, there is a
mechanism for individual authors to match it (indent flags or an emacs
c-mode or whatever), and it is enforced.  if i'm going to use a source
style i don't like, it would help if i could figure out what it *is*
(style(9) is about half of a policy), and a way to reasonably
duplicate it.  i ended up wasting a while trying to figure out what
the right thing to do was before deciding reformatting the whole thing
was the worst possible thing to do, except for all the other
possibilities.

i have maintained wd.c's indentation; that was not too hard,
fortunately.

TO INSTALL:

my dev box is freebsd 2.2.2 release.  fortunately, wd.c is a living
fossil, and has diverged very little recently.  included in this
tarball is a patch file, 'otherdiffs', for all files except wd82371.c,
my edited wd82371.c, a patch file, 'wd82371.c-diff-exact', against the
2.2.2 dist of 82371.c, and another patch file,
'wd82371.c-diff-whitespace', generated with diff -b (ignore
whitespace).  most of you not using 2.2.2 will probably have to use
this last patchfile with 'patch --ignore-whitespace'.  apply from the
kernel source tree root. as far as i can tell, this should apply
cleanly on anything from -current back to 2.2.2 and probably back to
2.2.0.  you, the kernel hacker, can figure out what to do from here.
if you need more specific directions, you probably should not be
experimenting with this code yet.

to enable DMA support, set flag 0x2000 for that drive in your config
file or in userconfig, as you would the 32-bit-PIO flag.  the driver
will then turn on DMA support if your drive and controller pass its
tests.  it's a bit picky, probably.  on discovering DMA mode failures
or disk errors or transfers that the DMA controller can't deal with,
the driver will fall back to PIO, so it is wise to setup the flags as
if PIO were still important.

'controller wdc0 at isa? port "IO_WD1" bio irq 14 flags 0xa0ffa0ff
vector wdintr' should work with nearly any PCI IDE controller.

i would *strongly* suggest booting single-user at first, and thrashing
the drive a bit while it's still mounted read-only.  this should be
fairly safe, even if the driver goes completely out to lunch.  it
might save you a reinstall.

one way to tell whether the driver is really using DMA is to check the
interrupt count during disk i/o with vmstat; DMA mode will add an
extremely low number of interrupts, as compared to even multi-sector
PIO.

boot -v will give you a copious register dump of timing-related info
on Intel and VIAtech chipsets, as well as PIO/DMA mode information on
all hard drives.  refer to your ATA and chipset documentation to
interpret these.

WHAT I'D LIKE FROM YOU and THINGS TO TEST:

reports.  success reports, failure reports, any kind of reports. :)
send them to cgull+ide@smoke.marlboro.vt.us.

i'd also like to see the kernel messages from various BIOSes (boot -v;
dmesg), along with info on the motherboard and BIOS on that machine.

i'm especially interested in reports on how this code works on the
various Intel chipsets, and whether the register dump works
correctly.  i'm also interested in hearing about other chipsets.

i'm especially interested in hearing success/failure reports for PCI
IDE controllers on cards, such as CMD's or Promise's new busmastering
IDE controllers.

UltraDMA-33 reports.

interoperation with ATAPI peripherals-- FreeBSD doesn't work with my
old Hitachi IDE CDROM, so i can't tell if I've broken anything. :)

i'd especially like to hear how the drive copes in DMA operation on
drives with bad sectors.  i haven't been able to find any such yet.

success/failure reports on older IDE drives with early support for DMA
modes-- those introduced between 1.5 and 3 years ago, typically
ranging from perhaps 400MB to 1.6GB.

failure reports on operation with more than one drive would be
appreciated.  the driver was developed with two drives on one
controller, the worst-case situation, and has been tested with one
drive on each controller, but you never know...

any reports of messages from the driver during normal operation,
especially "reverting to PIO mode", or "dmaverify odd vaddr or length"
(the DMA controller is strongly halfword oriented, and i'm curious to
know if any FreeBSD usage actually needs misaligned transfers).

performance reports.  beware that bonnie's CPU usage reporting is
useless for IDE drives; the best test i've found has been to run a
program that runs a spin loop at an idle priority and reports how many
iterations it manages, and even that sometimes produces numbers i
don't believe.  performance reports of multi-drive operation are
especially interesting; my system cannot sustain full throughput on
two drives on separate controllers, but that may just be a lame
motherboard.

THINGS I'M STILL MISSING CLUE ON:

* who's responsible for configuring DMA timing modes on IDE drives?
the BIOS or the driver?

* is there a spec for dealing with Ultra-DMA extensions?

* are there any chipsets or with bugs relating to DMA transfer that
should be blacklisted?

* are there any ATA interfaces that use some other kind of DMA
controller in conjunction with standard ATA protocol?

FINAL NOTE:

after having looked at the ATA-3 spec, all i can say is, "it's ugly".
*especially* electrically.  the IDE bus is best modeled as an
unterminated transmission line, these days.

for maximum reliability, keep your IDE cables as short as possible and
as few as possible.  from what i can tell, most current chipsets have
both IDE ports wired into a single buss, to a greater or lesser
degree.  using two cables means you double the length of this bus.

SCSI may have its warts, but at least the basic analog design of the
bus is still somewhat reasonable.  IDE passed beyond the veil two
years ago.

  --John Hood, cgull@smoke.marlboro.vt.us
1997-07-29 12:57:25 +00:00
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
Steve Passe
412f3e4d71 Modified the PEND_INTS algorithm to fix the ISA INT loss problem.
Noticed by:	dave adkins <adkin003@gold.tc.umn.edu> and others.
1997-07-28 03:59:54 +00:00
Poul-Henning Kamp
9587ee1621 Fix a brino in my last commit.
Noticed by:	smp
1997-07-26 07:58:29 +00:00
Steve Passe
12084b3cf1 clock.c:
- removed TEST_ALTTIMER.
 - removed APIC_PIN0_TIMER.
 - removed TIMER_ALL.

apic_vector.s:
 - new algorithm where a CPU uses try_mplock instead of get_mplock:
	if successful continue as before.
	if fail set ipending bit, mask INT (to avoid recursion), cleanup & iret.

   This allows the CPU to return to successful work, while the ISR will be run
   by the CPU holding the lock as part of the doreti dance.
1997-07-26 01:53:04 +00:00
Poul-Henning Kamp
38d8a113a9 Add option for compiling in a 8x16 font. 1997-07-25 11:53:30 +00:00
Steve Passe
fa4e34805d Removed the simplelock functions.
Cleaned up the other functions.
1997-07-24 23:49:44 +00:00
Steve Passe
9edce0605a Fix a difference between the declaration & definition of isa_dmastatus().
Submitted by:	Chuck Robey <chuckr@glue.umd.edu>
1997-07-24 18:05:22 +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
Steve Passe
7f6ab10763 Removed the defunct GET_MPLOCK/REL_MPLOCK macros.
These are no-ops for UP, and should have been removed when vector.s
was split into UP and SMP subsets.
1997-07-24 03:24:57 +00:00
Steve Passe
e78205df5b Fixed possible deadlock from recursive INTs on same cpu. Since
we use lazy masking INTREN()/INTRDIS() might be called with INTs enabled.
This means another higher prio INT to the same cpu could attempt to
re-enter the critical region, but would spin waiting for the lock.  Since
it is the owner, it would deadlock.
1997-07-23 21:25:31 +00:00
Steve Passe
812e4da7a8 New simple_lock code in asm:
- s_lock_init()
 - s_lock()
 - s_lock_try()
 - s_unlock()

Created lock for IO APIC and apic_imen  (SMP version of imen)
 - imen_lock

Code to use imen_lock for access from apic_ipl.s and apic_vector.s.
Moved this code *outside* of mp_lock.

It seems to work!!!
1997-07-23 20:47:19 +00:00
Steve Passe
919bdda1d4 Coded simple_lock and friends in asm. 1997-07-23 05:49:19 +00:00
Steve Passe
87a6f31089 Last commit didn't take, operator error??? 1997-07-22 20:12:32 +00:00
Bruce Evans
43ba542895 Store SWI_MASK in a variable so that LKMs can use it portably. 1997-07-21 16:43:48 +00:00
Steve Passe
e94493547b Disabled 2 static inlines:
- INTRGET()
 - INTRSET()

These were only used in if_ze.c (already removed) and npx.c.  The code
in npx.c has also been cleaned of all APIC code.
1997-07-21 08:20:07 +00:00
Steve Passe
3902c3ef1f Made the SMP case ignore the possibility of an INT13 interface.
This eliminates all the APIC code, and thus several routines that
would otherwise need to be made MP-safe.

Reviewed by:	 Bruce Evans <bde@zeta.org.au>
1997-07-21 07:57:50 +00:00
Steve Passe
ba52d7ac34 Omit printout of imen, INTRGET() is not MP-safe yet... 1997-07-20 23:07:39 +00:00
Steve Passe
35b3c4a0e5 Developed a new strategy for handling the 8254/8259/APIC issue. 1997-07-20 19:41:38 +00:00
Steve Passe
0571e04aee Minor cleanup. 1997-07-20 18:02:59 +00:00
Bruce Evans
f71d35e402 Removed unused #includes. 1997-07-20 14:10:18 +00:00
Bruce Evans
f94276a095 Removed yet another vestige of devconf. 1997-07-20 12:34:15 +00:00
Bruce Evans
288f6303ba Finished (?) converting md_regs to a `struct trapframe *'. Some bogus casts
are now unnecessary.
1997-07-20 12:33:19 +00:00
Bruce Evans
e852f922ab Uniformized idempotency ifdef. 1997-07-20 12:26:34 +00:00
Bruce Evans
9d675655a2 Fixed missing indent protection in copyright.
Uniformized idempotency ifdef.
1997-07-20 12:18:53 +00:00
Bruce Evans
6fdad28eb1 Removed unused #includes. 1997-07-20 11:58:40 +00:00
Bruce Evans
921cf4d2a2 #include <machine/stdarg.h> in the one place in pcvt that it is used
instead of centrally.
1997-07-20 11:28:41 +00:00
Bruce Evans
f5f91b3249 Removed a stray semicolon. 1997-07-20 11:19:46 +00:00
Bruce Evans
395d48aff0 Removed unused #includes.
Updated an #include to 4.4Lite style (missed one).
1997-07-20 11:14:53 +00:00
Bruce Evans
dd1df1935f Moved some definitions of initialized data nearer to the start of
the file so that this compiles without forward declarations of that
data.  (It is impossible to forward-declare static data in Gnu C.
Declaring it as static is correct, but causes bogus warnings from
gcc -Wredundant-decls.  Declaring it as extern works, but causes
correct warnings from gcc -pedantic and is undefined in ANSI C.
We usually declare it as extern.  Here it was once really extern,
but botched staticization left it as static here and apparently-
extern in a header file.)
----------------------------------------------------------------------
another system, such as NetBSD, CVS:   then name the system in this
line, otherwise delete it.  CVS: Reviewed by:  CVS:   Before
committing changes please have someone check your work and CVS:
include their name here. If the change is trivial and you have not
else; i.e., CVS:   they sent us a patch or a new module, then
include their name/email CVS:   address here. If this is your work
then delete this line.  CVS:
----------------------------------------------------------------------
----------------------------------------------------------------------
1997-07-20 10:07:55 +00:00
Steve Passe
797cb61b54 Added #code to support define APIC_PIN0_TIMER.
This code ALWAYS runs the 8254 timer thru the 8259 ICU.
It depricates the usage of "options SMP_TIMER_NC" in the config file.
1997-07-19 03:59:28 +00:00
Steve Passe
bed422e5a3 SMP or APIC_IO:
- Increased NIDT to 256.
 - Moved IPI vectors up above the linux compat vector.
 - Removed runtime setup of RTC vector.
1997-07-19 02:28:30 +00:00
Steve Passe
d2ecb616f2 Split TEST_CPUSTOP code into CPUSTOP_ON_DDBBREAK and mainline code. 1997-07-18 21:27:53 +00:00
Steve Passe
7bbd2262eb Made the printing of the APIC INTs depend on bootverbose. 1997-07-18 03:59:28 +00:00
John Dyson
955bc15107 Add some support for the 16650 type UARTS. 1997-07-17 06:01:15 +00:00
Peter Wemm
5611a020da Remove the disable for the P5 cpu class bcopy using the FPU on SMP kernels,
it is understood to work now (and has been for quite a while apparently).
1997-07-17 02:09:25 +00:00
Kazutaka YOKOTA
870521063a Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver.  The screen saver calls these
functions to notify syscons of loading/unloading events.

It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.

Now only one screen saver is allowed in memory at a time.

Soeren will be looking into this issue again later.  syscons is
becoming too heavy.  It's time to cut things down, rather than adding
more...

2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.

There are three exceptions, however.

One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.

The others are sccngetc() and sccncheckc(); they will unblank the
screen too.  When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...

(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)

3. Use `mono_time' rather than `time'.

4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.

Changes to the LKM screen saver modules will follow shortly.  YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.

Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
Steve Passe
bb0be67512 Cleanup. 1997-07-15 03:28:53 +00:00
Steve Passe
4e914a7eb7 Tighten up asm code for EOI access. 1997-07-15 02:49:21 +00:00
Kazutaka YOKOTA
99ec86e438 scgetc() referred to `spcl' in different ways when a key is pressed
and released.  It should use `spcl' consistently in both cases,
otherwise shift/control/alt state may not be correctly set/reset.

(Even with this fix, you can still make syscons confused and fail to
change internal state if you really want to, by installing a really
arcane and artificial keymap.)

PR: i386/4030
Reviewed by: sos
1997-07-14 03:36:50 +00:00
Steve Passe
c064ef9175 Cleanup old stop_cpus/restart_cpus() cruft.
new code for handling mixed-mode 8259/APIC programming without 'ExtInt'
new code to control other CPUs: stop_cpus()/restart_cpus()/_Xstopcpu
1997-07-13 01:18:51 +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
Brian Somers
b73937137c Don't allow CONS_HISTORY ioctl to alter history pointers
while in "scroll mode" (return EBUSY).
Suggested by:	Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
1997-07-09 14:10:19 +00:00
Andrey A. Chernov
5fe7f59b19 Don't pass configured information back to ISA for this subdevices,
it cause conflicts
1997-07-08 15:35:28 +00:00
Brian Somers
5d20d6843c Remove useless comparison.
Suggested by:	Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
1997-07-08 13:38:58 +00:00
Brian Somers
b43f9ca153 YAMF2.2: Handle indirect results of "kbdcontrol -h X"
where X < 25.
1997-07-07 13:42:42 +00:00
Steve Passe
b956b5370c First cut at code for handling "spurious INTerrupts".
First cut at code for handling CPU stop/restart.

Notes:
	not working properly yet.
1997-07-06 23:32:38 +00:00
Steve Passe
01bd6212ca Added a hook for a "spurious INTerrupt handler". 1997-07-06 22:11:26 +00:00
Bruce Evans
a24a66635c Don't depend on gcc's feature of permitting labels that aren't followed
by a statement.
1997-07-01 00:22:51 +00:00
Kazutaka YOKOTA
ac4c944d67 Fixes annoying behavior and a bug regarding the destructive
cursor (CHAR_CURSOR)

1. Reduced the number of calls to set_destructive_cursor().  The
destructive cursor produced noticeable overhead on the system.  It was
caused by draw_cursor_image() calling set_destructive_cursor() every
so often.

set_destructive_cursor() absolutely needs to be called when

a) the character code under the cursor has changed either because
   the cursor moved or because the screen was updated or the mouse
   pointer overlapped the cursor.
b) Or a new font has been loaded,
c) or the video mode has been changed,
d) or the cursor shape has been changed,
e) or the user switched virtual consoles.

2. Turn off the configuration flag CHAR_CURSOR (destructive cursor) in
scattach() if we have a non-VGA card.  The destructive cursor works
only for VGA.

3. Removed redundant calls to set_destructive_cursor() in some places.

4. Fixed the "disappearing mouse pointer" problem. The mouse pointer
looked hidden under the destructive cursor when it overlaped the cursor.

A slightly different version of the patch was reviewd and OKed by
sos and ache.
1997-06-30 13:31:49 +00:00
Kazutaka YOKOTA
bf3c452e20 Add experimental APM support for some laptops.
If the configuration option PSM_HOOKAPM is defined and the APM device
is available, the psm driver will issue the ENABLE command to the
pointing device at the resume APM event if the device was open when
the system went into suspended mode. If the option
PSM_RESETAFTERSUSPEND is specified in addition to PSM_HOOKAPM, the
driver will try to reset the pointing device before sending the
ENABLE command.

Built-in PS/2-type pointing devices in some laptops (all the reports I
heard were about Toshiba models) sometimes don't work immediately
after the system is resumed. The device MAY become available after a
while. The system may exhibit the same symptom in other OS's too
(no, FreeBSD is not the only OS that is suffering :-).

I don't know the correct way of solving this yet, but it's been
reported that issuing the ENABLE command after resumption wakes up the
pointing device.

Without PSM_HOOKAPM, the psm driver behaves in the same way as before.

Problem reported in the bsd-nomads mailing list in Japan.
1997-06-30 12:52:57 +00:00
Andrey A. Chernov
32721aad4f dev->id_flags --> flags
(not compiles otherwise)
1997-06-29 22:23:32 +00:00
Kazutaka YOKOTA
a2fc20d086 A fix/work-around for ThinkPad 535.
Add a new configuration flag, KBD_NORESET (0x20) to tell scprobe() not
to reset the keyboard.

IBM ThinkPad 535 has the `Fn' key with which the user can perform
certain functions in conjunction with other keys. For example, `Fn' +
PageUP/PageDOWN adjust speaker volume, `Fn' + Home/End change
brightness of LCD screen. It can also be used to suspend the system.

It appears that these functions are implemented at the keyboard level
or the keyboard controller level and totally independent from BIOS or
OS.  But, if the keyboard is reset (as is done in scprobe()), they
become unavailable.  (There are other laptops which have similar
functions associated with the `Fn' key. But, they aren't affected by
keyboard reset.)

ThinkPad 535 doesn't have switches or buttons to adjust brightness and
volume, or to put the system into the suspend mode. Therefore, it is
essential to preserve these `Fn' key functions in FreeBSD. The new
flag make scprobe() skip keyboard reset.

If this flag is not set, scprobe() behaves in the same say as before.

(If we only knew a way to detect ThinkPad 535, we could skip keyboard
reset automatically, but...)
1997-06-29 15:11:40 +00:00
Steve Passe
58db75841d apic_vector.s:
- added Xcpustop IPI code to support stop_cpus()/restart_cpus().
   it is off by default, enable via smptests.h:TEST_CPUSTOP

intr_machdep.h:
 - moved +ICULEN to lower level.
 - added entry for Xcpustop.
1997-06-27 23:48:05 +00:00
Justin T. Gibbs
374114db56 KNF cleanup. 1997-06-27 19:36:27 +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
Peter Wemm
b3196e4b9f Preliminary support for per-cpu data pages.
This eliminates a lot of #ifdef SMP type code.  Things like _curproc reside
in a data page that is unique on each cpu, eliminating the expensive macros
like:    #define curproc (SMPcurproc[cpunumber()])

There are some unresolved bootstrap and address space sharing issues at
present, but Steve is waiting on this for other work.  There is still some
strictly temporary code present that isn't exactly pretty.

This is part of a larger change that has run into some bumps, this part is
standalone so it should be safe.  The temporary code goes away when the
full idle cpu support is finished.

Reviewed by: fsmp, dyson
1997-06-22 16:04:22 +00:00
Kazutaka YOKOTA
124ff4169d The syscons driver doesn't really check the presence of the display
adapter during the system boot. It always assumes there is at least a
monochrome adapter.

This is rather strange assumption. If there is no dispaly adapter, the
console driver cannot be any good...

In this patch, scinit() is split into two parts; the first part is
now called scvidprobe() which will detect the presence of video card
at the CGA or MONO buffer address and returns TRUE if found. It is
called during sccnprobe() and scprobe(). Both will fail if no video
card is found.

The second part, whose name stays the same as before, scinit(), is
called from sccninit() and scattach() to complete initialization of
the found video card.

The keyboard probe code is moved from scprobe() to sckbdprobe();
scprobe() now calls scvidprobe() and sckbdprobe() to carry out device
probe. (This is rather a cosmetic change, but it sure makes the code
look better organized.)

The problem pointed out by Joerg.
1997-06-22 12:04:36 +00:00
Bruce Evans
9edc7ccf77 Fixed the type of a timeout function and removed casts that hid the
problem.  There was no problem in practice (at least on 386's).
1997-06-14 14:54:55 +00:00
Justin T. Gibbs
9996b3a56a Fix two typos in this driver that prevented it from working properly.
PR: kern/3776
Submitted by: flash@hway.ru
1997-06-10 16:07:22 +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
Andrey A. Chernov
0b3a25d648 Remove no irq -> irq 31 conversion 1997-06-08 12:55:26 +00:00
Paul Traina
5ea6cb03f3 Bring back CONSPEED as a last-ditch default if you can't change the speed
any other way.

Requested by: dfr
1997-06-04 16:25:15 +00:00
Paul Traina
2334749d02 If the boot blocks were using the serial port, read the system console
speed using the boot blocks, instead of a hardcoded value stuck in the
kernel.  This way, you can have systems using the same kernel but different
console speeds.

Add a sysctl entry for changing the system console speed.
Lock the user tty speed to match the system console speed.

Nuke CONSPEED.
Reviewed by:	bde
1997-06-04 04:52:40 +00:00
KATO Takenori
6670f8f6e7 Fixed mu-law data. Originator's patch was applied.
PR:		1950
Submitted by:	NAGAO Tadaaki <nagao@cs.titech.ac.jp>
1997-06-03 10:34:40 +00:00
KATO Takenori
b7b905e770 Fixed order of data transfer.
Reviewed by:	NAGAO Tadaaki <nagao@cs.titech.ac.jp>
Submitted by:	Takuya SHIOZAKI <tshiozak@makino.ise.chuo-u.ac.jp>
1997-06-03 10:25:41 +00:00
KATO Takenori
eeef1264c6 Include <sys/conf.h> 1997-06-03 08:23:26 +00:00
KATO Takenori
40b2de1758 Added PC-98 code. 1997-06-02 15:28:10 +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
Bruce Evans
92278e9a02 Was superseded by ns16550.h 4-5 years ago. 1997-06-02 03:10:10 +00:00
Poul-Henning Kamp
55d2795997 I've given up on the idea of sizing FIFO's. You can set it with a flag
value now, if you know that you have a fifo deeper than 16.
1997-06-01 20:42:01 +00:00
Peter Wemm
131cb049f4 on second thoughts, it doesn't even need <machine/ipl.h> either. 1997-06-01 16:03:13 +00:00
Peter Wemm
096a814086 <machine/spl.h> -> <machine/ipl.h> 1997-06-01 15:59:11 +00:00
KATO Takenori
0c8cda329f Include file update: <machine/spl.h> --> <machine/ipl.h>. 1997-05-31 12:45:37 +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
Peter Wemm
c9bfe68408 move intrhand2_t from isa_device.h to machine/types.h - it's used far more
than in the isa dependent code.
create intrmask_t in machine/types.h  (replaces "intrmask" typedef from
sys/interrupt.h)

Reviewed by: bde
1997-05-31 09:07:36 +00:00
Peter Wemm
dfa67ec76e Store the macro values for SWI_TTY_MASK and SWI_NET_MASK in variables to
that lkm's can use them for fiddling the masks without being dependent on
which mode the kernel is compiled in (SMP or UP).  This is particularly
for ppp_tty.c which has some domain crossing between the net and tty
subsystems.  The values are not used in the spl code, they are for
reference only (ie: the compiled code uses immediate values rather than
an indirect 32 bit address and 32 bit data fetch).
1997-05-31 09:03:52 +00:00
Peter Wemm
0589fe3b6e The SWI_NET_MASK and SWI_TTY_MASK handlers are now back adjacent to the
top of the hardware interrupt handlers.  Apparently this is slightly
faster with the bit scanning instruction that looks these up - this set of
changes reverts the original change.

Reviewed by: bde
1997-05-31 08:59:51 +00:00
Peter Wemm
a24514dfdf Bruce's original implementation of the splxxx() routines, but as C code
rather than inlines.  These are compiled with -fomit-frame-pointer and
work out pretty close to the original routines, but it might be a fraction
slower.  The reason for doing this is to prevent the SWI_* and HWI_* values
from being compiled into drivers and lkms etc which is one of the things
that prevents the same lkm from being used on both SMP and UP kernels.

This gives us a lot more scope for experimenting with the splxxx
implementaton for SMP parallelism etc.

Reviewed by: bde
1997-05-31 08:57:05 +00:00
Peter Wemm
0638a3a84b Bruce's original definitions for the spl/ipl code when running on the old
PIC's.

Reviewed by: bde
1997-05-31 08:50:34 +00:00
Peter Wemm
f09434da26 Definitions for the spl/ipl code when running on an IO APIC.
Obtained from: fsmp  (part of what Steve added for IO APIC support)
Reviewed by:   bde
1997-05-31 08:49:08 +00:00
Gene Stark
bb7e0661df Submitted by: Rich Murphey (ages ago) and Gene Stark
Hopefully I've done the proper magic to merge changes between 1.17 and
1.17.2.1 into the main trunk.  Description of those changes follows:

Brought in changes sent to me in late 1995 by Rich Murphey.
I cleaned up a few things and am currently running these under
2.2-970205-GAMMA.

The changes deal with software debouncing apparently necessary on
todays faster hardware, and also some problems with the use of the -Select
line for the TW-523 sync.  This driver allows use of +PaperEnd as an
alternative.
1997-05-31 02:39:32 +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
7a14de6260 No longer need opt_smp.h here 1997-05-29 05:00:35 +00:00
Peter Wemm
ecf8148761 remove opt_smp.h from this well-included file, minor style police 1997-05-29 04:58:04 +00:00
Peter Wemm
6b19c20ba5 remove opt_smp.h, minor style police 1997-05-29 04:55:39 +00:00
Stefan Eßer
9a8979b997 Fix problem introduced in the CMD640 workaround which could lead
to a NULL pointer dereference.

PR:		kern/3696
Submitted by:	Joel.Faedi@esial.u-nancy.fr
1997-05-27 18:28:08 +00:00
Kazutaka YOKOTA
ea9a5f9bf5 scprobe() referred to the psm_softc structure even after it was
freed ;-<

PR:		kern/3694
1997-05-27 11:55:41 +00:00
Stefan Eßer
b3daa02e72 Yet another fix for configuration mechanism 1 register accesses:
Adjust the data port address by adding the two low order bits of
the register number. The address port takes only a word address
(i.e. ignores the two low order bits written to it).
1997-05-26 21:52:41 +00:00
Stefan Eßer
64039d403f Fix previous fix: The enable bit is bit 31 (0x8000000) and not bit 15. 1997-05-26 21:25:24 +00:00
Stefan Eßer
e0c57a9615 Set enable bit when writing the configuration address in configuration
mode 1. Omission of this bit makes all config register accesses fail in
on recent chip sets ...

(The problem was reported and debug output provided by: Steve Passe)
1997-05-26 21:11:05 +00:00
Steve Passe
81c1993f87 Split vector.s into UP and SMP specific files:
- vector.s		<- stub called by i386/exception.s
 - icu_vector.s		<- UP
 - apic_vector.s	<- SMP

Split icu.s into UP and SMP specific files:
 - ipl.s		<- stub called by i386/exception.s (formerly icu.s)
 - icu_ipl.s		<- UP
 - apic_ipl.s		<- SMP

This was done in preparation for massive changes to the SMP INTerrupt
mechanisms.  More fine tuning, such as merging ipl.s into exception.s,
may be appropriate.
1997-05-26 17:58:27 +00:00
Stefan Eßer
5bec615793 Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .

The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...

This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.

A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:

1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
   and are probed like any "standard" PCI device.

The following features are currently missing, but will be added back,
soon:

1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets

This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +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
383243e687 Made the array vec[] a global.
This allows the APIC code to reorder the vectors at runtime.
1997-05-25 16:55:26 +00:00
Peter Wemm
4c728676b7 Make the multicast code compile under -current. This has not been reviewed
or tested yet.  Mike may want to make some adjustments.
1997-05-25 07:17:02 +00:00
Peter Wemm
cee77949ec Fix(?) two volatile cast warnings. The buffer is volatile within the
function so as to avoid compiler side effects, but functions calling it
shouldn't be affected (gcc shouldn't cache memory scope past a function
call)
1997-05-25 04:13:27 +00:00
Peter Wemm
70117bbefd match the #include opt_ file with options.i386 (it has opt_wavelan.h) 1997-05-25 04:04:20 +00:00
Søren Schmidt
4aab40db6c Fix support for the Hitachi CDR7730 IDE cdrom drive.
Patch from pr1730.
Tested on our IDE cdrom drive farm...
1997-05-23 16:22:04 +00:00
Mike Smith
4eb256367e Add 'wl' Wavelan driver.
Obtained from:	Jim Binkley <jrb@cs.pdx.edu>
1997-05-22 08:50:14 +00:00
Justin T. Gibbs
cc80aa3972 Several bug fixes for the ee16 support from Richard Straka:
1) Adjust NFRAMES from 16 to 8 per 16k of memory.
2) Acknowledge interrupts to the card early in the interrupt
   handler before processing the event that caused the interrupt.
   This frees the card to process addtional events instead of
   waiting for the driver to finish handling events.
3) Changed the initialization of the transmit buffers to be a
   loop so that the number of buffers can be more easily changed.
4) Moved the code to take the adapter out of loop back mode to just
   before we enable the receiver.

I also made the driver dynamically size its resource arrays at attach
time so that we can take full advantage of adapters with more than 16k
of memory.

Richard has some other changes he's working on to improve performance,
but this should get ee16 support working reliably again.

Thanks to Wes Santee <wes@bogon.net> for testing these patches.

Submitted by: Richard Straka <straka@user1.inficad.com>
1997-05-21 18:26:09 +00:00
Joerg Wunsch
00081cc989 Major overhaul of the SyncPPP layer. Basically, this comprises now a
full implementation of the sate machine as described in RFC1661, and
provides support for plugging in various control protocols.  I needed
this to provide PPP support for the BISDN project (right now).

Unfortunatley, while the existing API was almost up to the point, i
needed one minor API change in order to decouple the this-layer-
started and this-layer-finished actions from the respective Up and
Down events of the lower layer.  This requires two additional lines in
the attach routines of all existing lower layer interface drivers that
are using syncPPP (shortcutting these actions and events).  Apart from
this, i believe i didn't change the API of all this, so everything
should plug in without too many hassles.  Please report if i broke
something in the existing drivers.

For a list of features (including new ones like dial-on-demand), and
things still to be done, please refer to the man page i'll commit asap.

Encouraged by:	Serge Vakulenko <vak@cronyx.ru>
1997-05-19 22:03:09 +00:00
Poul-Henning Kamp
468d825d86 Whoops, missed a zero there. Flags 0x10000 it is. 1997-05-18 21:22:11 +00:00
Poul-Henning Kamp
e12ca851a6 Flags 0x1000 on sio now disables the dreaded test#3.
PR:		3395
1997-05-18 21:19:04 +00:00
Poul-Henning Kamp
8463cf03a9 Detect various supersets of 16550A based on fifo depth.
PR:		i386/3523
Reviewed by:	phk
Submitted by:	vak@cronyx.ru
1997-05-18 20:53:52 +00:00
Kazutaka YOKOTA
3ef626ecd5 1) font loading (two fixes)
When an ioctl command SW_XXXX is issued, scioctl() checks if the font
appropriate for the specified mode is already loaded.  The check was
correctly done for 8 line and 16 line fonts, but not for 14 line font.

The symbols FONT_8, FONT_14 and FONT_16 were defined as numbers but
were sometimes treated as bit flags. They are now defined as bit
flags.

2) screen blinking (two fixes)

Removed a redundant call to timeout() in do_bell().

Don't let blink_screen() write to the video buffer if the screen is in
the graphics (UNKNOWN) mode.

3) screen saver timeout

The ioctl command CONS_BLANKTIME sets the screen saver's timeout.  The
value of zero will disable the screen saver. If the screen saver is
currently running it should be stopped.

4) border color and destructive cursor (two fixes)

The border color and the cursor type can be changed via escape
sequences.  But only VGA can change the border color and set the
cursor type to destructive (CHAR_CURSOR) in the current syscons.
scan_esc() failed to check this.

Reviewed by:	sos
1997-05-15 05:43:59 +00:00
Joerg Wunsch
28d90c30ee Add the D_DISK flag to the cdevsw structs of various CD-ROM drivers. 1997-05-10 12:13:17 +00:00
Peter Wemm
36428e6100 simplify IOPL gain/remove privs code. It's easier with md_regs
being a trapframe.
1997-05-07 20:02:38 +00:00
Peter Wemm
06884fd04e remove now redundant (struct trapframe *) cast 1997-05-07 19:58:13 +00:00
Kazutaka YOKOTA
df25dec0e5 Now that we have replaced video-related block copy calls with
sc_bcopy(), which is generic_bcopy() in reality, there is no point in
retaining bcopyw() calls in the source code.
OKed by : sos
1997-05-07 10:42:06 +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
Peter Wemm
f435322e07 correct the order of the variables
use #ifdef where possible instead of #if defined

Submitted by: the KNF police, ie: bde :-)
1997-05-05 09:34:33 +00:00
Joerg Wunsch
5a9714de76 This mega-commit brings the following:
. It makes cd9660 root f/s working again.
. It makes CD9660 a new-style option.
. It adds support to mount an ISO9660 multi-session CD-ROM as the root
  filesystem (the last session actually, but that's what is expected
  behaviour).

Sigh.  The CDIOREADTOCENTRYS did a copyout() of its own, and thus has
been unusable for me for this work.  Too bad it didn't simply stuff
the max 100 entries into the struct ioc_read_toc_entry, but relied on
a user supplied data buffer instead. :-(  I now had to reinvent the
wheel, and created a CDIOREADTOCENTRY ioctl command that can be used
in a kernel context.

While doing this, i noticed the following bogosities in existing CD-ROM
drivers:

wcd:	This driver is likely to be totally bogus when someone tries
	two succeeding CDIOREADTOCENTRYS (or now CDIOREADTOCENTRY)
	commands with requesting MSF format, since it apparently
	operates on an internal table.

scd:	This driver apparently returns just a single TOC entry only for
	the CDIOREADTOCENTRYS command.

I have only been able to test the CDIOREADTOCENTRY command with the
cd(4) driver.  I hereby request the respective maintainers of the
other CD-ROM drivers to verify my code for their driver.  When it
comes to merging this CD-ROM multisession stuff into RELENG_2_2 i will
only consider drivers where i've got a confirmation that it actually
works.
1997-05-04 15:24:23 +00:00
Peter Wemm
b455e1e981 don't #ifdef out reference to i586_ctr_freq. 1997-05-04 14:28:22 +00:00
Peter Wemm
26e5316524 Don't remove i586_ctr_freq from scope, leave it defined as zero. This
simplifies some assumptions and stops some code compile problems.

This should fix the compile hiccup in PR#3491, but smp kernel profiling
isn't likely to be fixed by this.
1997-05-04 14:25:00 +00:00
Andrey A. Chernov
8a13426b30 Restore CRTC start address check back after looking into more sources 1997-04-30 15:31:22 +00:00
Andrey A. Chernov
bfc43e99c4 In comp_vgaregs skip cursor shape and 4 unused bytes (6 total)
instead of 2 unused.
Previus code broke syscons on Diamond Stealth 3D 3000
(video mode ptr was NULL with no real reason)
1997-04-30 01:19:21 +00:00
Peter Wemm
176c49e057 Use a common numbering of the tty and net software interrupt levels
between the SMP and non-SMP case.  It simplifies the #ifdef's, since
NHWI changes (at least for the moment) when APIC's are involved.
1997-04-29 20:05:48 +00:00
Stefan Eßer
862b403b04 Move CMD640 option from kernel Makefile into opt_wd.h
Submitted by:		Wolfgang Helbig <helbig@mx.ba-stuttgart.de>
1997-04-28 19:26:18 +00:00
Steve Passe
f50a491f78 removed TEST_CPUHITS code.
replaced push/pop of %ds with use of 'ss' prefix in Xinvltlb.

Submitted by:	 Bruce Evans <bde@zeta.org.au>
1997-04-28 01:47:55 +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
Kazutaka YOKOTA
d75a8fdbb1 Addresses the following two problems.
1) i586_bcopy() problem

There have been a number of reports that the syscons doesn't work
properly if i586_bcopy() is enabled.

The problem prevented users from installing 2.2(.1)-RELEASE.  The
symptom is that the system looks frozen during device probe or just
before the main installation menu.  The workaround was to specify the
flag 0x01 to the npx device so that i586_bcopy() is disabled.

The patch forces the syscons to call generic_bcopy() when copying
to/from the video memory, even if CPU is Pentium and i586_bcopy() is
enabled. i586_bcopy() is still called for copy operations between
non-video memory regions.

PR: kern/2277, kern/3066, kern/3107, kern/3134

2) video mode parameter table problem

The syscons reads and uses the video mode parameter table provided by
the VGA BIOS to set VGA registers when changing video mode and
modifying font data. It appears that in some VGA BIOSes the table is
not ordered as the syscons expects, and this leads to screen
corruption.

The problem prevented users from installing 2.2(.1)-RELEASE. The
symptom is the corrupt screen or strange vertical lines soon after the
kernel is loaded into memory (just after the kernel decompression).

The patch performs simplistic test and if it fails, set video_mode_ptr
to NULL so that the video mode switching won't happen.

This is an interim kludge. There should be a better way to deal with
the problem.

PR: kern/2498, conf/2775, conf/3354

Reviewed by: sos
Tested by: PR originators (not all of them, though)
1997-04-27 09:03:10 +00:00
Peter Wemm
fbf8a6b7cb change #if 0 to #ifdef KERNEL since this is pretty important for
smp compiling.  It still leaves dset non-functional on smp kernels, but
we've been doing that all along with the private smp tree anyway.
1997-04-26 19:26:37 +00:00
Steve Passe
bb625c15c9 #if'ed out the '#include "opt_smp.h"' line.
The SMP source was merged into 3.0-current last nite and this broke
the make of sbin/dset.

Should make things work for non-SMP case.

People making SMP kernels will need to edit i386/isa/isa_device.h, re-enabling
'#include "opt_smp.h"'.  People making SMP worlds will have to punt for now...
I'm thinking about the real solution, but for now the goal is to NOT break
the world!
1997-04-26 19:07:36 +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
John Polstra
9081eec1fb Make the necessary changes so that an ELF kernel can be built. I
have successfully built, booted, and run a number of different ELF
kernel configurations, including GENERIC.  LINT also builds and
links cleanly, though I have not tried to boot it.

The impact on developers is virtually nil, except for two things.
All linker sets that might possibly be present in the kernel must be
listed in "sys/i386/i386/setdefs.h".  And all C symbols that are
also referenced from assembly language code must be listed in
"sys/i386/include/asnames.h".  It so happens that failure to do
these things will have no impact on the a.out kernel.  But it will
break the build of the ELF kernel.

The ELF bootloader works, but it is not ready to commit quite yet.
1997-04-22 06:55:47 +00:00
Kazutaka YOKOTA
29c78ed5ef Fixed typo in the set_keyboard_param().
Spotted by: Philippe Charnier@xp11.frmug.org
1997-04-22 02:04:15 +00:00
Nate Williams
a4586acb0c - Better fix for 3C589D support. Revert previous changes and add a
delay after we reset the card to allow the card to come back to life.
  It appears the newer card takes longer to reset.

Submitted by:	Samuel Lam <skl@ScalableNetwork.com>
1997-04-21 13:38:32 +00:00
Bruce Evans
4b04349ab9 Fixed the type of a timeout function and removed casts that hid the
type mismatches.  There was no problem in practice (at least on 386's).
The timeout args still get bogusly cast from int to `void *' via
caddr_t and back to int.
1997-04-20 18:02:40 +00:00
Bruce Evans
20925249e7 Fixed the type of timeout functions and removed casts that hid the
type mismatches.  mcd and scd were/are particularly bogus.  They
used a general purpose function taking 2 args for the timeout
function and fudged varargs stuff to supply the second arg for the
timeout case.  This broke `cc -mrtd'.  Bounce through a timeout
function instead.  The timeout arg still gets bogusly cast from
int to `void *' and back.
1997-04-20 17:26:55 +00:00
Bruce Evans
14da13a2f1 Fixed the type of timeout functions and removed casts that hid the
type mismatches.  Not taking an arg in sequencer_timer() broke
`cc  -mrtd'.
1997-04-20 16:54:58 +00:00
Bruce Evans
8fb722b5e1 Fixed the type of timeout functions and removed casts that hid the
type mismatches.  There was no problem in practice (at least on 386's).

Don't cast NULL in calls to timeout functions.  pcvt is fully prototyped
and doesn't support K&R.

Timeout functions take args of type `void *', so use magic numbers of
type `void *' for UPDATE_* to reduce the danger of wrong conversions.

Removed FreeBSD-pre-1.1-related TIMEOUT_FUNC_T macro.  It was especially
bogus for the pre-1.1 case.
1997-04-20 16:38:22 +00:00
Bruce Evans
5e994ca33f Fixed the type of timeout functions and removed casts that hid the
type mismatches.  Not taking an arg in scrn_timer() broke `cc -mrtd'.
1997-04-20 16:05:33 +00:00
Bruce Evans
5a837b22e5 Fixed the type of timeout functions and removed casts that hid the
type mismatches.  There was no problem in practice (at least on 386's).
1997-04-20 15:36:12 +00:00
Bruce Evans
68f7a74b48 Fixed inconsistent extern declaration of a timeout function and
removed a cast that helped hide the problem.  There was no problem
in practice (at least on 386's).
1997-04-20 15:25:33 +00:00
Bruce Evans
0e4f24a34e Avoid division by 0 in check_part(). (It occurred when max_nsectors == 0.
This case is clearly an error, but we keep calling check_part() to get
diagnostics.)

Fixed nearby indentation and commenting bugs.
1997-04-19 14:14:17 +00:00
Bruce Evans
63e32a69f2 Don't call timeout() for DTR wakeup or busy check if the relevant timeout
is already active.  This fixes "timeout table full" panics under 100%
interrupt load and other weird conditions.
1997-04-18 18:28:09 +00:00