summaryrefslogtreecommitdiffstats
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Limit the amount of memory userspace processes can cause the kernel torwatson2004-02-231-0/+17
| | | | | | | allocate via DRI on r128 devices. Obtained from: Thomas Biege <thomas@suse.de> Reviewed by: scottl
* - Substitute bdone() and bwait() from vfs_bio.c foralc2004-02-231-23/+4
| | | | | | | | | | swap_pager_putpages()'s buffer completion code. Note: the only difference between swp_pager_sync_iodone() and bdone(), aside from the locking in the latter, was the unnecessary clearing of B_ASYNC. - Remove an unnecessary pmap_page_protect() from swp_pager_async_iodone(). Reviewed by: tegge
* Fix comment containing vop_readdir_args contents: a_cookies is reallytjr2004-02-232-2/+2
| | | | u_long ** not u_long *.
* cookies is an array of u_long, not u_int, so MALLOC() it accordingly.tjr2004-02-232-4/+4
| | | | | Allocating it with the wrong size could have caused corruption on 64-bit architectures.
* Correct some major SMP-harmful problems in the pipe implementation. Firstgreen2004-02-221-41/+66
| | | | | | | | | | | | of all, PIPE_EOF is not checked pervasively after everything that can drop the pipe mutex and msleep(), so fix. Additionally, though it might not harm anything, pipelock() and pipeunlock() are not used consistently. Third, the kqueue support functions do not use the pipe mutex correctly. Last, but absolutely not least, is a race: if pipe_busy is not set on the closing side of the pipe, the other side that is trying to write to that will crash BECAUSE PIPE_EOF IS NOT SET! Unconditionally set PIPE_EOF, and get rid of all the lockups/crashes I have seen trying to build ports.
* Ye/PCI is supported by cy driver, so we don't need to assign a number to it.imp2004-02-221-1/+1
|
* Add sysctls to allow showing threads for pgrp, tty, uid, ruid,deischen2004-02-222-7/+35
| | | | and pid.
* Unbreak after the change to use vm_paddr_t. Since vm_paddr_t ismux2004-02-224-8/+8
| | | | | | | an integer type and the a cast to (void *) was added in the definition of NULL for the kernel, we need to use 0 here instead. Partly submitted by: cperciva
* Reimplement sysctls handling by MAC framework.pjd2004-02-2210-57/+50
| | | | | | | | | | | Now I believe it is done in the right way. Removed some XXMAC cases, we now assume 'high' integrity level for all sysctls, except those with CTLFLAG_ANYBODY flag set. No more magic. Reviewed by: rwatson Approved by: rwatson, scottl (mentor) Tested with: LINT (compilation), mac_biba(4) (functionality)
* Check that amrd_sc is non-NULL before dereferencing it, not after.cperciva2004-02-221-2/+2
| | | | | Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor)
* Check that twed_sc is non-NULL before dereferencing it, not after.cperciva2004-02-221-2/+2
| | | | | Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor)
* Don't free k_cfg until we're finished using it -- reverse the order ofcperciva2004-02-221-1/+1
| | | | | | | two free commands. Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor), scottl
* Don't free meo until we're finished using it.cperciva2004-02-221-1/+1
| | | | | Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor), scottl
* protect new cdevsw entries with "#if (__FreeBSD_version > 502102)"rees2004-02-221-1/+3
|
* Correct a long-standing race condition in vm_object_page_remove() thatalc2004-02-221-1/+1
| | | | | | | could result in a dirty page being unintentionally freed. Reviewed by: tegge MFC after: 7 days
* Do not pre-map the I/O port space. On the Intel Tiger 4 this conflictsmarcel2004-02-223-35/+0
| | | | | | | | | with a memory mapped I/O range that's immediately before it and is not 256MB aligned. As a result, when an address is accessed in the memory mapped range and a direct mapping is added for it, it overlaps with the pre-mapped I/O port space and causes a machine check. Based on a patch from: arun@
* If mountnfs returns an error, it will have already freed nam; no need tocperciva2004-02-221-1/+0
| | | | | | | free it again. Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor)
* Check that periph is non-NULL before dereferencing it.cperciva2004-02-221-1/+1
| | | | | Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor), ken (scsi@)
* If we're going to panic(), do it before dereferencing a NULL pointer.cperciva2004-02-221-1/+1
| | | | | Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor)
* Check that xfer != NULL before dereferencing it, not after.cperciva2004-02-221-2/+2
| | | | | Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor)
* If we're going to assert that logData != NULL, do it before wecperciva2004-02-221-1/+1
| | | | | | | try to dereference logData. Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor), scottl
* We want to allocate and zero sizeof(struct foo) bytes, notcperciva2004-02-221-2/+2
| | | | | | | sizeof(struct foo *) bytes. Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor), scottl
* Fix off-by-one error: sc->twe_drive is an array of TWE_MAX_UNITS elements.cperciva2004-02-221-1/+1
| | | | | Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor)
* Update my personal copyrights and NETA copyrights in the kernelrwatson2004-02-2231-59/+59
| | | | | | | | to use the "year1-year3" format, as opposed to "year1, year2, year3". This seems to make lawyers more happy, but also prevents the lines from getting excessively long as the years start to add up. Suggested by: imp
* Check for NODEV return from udev2dev()phk2004-02-211-0/+2
|
* Regen (FWIW)peter2004-02-214-5/+5
|
* Try and make the compat sigreturn prototypes closer to reality.peter2004-02-211-1/+1
|
* Add a note about the landmine in the middle of struct ia32_sigframe.peter2004-02-211-0/+1
|
* DOH!!! Fix signals for freebsd-4.x/i386 binaries. The ucontext haspeter2004-02-211-1/+1
| | | | different alignments due to the sse fxsave dump area.
* Catch up with some proc/procsig locking improvements that were made to thepeter2004-02-211-6/+2
| | | | i386 version and were not merged over.
* Eliminate the second, unnecessary call to pmap_page_protect() near the endalc2004-02-211-2/+4
| | | | | | | of vm_pageout_flush(). Instead, assert that the page is still write protected. Discussed with: tegge
* in idmap_uid_to_name(), don't try to use the entry after freeing it, in therees2004-02-211-11/+7
| | | | | | | | idmap_add failure case (found by Ted Unangst via Colin Percival) also convert idmap_hashf to return void, since it can't fail also change some panics to error returns
* Fixed a serious off by 1 error. The cluster-in-use bitmap was overrunbde2004-02-211-2/+1
| | | | | | | by 1 u_int if the number of clusters was 1 more than a multiple of (8 * sizeof(u_int)). The bitmap is malloced and large (often huge), so fatal overrun probably only occurred if the number of clusters was 1 more than 1 multiple of PAGE_SIZE/8.
* ask for rdattr_err in readdir, so we won't fail the readdir if we can't getrees2004-02-211-21/+27
| | | | attrs on one or more entries
* Bump __FreeBSD_version to mark cdevsw megapatching.phk2004-02-211-1/+1
|
* Device megapatch 6/6:phk2004-02-216-78/+259
| | | | | | | | | | | | | | | | | | | | | | | | | This is what we came here for: Hang dev_t's from their cdevsw, refcount cdevsw and dev_t and generally keep track of things a lot better than we used to: Hold a cdevsw reference around all entrances into the device driver, this will be necessary to safely determine when we can unload driver code. Hold a dev_t reference while the device is open. KASSERT that we do not enter the driver on a non-referenced dev_t. Remove old D_NAG code, anonymous dev_t's are not a problem now. When destroy_dev() is called on a referenced dev_t, move it to dead_cdevsw's list. When the refcount drops, free it. Check that cdevsw->d_version is correct. If not, set all methods to the dead_*() methods to prevent entrance into driver. Print warning on console to this effect. The device driver may still explode if it is also incompatible with newbus, but in that case we probably didn't get this far in the first place.
* Device megapatch 5/6:phk2004-02-2110-25/+25
| | | | | | | | | | | | Remove the unused second argument from udev2dev(). Convert all remaining users of makedev() to use udev2dev(). The semantic difference is that udev2dev() will only locate a pre-existing dev_t, it will not line makedev() create a new one. Apart from the tiny well controlled windown in D_PSEUDO drivers, there should no longer be any "anonymous" dev_t's in the system now, only dev_t's created with make_dev() and make_dev_alias()
* Device megapatch 4/6:phk2004-02-21163-73/+349
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Device megapatch 3/6:phk2004-02-2129-76/+31
| | | | | | | | | | | | Add missing D_TTY flags to various drivers. Complete asserts that dev_t's passed to ttyread(), ttywrite(), ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty pointer. Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default cdevsw methods for D_TTY drivers and remove the explicit initializations in various drivers cdevsw structures.
* Device megapatch 2/6:phk2004-02-2110-398/+342
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a couple of functions for pseudodrivers to use for implementing cloning in a manner we will be able to lock down (shortly). Basically what happens is that pseudo drivers get a way to ask for "give me the dev_t with this unit number" or alternatively "give me a dev_t with the lowest guaranteed free unit number" (there is unfortunately a lot of non-POLA in the exact numeric value of this number, just live with it for now) Managing the unit number space this way removes the need to use rman(9) to do so in the drivers this greatly simplifies the code in the drivers because even using rman(9) they still needed to manage their dev_t's anyway. I have taken the if_tun, if_tap, snp and nmdm drivers through the mill, partly because they (ab)used makedev(), but mostly because together they represent three different problems for device-cloning: if_tun and snp is the plain case: just give me a device. if_tap has two kinds of devices, with a flag for device type. nmdm has paired devices (ala pty) can you can clone either of them.
* Device megapatch 1/6:phk2004-02-21103-291/+4
| | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
* Use the more appropriate vm_paddr_t in places where a physicalharti2004-02-218-61/+74
| | | | | | address for DMA is handled instead of pointers. Submitted by: Joerg Sonneberger <joerg@britannica.bec.de>
* Dont alloc size 0 buffers.sos2004-02-211-3/+5
|
* Check both PORTEN and MEMEN for enabled HW.sos2004-02-211-1/+1
|
* Only register interrupt as seen if it was a real HW interrupt.sos2004-02-211-1/+3
|
* Make sure that the first mbuf in the chain passed to atm_intrharti2004-02-211-4/+8
| | | | always contains a packet header.
* The token for atm_intr is actually a void *, not an int. Clarifyharti2004-02-211-2/+4
| | | | | what atm_intr expects in a comment and de-obfuscate the code a little bit by replacing the portability macros with the native BSD names.
* Minor beautifications related to style(9) and code consistency.yar2004-02-211-5/+5
| | | | No functional changes.
* Don't remove the first mbuf in the chain if it got empty.harti2004-02-211-7/+6
| | | | | | | | This removes the packet header in certain cases which later on will give panic. Clarify what the atm_intr expects in the comment and de-obscurify the code a little bit by replacing the portability macros with the BSD names. The code isn't maintained externally anymore so there's no point in keeping the extra level of obscurity.
* Improve the SIOCSIFCAP handler a bit:yar2004-02-211-1/+5
| | | | | | | - allow for ifp->if_ioctl being NULL, as the rest of ifioctl() does; - give the interface driver a chance to report a error to the caller; - don't forget to update ifp->if_lastchange upon successful modification of interface operation parameters.
OpenPOWER on IntegriCloud