summaryrefslogtreecommitdiffstats
path: root/sys/isa
Commit message (Collapse)AuthorAgeFilesLines
* Fixed error handling:bde1998-07-292-57/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Call isa_dmadone() whenever necessary to stop DMA and/or free bounce buffers. Undead DMA corrupted the malloc freelist fairly consistently in the following configuration: SLICE kernel, 2 floppy drives, no disk in fd0, disk in fd1. - Don't call fdc_reset() from fd_timeout(). Doing so gave an "extra" interrupt which was usually misinterpreted as being for completion of the next FDC command; the interrupt for completion of the next FDC command was then usually misinterpreted... There were further complications for interrupts latched by the soft-spl mechanism so that they were delivered after all the h/w interrupts went away. This caused at least wrong head settle delays and may be why the FreeBSD floppy driver seems to munch floppies more than most floppy drivers. The reset was unnecessary anyway in cases that didn't have the bug described next, since is was repeated a little later for the IOTIMEDOUT state. The state machine has complications to handle resets correctly, so just use it. - Don't call retrier() from fd_timeout(). The IOTIMEDOUT state needs to be processed next, and it isn't valid to set to that state if retrier() has aborted the current transfer. Doing so caused null pointer panics after the previous bug was fixed. Improved error handling: - If an i/o is aborted, arrange to reset in the state machine before doing the next i/o. New fdc flag for this. This fixes spurious warnings and lengthy busy-waiting for the next i/o. - Split STARTRECAL into RESETCOMPLETE and STARTRECAL and only check for the results from reset if we actually reset. This fixes spurious warnings for other paths to STARTRECAL. [Oops, it may break reset handling for motor-off resets.] Cleanups in fd_timeout(): - Renamed to fd_iotimeout() to make it clearer that it is only used for i/o. - Don't handle the bp == 0 case. This case can't happen for i/o. - Don't check for controller-busy. We know it must be. - Don't print anything. retrier() already prints too much for normal errors. - Fudge the state differently so that the state machine advances fdc->retry and the status is invalid (perhaps this should fudge a valid state like the one for WP). - Style fixes.
* Fixed error handling after a seek error that can't happen. When thebde1998-07-181-1/+3
| | | | | | | | | | | | | | | | controller reports a successful seek, it is very unlikely to report seeking to a cylinder other than the one requested, but we check for this, and botched the error handling for the requested_cylinder != 0 case. This error happened when the bug fixed in rev.1.52 of <sys/buf.h> caused the head of buffer queue to change to one starting on a different cylnder - the requested cylinder was found, but it wasn't what we thought we requested. The fix is simply to arrange to reset the state machine. Corruption of the buffer queue seems to only have been a problem in the floppy driver. Other drivers dequeue the head of the queue before doing physical i/o on it, so the corruption at worse broke the elevator sort order. Dequeueing breaks it anyway.
* Changed %n to %r in devfs name format strings. %n has almost gone away.bde1998-07-152-9/+9
|
* The ioctl request arg is unsigned long, so don't attempt to pass itbde1998-07-151-2/+2
| | | | around as signed int.
* Don't pretend to support ix86's with 16-bit ints by using longsbde1998-07-141-8/+8
| | | | | just to ensure 32-bit variables. Doing so broke i386's with 64-bit longs.
* SLICE probing becomes asynchronous. It can now be triggered byjulian1998-07-131-6/+3
| | | | | | | | interupt level events. This needs a lot of cleanup, but has been working here for a month or two.. originally needed for CAM integration but that hasn't happenned yet. The probing state machines for each handler should be replaced by a more generic state-service. It's still quite messy in there..
* Improve a couple of comment.phk1998-07-111-6/+7
| | | | | | PR: 7242 Reviewed by: phk Submitted by: Peter Jeremy <peter.jeremyp@alcatel.com.au>
* Don't pretend to support ix86's with 7-bit ints by using longs just tobde1998-07-112-6/+6
| | | | ensure 8-bit variables. Doing so mainly bogotified some printf formats.
* Add the ability to suspend as well as hibernate to the system. Thisimp1998-07-061-2/+21
| | | | | | | is the kernel part of my commits, the userlevel stuff will be done in a separate commit. Add the ability to suspend as well as hibernate to syscons. Create a new virtual key like hibernate for suspend. Update apm_bios.h to define more apm bios goodies.
* There is no such thing any more as "struct bdevsw".julian1998-07-041-8/+27
| | | | | | | | | | | | | | | | | | There is only cdevsw (which should be renamed in a later edit to deventry or something). cdevsw contains the union of what were in both bdevsw an cdevsw entries. The bdevsw[] table stiff exists and is a second pointer to the cdevsw entry of the device. it's major is in d_bmaj rather than d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw). rawread()/rawwrite() went away as part of this though it's not strictly the same patch, just that it involves all the same lines in the drivers. cdroms no longer have write() entries (they did have rawwrite (?)). tapes no longer have support for bdev operations. Reviewed by: Eivind Eklund and Mike Smith Changes suggested by eivind.
* Don't refer to mouse_info.u.datea.[xyz] while processing MOUSE_BUTTON_EVENTyokota1998-06-241-5/+2
| | | | | | ioctl. These fields don't have valid values for this ioctl. PR: kern/6928 Submitted by: Bill Fenner <fenner@parc.xerox.com>
* Avoid some panics in sio_unload which gets called with various dirtphk1998-06-241-1/+9
| | | | if the attach of a modem card failed.
* Don't log "unexpected" events on never-opened devices. Events leftbde1998-06-161-11/+4
| | | | | | | | over from the probe are now expected for incompatible UARTs that deliver IRQs as a strobe (low) instead of a level (high). Discard events on going-away devices too. Endless loops may have been possible when an active pccard was removed.
* Add a symlink from /dev/vga to /dev/ttyv0 when using DEVFSsteve1998-06-131-1/+3
| | | | | | | for programs like doscmd. PR: 6920 Submitted by: Luoqi Chen <luoqi@chen.ml.org>
* Add a tc_ prefix to struct timecounter members.phk1998-06-091-6/+6
| | | | Urged by: bde
* Add a member function more to the timecounters, this one is for usephk1998-06-071-1/+3
| | | | | with latch based PPS implementations. The client that uses it will be committed after more testing.
* Fix some more ioctls which I missed becausese they were hidden by optionsdfr1998-06-071-2/+2
| | | | which were not in LINT.
* This commit fixes various 64bit portability problems required fordfr1998-06-074-7/+7
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Add a "this" style argument and a "void *private" so timecounters canphk1998-06-071-5/+5
| | | | figure out which instance to wount with.
* keymap -> key_map so that the kernel will compile withsteve1998-06-061-2/+2
| | | | | | | -DESKEYMAP. PR: 6864 Submitted by: Javier Rueda <jmrueda@diatel.upm.es>
* Force success of the probe (after doing it as before except in onebde1998-06-031-4/+5
| | | | | | | | | | | | | | miscconfigured case) if the port is the console. This fixes several bugs: - if all sioprobe()s failed, then the console driver followed null pointers in cdevsw[]. - if the sioprobe() for the console failed but another sioprobe() succeeded, then init hung early when the console couldn't be opened. - it was silly for the console to not be there after printing boot messages on it. Bugs introduced by this are hopefully no worse than old ones caused by forcing the success of the `cn' level probe.
* Fixed a printf() arg botch in the previous commit.bde1998-06-031-7/+6
| | | | | | | | | Only complain about an irq mismatch in the probe if the configured irq doesn't become active, and then print the bitmap of irqs that became active (including clock irqs) instead of just the first (not including clock irqs). Bugs reported by: msmith
* Converted the ICU-level interrupt tests (3, 5 and 8) in sioprobe() intobde1998-05-311-22/+27
| | | | | | | | | a test of the irq number, and made failure of this test non-fatal. Removed related unused complications for the APIC_IO case. Removed the no-test3 flag. Deverbosified the failure messages for the other tests. Removed the per-port verbose flag - just use the general verbose flag.
* Some cleanups related to timecounters and weird ifdefs in <sys/time.h>.phk1998-05-281-3/+3
| | | | | | | | | | | | | | | | | | | | Clean up (or if antipodic: down) some of the msgbuf stuff. Use an inline function rather than a macro for timecounter delta. Maintain process "on-cpu" time as 64 bits of microseconds to avoid needless second rollover overhead. Avoid calling microuptime the second time in mi_switch() if we do not pass through _idle in cpu_switch() This should reduce our context-switch overhead a bit, in particular on pre-P5 and SMP systems. WARNING: Programs which muck about with struct proc in userland will have to be fixed. Reviewed, but found imperfect by: bde
* LoadSoftModem() routine at sio.c does not trap general serial I/Os.phk1998-05-201-2/+2
| | | | | | | | It fauls to probe eather DSI Modem or others. PR: 4657 Reviewed by: phk Submitted by: Kenji Saito <marukun@mx2.nisiq.net>
* Change a data type internal to the timecounters, and remove the "delta"phk1998-05-191-18/+9
| | | | | | function. Reviewed, but not entirely approved by: bde
* s/nanoruntime/nanouptime/gphk1998-05-171-9/+9
| | | | | | s/microruntime/microuptime/g Reviewed by: bde
* The PnP code in 2.2.6 detects the Motorola ModemSurfer 56K,phk1998-05-131-1/+2
| | | | | | | | | but doesn't do much of anything with it. I added it to siopnp_ids[] and it was found and recognized as a serial port. PR: 6605 Reviewed by: phk Submitted by: Dave Marquardt <marquard@zilker.net>
* There is no dump routine for fd so give it an explicit NULL entryjulian1998-05-061-2/+3
| | | | in the SLICE table.
* Add dump support to the DEVFS/slice code.julian1998-05-061-3/+3
| | | | | | now we can actually catch our crashes :-) Submitted by: Luoqi Chen <luoqi@chen.ml.org> (the man who's everywhere)
* Detect USR PnP x2 modem.phk1998-05-041-1/+2
| | | | | | PR: 6496 Reviewed by: phk Submitted by: Kurt D. Zeilenga <Kurt@Boolean.NET>
* close() is no longer a SLICE method.julian1998-04-221-4/+10
| | | | | Close is simply an open with no-read and no-write once internal to SLICE (it still exports a close to the rest of the kernel)
* Add changes and code to implement a functional DEVFS.julian1998-04-191-17/+269
| | | | | | | | | | | | | | | | | | | | | This code will be turned on with the TWO options DEVFS and SLICE. (see LINT) Two labels PRE_DEVFS_SLICE and POST_DEVFS_SLICE will deliniate these changes. /dev will be automatically mounted by init (thanks phk) on bootup. See /sys/dev/slice/slice.4 for more info. All code should act the same without these options enabled. Mike Smith, Poul Henning Kamp, Soeren, and a few dozen others This code does not support the following: bad144 handling. Persistance. (My head is still hurting from the last time we discussed this) ATAPI flopies are not handled by the SLICE code yet. When this code is running, all major numbers are arbitrary and COULD be dynamically assigned. (this is not done, for POLA only) Minor numbers for disk slices ARE arbitray and dynamically assigned.
* Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.des1998-04-172-4/+4
|
* Stop the screensaver before switching consoles.des1998-04-171-1/+7
|
* Swapped "should we just return" and "should we stop the screensaver"des1998-04-161-8/+11
| | | | in scrn_timer() to avoid deadlock with graphical screensavers.
* Remove some unneeded statements that enabled interrupts.tegge1998-04-051-3/+2
|
* More fixes to deal with fonts:yokota1998-04-041-23/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Set the correct value scp->font_size in init_scp(). - Set scp->font_size to FONT_NONE for VGA_MODEX. Interim fix for a font problem: - A kludge to display the correct font on some video cards. We should be able to load multiple fonts to the VGA plane #2 and switch between fonts by setting the font select register in the VGA sequencer. It appears that the current code isn't functioning as expected on some VGA cards (I have reports on Millenium and Mach64 cards). This is either a bug in syscons or a hardware compatibility problem ;-< This kludge will always load only one font set at a time and always use the font page #0 on the plane #2. It is an interim kludge until we find the exact cause and solution. Small adjustment for mouse cursor handling: - Turn off the mouse cursor early when changing video modes. Video mode switch fixes: - Stop the screen saver when changing video modes. - Enclose the critical section with a pair of spltty()/splx(). - A kludge to prevent scrn_update() from accessing video memory in less- critical sections in video mode change; artificially turn on the UNKNOWN_MODE flag. PR: bin/5899, bin/5907 Tested by: ache and a couple of users OKed by: sos
* Time changes mark 2:phk1998-04-041-10/+12
| | | | | | | | | | | | | | | | | * Figure out UTC relative to boottime. Four new functions provide time relative to boottime. * move "runtime" into struct proc. This helps fix the calcru() problem in SMP. * kill mono_time. * add timespec{add|sub|cmp} macros to time.h. (XXX: These may change!) * nanosleep, select & poll takes long sleeps one day at a time Reviewed by: bde Tested by: ache and others
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* Moved some #includes from <sys/param.h> nearer to where they are actuallybde1998-03-281-0/+1
| | | | used.
* Be less draconian about the TSC if APM is configured, use it forphk1998-03-161-8/+31
| | | | | timecounting if APM-BIOS isn't found. Be just as draconian about SMP as always, but explain it better.
* On SMP systems, initially follow the MP spec with regard to which pintegge1998-03-141-38/+90
| | | | | | on the IOAPIC being connected to the 8254 timer interrupt. Verify that timer interrupts are delivered. If they aren't, attempt a fallback to mixed mode (i.e. routing the timer interrupt via the 8259 PIC).
* Remove special handling for resuming clock interrupt when using APIC_IO.tegge1998-03-051-6/+6
| | | | The `generic' vector stubs do the right thing.
* Prevent the TSC from being used on APM machines, we have no idea ifphk1998-02-281-2/+6
| | | | | | | | it runs at a constant frequency. This was less of an issue before, because the TSC only interpolated in the HZ intervals, but now where the timecounter is used all the way, this becomes much more visible. Nit: Fix a printf which triggered the bde-filter.
* PCCARD-code related style nits, as requested.msmith1998-02-271-4/+4
| | | | Submitted by: bde
* Fix some style nits and remove an unused header.msmith1998-02-271-2/+1
| | | | Submitted by: bde
* Quick fix for the i8254 timecounter often gaining 10 msec.bde1998-02-231-1/+2
|
* Add missing CLOCK_UNLOCK() before write_eflags().jkh1998-02-211-1/+2
| | | | Submitted by: dave adkins <adkin003@tc.umn.edu>
* Replace TOD clock code with more systematic approach.phk1998-02-201-68/+115
| | | | | | | | | | | | | | | Highlights: * Simple model for underlying hardware. * Hardware basis for timekeeping can be changed on the fly. * Only one hardware clock responsible for TOD keeping. * Provides a real nanotime() function. * Time granularity: .232E-18 seconds. * Frequency granularity: .238E-12 s/s * Frequency adjustment is continuous in time. * Less overhead for frequency adjustment. * Improves xntpd performance. Reviewed by: bde, bde, bde
OpenPOWER on IntegriCloud