Commit Graph

4053 Commits

Author SHA1 Message Date
mycroft 4605cec510 PRIBIO -> PSOCK. This emulates the pre-sys_pipe behavior, and avoids including
processes blocked on pipe I/O in the load average.
2004-07-17 20:50:08 +00:00
yamt 118553b061 sa_release: NULL out l_savp to avoid having a stale reference to per-vp data.
it matters when an application using SA does exec() an application which also
uses SA.  (firefox 0.9 seems to do this.)
2004-07-06 12:23:40 +00:00
pk a7c40722d8 Call inittodr() from main(). Let file system code set the recorded `last
update' time (if any) through the new function setrootfstime().
2004-07-05 07:28:45 +00:00
manu 26200ee754 In MacOS X.3, the kernel maps tw opages of memory in every user process.
This areas is called the comm pages. It is used to provide fast access to
several data and functions.

The comm pages are mapped starting at 0xffff800 (address chosed so that
absolute branch can be used, so it can be accessed even when dynamic linking
is not ready). NetBSD has the user stack here, so we need to provide a
Darwin-specific stack setup routine which sets the top of the stack at
0xbfff0000.

This implementation is not complete but it does enough to get MacOS X.3
starting again (static binaries run, dynamic binaries still have an issue).
in the comm pages functions, we only implement bcopy, pthread_self and
memcpy.

TODO:
- clean up the powerpc specific code from MD parts
- for now we map only one page to avoid a crash, we want two pages.
- write all the comm functions.
2004-07-03 00:14:30 +00:00
yamt fb277865d7 bump sb_timeo from short to int to allow longer timeouts.
especially when hz is high.

while i'm here, bump sb_flags to int, as suggested by
Jason Thorpe and Bill Studenmund.

ride on 2.0G.
2004-07-01 12:42:57 +00:00
yamt 0f3ce64ad4 statclock: don't assume hz==100 when determining frequency to call schedclock. 2004-07-01 12:36:57 +00:00
hannken f59f039ea5 Keep a pointer to the leaf mount. Needed for write gating where a
file system gets suspended and has layered mounts above it.

Welcome to 2.0G

Reviewed by: Bill Studenmund <wrstuden@netbsd.org>
2004-07-01 10:03:29 +00:00
fredb 430f0ecf15 Multiply before divide, correcting a mistake introduced by revision 1.7.
The loss of precision could be significant in some cases.
2004-06-27 15:21:30 +00:00
yamt ce02ffbc68 introduce a new function, cache_lookup_raw(), for filesystems which
want more flexible namecache handling.
it just looks up a dnlc entry and vget() the result vnode.
ie. no automatic entry removal, no automatic vnode locking.

discussed on tech-kern@.
2004-06-27 08:50:44 +00:00
fredb ca3c6f824f Partly back out the last, to avoid a deadlock when microtime() is called
from levels below IPL_CLOCK (pointed out by thorpej). Just take the lock
before reading the time and cycle counter.
2004-06-27 01:36:04 +00:00
chs a4bbde95f7 add a workaround for PR 25664 (failure to map sigcode for Tru64 binaries). 2004-06-27 00:55:08 +00:00
chs a77ca34b8a rearrange the handling of p_textvp so that the ref-counting is correct.
fixes PR 25663.
2004-06-27 00:41:03 +00:00
fredb f17b436426 Take the lock earlier, before reading the cycle counter, so that it
doesn't advance while we're waiting on the lock. In fact, try to take
the lock even before blocking interrupts: the lock is locking "lasttime"
against other callers of cc_microtime(), not against the clock routines,
and if we take a clock interrupt while waiting for the lock, that's one
we don't have to take after the computations, but before returning to
the caller, and that makes the data a little fresher to the caller.

Moreover, inverting the order of splXXX() and simple_lock() permits us
to unblock interrupts before doing the long division.

With this, finally, performance of "ntpd" on my MP i386 seems to be no
worse than on non-MP i386, so this may fix PR kern/24207.
2004-06-26 16:31:33 +00:00
christos 39e498b419 Explain why the comment is a lie. 2004-06-24 15:06:35 +00:00
jonathan 5249b5a2a5 Rename MBUFTRACE helper function m_claim() to m_claimm(),
for consistency with M_FREE() and m_freem().  Affected files:

sys/mbuf.h
kern/uipc_socket2.c
kern/uipc_mbuf.c
net/if_ethersubr.c
netatalk/ddp_input.c
nfs/nfs_socket.c
2004-06-24 04:15:50 +00:00
christos 7e8ca29827 Fix a panic induced by forcing ktrace to inject an emul record on
a ktraced file descriptor that has already been invalidated. Change
all ktrace functions to propagate the error from ktrwrite() and
check for it. Thanks to Pavel Cahyna for finding this and giving
a perfect bug report.

[should be pulled up for 2.0]
2004-06-23 23:05:48 +00:00
christos 0fe4a0b07a Don't check for negative offset in the memory case. 64 bit addresses can
have the high bit set, and thus be interpreted as negative offsets. This
is not a problem because uvm_io() does all the range checks.
2004-06-22 02:06:55 +00:00
hannken 7a5be5a9ff - Add flag L_COWINPROGRESS to struct lwp to avoid recursion when
doing copy-on-write.

- Change VFS_SNAPSHOT() to return the snapshot vnode locked.

- Make the IO path for copy-on-write and snapshot-read more lightweight.
  Avoids deadlocks where vn_rdwr(...READ...) has a shared lock and needs
  to copy-on-write.
  Avoids deadlocks/panics where to clean pages the copy-on-write needs
  to allocate pages for its VOP_PUTPAGES().

L_COWINPROGRESS part approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-06-20 18:55:58 +00:00
thorpej 3183ea47c2 When initializing the buffer cache memory pools where the size <= PAGE_SIZE,
also use the standard allocator on systems that use a direct-mapped memory
segment for mapping pool pages.
2004-06-20 18:29:47 +00:00
thorpej 3cd310ba0f Remove PR_IMMEDRELEASE, since setting the high water mark will achieve
the same thing.

Pointed out back in January by YAMAMOTO Takashi.
2004-06-20 18:19:27 +00:00
thorpej bbbb3183d6 Don't use PR_IMMEDRELEASE on buffer cache pools. Instead, set a high
water mark of 1, which will have the same effect.

Pointed out back in January by YAMAMOTO Takashi.
2004-06-20 18:17:09 +00:00
fredb c6f9967d69 Introduce a variable "cc" to hold the cpu counter delta, rather than
overloading "usec". The counter isn't counting micro-seconds, and using
the same variable to mean two different things is false economy: with
this change, the compiled object is 72 bytes smaller on i386, and the
code is easier to understand, to boot.
2004-06-19 20:02:38 +00:00
yamt 8a2c13021f cache_lookup: avoid to grab two vnode's v_interlock.
just hold a reference (usecount) to a vnode instead.
2004-06-19 18:49:47 +00:00
fredb e89e654031 Fix a typo in the comments. 2004-06-19 18:12:55 +00:00
yamt 79dd9743cd getcleanvnode: fix spurious ENFILE.
try vnode_hold_list if none of vnodes on vnode_free_list are re-usable.
2004-06-19 06:20:02 +00:00
christos c22e4ed8cd ptm is now mandatory, depends on pty, and can be disabled with -DNO_DEV_PTM 2004-06-18 15:02:29 +00:00
yamt b3384c452e getcleanvnode: don't try to reclaim a vnode marked as VXLOCK.
fix crashes with VOP_RECLAIM implementations which might block.
(eg. layered filesystems)
2004-06-16 12:35:51 +00:00
yamt a0d352ca6d getcleanvnode: add a comment on a VLAYER hack. 2004-06-16 12:32:51 +00:00
jonathan d907e82ddc Fix potential memory leak in sbappendaddrchain():
We do an MGETHDR)() for each mbuf "packet" of the input chain, to hold
the socket address prepended to that "packet".  If those MGETHDR()s
ever failed, we would leak all the successfully-allocated mbuf
headers.  Leak noted by Yamamoto-san (yamt@NetBSD.org); thanks for catching it!

Add socketbuf invariant-checking macros to sbappendaddrchain(), and
replace a stray bcopy() with memcpy(), also as suggested by Yamamoto-san.
2004-06-11 03:46:01 +00:00
he 32381a5299 PAGE_SIZE is apparently not a constant on the sparc port, so don't
use it in a static initializer.  Instead, initialize in signal_init().
2004-06-08 19:35:30 +00:00
lha a9970d44c9 Return directly when pty_alloc_master failes in ptmioctl,
bug-report on current users from Denis Lagno  dlagno at smtp dot ru.
Make debug message in pty_alloc_master to match the code.
2004-06-05 11:23:15 +00:00
skrll b00b102b41 Allow for struct sigacts being greater than PAGE_SIZE on sun2. sun2
-current kernels now work again.

Reviewed by Matt Thomas. Thanks.
2004-06-04 12:23:50 +00:00
nathanw 956448b619 Initialize simple_lock in struct cwd; otherwise, one gets an
uninitialized lock panic at the first use of cwdshare().
2004-06-03 20:35:30 +00:00
pk 69211c6484 cwdfree() signature has been changed to accomodate fine-grained locking. 2004-05-31 15:33:38 +00:00
pk 2560fefc23 Implement mutexes for file descriptor and current working directory access.
Fix a potential race condition when reallocating storage for file descriptors
(even for non-SMP kernels).
Add missing locks for `struct file' ref count updates.
2004-05-31 15:30:55 +00:00
yamt 2fd3d08b3d lockmgr: add a comment about LK_RETRY. 2004-05-31 09:05:10 +00:00
yamt bd2a784b57 vn_lock: add an assertion about usecount. 2004-05-31 09:02:51 +00:00
yamt 59ba83d898 lockmgr: assert that LK_RETRY is not specified. 2004-05-30 20:49:04 +00:00
yamt c2f93eb91f vn_lock: don't pass LK_RETRY to VOP_LOCK. 2004-05-30 20:48:04 +00:00
jonathan d25d3eb263 Rework to make FAST_IPSEC PF_KEY dumps unicast and reliable:
Introduce new socket-layer function sbappendaddrchain() to
sys/kern/uipc_socket2.c: like sbappendaddr(), only takes a chain of
records and appends the entire chain in one pass. sbappendaddrchain()
also takes an `sbprio' argument, which indicates the caller requires
special `reliable' handling of the socket-buffer.  `sbprio' is
described in sys/sys/socketvar.h, although (for now) the different
levels are not yet implemented.

Rework sys/netipsec/key.c PF_KEY DUMP responses to build a chain of
mbuf records, one record per dump response. Unicast the entire chain
to the requestor, with all-or-none semantics.

Changed files;
 	sys/socketvar.h kern/uipc_socket2.c netipsec/key.c
Reviewed by:
	Jason Thorpe, Thor Lancelot Simon, post to tech-kern.

Todo: request pullup to 2.0 branch.  Post-2.0, rework sysctl() API for
dumps to use new record-chain constructors. Actually implement
the distinct service levels in sbappendaddrchain() so we can use them
to make PF_KEY ACQUIRE messages more reliable.
2004-05-27 19:19:00 +00:00
yamt a08da7645d regen. 2004-05-27 12:50:35 +00:00
yamt 9ae9b45731 update to match with the recent reality: getpages doesn't care about
vnode locks.
2004-05-27 12:49:09 +00:00
christos 3d4ca09443 turn off debugging. 2004-05-27 03:56:49 +00:00
christos 917cdbbd9e Unix 98 pty multiplexor device; original code from OpenBSD. 2004-05-27 02:56:38 +00:00
christos 19c4641ff8 (off_t)(long) is wrong when it comes to kernel addresses [because on a 32 bit
machine if the high bit is set they turn negative]. Make an intermediate cast
to unsigned long.
2004-05-26 16:28:05 +00:00
hannken 8c21bc6224 Add ffs internal snapshots. Written by Marshall Kirk McKusick for FreeBSD.
- Not enabled by default. Needs kernel option FFS_SNAPSHOT.
- Change parameters of ffs_blkfree.
- Let the copy-on-write functions return an error so spec_strategy
    may fail if the copy-on-write fails.
- Change genfs_*lock*() to use vp->v_vnlock instead of &vp->v_lock.
- Add flag B_METAONLY to VOP_BALLOC to return indirect block buffer.
- Add a function ffs_checkfreefile needed for snapshot creation.
- Add special handling of snapshot files:
    Snapshots may not be opened for writing and the attributes are read-only.
    Use the mtime as the time this snapshot was taken.
    Deny mtime updates for snapshot files.
- Add function transferlockers to transfer any waiting processes from
  one lock to another.
- Add vfsop VFS_SNAPSHOT to take a snapshot and make it accessible through
  a vnode.
- Add snapshot support to ls, fsck_ffs and dump.

Welcome to 2.0F.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-05-25 14:54:55 +00:00
atatat 53c625655c Sysctl descriptions under vfs subtree 2004-05-25 04:44:43 +00:00
atatat 4de3747b89 Sysctl descriptions under net subtree (net.key not done) 2004-05-25 04:33:59 +00:00
atatat 5b22e79ada Remaining sysctl descriptions under kern subtree 2004-05-25 04:30:32 +00:00
jonathan 230fb9b8ab Eliminate several uses of `curproc' from the socket-layer code and from NFS.
Add a new explicit `struct proc *p' argument to socreate(), sosend().
Use that argument instead of curproc. Follow-on changes to pass that
argument to socreate(), sosend(), and (*so->so_send)() calls.
These changes reviewed and independently recoded  by Matt Thomas.

Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas:
pass soreceive()'s struct uio* uio->uio_procp to unp_externalize().
Eliminate curproc from unp_externalize.   Also, now soreceive() uses
its uio->uio_procp value, pass that same value downward to
((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0.

Similar changes in sys/nfs to eliminate (most) uses of curproc,
either via the req-> r_procp field of a struct nfsreq *req argument,
or by passing down new explicit struct proc * arguments.

Reviewed by: Matt Thomas, posted to tech-kern.
NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.
2004-05-22 22:52:13 +00:00
atatat dcf1a79f46 Add a DIAGNOSTIC check to detect un-initialized pools. 2004-05-20 05:08:29 +00:00
nathanw 78c16ce8ed Adjust code that tries to prevent cc_microtime() from going backwards
so that it doesn't fire when called twice in the same microsecond,
which can lead to large error accumulation.

Appears to fix "repeated gettimeofday() goes backwards" on a fast
alpha and i386 box.
2004-05-18 16:09:07 +00:00
yamt efc80878d1 use lockstatus() instead of L_BIGLOCK to check if we're holding a biglock.
fix PR/25595.
2004-05-18 11:59:11 +00:00
yamt b4831906b2 introduce LK_EXCLOTHER for lockstatus().
from FreeBSD, but a little differently.  instead of letting lockstatus()
take an additional thread argument, always use curlwp/curcpu.
2004-05-18 11:55:59 +00:00
ragge ac1e5c0888 Fix connect() "bug": If connect() is interrupted by a signal, the connection
attempt is terminated,  so if a process needs frequent timer interrupts
it can't ever connect() to a machine far away.

Bug found by Erik Lundgren, bugfix (for the same problem) is similar to
the way FreeBSD solved the same problem.

As a side effect, the new connect() behaviour conformes to Posix.
2004-05-18 11:31:49 +00:00
christos d3f7c2a23c Check for bad offsets at the beginning of the functions to save processing.
Idea from OpenBSD.
2004-05-14 16:36:33 +00:00
kleink 71b3883248 KNF previous. 2004-05-13 17:56:14 +00:00
christos 6033f15f86 Disable chgsbsize. It is not MPSAFE 2004-05-13 17:43:11 +00:00
matt 617ba1df60 In proc_representative_lwp, if there is an outstanding trap signal, return
the lwp that had the trap.
2004-05-12 21:10:09 +00:00
yamt 054ed3afcb use callout_schedule() for schedcpu(). 2004-05-12 20:13:58 +00:00
cube 8a0e3b4be1 In sysctl_destroyv, the newly created dnode structure must have its
version set to the correct value to prevent later failure of
sysctl_cvt_in.
2004-05-12 12:21:39 +00:00
kleink 90c0c343b0 Regen from syscalls.master rev. 1.142:
POSIX-2001: Change readlink(2)'s return type from int to ssize_t.
2004-05-10 22:30:41 +00:00
kleink 43b7ae77fa POSIX-2001: Change readlink(2)'s return type from int to ssize_t. 2004-05-10 22:28:23 +00:00
yamt 68b4772ef6 redo the previous (rev.1.58; overwrite a duplicate entry rather than leave it)
differently so that entries entered during we're doing pool_get() are
checked as well.  pointed by Paul Kranenburg on source-changes@.
2004-05-07 12:05:41 +00:00
pk fba1aa540d Provide a mutex for the process limits data structure. 2004-05-06 22:20:30 +00:00
yamt 8d615f3e18 cache_enter: when we found a duplicate entry,
simply overwrite it rather than leaving a stale entry.
2004-05-06 22:02:02 +00:00
yamt f573d83f7a no need to cache_purge() in getnewvnode().
it should be already done by vclean().
2004-05-06 22:01:14 +00:00
atatat 778eadaf46 Add a printf() to the other case in sysctl_createv() where a node did
not get attached for what should be an extremely unusual case.
2004-05-06 07:06:46 +00:00
pk b2260877bf proc_reparent() must be called with proclist write lock held. Make it so. 2004-05-04 21:58:47 +00:00
pk 2fb3dac280 Since a `vmspace' always includes a `vm_map' we can re-use vm_map's
reference count lock to also protect the vmspace's reference count.
2004-05-04 21:33:40 +00:00
pk 3ec3f724be crcopy: no need to lock if we're only reading the structure's reference count. 2004-05-04 21:27:28 +00:00
pk f3f1104ed8 Change sigactsfree() to take a `struct sigacts' pointer, to fit the needs
of exit1 (its only client).
2004-05-04 21:25:47 +00:00
pk d190ac352d exit1: if !BIGLOCK, once the exiting process has been placed on the zombie
list and the proclist lock is released, we shouldn't touch the process
structure anymore, since it may be collected immediately by a waiting
parent.
2004-05-04 21:23:39 +00:00
martin efe61cce0d Fix a comment.
Approved by Andrew Brown.
2004-05-03 13:39:50 +00:00
pk 7d0afa7f41 Add mutex to protect the ucred reference counter. 2004-05-02 12:36:55 +00:00
pk 2834786715 Add a mutex for mount point I/O and wait counters (i.e. the `mnt_wcnt',
`mnt_writeopcountupper' and `mnt_writeopcountlower' members).
2004-05-02 12:21:02 +00:00
pk 5c36071518 cache_enter: concurrent lookups in the same directory may race for a
cache entry. Upon detection, free our tentative entry and return.
2004-05-02 12:00:34 +00:00
pk 1bc2407362 sys_access: use crdup(). 2004-05-02 11:13:29 +00:00
matt d1fcd75db0 Define link_sets start/stop as ptype * const [] since they are in a
readonly section.
2004-05-01 07:16:55 +00:00
matt a029630354 Commons are not allowed in header files. extern them and declare them in
the appropriate .c file.
2004-05-01 06:17:26 +00:00
matt a035030007 Use EVCNT_ATTACH_STATIC 2004-05-01 02:24:38 +00:00
enami a874187808 ANSI'fy the rest of functions. 2004-04-30 07:51:59 +00:00
simonb 01837603b0 Fix "comments within comments" problem pointed out by Geoff Wing on
source-changes.
2004-04-27 05:25:33 +00:00
kleink 3925dc263a Regen from syscalls.master 1.141: [gs]ettimeofday(2) argument declaration
change.
2004-04-27 01:15:38 +00:00
kleink 681b62c2ce POSIX-2001: Add restrict keywords to gettimeofday(2) and setitimer(2);
further deprecate struct timezone usage by changing `tzp' argument to
gettimeofday() to void *; align utimes(2) declaration by changing `times`
argument from struct timeval * to struct timeval[2].  From Murray
Armfield in PR standards/25331.

In due curse, reflect these changes in futimes(2), lutimes(2), and
settimeofday(2).
2004-04-27 01:12:44 +00:00
kleink 679cb3e5a5 Regen from rev. 1.140:
POSIX-2001: Change the `who' argument to [gs]etpriority(2) from int
to id_t.  Partially addressing PR standards/25216 from Murray Armfield.
2004-04-25 22:21:17 +00:00
kleink 3e7f30c118 POSIX-2001: Change the `who' argument to [gs]etpriority(2) from int
to id_t.  Partially addressing PR standards/25216 from Murray Armfield.
2004-04-25 22:18:08 +00:00
simonb b5d0e6bf06 Initialise (most) pools from a link set instead of explicit calls
to pool_init.  Untouched pools are ones that either in arch-specific
code, or aren't initialiased during initial system startup.

 Convert struct session, ucred and lockf to pools.
2004-04-25 16:42:40 +00:00
yamt ab195ed32f bio_doread: vp is always non-NULL here. 2004-04-25 12:41:12 +00:00
matt f86644a808 Constify the table argument to ttspeedtab. 2004-04-25 06:13:38 +00:00
atatat 3f800573aa Be consistent about using sysc_init_field() 2004-04-25 05:54:38 +00:00
atatat 990f278f7a Remove dynamic sysctl node version 0 from the tree. It seemed okay at
first, but quickly showed its shortcomings.  The version 1 node we're
now using should be good for a while.
2004-04-25 05:47:52 +00:00
simonb 9bc855a931 s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
2004-04-23 02:58:27 +00:00
yamt 05076bfbb9 chgsbsize: correct limit check and ui_sbsize calculation.
ok'ed by Christos Zoulas.
2004-04-23 02:13:29 +00:00
enami 45a4841ce9 Copy fsidx so that not to break binary compatibility of mountd etc. 2004-04-22 03:47:58 +00:00
matt e50668c7fa Constify protosw arrays. This can reduce the kernel .data section by
over 4K (if all the network protocols) are loaded.
2004-04-22 01:01:40 +00:00
matt fde909e1a1 Add prototype for uiomove_frombuf. Change uiomove_frombuf to use size_t
for its length argument (to be the same as uiomove).  Remove code that
dealt with length being negative.
2004-04-21 20:31:50 +00:00
itojun d2f1c029b9 kill sprintf, use snprintf 2004-04-21 18:40:37 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
christos ed95f3e980 Charge root for socket buffers without a socket pointer. 2004-04-19 03:44:46 +00:00
lukem fad77af2ac Add "vfs.generic.fstypes" sysctl, which contains a space separate
list of file system types currently supported by the kernel.
Previously there wasn't an easy way to determine this.
(Code shamelessly cribbed from subr_disk.c::sysctl_hw_disknames().)

Use LIST_FOREACH() appropriately.
2004-04-19 00:15:55 +00:00
matt ac57eb9d5b Constify sun_noname. 2004-04-18 22:20:32 +00:00
matt 70e1f0d3ac ANSI'fy. 2004-04-18 21:48:15 +00:00
matt 91bb3497f5 Constify the addr parameter to sbappenaddr. 2004-04-18 21:47:11 +00:00
matt 8f23e3baa1 sbreserve can be called with a NULL socket, deal with it. 2004-04-18 16:38:42 +00:00
christos f13a3d0852 PR/9347: Eric E. Fair: socket buffer pool exhaustion leads to system deadlock
and unkillable processes.
1. Introduce new SBSIZE resource limit from FreeBSD to limit socket buffer
   size resource.
2. make sokvareserve interruptible, so processes ltsleeping on it can be
   killed.
2004-04-17 15:15:29 +00:00
atatat 904ca21614 Prefer that kern.hostid is printed in hex, not as a signed decimal,
and avoid accidental sign-extension when setting it.
2004-04-16 13:25:40 +00:00
pk f663e2397e checkalias: pass LK_NOWAIT to vget() while holding the spechash spinlock. 2004-04-16 09:59:32 +00:00
provos 2e7c8ca97f check process flags, noted by Stefan Esser 2004-04-09 16:49:33 +00:00
atatat 3a5915c0ae Lots of sysctl descriptions (if someone wants to help out here, that
would be good) mostly copied from sysctl(3).  This takes care of the
top-level, most of kern.* and hw.* (modulo the ath and bge stuff), and
all of proc.*.

If you don't want the added rodata in your kernel, use "options
SYSCTL_NO_DESCR" in your kernel config.
2004-04-08 06:20:29 +00:00
atatat a70c39ff35 Clear out the struct kinfo_drivers before stuffing things into it.
Avoids leaking garbage from the stack (left over from the earlier
call to sysctl_locate()).
2004-04-08 03:35:10 +00:00
atatat 275e2ae7f3 First caller to set a description on a node sets it. This allows one
setup function to set the description, even if the node has been
instantiated elsewhere.  Or not, depending on the other that the setup
functions are called.
2004-04-06 18:52:35 +00:00
yamt 4972de4cca make cache_purge more controlable.
namely, allow following operations.
	- purge only an entry specified by a component name.
	- purge only child entries.
	- purge only parent entries.
no objections on tech-kern@.
2004-04-05 10:20:52 +00:00
yamt 9aa8d354bd add assertions related to file descriptor allocation. 2004-04-05 10:10:29 +00:00
pk b3efee4b3b We use maxdmap and maxsmap, so remove comment questioning that. 2004-04-04 18:22:44 +00:00
matt 4dfb2be423 When a process is being traced (debugged) and a catchable signal arrives,
make sure to save its ksiginfo_t for eventual delivery.  This makes debugging
SA_SIGINFO signal handlers work.
2004-04-03 19:46:10 +00:00
matt dfe066e777 Add the notion of an "empty" ksiginfo_t (one where on signo is filled in).
Add an initializer for them: KSI_INIT_EMPTY
Add a predicate for them: KSI_EMPTY_P
Don't bother storing empty ksiginfo_t's since they have no information.
Change uses of KSI_INIT to KSI_INIT_EMPTY where no other information other
than the signo is being filled in.
2004-04-03 19:43:08 +00:00
matt 11d24b6c29 Replace memset's of ksiginfo_t with KSI_INIT (which is the proper way to
initialize ksiginfo_t structures).
2004-04-03 19:38:04 +00:00
matt 44708bbf1a If a signal is the result of trap, only invoke a supplied handler if it's
not blocked.  Otherwise (it if it blocked or the hanlder is set to SIG_IGN)
reset the signal back to its default settings so that a coredump can be
generated.
2004-04-01 16:56:44 +00:00
atatat f06d00c1a8 Add the standard "is this tree writeable" check to sysctl_describe()
and a comment to sysctl_destroy() about why the check is slightly
different there.
2004-04-01 04:50:06 +00:00
yamt f74afe6463 ras_fork: don't do PR_WAITOK holding a spinlock. 2004-04-01 02:37:42 +00:00
yamt b27349c286 ras_install: don't do pool_get(PR_WAITOK) while we're holding a spinlock. 2004-04-01 01:49:04 +00:00
matt b173c9d332 Make kernel continuations optional for now. 2004-03-28 22:43:56 +00:00
atatat d97889de23 Fix sysctl_createv() so that rnode and cnode can refer to the same
pointer.  Fix sysctl_create() so that nodes cannot be added to an
alias node.
2004-03-27 04:26:23 +00:00
petrov 2edf945c23 sys_sa_yield returns EJUSTRETURN. 2004-03-27 00:49:47 +00:00
jonathan 63fe9ef057 Use proper NetBSD conventions for deferred kthread creation, not the
other semantics from an earlier incarnation.

Call kcont_init() from init_main before device autoconfiguration,
so kcont is availble to device drivers if required.

Also ensure the kthread process runs any pending continuations once
the kthread is finally up and running. For now, use a non-null timeout
to poll the queue periodically.  Draining any pending requests just
before the kthread enters its ltsleep()/kc_run loop is cleaner, but
this is the version I tested with an early-in-boot kcont request.)
2004-03-27 00:42:38 +00:00
drochner 945c30f4ab all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 17:13:37 +00:00
drochner 4f4ec7e627 regen after __HAVE_SIGINFO removal 2004-03-26 15:29:28 +00:00
drochner 9fd8e8983b all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 15:18:54 +00:00
simonb 1c13fd358f Give buf_lotsfree() a bit of a service:
- Fix a 32-bit overflow that could erroneously return true even if the
  currently allocated buffer memory was greater than the high water mark.
- Add an early check for bufmem > hiwater to avoid a needless call to
  random().
- Sprinkle some comments.

Add a vm.bufmem sysctl so the current bufmem value can be easily queried
from userland.

Reviewed by Thor Simon.
2004-03-26 00:31:55 +00:00
simonb 07056cd3d1 More white space nits. 2004-03-25 23:17:16 +00:00
enami c4a655ef80 Misc. style fix; white-space usage, comment style, ansify, multiple
include protection, rcsid, typo, ...
2004-03-25 23:02:58 +00:00
atatat 76f167c40b Set version in node destroy request 2004-03-25 22:16:04 +00:00
pooka 845a217e15 Convert pool_get()'s from nowait to waitok. We're allowed to block,
and this is more acceptable since the code assumes success.

gmcgarry ok
2004-03-25 22:08:33 +00:00
atatat 44afe14cb6 Unwind the nested designators for fields within structs within structs
(or unions).  This should really be put back once we're all using gcc3
for everything, since that makes it look a *lot* cleaner.
2004-03-25 18:36:49 +00:00
drochner bcb7a96b95 In exec_sigcode_map(), do nothing if the sigcode is of
size 0.
This way, individual ports can circumvent sigcode mapping
by setting sigcode/esigcode.
(would be better to clean up the __HAVE_SIGINFO/COMPAT_XX
stuff, but it is not a good moment now)
2004-03-25 18:29:24 +00:00
simonb c67d420cbf White-space nit. 2004-03-25 08:22:31 +00:00
pooka 8a7ed44002 * replace incorrect M_WAITOK flag from pool_get() by proper PR_WAITOK
and remove redundant check for NULL return value
* switch pool page allocator to nointr allocator

jdolecek sayeth ok
2004-03-24 20:25:28 +00:00
atatat 38c4183b04 Implement sysctl descriptions. Now all that remains is actually to
write them.
2004-03-24 18:11:09 +00:00
atatat 5aab77f087 Framework for sysctl descriptions. Implementation to follow shortly. 2004-03-24 17:40:02 +00:00
atatat c6abd47f96 New node version and layout. This should take care of the netbsd32
emulation problem, formalizes the versioning (should it ever be needed
again), and provides a slot for descriptions.
2004-03-24 17:21:02 +00:00
atatat 289b641ef9 Implement sysctllog and sysctl_teardown(), which unwinds the log. 2004-03-24 16:55:49 +00:00
atatat d42aae36c0 The new sysctl query interface returns the same information as the old
one, but you must pass in an empty node that indicates the version
you're using.
2004-03-24 16:34:34 +00:00
atatat 19af35fd0d Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
2004-03-24 15:34:46 +00:00
atatat 70057f1d4e That copystr() should be copyinstr(), and fix a couple of places where
aliasing needs to be avoided.
2004-03-24 15:25:43 +00:00
pooka cca4b8c09d tyop in comment 2004-03-24 10:01:46 +00:00
matt 3549b49655 Don't use malloc/free for fixed sized items, use a pool instead. 2004-03-24 01:27:57 +00:00
junyoung fdc32973e7 - Nuke __P().
- Drop trailing spaces.
2004-03-23 13:22:32 +00:00
junyoung a222c81884 Nuke __P(). 2004-03-23 13:22:03 +00:00
cl d636a8b9cb On MP, exit postsig() when another LWP has already handled the signal while
this LWP was waiting for the kernel lock.

Fixes PR kern/24829
2004-03-21 18:41:38 +00:00