aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* There is a consensus that ifaddr.ifa_addr should never be NULL,Yaroslav Tykhiy2006-06-2911-50/+28
| | | | | | | | | | | | | except in places dealing with ifaddr creation or destruction; and in such special places incomplete ifaddrs should never be linked to system-wide data structures. Therefore we can eliminate all the superfluous checks for "ifa->ifa_addr != NULL" and get ready to the system crashing honestly instead of masking possible bugs. Suggested by: glebius, jhb, ru Notes: svn path=/head/; revision=160038
* Use TAILQ_FOREACH in the __FreeBSD__ case, too.Yaroslav Tykhiy2006-06-291-2/+1
| | | | | | | Funnily enough, rev. 1.15 changed the __Net and __Open cases only. Notes: svn path=/head/; revision=160035
* Use TAILQ_FOREACH.Yaroslav Tykhiy2006-06-291-4/+1
| | | | Notes: svn path=/head/; revision=160034
* Use the nifty TAILQ_FOREACH.Yaroslav Tykhiy2006-06-291-2/+1
| | | | Notes: svn path=/head/; revision=160033
* Use TAILQ_FOREACH consistently.Yaroslav Tykhiy2006-06-291-2/+1
| | | | Notes: svn path=/head/; revision=160032
* Use queue(3) macros instead of accessing list/queue internals directly.Yaroslav Tykhiy2006-06-291-3/+3
| | | | Notes: svn path=/head/; revision=160031
* Fix building with GCC 4.2: ensure types are defined before refering to them.David E. O'Brien2006-06-295-5/+5
| | | | Notes: svn path=/head/; revision=160030
* Use the elegant TAILQ_FOREACH() in place of a hand-rolled for() loop.Yaroslav Tykhiy2006-06-291-3/+1
| | | | Notes: svn path=/head/; revision=160029
* Fix semctl(2) breakage from the previous commit. Previously __semctl() hadJohn Baldwin2006-06-291-7/+12
| | | | | | | | | | | | | | | | a local 'semid' variable which was the array index and used uap->semid as the original IPC id. During the kern_semctl() conversion those two variables were collapsed into a single 'semid' variable breaking the places that needed the original IPC ID. To fix, add a new 'semidx' variable to hold the array index and leave 'semid' unmolested as the IPC id. While I'm here, explicitly document that the (undocumented, at least in semctl(2)) SEM_STAT command curiously expects an array index in the 'semid' parameter rather than an IPC id. Submitted by: maxim Notes: svn path=/head/; revision=160028
* Fix URL to Bellovin's paper.Gleb Smirnoff2006-06-291-1/+1
| | | | | | | Submitted by: Anton Yuzhaninov <citrin rambler-co.ru> Notes: svn path=/head/; revision=160027
* Fix a bug when accumulating run time, if a thread calls yield() syscall,David Xu2006-06-291-5/+5
| | | | | | | its run time may be lost. Notes: svn path=/head/; revision=160026
* Eliminate the offset argument from send_reject. It's not beenBjoern A. Zeeb2006-06-291-9/+7
| | | | | | | | | | | used since FreeBSD-SA-06:04.ipfw. Adopt send_reject6 to what had been done for legacy IP: no longer send or permit sending rejects for any but the first fragment. Discussed with: oleg, csjp (some weeks ago) Notes: svn path=/head/; revision=160025
* Use INPLOOKUP_WILDCARD instead of just 1 more consistently.Bjoern A. Zeeb2006-06-295-9/+15
| | | | | | | OKed by: rwatson (some weeks ago) Notes: svn path=/head/; revision=160024
* Fix system load count (noticed by dephij). Remove incorrectDavid Xu2006-06-291-6/+1
| | | | | | | comment. Notes: svn path=/head/; revision=160023
* Detach the interface first, do vlan_unconfig() then.Yaroslav Tykhiy2006-06-291-9/+3
| | | | | | | | | | | | | | | | | | Previously, another thread could get a pointer to the interface by scanning the system-wide list and sleep on the global vlan mutex held by vlan_unconfig(). The interface was gone by the time the other thread woke up. In order to be able to call vlan_unconfig() on a detached interface, remove the purely cosmetic bzero'ing of IF_LLADDR from the function because a detached interface has no addresses. Noticed by: a stress-testing script by maxim Reviewed by: glebius Notes: svn path=/head/; revision=160020
* Remove a few unused things.Yaroslav Tykhiy2006-06-291-12/+8
| | | | | | | Fix some style and consistency points. Notes: svn path=/head/; revision=160019
* Reduce unneeded code duplication.Yaroslav Tykhiy2006-06-291-12/+1
| | | | Notes: svn path=/head/; revision=160018
* Since 5714 family doesn't have Jumbo ring, we do not supportGleb Smirnoff2006-06-291-3/+0
| | | | | | | | | Jumbos on them, yet. The 5780 is equivalent to the 5714. Submitted by: brad@OpenBSD, davidch Notes: svn path=/head/; revision=160017
* Comment fix.Takanori Watanabe2006-06-291-2/+2
| | | | | | | Pointed out by: ume via IRC Notes: svn path=/head/; revision=160016
* Willcom WSIM DD support.Takanori Watanabe2006-06-292-1/+4
| | | | Notes: svn path=/head/; revision=160015
* Remove unused function declaration.David Xu2006-06-291-4/+2
| | | | | | | | Add else statement in sched_calc_pri. Fix a bug when checking interrupt thread in sched_add. Notes: svn path=/head/; revision=160014
* Remove load balancer code, since it has serious priority inversion problemDavid Xu2006-06-291-1011/+413
| | | | | | | which really hurts performance on FreeBSD. Notes: svn path=/head/; revision=160013
* A small race existed where the lock was dropped between when encif wasAndrew Thompson2006-06-281-24/+20
| | | | | | | | | | | | | | | tested and then set. [1] Reorganise things to eliminate this, we now ensure that enc0 can not be destroyed which as the benefit of no longer needing to lock in ipsec_filter and ipsec_bpf. The cloner will create one interface during the init so we can guarantee that encif will be valid before any SPD entries are added to ipsec. Spotted by: glebius [1] Notes: svn path=/head/; revision=160011
* Properly detect the RTL8168(B?) again. RealTek sent me a bunch of sampleBill Paul2006-06-282-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cards: the chips are all marked "RTL8111B", but they put stickers on the back that say "RTL8168B/8111B". The manual says there's only one HWREV code for both the 8111B and 8168B devices, which is 0x30000000, but the cards they sent me actually report HWREV of 0x38000000. Deciding to trust the hardware in front of me rather than a possibly incorrect manual (it wouldn't be the first time the HWREVs were incorrectly documented), I changed the 8168 revision code. It turns out this was a mistake though: 0x30000000 really is a valid for the 8168. There are two possible reasons for there to be two different HWREVs: 1) 0x30000000 is used only for the 8168B and 0x38000000 is only for the 8111B. 2) There were 8111/8168 rev A devices which both used code 0x30000000, and the 8111B/8168B both use 0x38000000. The product list on the RealTek website doesn't mention the existence of any 8168/8111 rev A chips being in production though, and I've never seen one, so until I get clarification from RealTek, I'm going to assume that 0x30000000 is just for the 8168B and 0x38000000 is for the 8111B only. So, the HWREV code for the 8168 has been put back to 0x30000000, a new 8111 HWREV code has been added, and there are now separate entries for recognizing both devices in the device list. This will allow all devices to work, though if it turns out I'm wrong I may need to change the ID strings Notes: svn path=/head/; revision=160008
* Dont call free on non-alloc'd items.Søren Schmidt2006-06-281-2/+4
| | | | Notes: svn path=/head/; revision=160007
* Update AHCI support to be more generic.Søren Schmidt2006-06-282-67/+104
| | | | | | | Add support for AHCI on the VIA VT8251. Notes: svn path=/head/; revision=160000
* - Recognize more device IDs adding support for BCM5754, BCM5755,Gleb Smirnoff2006-06-282-34/+44
| | | | | | | | | | | | | | | | BCM5787 based NICs. - Recognize BCM5703 B0 ASIC. - Rewrite the jumbo capability matching macro, so that chips known to work are listed there. [*] [*] I'm still not sure about this. Probably more corrections will be done to this macro after discussion with davidch@ and brad@OpenBSD. Obtained from: OpenBSD (brad) Notes: svn path=/head/; revision=159999
* Updated the XBOX kernel to use the new nfe(4) driver obtained fromRink Springer2006-06-271-1/+1
| | | | | | | | | | | | | | OpenBSD. This driver seems to give a small performance increase, and should lead to better maintainability in the future. The nForce Ethernet-specific hack in sys/i386/xbox/xbox.c is still required, judging from dev/nfe/if_nfe.c. The condition it hacks will almost certainly only occur on XBOX-es anyway, so it is best left there. Approved by: imp (mentor) Notes: svn path=/head/; revision=159997
* Correctly calculate a buffer length. It was off by one so a read() returnedAlexander Leidinger2006-06-271-1/+1
| | | | | | | | | | | | | | | | one byte less than needed. This is a RELENG_x_y candidate, since it fixes a problem with Oracle 10. Noticed by: Dmitry Ganenko <dima@apk-inform.com> Testcase by: Dmitry Ganenko <dima@apk-inform.com> Reviewed by: des Submitted by: rdivacky Sponsored by: Google SoC 2006 MFC after: 1 week Notes: svn path=/head/; revision=159996
* Improve linprovfs to provide/fix theAlexander Leidinger2006-06-271-27/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - process state (idle, sleeping, running, ...) [1] - the process group ID of the process which owns the connected tty - some page fault stats - time spend in kernel/userland - priority/nice value - starttime [1] - memory/swap stats - scheduling policy Additionally add some new fields and correct some not filled out ones. This brings us down to 15 dummy fields. The fields marked with [1] are needed to get Oracle 10 running. The starttime field is not completely right, since it displays the _same_ starttime for _every_ process, but at least it is not 0 and Oracle accepts this. This is a RELENG_x_y candidate. Noticed by: Dmitry Ganenko <dima@apk-inform.com> [1] Reviewed by: des, rdivacky MFC after: 1 week Notes: svn path=/head/; revision=159995
* Regen.John Baldwin2006-06-2710-14/+14
| | | | Notes: svn path=/head/; revision=159994
* Use kern_shmctl() in svr4_sys_shmctl() and drop use of the stackgap. MarkJohn Baldwin2006-06-272-47/+32
| | | | | | | svr4_sys_shmctl() MPSAFE. Notes: svn path=/head/; revision=159993
* Axe the stackgap macros as the Linux ABIs no longer use the stackgap.John Baldwin2006-06-271-26/+0
| | | | Notes: svn path=/head/; revision=159992
* - Add a kern_semctl() helper function for __semctl(). It accepts a pointerJohn Baldwin2006-06-277-162/+142
| | | | | | | | | | to a copied-in copy of the 'union semun' and a uioseg to indicate which memory space the 'buf' pointer of the union points to. This is then used in linux_semctl() and svr4_sys_semctl() to eliminate use of the stackgap. - Mark linux_ipc() and svr4_sys_semsys() MPSAFE. Notes: svn path=/head/; revision=159991
* Regen.John Baldwin2006-06-2710-19/+19
| | | | Notes: svn path=/head/; revision=159983
* - Expand the scope of Giant some in mount(2) to protect the vfsp structureJohn Baldwin2006-06-275-24/+35
| | | | | | | | | | | from going away. mount(2) is now MPSAFE. - Expand the scope of Giant some in unmount(2) to protect the mp structure (or rather, to handle concurrent unmount races) from going away. umount(2) is now MPSAFE, as well as linux_umount() and linux_oldumount(). - nmount(2) and linux_mount() were already MPSAFE. Notes: svn path=/head/; revision=159982
* Fix breakage of CHIP_I855 in the last revision.Eric Anholt2006-06-272-6/+8
| | | | | | | Submitted by: Ted Faber <faber@ISI.EDU> Notes: svn path=/head/; revision=159981
* A netgraph node that can do different manipulations withGleb Smirnoff2006-06-277-0/+857
| | | | | | | | | | mbuf_tags(9) on packets. Submitted by: Vadim Goncharov <vadimnuclight tpu.ru> mdoc(7) reviewed by: ru Notes: svn path=/head/; revision=159979
* - Use suser_cred(9) instead of directly comparing cr_uid.Pawel Jakub Dawidek2006-06-271-2/+3
| | | | | | | | | - Compare pointer with NULL. Reviewed by: rwatson Notes: svn path=/head/; revision=159978
* - Use suser_cred(9) instead of directly comparing cr_uid.Pawel Jakub Dawidek2006-06-271-1/+2
| | | | | | | | | - Compare pointer with NULL, instead of 0. Reviewed by: rwatson Notes: svn path=/head/; revision=159977
* - Use suser_cred(9) instead of directly checking cr_uid.Pawel Jakub Dawidek2006-06-272-4/+4
| | | | | | | | | | - Change the order of conditions to first verify that we actually need to check for privileges and then eventually check them. Reviewed by: rwatson Notes: svn path=/head/; revision=159976
* Compress direct cr_ruid comparsion and jailed() call to suser_cred(9).Pawel Jakub Dawidek2006-06-271-2/+4
| | | | | | | Reviewed by: rwatson Notes: svn path=/head/; revision=159975
* Use suser_cred(9) instead of checking cr_uid directly.Pawel Jakub Dawidek2006-06-271-1/+1
| | | | | | | Reviewed by: rwatson Notes: svn path=/head/; revision=159974
* - Use suser_cred(9) instead of checking cr_ruid directly.Pawel Jakub Dawidek2006-06-271-7/+10
| | | | | | | | | | | | - For privileged processes safe two mutex operations. We may want to consider if this is good idea to use SUSER_ALLOWJAIL here, but for now I didn't wanted to change the original behaviour. Reviewed by: rwatson Notes: svn path=/head/; revision=159973
* Make several changes to pmap_enter_quick_locked():Alan Cox2006-06-271-20/+39
| | | | | | | | | | | | | | | | | | | | | 1. Make the caller responsible for performing pmap_install(). This reduces the number of times that pmap_install() is performed by pmap_enter_object() from twice per page to twice overall. 2. Don't block if pmap_find_pte() is unable to allocate a PTE. If it did block, then it might wind up mapping a cache page. Specifically, if pmap_enter_quick_locked() slept when called from pmap_enter_object(), the page daemon could change an active or inactive page into a cache page just before it was to be mapped. 3. Bail out of pmap_enter_quick_locked() if pv entries aren't plentiful. In other words, don't force the allocation of a pv entry if they aren't readily available. Reviewed by: marcel@ Notes: svn path=/head/; revision=159971
* Correct a very old and very obscure bug: vmspace_fork() callsAlan Cox2006-06-272-6/+9
| | | | | | | | | | | | | | | | pmap_copy() if the mapping is VM_INHERIT_SHARE. Suppose the mapping is also wired. vmspace_fork() clears the wiring attributes in the vm map entry but pmap_copy() copies the PG_W attribute in the PTE. I don't think this is catastrophic. It blocks pmap_remove_pages() from destroying the mapping and corrupts the pmap's wiring count. This revision fixes the problem by changing pmap_copy() to clear the PG_W attribute. Reviewed by: tegge@ Notes: svn path=/head/; revision=159970
* Simplify ipsec_bpf by using bpf_mtap2().Andrew Thompson2006-06-271-9/+2
| | | | Notes: svn path=/head/; revision=159969
* Add a pure open source nForce Ethernet driver, under BSDL.David E. O'Brien2006-06-269-999/+1501
| | | | | | | | | | | | This driver was ported from OpenBSD by Shigeaki Tagashira <shigeaki@se.hiroshima-u.ac.jp> and posted at http://www.se.hiroshima-u.ac.jp/~shigeaki/software/freebsd-nfe.html It was additionally cleaned up by me. It is still a work-in-progress and thus is purposefully not in GENERIC. And it conflicts with nve(4), so only one should be loaded. Notes: svn path=/head/; revision=159967
* Add a pseudo interface for packet filtering IPSec connections before or afterAndrew Thompson2006-06-268-0/+361
| | | | | | | | | | | | | | encryption. There are two functions, a bpf tap which has a basic header with the SPI number which our current tcpdump knows how to display, and handoff to pfil(9) for packet filtering. Obtained from: OpenBSD Based on: kern/94829 No objections: arch, net MFC after: 1 month Notes: svn path=/head/; revision=159965
* Backed out the change by request from rwatson.Sergey Babkin2006-06-269-143/+0
| | | | | | | PR: kern/14584 Notes: svn path=/head/; revision=159964