summaryrefslogtreecommitdiffstats
path: root/sys/isa
Commit message (Collapse)AuthorAgeFilesLines
* Use the correct value when writing the Day Of Week byte in the CMOS.phk2002-12-041-1/+1
| | | | | | | | | | | | | | | | | The correct range is [1...7] with Sunday=1, but we have been writing [0...6] with Sunday=0. The Soekris computers flagged the zero, zapped the date, so if you rebooted your soekris on a sunday, it would come up with a wrong date. Bruce has a more extensive rework of this code, but we will stick with the minimalist fix for now. Spotted by: Soren Kristensen <soren@soekris.com> Thanks to: Michael Sierchio <kudzu@tenebras.com>. Confirmed by: bde Approved by: re
* Capitalize the first letter of device descriptionsmux2002-11-111-2/+2
| | | | for consistency with the rest of the drivers.
* Fix compile with options SC_NO_SUSPEND_VTYSWITCH.jhb2002-10-171-0/+2
|
* 1. Fix a comment. Locking _is_ needed (but not done).iwasaki2002-10-171-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | 2. Update a comment. We now restore much more than RTC updates and interrupts. 3. Order change. Stop interrupts by writing to RTC_STATUSB, restore rate bits for the interrupts by writing to RTC_STATUSA, then enable interrupts again. This seems to be done perfectly backwards in startrtclock(). Otherwise, the idea for this change was obtained from startrtclock(). 4. Don't stop the clock (RTCB_HALT). We only program some control bits and don't want to stop the clock. 5. (Not really related.) Add caveats to the comment about timer_restore(). The update is non-atomic since locking is not done. On locking: 6. rtcin() and writertc() are locked() adequately by splhigh() in RELENG_4, but this locking is null in -current. 7. Doing things in the correct order in (3) combined with (6) is probably enough locking for rtcrestore() in RELENG_4. In -current, the writertc()'s race with rtcintr() unless the BIOS disables RTC interrupts. Submitted by: bde (including commit message) MFC after: 1 week
* Add new syscons option SC_NO_SUSPEND_VTYSWITCH.iwasaki2002-10-171-0/+4
| | | | This disables vty switch during suspend/resume.
* Put an XXX: comment here to point out a couple of free() issues onphk2002-10-161-0/+4
| | | | | | pnp_read_bytes(). Spotted by: FlexeLint
* No need to declare M_ISADEV here.phk2002-10-161-2/+0
| | | | Spotted by: FlexeLint.
* Properly put macro args in ().phk2002-10-161-1/+1
| | | | Spotted by: FlexeLint.
* - Use __BUS_ACCESSOR() to define the ISA ivar accessor functions instead ofjhb2002-10-152-22/+10
| | | | | | | | homerolling our own version. - Rename the enum for memsize from ISA_IVAR_MSIZE to ISA_IVAR_MEMSIZE since using 'MSIZE' in the macro invocation of ISA_ACCESSOR() conflicts with the 'MSIZE' kernel option. The accessor function is still isa_get_msize().
* Fix a probably rare and inconsequential memory leak.phk2002-10-021-1/+3
| | | | Spotted by: FlexeLint
* Add support for DIOCGMEDIASIZE and DIOCGSECTORSIZE.phk2002-09-301-40/+9
| | | | | | Remove all traces of disklabel. Sponsored by: DARPA & NAI Labs.
* Prefix private BIO commands with "FD" so people get a hint that theyphk2002-09-301-11/+11
| | | | | | are in fact private. Sponsored by: DARPA & NAI Labs.
* Don't leak memory in case device_add_child_ordered() returns NULL.phk2002-09-301-3/+6
| | | | Found by: FlexeLint
* Added some buggy PC-98 PnP cards support.nyan2002-09-291-0/+40
|
* Be consistent about "static" functions: if the function is markedphk2002-09-281-4/+4
| | | | | | static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512
* Argh, isa(4), eisa(4) and mca(4) now attach to legacy(4) instead ofjhb2002-09-261-2/+2
| | | | | | | nexus(4) in the case of machines w/o equivalent bridges on a PCI bus. Reported by: winter Pointy hat to: jhb
* Fix a 3 year old oversight: Remove the #ifdef/#endif pair now that therephk2002-09-211-2/+0
| | | | | | is nothing between them anymore. Spotted by: peter.
* Make FreeBSD "struct disklabel" agnostic, step 311 of 723:phk2002-09-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Rename diskerr() to disk_err() for naming consistency. Drop the by now entirely useless struct disklabel argument. Add a flag argument for new-line termination. Fix a couple of printf-format-casts to %j instead of %l. Correctly print the name of all bio commands. Move the function from subr_disklabel.c to subr_disk.c, and from <sys/disklabel.h> to <sys/disk.h>. Use the new disk_err() throughout, #include <sys/disk.h> as needed. Bump __FreeBSD_version for the sake of the aac disk drivers #ifdefs. Remove unused disklabel members of softc for aac, amr and mlx, which seem to originally have been intended for diskerr() use, but which only rotted and got Copy&Pasted at least two times to many. Sponsored by: DARPA & NAI Labs.
* Restore status register A of RTC at resume time.iwasaki2002-09-181-0/+1
| | | | | | | This should fix the 'too many RTC interrupts and statclock seems broken after resume' problem. MFC after: 1 week
* Suitably shrink a comment so it applies again.phk2002-09-151-5/+2
| | | | Submitted by: bde
* Fix a bug were a struct bio was freed and certain members subsequentlyphk2002-09-131-4/+3
| | | | examined. Use biowait() instead of DIY.
* Pass the physical instead of the logical block number injoerg2002-09-121-1/+1
| | | | | bp->bio_pblkno. Otherwise, all formats not using 512 byte physical sectors got screwed.
* Add suspend/resume method to syscons. This switch the modeiwasaki2002-08-251-0/+35
| | | | | (text <-> graphics) by changing current vty during ACPI sleep/wakeup (maybe APM also).
* Replace various spelling with FALLTHROUGH which is lint()ablecharnier2002-08-251-3/+3
|
* Clock frequencies reported by sysctl should be unsigned values. Discoveredmp2002-06-221-2/+2
| | | | | | | | when machdep.tsc_freq returned a negative number on a 2.2GHz Xeon. Submitted by: Brian Harrison <bharrison@ironport.com> Reviewed by: phk MFC after: 1 week
* After some comments from bde, rewrite the loops to avoid turning thejoerg2002-05-141-43/+29
| | | | | | | | | | | | | | | | | previously used "micro-optimization" (count-down loop) into a pessimization. Now the loops are written in the more natural count-up form. Also, while being there, i made the logic in out_fdc() similar to the logic in in_fdc(). The old implementation was a bit bogus anyway since it first tested the DIO bit and only afterwards the RQM bit. However, according to the description of the i82077, the DIO bit is only guaranteed to be valid once the RQM bit is set. Thus, the old implementatoin would have had the chance to misbehave on a controller that is implemented in accordance with the i82077 description (but is not bug-for-bug compatible). MFC after: 3 days
* style(9) changes before further editing that region:joerg2002-05-131-6/+7
| | | | | . add unnecessary parenthesis around return values . put body of an "if" statement onto a line of its own
* Hide the fd autoselection messages behind the bootverbose case so theyjoerg2002-05-121-3/+5
| | | | stop bothering people on their consoles.
* Increase the PIO timeout to approximately the value it used to havejoerg2002-05-122-15/+38
| | | | | | | | | | | | before rev 1.229 (~ 100 ms). According to bde, some (old) broken hardware could require it. In order to make timing more accurate than what could be achieved with a loop around DELAY(1), increase loop timing after the initial ~ 1 ms. Also, move the declaration of FDSTS_TIMEOUT out from fdreg.h into fd.c where it actually belongs to. MFC after: 2 days
* Change the PIO loops from a hard counter into a loop that calls DELAY()joerg2002-05-102-8/+26
| | | | | | | | | | | | in each cycle, with a tunable max cycle count defined in fdreg.h. This is said to fix the problem on some Compaq hardware (and perhaps on other machines using the Natsemi PC87317 chip) where the fdc(4) driver failed to operate at all. PR: kern/21397 Submitted by: Jung-uk Kim <jkim@niksun.com> MFC after: 3 days
* Don't export timecounter structures under debug. with sysctl, theyphk2002-04-301-6/+0
| | | | contain no truly interesting data anymore.
* Remove the tc_update() function. Any frequency change to thephk2002-04-261-2/+0
| | | | | | timecounter will be used starting at the next second, which is good enough for sysctl purposes. If better adjustment is needed the NTP PLL should be used.
* GC various bits and pieces of USERCONFIG from all over the place.phk2002-04-091-8/+0
|
* When reading a UFS-style label from a floppy, don't attempt to use ajoerg2002-04-021-1/+1
| | | | | | | | | "raw partition" of any kind since the floppy driver doesn't support UFS-style partitions at all. Reported by: "Crist J. Clark" <crist.clark@attbi.com> Reviewed by: bde MFC after: 3 days
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-4/+4
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Compromise for critical*()/cpu_critical*() recommit. Cleanup the interruptdillon2002-03-271-0/+12
| | | | | | | | | | | | | | | | | | | disablement assumptions in kern_fork.c by adding another API call, cpu_critical_fork_exit(). Cleanup the td_savecrit field by moving it from MI to MD. Temporarily move cpu_critical*() from <arch>/include/cpufunc.h to <arch>/<arch>/critical.c (stage-2 will clean this up). Implement interrupt deferral for i386 that allows interrupts to remain enabled inside critical sections. This also fixes an IPI interlock bug, and requires uses of icu_lock to be enclosed in a true interrupt disablement. This is the stage-1 commit. Stage-2 will occur after stage-1 has stabilized, and will move cpu_critical*() into its own header file(s) + other things. This commit may break non-i386 architectures in trivial ways. This should be temporary. Reviewed by: core Approved by: core
* Push BIO_FORMAT into a local hack inside the floppy drivers wherephk2002-03-261-0/+2
| | | | it belongs.
* Restore the original copyrightnsouch2002-03-231-0/+1
|
* Remove __P.alfred2002-03-201-7/+7
|
* Remove __P.alfred2002-03-202-37/+37
|
* Fixes to make select/poll mpsafe.alfred2002-03-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: selwakeup required calling pfind which would cause lock order reversals with the allproc_lock and the per-process filedesc lock. Solution: Instead of recording the pid of the select()'ing process into the selinfo structure, actually record a pointer to the thread. To avoid dereferencing a bad address all the selinfo structures that are in use by a thread are kept in a list hung off the thread (protected by sellock). When a selwakeup occurs the selinfo is removed from that threads list, it is also removed on the way out of select or poll where the thread will traverse its list removing all the selinfos from its own list. Problem: Previously the PROC_LOCK was used to provide the mutual exclusion needed to ensure proper locking, this couldn't work because there was a single condvar used for select and poll and condvars can only be used with a single mutex. Solution: Introduce a global mutex 'sellock' which is used to provide mutual exclusion when recording events to wait on as well as performing notification when an event occurs. Interesting note: schedlock is required to manipulate the per-thread TDF_SELECT flag, however if given its own field it would not need schedlock, also because TDF_SELECT is only manipulated under sellock one doesn't actually use schedlock for syncronization, only to protect against corruption. Proc locks are no longer used in select/poll. Portions contributed by: davidc
* Add SONY VAIO psm controller ISA-PnP ID.takawata2002-03-101-0/+1
|
* revert last commit temporarily due to whining on the lists.dillon2002-02-261-13/+0
|
* STAGE-1 of 3 commit - allow (but do not require) interrupts to remaindillon2002-02-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enabled in critical sections and streamline critical_enter() and critical_exit(). This commit allows an architecture to leave interrupts enabled inside critical sections if it so wishes. Architectures that do not wish to do this are not effected by this change. This commit implements the feature for the I386 architecture and provides a sysctl, debug.critical_mode, which defaults to 1 (use the feature). For now you can turn the sysctl on and off at any time in order to test the architectural changes or track down bugs. This commit is just the first stage. Some areas of the code, specifically the MACHINE_CRITICAL_ENTER #ifdef'd code, is strictly temporary and will be cleaned up in the STAGE-2 commit when the critical_*() functions are moved entirely into MD files. The following changes have been made: * critical_enter() and critical_exit() for I386 now simply increment and decrement curthread->td_critnest. They no longer disable hard interrupts. When critical_exit() decrements the counter to 0 it effectively calls a routine to deal with whatever interrupts were deferred during the time the code was operating in a critical section. Other architectures are unaffected. * fork_exit() has been conditionalized to remove MD assumptions for the new code. Old code will still use the old MD assumptions in regards to hard interrupt disablement. In STAGE-2 this will be turned into a subroutine call into MD code rather then hardcoded in MI code. The new code places the burden of entering the critical section in the trampoline code where it belongs. * I386: interrupts are now enabled while we are in a critical section. The interrupt vector code has been adjusted to deal with the fact. If it detects that we are in a critical section it currently defers the interrupt by adding the appropriate bit to an interrupt mask. * In order to accomplish the deferral, icu_lock is required. This is i386-specific. Thus icu_lock can only be obtained by mainline i386 code while interrupts are hard disabled. This change has been made. * Because interrupts may or may not be hard disabled during a context switch, cpu_switch() can no longer simply assume that PSL_I will be in a consistent state. Therefore, it now saves and restores eflags. * FAST INTERRUPT PROVISION. Fast interrupts are currently deferred. The intention is to eventually allow them to operate either while we are in a critical section or, if we are able to restrict the use of sched_lock, while we are not holding the sched_lock. * ICU and APIC vector assembly for I386 cleaned up. The ICU code has been cleaned up to match the APIC code in regards to format and macro availability. Additionally, the code has been adjusted to deal with deferred interrupts. * Deferred interrupts use a per-cpu boolean int_pending, and masks ipending, spending, and fpending. Being per-cpu variables it is not currently necessary to lock; bus cycles modifying them. Note that the same mechanism will enable preemption to be incorporated as a true software interrupt without having to further hack up the critical nesting code. * Note: the old critical_enter() code in kern/kern_switch.c is currently #ifdef to be compatible with both the old and new methodology. In STAGE-2 it will be moved entirely to MD code. Performance issues: One of the purposes of this commit is to enhance critical section performance, specifically to greatly reduce bus overhead to allow the critical section code to be used to protect per-cpu caches. These caches, such as Jeff's slab allocator work, can potentially operate very quickly making the effective savings of the new critical section code's performance very significant. The second purpose of this commit is to allow architectures to enable certain interrupts while in a critical section. Specifically, the intention is to eventually allow certain FAST interrupts to operate rather then defer. The third purpose of this commit is to begin to clean up the critical_enter()/critical_exit()/cpu_critical_enter()/ cpu_critical_exit() API which currently has serious cross pollution in MI code (in fork_exit() and ast() for example). The fourth purpose of this commit is to provide a framework that allows kernel-preempting software interrupts to be implemented cleanly. This is currently used for two forward interrupts in I386. Other architectures will have the choice of using this infrastructure or building the functionality directly into critical_enter()/ critical_exit(). Finally, this commit is designed to greatly improve the flexibility of various architectures to manage critical section handling, software interrupts, preemption, and other highly integrated architecture-specific details.
* Fix style bugs:alfred2002-02-241-2/+3
| | | | | | | Missing `const' qualifier. Initialization in declaration. Submitted by: mike
* Give a little more information as to why pnp configuration of a devicealfred2002-02-241-1/+7
| | | | | | may have failed. Submitted by: Terry Lambert <tlambert2@mindspring.com>
* Disksort will not "munge" requests, BIO_ORDERED or not, so removephk2002-02-221-4/+2
| | | | use of BIO_ORDERED.
* - Do not hang if the resource allocation fails.tanimura2002-02-051-0/+2
| | | | | | | - Add another quirk entry of SB AWE64. PR: kern/32530 Submitted by: Magnus Backstrom <b@etek.chalmers.se>
* Don't include <isa/isavar.h> or compile code depending on it when isabde2002-01-301-0/+5
| | | | | | | | is not configured. Including <isa/isavar.h> when it is not used is harmful as well as bogus, since it includes "isa_if.h" which is not generated when isa is not configured. This was fixed in 1999 but was broken by unconditionalizing PNPBIOS.
* Use the new resource_list_print_type() function.tmm2001-12-212-41/+6
| | | | | Pass the bus device to isa_init() (this is needed for the sparc64 version).
OpenPOWER on IntegriCloud