summaryrefslogtreecommitdiffstats
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* The newpcm headers currently #define away INTR_MPSAFE and INTR_TYPE_AVgreen2004-04-1414-22/+17
| | | | | | | | | | | | | | | | | | because they bogusly check for defined(INTR_MPSAFE) -- something which never was a #define. Correct the definitions. This make INTR_TYPE_AV finally get used instead of the lower-priority INTR_TYPE_TTY, so it's quite possible some improvement will be had on sound driver performance. It would also make all the drivers marked INTR_MPSAFE actually run without Giant (which does seem to work for me), but: INTR_MPSAFE HAS BEEN REMOVED FROM EVERY SOUND DRIVER! It needs to be re-added on a case-by-case basis since there is no one who will vouch for which sound drivers, if any, willy actually operate correctly without Giant, since there hasn't been testing because of this bug disabling INTR_MPSAFE. Found by: "Yuriy Tsibizov" <Yuriy.Tsibizov@gfk.ru>
* Continue my efforts to imitate Windows as closely as possible bywpaul2004-04-1410-206/+468
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attempting to duplicate Windows spinlocks. Windows spinlocks differ from FreeBSD spinlocks in the way they block preemption. FreeBSD spinlocks use critical_enter(), which masks off _all_ interrupts. This prevents any other threads from being scheduled, but it also prevents ISRs from running. In Windows, preemption is achieved by raising the processor IRQL to DISPATCH_LEVEL, which prevents other threads from preempting you, but does _not_ prevent device ISRs from running. (This is essentially what Solaris calls dispatcher locks.) The Windows spinlock itself (kspin_lock) is just an integer value which is atomically set when you acquire the lock and atomically cleared when you release it. FreeBSD doesn't have IRQ levels, so we have to cheat a little by using thread priorities: normal thread priority is PASSIVE_LEVEL, lowest interrupt thread priority is DISPATCH_LEVEL, highest thread priority is DEVICE_LEVEL (PI_REALTIME) and critical_enter() is HIGH_LEVEL. In practice, only PASSIVE_LEVEL and DISPATCH_LEVEL matter to us. The immediate benefit of all this is that I no longer have to rely on a mutex pool. Now, I'm sure many people will be seized by the urge to criticize me for doing an end run around our own spinlock implementation, but it makes more sense to do it this way. Well, it does to me anyway. Overview of the changes: - Properly implement hal_lock(), hal_unlock(), hal_irql(), hal_raise_irql() and hal_lower_irql() so that they more closely resemble their Windows counterparts. The IRQL is determined by thread priority. - Make ntoskrnl_lock_dpc() and ntoskrnl_unlock_dpc() do what they do in Windows, which is to atomically set/clear the lock value. These routines are designed to be called from DISPATCH_LEVEL, and are actually half of the work involved in acquiring/releasing spinlocks. - Add FASTCALL1(), FASTCALL2() and FASTCALL3() macros/wrappers that allow us to call a _fastcall function in spite of the fact that our version of gcc doesn't support __attribute__((__fastcall__)) yet. The macros take 1, 2 or 3 arguments, respectively. We need to call hal_lock(), hal_unlock() etc... ourselves, but can't really invoke the function directly. I could have just made the underlying functions native routines and put _fastcall wrappers around them for the benefit of Windows binaries, but that would create needless bloat. - Remove ndis_mtxpool and all references to it. We don't need it anymore. - Re-implement the NdisSpinLock routines so that they use hal_lock() and friends like they do in Windows. - Use the new spinlock methods for handling lookaside lists and linked list updates in place of the mutex locks that were there before. - Remove mutex locking from ndis_isr() and ndis_intrhand() since they're already called with ndis_intrmtx held in if_ndis.c. - Put ndis_destroy_lock() code under explicit #ifdef notdef/#endif. It turns out there are some drivers which stupidly free the memory in which their spinlocks reside before calling ndis_destroy_lock() on them (touch-after-free bug). The ADMtek wireless driver is guilty of this faux pas. (Why this doesn't clobber Windows I have no idea.) - Make NdisDprAcquireSpinLock() and NdisDprReleaseSpinLock() into real functions instead of aliasing them to NdisAcaquireSpinLock() and NdisReleaseSpinLock(). The Dpr routines use KeAcquireSpinLockAtDpcLevel() level and KeReleaseSpinLockFromDpcLevel(), which acquires the lock without twiddling the IRQL. - In ndis_linksts_done(), do _not_ call ndis_80211_getstate(). Some drivers may call the status/status done callbacks as the result of setting an OID: ndis_80211_getstate() gets OIDs, which means we might cause the driver to recursively access some of its internal structures unexpectedly. The ndis_ticktask() routine will call ndis_80211_getstate() for us eventually anyway. - Fix the channel setting code a little in ndis_80211_setstate(), and initialize the channel to IEEE80211_CHAN_ANYC. (The Microsoft spec says you're not supposed to twiddle the channel in BSS mode; I may need to enforce this later.) This fixes the problems I was having with the ADMtek adm8211 driver: we were setting the channel to a non-standard default, which would cause it to fail to associate in BSS mode. - Use hal_raise_irql() to raise our IRQL to DISPATCH_LEVEL when calling certain miniport routines, per the Microsoft documentation. I think that's everything. Hopefully, other than fixing the ADMtek driver, there should be no apparent change in behavior.
* Style cleanups, M_ZERO instead of bzero.njl2004-04-141-22/+20
|
* Style cleanups, use M_ZERO instead of bzero, unify the !semaphore andnjl2004-04-141-44/+43
| | | | semaphore return paths.
* Style cleanup, plus properly backup partial resource allocation innjl2004-04-141-44/+51
| | | | AcpiOsInstallInterruptHandler() in the case of failure to initialize.
* Style cleanups to reduce diffs to locking tree.njl2004-04-145-111/+91
|
* Style and printf message cleanups.njl2004-04-141-138/+79
|
* Use METHOD_VIDEO instead of the method string itself.njl2004-04-142-2/+2
| | | | Pointed out by: Andrew Thompson
* Use TRUE for a boolean and a style nit.njl2004-04-141-2/+1
|
* sx was randomly added to NOTES. Instead, place it in the miscimp2004-04-142-12/+10
| | | | | | | hardware in properly sorted order. Fix a little disorder while I'm here. Submitted by: bde
* Update the name for edge triggered for the 20040402 import.njl2004-04-141-1/+1
|
* Prefer uint16_t to ushort.imp2004-04-141-1/+1
| | | | Submitted by: bde
* Check in files with local changes:njl2004-04-142-8/+20
| | | | | | | | | * In the resume path, give up after waiting for a while for WAK_STS to be set. Some BIOSs never set it. * Allow access to the field if it is within the region size rounded up to a multiple of the access byte width. This overcomes "off-by-one" programming errors in the AML often found in Toshiba laptops.
* Check in unmodified files off the vendor branch.njl2004-04-143-29/+42
|
* This commit was generated by cvs2svn to compensate for changes in r128212,njl2004-04-1432-222/+808
|\ | | | | | | which included commits to RCS files with non-trunk default branches.
| * Import ACPI-CA 20040402 distribution.njl2004-04-1437-259/+870
| |
* | Add another cleanfile for future imports.njl2004-04-141-2/+2
| |
* | In an effort to simplify the routing code, try to deprecate rtalloc()luigi2004-04-142-2/+2
| | | | | | | | | | | | | | | | in favour of rtalloc_ign(), which is what would end up being called anyways. There are 25 more instances of rtalloc() in net*/ and about 10 instances of rtalloc_ign()
* | Staticize <if>_clone_{create,destroy} functions.brooks2004-04-146-24/+24
| | | | | | | | Reviewed by: mlaier
* | Add support for video output switching. It appears no systems use HCI tonjl2004-04-142-20/+156
| | | | | | | | | | | | | | | | change the video output but use a separate device with a DSSX method and a HID of "TOS6201" instead. We use a pseudo-driver to get the handle for this object and pass it to the acpi_toshiba driver. This is untested but seems to match the Linux Toshiba driver.
* | Boomerang 10/100BT (found in 2c905-TX) chips apparently suffer theimp2004-04-131-0/+1
| | | | | | | | | | | | | | | | same problems as their Hurricane 575* bretheren in that one could set the memory mapped port, but that has no effect. Add a quirk for this. # I'll have to see if I can dig up documentation on these parts to see # if there's someway software can know this other than a table...
* | Some devices have what appear to be invalid BARs. They are invalid inimp2004-04-131-26/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the sense that any write to them reads back as a 0. This presents a problem to our resource allocation scheme. If we encounter such vars, the code now treats them as special, allowing any allocation against them to succeed. I've not seen anything in the standard to clearify what host software should do when it encounters these sorts of BARs. Also cleaned up some output while I'm here and add commmented out bootverbose lines until I'm ready to reduce the verbosity of boot messages. This gets a number of south bridges and ata controllers made mostly by VIA, AMD and nVidia working again. Thanks to Soren Schmidt for his help in coming up with this patch.
* | Use ifconfig(8) for setting common 802.11 parameters.fjoe2004-04-133-63/+245
| | | | | | | | Submitted by: Stanislav A. Svirid <count@riss-telecom.ru>
* | Add Direct Sequence 354K and 512K (needed for arl(4)).fjoe2004-04-131-0/+8
| |
* | Remove extra copy of code.imp2004-04-131-7/+0
| | | | | | | | Noticed by: Carlos Velasco
* | Enable the sx driver on i386 and pc98.nyan2004-04-132-1/+5
| |
* | Use headers from the kernel source tree rather than installed headers.des2004-04-131-1/+1
| | | | | | | | Submitted by: ru
* | route.h: introduce a macro, SA_SIZE(struct sockaddr *) which returnsluigi2004-04-133-14/+19
| | | | | | | | | | | | | | | | | | | | the space occupied by a struct sockaddr when passed through a routing socket. Use it to replace the macro ROUNDUP(int), that does the same but is redefined by every file which uses it, courtesy of the School of Cut'n'Paste Programming(TM). (partial) userland changes to follow.
* | Add support for the Promise command sequencer present on all modern Promisesos2004-04-1312-270/+625
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | controllers (PDC203** PDC206**). This also adds preliminary support for the Promise SX4/SX4000 but *only* as a "normal" Promise ATA controller (ATA RAID's are supported though but only RAID0, RAID1 and RAID0+1). This cuts off yet another 5-8% of the command overhead on promise controllers, making them the fastest we have ever had support for. Work is now continuing to add support for this in ATA RAID, to accellerate ATA RAID quite a bit on these controllers, and especially the SX4/SX4000 series as they have quite a few tricks in there.. This commit also adds a few fixes to the SATA code needed for proper support.
* | Bump __FreeBSD_version on behalf of the new .warning directive in make(1).ru2004-04-131-1/+1
| | | | | | | | Requested by: kris
* | Fix off by one error, twice.imp2004-04-121-2/+2
| | | | | | | | Submitted by: Carlos Velasco (first one), jhb (second one)
* | Do not drop Giant around the poll method yet, we're not ready for it.phk2004-04-121-2/+2
| |
* | MFp4:imp2004-04-121-4/+15
| | | | | | | | | | | | | | | | | | | | | | Alignment for pccards should also be treated in a similar way that we tread it for cardbus cards. Remove bogus debugs while I'm here. # This is also necessary to make the CIS reading work. Submitted by: Carlos Velasco
* | Improve reading of CIS cards:imp2004-04-121-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) Align to 64k for the CIS. Some cards don't like it when we aren't aligned to a 64k boundary. I can't find anything in the standard that requires this, but I have 1/2 dozen cards that won't work at all unless I enable this. (2) Sleep 1s before scanning the CIS. This may be a nop, but has little harm. (3) The CIS can be up to 4k in some weird, odd-ball edge cases. Since we have limiters for when that's not the case, it does no harm to increase it to 4k. #1 was submitted, in a different form, by Carlos Velasco.
* | remove an almost-duplicate piece of code by setting the loopluigi2004-04-121-16/+10
| | | | | | | | limits appropriately.
* | in rtinit(), remove one useless variable, and move a few othersluigi2004-04-121-9/+9
| | | | | | | | within the block where they are used.
* | stop() no longer needs sched_lock held; in fact, holding sched_lock causescperciva2004-04-121-3/+2
| | | | | | | | | | | | | | | | a LOR against sleepq. Fix the comment, and fix ptracestop() to pick up sched_lock after stop() rather than before. Reported by: Scott Sipe <cscotts@mindspring.com> Reviewed by: rwatson, jhb
* | Count outgoing link-level broadcast packets in if_omcasts.ru2004-04-121-1/+1
| | | | | | | | | | | | | | | | I'm not sure this is completely correct but at least this is consistent with the accounting of incoming broadcasts. PR: kern/65273 Submitted by: David J Duchscher <daved@tamu.edu>
* | Don't send the available space as is in the FSSTAT call. Undermux2004-04-121-2/+14
| | | | | | | | | | | | | | | | | | FreeBSD, we can have a negative available space value, but the corresponding fields in the NFS protocol are unsigned. So trnucate the value to 0 if it's negative, so that the client doesn't receive absurdly high values. Tested by: cognet
* | Fix "sleeping without a mutex" panic.markm2004-04-121-3/+6
| |
* | Remove a check for the return value added in rev 1.41. It's not an errornjl2004-04-121-8/+1
| | | | | | | | to fail to turn off a fan, since the case is that it's usually already off.
* | Move sx to i386/NOTES for the moment. I missed theimp2004-04-122-2/+4
| | | | | | | | enable/disable_intr() in the code.
* | Bump __FreeBSD_version for getgrent(3) removal. I doubt anythingmux2004-04-111-1/+1
| | | | | | | | outside of the tree uses it, but it doesn't cost anything.
* | Belatedly remove the getvfsent(3) API. All the consumers have beenmux2004-04-111-6/+0
| | | | | | | | | | updated to use getvfsbyname(3) or the vfs.conflist sysctl since a long time, except mount_smbfs(8) which has just been fixed.
* | Put struct ovfsconf inside BURN_BRIDGES as well.mux2004-04-111-0/+2
| |
* | Put deprecated sysctl code inside BURN_BRIDGES.mux2004-04-111-3/+5
| |
* | Implemented per-interface polling(4) control.ru2004-04-111-5/+13
| |
* | Implemented per-interface polling(4) control.ru2004-04-112-2/+23
| |
* | Add sx driver, since it looks like it should work on allimp2004-04-111-0/+2
| | | | | | | | architectures.
* | Update to recent driver api changes.imp2004-04-112-25/+11
| |
OpenPOWER on IntegriCloud