Commit Graph

1880 Commits

Author SHA1 Message Date
eeh 69d1f9d0d3 COMPAT_SPARC32 -> COMPAT_NETBSD32 1999-03-26 04:29:20 +00:00
thorpej c647f127c1 Assign initproc in main(), not start_init(). It's conventient to do so. 1999-03-26 01:10:50 +00:00
sommerfe ef07055d58 Disallow tracing of processes unless tracer's root directory is at or
above tracee's root directory.
1999-03-25 04:45:56 +00:00
nathanw e8b935d003 Garbage collect a non-useful variable in getcwd_scandir(). 1999-03-25 02:32:18 +00:00
sommerfe f1a508e354 Prevent deadlock cited in PR4629 from crashing the system. (copyout
and system call now just return EFAULT).  A complete fix will
presumably have to wait for UBC and/or for vnode locking protocols to
be revamped to allow use of shared locks.
1999-03-25 00:20:35 +00:00
mrg d2397ac5f7 completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
1999-03-24 05:50:49 +00:00
lukem 8a931fcdd8 Ensure that you can only bind a more specific address when it is done by the
same uid or by root.

This code is from FreeBSD. (Whilst it was originally obtained from OpenBSD,
FreeBSD fixed it to work with multicast. To quote the commit message:
    - Don't bother checking for conflicting sockets if we're binding to a
      multicast address.
    - Don't return an error if we're binding to INADDR_ANY, the conflicting
      socket is bound to INADDR_ANY, and the conflicting socket has
      SO_REUSEPORT set.
)
1999-03-23 10:45:37 +00:00
thorpej 845b609f97 Set the high water mark on the mbuf cluster pool to NMBCLUSTERS. 1999-03-23 02:51:27 +00:00
thorpej 9614a68c70 Fix the order of arguments to roundup(). 1999-03-23 02:49:03 +00:00
thorpej f2a91c9b91 Put back the code to log `mb_map full' that was lost when mbuf clusters
were converted to use the pool allocator.
1999-03-22 22:06:58 +00:00
sommerfe 098b6f8e8a Disallow descriptor-passing of descriptors which are open on
directories which aren't under the recipient's root.

Clean up of many error conditions involving descriptor passing, to
eliminate infinite loops, panics, premature garbage collection of
sockets, and descriptor leaks:
 - Avoid letting unp_gc() see descriptors with a refcount of zero by
removing them from the socket's queue before releasing them.
 - Avoid socket leak in PRU_ABORT (this will also gc descriptors queued
on a not-yet accepted socket when the accepting socket goes away).
 - Put in block comment explaining how unp_gc() should work.
 - Correctly manage unp_defer count so we don't get stuck in an infinite
loop with nothing to do.
 - Don't tie MARK and DEFER bits so closely together.
 - Mark descriptors queued on not-yet-accepted sockets as well.
 - Don't call sorflush on non-socket, it doesn't work very well.
 - Deal with discard of NULL file pointer.
 - Hopefully cause GC to converge faster by only deferring sockets in
unp_mark().
1999-03-22 17:54:38 +00:00
sommerfe 2f0f84b8e8 bug fix to fdavail: be consistent about taking per-process descriptor
limit into account when checking against the limit; fdp->fd_nfiles may
be greater than the current descriptor limit, and there may be space
in fdp->fd_ofiles beyond the limit.  If we say it's available,
unp_externalize will get confused and panic when fdalloc fails.
1999-03-22 17:39:44 +00:00
sommerfe 36dc99adac vinvalbuf, called from vclean, could cause a locking-against-self
deadlock in VOP_FSYNC() if the unreferenced vnode picked for
reclamation happened to be stacked on top of a vnode the process
already had locked.  This could happen if the same filesystem was
accessed both through a union mount and directly; it seemed to happen
most frequently when the direct access was through NFS.

Avoid this deadlock by changing vinvalbuf to pass a new FSYNC_RECLAIM
flag bit to VOP_FSYNC() to indicate that a reclaim is in progress and
only a `shallow' fsync is necessary.

Do nothing in *_fsync() in umapfs, nullfs, and unionfs when
FSYNC_RECLAIM is set; the underlying vnodes will shortly be released
in *_reclaim and may be reclaimed (and fsync'ed) later.
1999-03-22 17:24:19 +00:00
sommerfe 6d0f67d6aa Regen files based on changes to syscalls.master, vnode_if.src (latter
was changes to comments only, but..)
Build vfs_getcwd.c as standard part of kernel.
Add implementation of fchroot(), since two emulations already had it.
Call vn_isunder() in fchdir(), chroot(), and fchroot() to make it harder
to escape chroot().
1999-03-22 17:13:34 +00:00
sommerfe 095cd96cd5 Change namei cache to record vnode->(parent,name) entries (for directories).
Add kernel implementation of getcwd() which uses this cache, falling
back to reading the filesystem on a cache miss.
Along for the ride: add new VOP_FSYNC flag FSYNC_RECLAIM indicating
that a reclaim is being done, so only a "shallow" fsync is needed.
1999-03-22 17:01:55 +00:00
sommerfe 75fb6d661f Include some comments with more details on the VOP_LOOKUP locking protocol 1999-03-22 16:57:37 +00:00
bouyer 87662a89a2 Hinherit MNT_NOEXEC from the mount point. Without this a user can exec
arbitrary binaries by doing a user mount, even if the admin has carefully
setup his system to avoid arbitrary binaries execution.
1999-03-17 15:35:03 +00:00
kleink 51be278873 Defopt COMPAT_M68K4K. 1999-03-09 21:02:38 +00:00
mycroft f3df26f6f3 This is sort of gratuitous, but...
Strip the leading path off of init's argv[0].
1999-03-05 07:26:21 +00:00
fvdl 31289a4af8 Fill in vnodecovered in the mount structure before calling VFS_MOUNT anyway,
some things (e.g. unionfs) may depend on it. It's currently ok
for vnodecovered to be set already; it's not for v_mountedhere in
the vnode, though.

From John Darrow.

XXX should probably just extend VFS_MOUNT to take the vnode pointer as
an argument.
1999-03-02 07:47:49 +00:00
ross e47e3c9f45 schedclk() -> schedclock(), for consistency with hardclock(), statclock(), ...
update comments for recent scheduler mods
1999-02-28 18:14:57 +00:00
fvdl c0fb2ab4f2 Use a SETRECURSE lock before calling VFS_MOUNT in the mount() system call,
since the lock may be taken again. This was the intention of the CANRECURSE
lock already there, but didn't work.

Only fill in the vnode<->mountpoint links (mountedhere and vnodecovered)
after VFS_MOUNT returned succesfully. It might happen that something called
from VFS_MOUNT mistook the vnode for an already successfully mounted on
one because of this.
1999-02-28 14:12:54 +00:00
fvdl 080ad305ff Recursive locks were previously only available with LK_CANRECURSE. This
could be done in one of 2 ways:

	* call lk_init with LK_CANRECURSE, resulting in a lock that
 	  always can be used recursively.
	* call lockmgr with LK_CANRECURSE, meaning that it's ok if this
	  lock is already held by us.

Sometimes we need a locking type that says: take this lock now, exclusively,
but while I am holding it, I may go through a code path which could attempt
to get the lock again, and which is unaware that the lock might already
be taken.  Implement LK_SETRECURSE for this purpose. Assume that locks and
unlocks come in matching pairs (they should), and check for this 'level'
using SETRECURSE locks.
1999-02-28 14:09:15 +00:00
wrstuden 0078fc50dc Modify VOP_CLOSE vnode op to always take a locked vnode. Change vn_close
to pass down a locked node. Modify union_copyup() to call VOP_CLOSE
locked nodes.

Also fix a bug in union_copyup() where a lock on the lower vnode would
only be released if VOP_OPEN didn't fail.
1999-02-26 23:38:55 +00:00
christos 88162a0fe9 Make this compile without EXEC_AOUT and with COMPAT_FREEBSD 1999-02-23 18:19:29 +00:00
mycroft d4955ba8a9 While I'm on a fixed point kick, improve the NTP clock factor correction to
give <.1% error in all (supported) cases.  It doesn't cost us much.
1999-02-23 17:41:48 +00:00
ross 6803dbddbb Replace the recent scheduler mods with calls to scheduler_{fork,wait}_hook(),
(inlined) so scheduler functionality can be kept in a single .h/.c set.
Also, the wait hook has changed the way it clips the scheduler history.
1999-02-23 02:57:18 +00:00
ross b4a33c4e60 Scheduler bug fixes and reorganization
* fix the ancient nice(1) bug, where nice +20 processes incorrectly
  steal 10 - 20% of the CPU, (or even more depending on load average)
* provide a new schedclk() mechanism at a new clock at schedhz, so high
  platform hz values don't cause nice +0 processes to look like they are
  niced
* change the algorithm slightly, and reorganize the code a lot
* fix percent-CPU calculation bugs, and eliminate some no-op code

=== nice bug === Correctly divide the scheduler queues between niced and
compute-bound processes. The current nice weight of two (sort of, see
`algorithm change' below) neatly divides the USRPRI queues in half; this
should have been used to clip p_estcpu, instead of UCHAR_MAX.  Besides
being the wrong amount, clipping an unsigned char to UCHAR_MAX is a no-op,
and it was done after decay_cpu() which can only _reduce_ the value.  It
has to be kept <= NICE_WEIGHT * PRIO_MAX - PPQ or processes can
scheduler-penalize themselves onto the same queue as nice +20 processes.
(Or even a higher one.)

=== New schedclk() mechansism === Some platforms should be cutting down
stathz before hitting the scheduler, since the scheduler algorithm only
works right in the vicinity of 64 Hz. Rather than prescale hz, then scale
back and forth by 4 every time p_estcpu is touched (each occurance an
abstraction violation), use p_estcpu without scaling and require schedhz
to be generated directly at the right frequency. Use a default stathz (well,
actually, profhz) / 4, so nothing changes unless a platform defines schedhz
and a new clock.  Define these for alpha, where hz==1024, and nice was
totally broke.

=== Algorithm change === The nice value used to be added to the
exponentially-decayed scheduler history value p_estcpu, in _addition_ to
be incorporated directly (with greater wieght) into the priority calculation.
At first glance, it appears to be a pointless increase of 1/8 the nice
effect (pri = p_estcpu/4 + nice*2), but it's actually at least 3x that
because it will ramp up linearly but be decayed only exponentially, thus
converging to an additional .75 nice for a loadaverage of one. I killed
this, it makes the behavior hard to control, almost impossible to analyze,
and the effect (~~nothing at for the first second, then somewhat increased
niceness after three seconds or more, depending on load average) pointless.

=== Other bugs === hz -> profhz in the p_pctcpu = f(p_cpticks) calcuation.
Collect scheduler functionality. Try to put each abstraction in just one
place.
1999-02-23 02:56:03 +00:00
drochner 220b8d9add PR kern/7033 (Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>): use
device minor to unit/partition macros from sys/disklabel.h
1999-02-22 16:00:01 +00:00
cjs d390501801 Safer use of printf. 1999-02-22 00:12:36 +00:00
mycroft bb815bda9e Fix a thinko in the previous.
Also:
* Do the boundary check when creating a new region as well.
* If we crossed the boundary, don't just throw away the region; lop off the
  beginning and see if we still fit.
SB16 is now fully functional on the Alpha.
1999-02-18 18:52:29 +00:00
mycroft ca00239fe9 Speed up the calculation of dontcross; use EXTENT_ALIGN to calculate it
directly rather than using a loop.  Also adjust so that we can allocate at
the end of the integer range.
1999-02-18 18:13:50 +00:00
christos 1aede0624c Now that shell has been fixed so that ". filename" does not look at . if .
is not in the path add ./ to the files.
1999-02-17 18:17:10 +00:00
christos ac66b8f92d Don't forget to lower the spl in the error case of sigprocmask 1999-02-13 15:25:51 +00:00
veego 8b48b6c4af Protect the COMM variable with an '.ifmake tags' to stop the long delay
while doing a make in src/sys/arch/* on slow machines.
1999-02-12 19:52:30 +00:00
cjs 1caabb110e Don't hardware /sys, use $SYSDIR if it exists. This should still be looked
at, though; should we be using relative paths instead?
1999-02-12 04:58:18 +00:00
thorpej 94962b67c7 Fix some printf format problems on Alpha. 1999-02-12 00:46:11 +00:00
christos be58edf2b6 Add compat_aout bit. 1999-02-11 09:35:21 +00:00
christos 7f718b612a Print the line that caused the error message. Unfortunately the line
numbers reported by awk are not useful, because the \$ preprocessing
by sed...
1999-02-11 09:32:01 +00:00
kleink 5dfcd3c125 Regen: socklen_t changes. 1999-02-10 18:05:24 +00:00
explorer c3167035de no need to set tailp twice. 1999-02-10 18:03:05 +00:00
kleink dfffb2f357 * Due to addition and use of socklen_t, make the socket option and address
arguments passed to accept(), bind(), connect(), getpeername(), getsockname(),
getsockopt(), recvfrom(), sendto() and sendmsg() unsigned, which also elimiates
a few casts.
* Reflect the (now) signedness of msg_iovlen, which necessiates the addition
of a few casts.
1999-02-10 18:02:28 +00:00
kleink f69591d12d Use of casts as lvalues is a GNU C extension; rearrange slightly. 1999-02-10 17:03:26 +00:00
christos fe1f028894 PR/6962: Paul Shupak: FreeBSD elf support. 1999-02-09 20:35:04 +00:00
wrstuden d0ab43c887 Oops. Need to have VOP_LOCK before calling uvm_vnp_terminate, not after
(comments and code inspection in uvm_vnp_terminate agree on this).
1999-02-09 01:57:05 +00:00
jonathan c9d036d796 defopt MEMORY_DISK_{HOOKS,SERVER,IS_ROOT}. 1999-02-07 09:34:58 +00:00
explorer 47bc7c51b7 rewrite usage of tailp slightly, to convince gcc that it really isn't used
initialized.
1999-02-06 11:57:35 +00:00
msaitoh de35d7228d fix compiler warning 1999-02-03 01:16:20 +00:00
msaitoh a01e3cd255 Implement [v]snprintf() 1999-01-28 00:05:49 +00:00
drochner 846db6691a make console_debugger() a macro - no need to waste a stackframe 1999-01-26 17:05:41 +00:00
kleink 88cb9dd89c Adapt the System V behaviour of a child process inheriting its parent's
ucontext link but still reset it on exec().
1999-01-25 16:00:06 +00:00
sommerfe 31a1ef68c7 Tweak to earlier fix to p_estcpu:
- no longer conditionalized
	- when traced, charge time to real parent, not debugger
	- make it clear for future rototillers that p_estcpu should be moved
	  to the "copy" region of struct proc.
1999-01-23 22:23:19 +00:00
sommerfe 068dd91745 Under control of "slowchild" global, make child process inherit the
scheduling penalty for being cpu-bound (p_estcpu) of its parent.
1999-01-23 17:02:35 +00:00
ross d8d8301934 Fix the recently infamous "sucky performance" problem by charging wait(2)'ing
parents for children's p_estcpu. I think this problem has always been there.
It's particularly noticable with X because the server builds up non-trivial
CPU, and hence, non-trivial p_estcpu scheduler penalty. The repeatedly
forked children were always starting from scratch and receiving a scheduler
preference.
1999-01-23 08:25:36 +00:00
kleink fe2f7c1f64 Indentation nit. 1999-01-22 20:51:04 +00:00
chs 3bd133da7d no need to do locking in extext_destroy(). 1999-01-22 07:57:59 +00:00
chs 5819a5d0f4 fix an off-by-one space-waster in hashinit() and add some description. 1999-01-22 07:57:13 +00:00
chs 254ae63e2c avoid math on void *. 1999-01-22 07:55:49 +00:00
chs 33c042b6a2 print a little more info in simple_lock_freecheck(). 1999-01-22 07:55:17 +00:00
mycroft 808496666c Do remove sockets on so_q0, since select(2) and accept(2) do not (currently?)
return them.
1999-01-21 22:09:10 +00:00
christos 198f0a3f56 Fix initialization of resource limits for number of files and number
of processes:
- Don't initialize rlim_max to RLIM_INFINITY. The limits for those should
  be maxfiles and maxproc respectively. Programs expect getrlimit to
  return reasonable values, so that they can allocate structures (for
  example jdk does this).
- Don't initialize rlim_cur to NOFILE and MAXUPRC respectively, but to
  min(NOFILE, maxfiles) and min(MAXUPRC, maxproc) respectively.
1999-01-21 14:50:41 +00:00
mycroft 0fb75f560a Oops; previous was slightly broken. 1999-01-20 20:24:12 +00:00
mycroft 430ecf369d Do not remove sockets from the accept(2) queue on close. 1999-01-20 09:15:41 +00:00
chuck 4ef779d5e5 MNN is no longer optional 1999-01-16 21:06:44 +00:00
sommerfe 324ea43975 Fix format mismatch which only turns up when building with DEBUG 1999-01-15 22:02:59 +00:00
thorpej 54cabada51 Garbage-collect some straggling netimp stuff. 1999-01-14 01:14:01 +00:00
sommerfe 114c430bbb Allow lkm's to include symbols for use by DDB. 1999-01-13 23:06:28 +00:00
thorpej e598335d1c Garbage-collect `mbutl'. 1999-01-09 22:10:12 +00:00
thorpej 99d93cb85e Garbage-collect `union mcluster' and `mclfree'. 1999-01-09 21:54:07 +00:00
lukem 0e36738ca6 add copyright 1999 1999-01-06 13:51:09 +00:00
christos 6434d50bd2 Fix 3 problems with the new signature code:
- don't set position to 0, set it to NO_ADDR (cgd)
- no need to malloc size + 1 bytes (cgd)
- fix calculation of minimum note size section.
1999-01-06 11:52:53 +00:00
erh 2f64a3eccc Protect the syscallargs header file with a define. 1999-01-03 04:25:26 +00:00
thorpej e1315a2447 Make this compile with POOL_DIAGNOSTIC, and add a POOL_LOGSIZE option.
Defopt these.
1998-12-27 21:13:43 +00:00
christos 27e4ef39db Add support for parsing OS type note fields. 1998-12-23 15:08:37 +00:00
kleink 7d144777a3 #ifdef __STDC__ -> #if __STDC__ 1998-12-22 21:21:36 +00:00
thorpej 943f7cd0e7 In unp_internalize(), add a comment explaining why we must ALIGN() the
data after the cmsghdr when accessing internalized SCM_RIGHTS messages
(i.e. array of struct file *s).  The historic interface does not align
the externalized SCM_RIGHTS messages (i.e. array of ints).
1998-12-21 23:12:19 +00:00
thorpej 992f3b8ea7 Fix a fencepost error in unp_scan() which caused a bad pointer deref on
the SPARC platform only (ILP32 but ALIGNBYTES of 7), due to a missing
ALIGN().
1998-12-21 23:03:02 +00:00
thorpej 489d6d0e46 Reverse the stopgap change made in revision 1.29:
date: 1998/08/01 01:47:24;  author: thorpej;  state: Exp;  lines: +18 -8
Don't call the protocol drain routines if how == M_NOWAIT, which typically
means we're in interrupt context.  Since we can be called from a network
hardware interrupt, we could corrupt the protocol queues we try to drain
them at that time.

The problem has been addressed by letting the drain'able protocols use
a locking scheme to prevent queue corruption.
1998-12-18 21:40:14 +00:00
drochner 8ece294afc COMPAT_xxx option review: add missing opt_compat_linux.h
alpha -> __alpha__
1998-12-18 14:10:06 +00:00
drochner c22ef79250 solve the COMPAT_OLDSOCK/MSG_COMPAT problem differently:
The source files which need MSG_COMPAT define COMPAT_OLDSOCK.
1998-12-18 13:18:42 +00:00
briggs 4a01b776e5 Prototype pool_print() and pool_chk() if DEBUG.
Initialize pool hash table with PR_HASHTABSIZE (i.e., 8) LIST_INIT()s
instead of one memset().
Only check for page != ph->ph_page if PR_PHINPAGE is set (in pool_chk()).
Print pool base pointer when reporting page inconsistency in pool_chk().
1998-12-16 04:28:23 +00:00
thorpej 2ef3bcfbb8 In the sosend() loop, if the residual count is > 0 before calling PRU_SEND,
set SS_MORETOCOME as a hint to the lower layer that more data is coming
on the next iteration of the loop.  Clear the flag after the PRU_SEND
call.

Suggested by Justin Walker <justin@apple.com> on the freebsd-net
mailing list.
1998-12-16 00:26:10 +00:00
christos 32b0dc0fbd Regen 1998-12-10 16:44:16 +00:00
christos bee9dafdf5 defopt COMPAT_43 1998-12-10 15:07:01 +00:00
pk 1673c21984 Enable `device_register()' for the sparc. 1998-12-03 23:50:11 +00:00
thorpej d90b3d3438 Add dump_kmemstats(), callable from DDB to show kmem statistics. From
Chuck Silvers via Chuck Cranor.
1998-12-02 20:35:28 +00:00
bouyer c2912048fc Cosmectic change in a panic(), so that the panic string printed by savecore
has more meaning.
1998-12-02 10:41:01 +00:00
kenh b519a199d6 Pass MNT_NODEVMTIME flag to lower VFS layer. 1998-12-01 23:17:25 +00:00
kleink abd228c31c Regen: getpgid() prototype change. 1998-11-26 16:13:56 +00:00
kleink 5eb7ae9656 getpgid(2) returns a value of type pid_t. 1998-11-26 16:07:05 +00:00
mycroft 74ad07cef5 Revert the functional change in rev 1.38; permit a msg_iovlen of 0.
There are two reasons for this:
* We should be able to pass file descriptors without sending any data.
* We could send zero-length iovecs anyway (but we shouldn't have to do this).
Also, msg_iovlen is already a u_int, so delete a bunch of casts.
1998-11-26 02:25:20 +00:00
castor 813222c472 Allow pattern matching for symbol string to handle GCC's output for mips,
where strings are output as
	.ascii	"foo\000"
instead of
	.ascii	"foo\0"
1998-11-25 06:10:19 +00:00
thorpej eb8f1afb3e Implement vdevgone(), to revoke all vnodes corresponding to the specified
type, major, (low minor...high minor).
1998-11-18 20:24:59 +00:00
thorpej f50fecdeaf Oops, fix uninitialzed variable in last. 1998-11-18 18:40:54 +00:00
thorpej 587f931901 Be a bit more precise about how we allow no deactivation support in
config_detach().
1998-11-18 18:40:08 +00:00
thorpej 3579ddab03 If the ca_activate entry point fails, make sure to restore the old
dv_flags.
1998-11-18 18:38:07 +00:00
thorpej ab1b371163 Implement config_detach(), mostly from Chris Demetriou, modified slightly
by Ken Hornstein and myself.

Add flags to struct device, and define one as "active".  Devices are
initially active from config_attach().  Their active state may be changed
via config_activate() and config_deactivate().

These new functions assume that the device being manipulated will recursively
perform the action on its children.

Together, config_deactivate() and config_detach() may be used to implement
interrupt-driven device detachment.  config_deactivate() will take care of
things that need to be performed at interrupt time, and config_detach()
(which must run in a valid thread context) finishes the job, which may
block.
1998-11-17 08:38:07 +00:00
perry 0c20c72cf9 (mostly) fix kernel tags support. from Frederick Bruckman in pr-6445. 1998-11-15 20:36:30 +00:00
thorpej 88bc4b9f8d Conditionally include the 4.4BSD-Lite2 compat vfs sysctl code. 1998-11-15 18:38:11 +00:00
tls 6321478a33 At securelevel >=2, don't allow new mounts, only allow change from rw to ro. 1998-11-14 06:38:54 +00:00
thorpej 1d03badef0 Implement a way to queue kernel threads for creation after init,
pagedaemon, reaper, etc.  Caller provides a callback function and
argument which will be called to create the threads.
1998-11-14 00:08:49 +00:00
thorpej d23593a784 Make vfs_sysctl() work. 1998-11-13 20:15:32 +00:00
mycroft 1115f2e840 Er, NSIG is one *more* than the number of signals. 1998-11-13 17:23:52 +00:00
mycroft d6ffecf67c Oops; signal numbers are 1..NSIG, not 0..NSIG-1. 1998-11-13 17:12:54 +00:00
thorpej 2f3f9379cf Add a couple more file systems to mountcompatnames[] (even though they
didn't exist in 4.3BSD or NetBSD 0.9) and always put the table into
the kernel.  It's going to be needed for VFS sysctls.
1998-11-13 04:12:35 +00:00
thorpej 920a1ace5b fork_kthread() -> kthread_create(). Set P_NOCLDWAIT on kernel threads,
which will cause any of their children to be reparented to init(8) (which
is already prepared to wait out orphaned processes).
1998-11-11 22:45:32 +00:00
thorpej a0fac8a7bc Move fork_kthread() to a new file, kern_kthread.c, and rename it to
kthread_create().  Implement kthread_exit() (causes a thrad to exit).
Set P_NOCLDWAIT on kernel threads, which will cause any of their children
to be reparented to init(8) (which is already prepared to wait out orphaned
processes).
1998-11-11 22:44:24 +00:00
thorpej 04dc9a8878 Remove some code accidentally readded when Christos implement P_NOCLDWAIT. 1998-11-11 22:37:13 +00:00
thorpej 6956a57584 Initial version of API for creating kernel threads (likely to change somewhat
in the future):
- New function, fork_kthread(), takes entry point, argument for entry point,
  and comment for new proc.  May be called by any context, will fork the
  thread from proc0 (requires slight changes to cpu_fork()).
- cpu_set_kpc() now takes a third argument, a void *arg to pass to the
  thread entry point.  Thread entry point now takes void * instead of
  struct proc *.
- Create the pagedaemon and reaper kernel threads using fork_kthread().
1998-11-11 06:34:43 +00:00
mycroft d4026f6eb5 GC the B_CACHE bit. 1998-11-09 01:18:34 +00:00
mycroft 36918f312f Rework cluster_rbuild() to use buffers with the file system block size.
From Alasdair Baird.
1998-11-08 18:18:31 +00:00
chs 61458d7dfa LOCKDEBUG enhancements for non-MP:
keep a list of locked locks.
use this to print where the lock was locked
when we either go to sleep with a lock held
or try to free a locked lock.
1998-11-04 06:19:55 +00:00
jonathan 3ac3cbcfb8 Add options DDB_FROMCONSOLE and sysctl ddb.fromconsole, analagous to
DDB_ONPANIC. Lets user ignore breaks but enter DDB on panic.  Intended
for machines where debug on panic is useful, but DDB entry is not,
(public-access console, or terminal-servers which send spurious breaks)

Add new ddb hook, console_debugger(), which decides whether or not to
ignore console ddb requests. Console drivers should be updated to call
console_debugger(), not Debugger(), in response to serial-console
break or ddb keyboard sequence.
1998-10-29 21:22:32 +00:00
mycroft 13daec0fb1 Several things:
* Change the usage of B_DONE so that it is only set when a buffer is in sync
  with the data on disk.
* If a buffer is being waited for, don't put it on the age queue.
* Make sure to clear B_DONE when pages are stolen from a buffer.
* Make sure to clear B_CACHE after each use.
* If we find a buffer for the block we want with valid data, but it is too
  small, panic.  (This isn't supposed to happen.)
Fixes potential file corruption problems with clustering.
1998-10-27 23:48:22 +00:00
tron bac6bb6bf2 No need to get definition of "SYSV..." from "opt_sysv.h" because they
must be set if these files are compiled.
1998-10-21 22:24:28 +00:00
tron bb56b72356 Defopt SYSVMSG, SYSVSEM and SYSVSHM. 1998-10-19 22:19:27 +00:00
tron f87a1b6e7a 1.93:Regen. 1998-10-19 22:19:26 +00:00
tron fe8170d1b1 Defopt SYSVMSG, SYSVSEM and SYSVSHM. 1998-10-19 22:19:26 +00:00
tron 06fb47025e 1.99:Regen. 1998-10-19 22:19:25 +00:00
tron 39876df951 Defopt SYSVMSG, SYSVSEM and SYSVSHM. 1998-10-19 22:14:54 +00:00
pk 2d45ece0e7 Allow `curproc' to be defined in <machine/proc.h> to enable a transition
to SMP support.
1998-10-19 11:51:53 +00:00
bouyer bf32feec28 More >2Gb fixes, from Constantine Sapuntzakis. 1998-10-16 14:29:40 +00:00
pk c65c55af6f Disable the daft PAUSE() macro, which manages to skip all the relevant
code in lockmgr() most of the time. This a no doubt a case of Bad Coding Style.
1998-10-14 09:41:21 +00:00
bouyer 91ce6daac5 Fix for files > 2Gb, one from Kirk McKusick via OpenBSD and one similar from me. 1998-10-12 09:57:48 +00:00
christos 10b5900f45 update for linux file move. 1998-10-03 20:39:32 +00:00
eeh 903d20a930 Fix big-endian syscall args. 1998-10-03 19:21:11 +00:00
drochner 835d1b736c Make contsigmask, stopsigmask, sigcantmask kernel private. 1998-10-03 14:29:02 +00:00
erh 8c963d5a04 Move elf function name macros to exec_elf.h. COMPAT_LINUX is no longer limited to ELFSIZE==32. 1998-10-01 16:06:24 +00:00
erh a0480f4f57 Only include linux a.out makecmds if EXEC_AOUT is defined. 1998-10-01 15:55:34 +00:00
thorpej d46253f21c Implement vsprintf(). 1998-09-29 21:03:02 +00:00
pk 25e37f3b97 In addition to the spinlock, use the lockmgr() to serialize access to
the back-end page allocator. This allows the back-end to sleep since we
now relinquish the spin lock after acquiring the long-term lock.
1998-09-29 18:09:29 +00:00
thorpej ac0d359bcb Initialize the CPU ID in the simplelock. 1998-09-29 07:29:53 +00:00
thorpej 73aefe65bc If MULTIPROCESSOR, add a spin lock around the kernel printf (in the
appropriate places).  This makes debugging messages work a LOT better
on my multiprocessor Alpha.
1998-09-29 01:49:43 +00:00
matt f0071e56cf Fix spl problem in socreate (which lead to the corruption of the
socket pool).
1998-09-25 23:32:27 +00:00
erh 3affe03bf4 Alpha Linux compat tweak for getpid, getuid and getgid. 1998-09-25 06:04:48 +00:00
thorpej 0c11d72456 Key off MULTIPROCESSOR, not NCPUS > 1. Pull in <machine/lock.h> if
MULTIPROCESSOR is defined, and rely on it to define the simple lock
operations.
1998-09-24 22:30:11 +00:00
thorpej c0dd0b8353 Make sure the size is large enough to hold a pool_item. 1998-09-22 03:01:29 +00:00
enami 19031a5309 make this file compile again; the variable points signal action being
set is `nsa' and there is no variable `sa'.
1998-09-19 02:00:52 +00:00
christos eb1a214078 Add NOCLDWAIT (from FreeBSD) 1998-09-18 18:48:22 +00:00
perry 5d0722b723 Note that kernel Makefile support for tags is totally broken. 1998-09-13 23:50:39 +00:00
christos f35a4d311a Regen 1998-09-13 14:45:22 +00:00
christos 34cb71bf00 Quote the backquotes in the double-quoted shell string, otherwise they
disappear and you get AS IS'' instead of ``AS IS'' in the generated files.
1998-09-13 14:44:34 +00:00
thorpej f93b23110f Regen. 1998-09-13 04:58:21 +00:00
thorpej 45431e6471 Emit syscall numbers for COMPAT_xx syscalls, too. 1998-09-13 04:57:24 +00:00
christos 34c5a58bb4 Make copyrights consistent; fix weird/trailing spaces add missing (c) etc. 1998-09-12 17:20:02 +00:00
pk 818fef1cd7 Nuke spurious pointer incrementation. 1998-09-12 13:12:14 +00:00
mycroft b1c2e63db6 Regen. 1998-09-12 10:48:51 +00:00
mycroft 3f2c7263b1 Fix thinko in previous. 1998-09-12 10:48:27 +00:00
mycroft 584cc642fc Regen. 1998-09-12 10:33:26 +00:00
mycroft 89ea1fcbdd Version sys_sigreturn, to avoid breaking programs that use it explicitly. 1998-09-12 00:47:12 +00:00