Commit Graph

2297 Commits

Author SHA1 Message Date
itojun 243eebc256 disable m_dup(), as it makes false assumption on cluster mbuf and unsafe
(does not do the right thing).
2000-08-18 14:23:48 +00:00
itojun 1905ac079e add a comment about false assumption made by m_dup() 2000-08-18 14:12:47 +00:00
thorpej 3a1f5cdbfc If maniuplating a read lock on the proc list, we no longer need
to go to splclock() -- spinlockmgr() handles the interrupt blocking
while holding the interlock for us, now.
2000-08-17 14:37:54 +00:00
thorpej 391e1e1f44 For spinlocks, block interrupts while holding the interlock. Partially
from Bill Sommerfeld.
2000-08-17 14:36:32 +00:00
thorpej b6aaff9c44 Add a DIAGNOSTIC check for release of an unlocked lock.
From Bill Sommerfeld.
2000-08-17 04:18:21 +00:00
thorpej f2098b2382 Some more lock debugging support:
- LOCK_ASSERT(), which expands to KASSERT() if LOCKDEBUG.
- new simple_lock_held(), which tests if the calling CPU holds
  the specified simple lock.

From Bill Sommerfeld, modified slightly by me.
2000-08-17 04:15:43 +00:00
fvdl 4ca7344324 Fix omission in previous. 2000-08-15 17:54:59 +00:00
eeh 2ce37274f1 Fix LP64BE bug. 2000-08-15 16:26:42 +00:00
augustss ce60088d05 Define ltsleep() in the case of _EXTENT_TESTING so regressions testing
works again.
2000-08-12 23:56:50 +00:00
thorpej a91e7a7c6d Don't bother with a trampoline to start the pagedaemon and
reaper threads.
2000-08-12 22:41:53 +00:00
thorpej d66573f747 In reaper(), use ltsleep() instead of simple_unlock()/tsleep(). 2000-08-12 22:26:01 +00:00
sommerfeld 861fcc44b7 Use ltsleep(...,PNORELOCK..) instead of simple_unlock()/tsleep() 2000-08-12 16:43:00 +00:00
sommerfeld a6cdaddbe6 Use ltsleep(... PNORELOCK ) instead of simple_unlock()/tsleep() 2000-08-12 16:29:36 +00:00
sommerfeld 01233143b9 Use ltsleep instead of simple_unlock/tsleep/simple_lock 2000-08-12 16:28:30 +00:00
eeh cd557cfb3c Nother __kprintf_attribute__ to be removed. 2000-08-10 04:37:59 +00:00
tv 5b0a45ec9b Strip %b and DDB formats out of kprintf, as they are no longer supported. 2000-08-09 10:22:31 +00:00
thorpej 414765c253 In fill_kproc2(), testing p->p_stats != NULL doesn't do much good,
instead test for (p->p_flag & I_INMEM), and don't access the U-area
(via p->p_stats) if that bit is clear.  Fixes the hangs people have
seen when the system is paging and the user runs top/ps/w.
2000-08-08 23:42:07 +00:00
thorpej c70ada6428 Fix printf format error pointed out by Steve Woodford. 2000-08-08 19:55:26 +00:00
thorpej b9d2d53fb8 Add a DIAGNOSTIC or LOCKDEBUG check for held spin locks. 2000-08-07 22:10:52 +00:00
thorpej b24441d4d1 It doesn't make sense to charge simple locks to proc's, because
simple locks are held by CPUs.  Remove p_simple_locks (which was
unused anyway, really), and add a LOCKDEBUG check for held simple
locks in mi_switch().  Grow p_locks to an int to take up the space
previously used by p_simple_locks so that the proc structure doens't
change size.
2000-08-07 21:55:22 +00:00
bjh21 24f9914cb3 Second phase of changes to remove ntp_adjtime(2) from the kernel entirely if
NTP is not defined.

Also removes sysctl_ntptime, since that's unreferenced without NTP.

ntp_gettime(2) is left alone, since it doesn't raise SIGSYS, which sys_nosys()
does.
2000-08-07 18:10:20 +00:00
bjh21 a9397f5bfc Changes to syscalls.master to exclude ntp_adjtime(2) entirely if NTP is not
defined.  Changes to other files will follow in a moment.
2000-08-07 17:59:33 +00:00
thorpej 7cc27a88c0 Convert namei pathname buffer allocation to use the pool allocator. 2000-08-03 20:41:05 +00:00
thorpej 831865b30e MALLOC()/FREE() are not to be used for variable sized allocations. 2000-08-02 20:53:07 +00:00
thorpej c80a866888 MALLOC()/FREE() are not to be used for variable sized allocations. 2000-08-02 20:42:03 +00:00
thorpej 0b3ef940d0 MALLOC()/FREE() should not be used for variable sized allocations.
(A few remain here -- need to fix exec_script.c)
2000-08-02 20:36:33 +00:00
nathanw 729e93de71 principal -> principle (in a comment) 2000-08-02 20:21:36 +00:00
itojun eb0816bfcb allow admins to disable pps rate limitation, by setting "maxpps"
parameter to negative value.
2000-08-02 12:24:11 +00:00
thorpej cd32ace8bb ANSI'ify. 2000-08-01 04:57:28 +00:00
mrg a8fc5226d3 fix rev 1.44; make this cast look like:
sig = (int)(long)*(caddr_t *)data;
to *properly* dereference the passed data.  this makes signals on
ptys actually *work* on the sparc64 port.  from mycroft.


XXX: the release branch version needs this ASAP as it is probably
unstable on ILP32BE.
2000-07-28 04:31:19 +00:00
eeh 2152b574c0 Fix LP64BE bug. 2000-07-28 04:21:26 +00:00
mason fa62f74f37 Moving to a default of 64 PTYs. 2000-07-27 17:32:11 +00:00
mrg 705b50bf32 fix LP64 warnings. 2000-07-27 14:00:56 +00:00
mycroft 9daa55017e Fix the sparc_v9 hack... 2000-07-27 13:45:59 +00:00
mycroft 93a8d5ffea The ELF ABI declares that argc must fill an `argument slot'. Make it so.
For __sparc_v9__ only, do a hack to make old executables continue to work --
for now.
2000-07-26 15:42:09 +00:00
augustss 72afbf03cf Run power hooks in reverse installation order when powering down and
installation order when powering up.  This allows drivers in a hierarchy
to DTRT.
2000-07-26 12:24:52 +00:00
tron 6f6272c9e9 Include "uvm/uvm_param.h" to get definition of "VM_MAX_KERNEL_BUF" as
suggested by Richard Earnshaw. This fixes PR kern/10649.
2000-07-23 10:41:35 +00:00
simonb da251cb08f Delete a couple of <uvm/uvm_extern.h> includes that were for
<sys/sysctl.h> only.
2000-07-22 16:11:02 +00:00
jdolecek b0fb24279c change the lf_advlock() arguments from
int     lf_advlock __P((struct lockf **,
           off_t, caddr_t, int, struct flock *, int));
to

int     lf_advlock __P((struct vop_advlock_args *, struct lockf **, off_t));

This matches common usage and is also compatible with similar change
in FreeBSD (though they use u_quad_t as last arg).
2000-07-22 15:26:11 +00:00
jeffs ddc66457b1 Same change in the kgdb code as was done in ddb:
Move platform db_trap callback from arch/mips into ddb as suggested by
  jhawk.  This callback is used by platform code to manage things like
  watchdogs that should be disabled while in ddb.  Done as a callback
  for processors such as mips that support lots of different systems.
2000-07-18 21:49:08 +00:00
fvdl 57e3691758 Don't wait for B_READ buffers to finish in vfs_shutdown, it makes no sense
to do so.

From Ethan Solomita.
2000-07-16 21:07:24 +00:00
fvdl 9067306192 Don't use *(unsigned int *)data to get the signal number out; this will
fail on LP64-BE systems. Also, fix up the invalid signal number check.
2000-07-14 12:10:58 +00:00
thorpej 195bf5c09f - Fix the likely cause of the "ps(1) hangs machine" problem. Always
vslock the user pages for the data being copied out to userspace,
  so that we won't sleep while holding a lock in case we need to
  fault the pages in.
- Sprinkle some const and ANSI'ify some things while here.
2000-07-14 07:21:21 +00:00
thorpej 8fd9032b90 ANSI'ify. 2000-07-14 07:14:33 +00:00
thorpej c55e09bd44 Add a comment about the hzto() return value. 2000-07-13 17:32:06 +00:00
thorpej c0c8481a2a New hzto() function from FreeBSD and Artur Grabowski <art@stacken.kth.se>.
Stops sleeps from returning early (by up to a clock tick), and return 0
ticks for timeouts that should happen now or in the past.

Returning 0 is different from the legacy hzto() interface, and callers
need to check for it.
2000-07-13 17:06:15 +00:00
simonb b10a1b69be Add a KERN_CONSDEV sysctl that returns cn_tab->cn_dev (if cn_tab is not
NULL).
2000-07-13 14:26:43 +00:00
mjacob c9f691d778 Correct omissions inadvertantly introduced when the non-debug
version (macro) was updated in exec.h.
2000-07-13 09:34:23 +00:00
itojun f5211e847a remove m_pulldown statistics code. it is highly experimental and belong
to kame tree only (not for *bsd).
2000-07-13 05:34:21 +00:00
matt b4c1bfd1f3 modify load_file to load at relative vms'a as specified in the phdr's. 2000-07-13 02:35:25 +00:00
matt 84bbae583c remove a debugging printf. 2000-07-13 02:33:36 +00:00
thorpej ccb90e6fe9 When select(2)/poll(2) is awakened by a collision, recalculate the
timeout value for tsleep().  From Artur Grabowski <art@stacken.kth.se>.
2000-07-13 01:32:33 +00:00
matt 81ce10aa1f Extend the vmcmd stuff a bit. Add a flags field and define
VMCMD_BASE & VMCMD_RELATIVE.  This allows one to add vmcmds
which are relative to previous entries.  This is needed for
loading the VAX ld.elf_so
2000-07-13 01:24:04 +00:00
kleink a5eeea36d4 Add back a failure return statement in check_header() which I accidently
deleted in rev. 1.46; pointed out by Chris Demetriou.
2000-07-11 06:23:38 +00:00
jhawk 84fe4f536c Comment police. s/DIAGNOSTICS/DIAGNOSTIC/ 2000-07-09 14:13:04 +00:00
itojun d8a9a3cc7b add ppsratelimit(9), which does event-per-sec rate limitation.
use it from icmp6 error rate limitation code.
XXX better name for the function?
2000-07-09 06:44:57 +00:00
itojun 8f3d56a298 shorten splclock() period in ratelimit().
From: onoe
2000-07-09 06:40:08 +00:00
mycroft caf07dfa04 When unmounting, make sure to free the syncer vnode so that it can be reused. 2000-07-09 00:59:03 +00:00
sommerfeld d5906caa54 Format paranoia 2000-07-08 18:11:02 +00:00
sommerfeld bb22022c59 Format paranoia. 2000-07-08 18:10:25 +00:00
mrg 4384010332 more extent_alloc() fixes:
check that newstart + size - 1 doesn't overflow the end of the extent, rather
than the "dontcross" value, which can easily overflow the end of an extent
when being asked for an object with a large boundary requirement.  this test
is more valid, in any case, and fixes extent_alloc() failure when the start of
the extent is not "aligned".
2000-07-07 14:10:48 +00:00
jdolecek 53385f1dfd adjust maximum number of vnodes in vnode cache according
to machine memory size upon boot if the number has not been specified
explicitly in kernel config - at this moment, 0.5% of system
memory is used for vnodes (but minimum NVNODE vnodes)
2000-07-06 09:51:54 +00:00
jdolecek 1ec07d7439 change tablefull() to accept one more parameter - optional hint
use that to inform about way to raise current limit when we reach maximum
number of processes, descriptors or vnodes

XXX hopefully I catched all users of tablefull()
2000-07-04 15:33:28 +00:00
fvdl 975751cda2 vinsheadfree -> ungetnewvnode 2000-06-27 23:51:51 +00:00
fvdl c39797c045 Add vinsheadfree, a small function to push vnodes that have just
been allocated by getnewvnode, back onto the head of the free list.
Needed in some VFS_VGET functions to deal with races.
2000-06-27 23:34:45 +00:00
mrg 32aa199ccf remove include of <vm/vm.h> 2000-06-27 17:41:07 +00:00
mrg 89d0a3e519 remove redundant vm includes. 2000-06-26 14:38:50 +00:00
mrg 2f159a1bac remove/move more mach vm header files:
<vm/pglist.h> -> <uvm/uvm_pglist.h>
	<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
	<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
	<vm/vm_object.h> -> nothing
	<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
2000-06-26 14:20:25 +00:00
mrg 53be5b215c <vm/vm_pageout.h> is already empty; kill it totally. 2000-06-25 13:49:33 +00:00
pk ac2055bc9a Fix-up (#if 0'd) printf() formats. 2000-06-24 12:46:57 +00:00
matt f2bfc30377 Add some kernel printfs (under DEBUG) to print messages when bad things
happen in a exec.
2000-06-21 05:43:33 +00:00
matt d4513b2c95 Add vmcmd_readvn (which was the 2nd halt of vmcmd_map_readvn). 2000-06-21 05:41:07 +00:00
pooka 7747299e6d Correct situation where vnode was left hanging around when trying to
mount a filesystem with securelevel 2. A second mount-attempt left
everything completely frozen.

Fix by Bill Sommerfeld.
2000-06-19 18:53:55 +00:00
mrg 8c758332be in extent_alloc_subregion1(), check for EXTENT_ALIGN() overflow when
doing the boundary-case check.  approved by thorpej.
2000-06-16 16:48:56 +00:00
simonb cd36ac22df Add #ifdef checks for SYSVMSG, SYSVSEM and SYSVSHM in more places to catch
when some but not all of the SysV IPC facilities are configured.
Problem noticed by Phil Nelson.
2000-06-16 00:57:04 +00:00
simonb 00d1b6b147 Add a KERN_MSGBUF sysctl to return the message buffer. 2000-06-16 00:18:09 +00:00
fvdl 4fbe4a470d Enable passing of the MNT_SOFTDEP flag in the mount system call. 2000-06-15 22:32:44 +00:00
cgd ef767ee388 Replace my personal attribution string ("This product includes software
developed by Christopher G. Demetriou for the NetBSD Project.") with
a generic NetBSD one ("This product includes software developed for the
NetBSD Project.  See http://www.netbsd.org/ for information about NetBSD.")
so that this same set of terms can be used by others if they so desire.
(Eventually i'll be converting more/all of my code.)
2000-06-13 22:36:16 +00:00
chs b4aac1046f round the sizes of mapped text and data segments to PAGE_SIZE.
fixes PR 10079.
2000-06-13 06:21:51 +00:00
chs ded9898d88 make sure that the size we pass to uvm_map() is a multiple of PAGESIZE.
this should fix PR 10175 and prevent the panic of PR 10079.
2000-06-13 04:25:31 +00:00
simonb e907fee281 In the KERN_GETPROC* handler:
* Handle KERN_PROC_SESSION that has been defined in <sys/sysctl.h> from
  day one.
* Add handlers for KERN_PROC_GID and KERN_PROC_RGID.
* If "op" doesn't valid, return EINVAL.
2000-06-13 01:27:00 +00:00
sommerfeld c0011ad705 Fix several problems with lockf/fcntl byte range locks:
- document a data structure invariant in lockf.h
 - add KASSERT() to check the invariant.
 - be more consistent about dequeuing ourselves from the blocked list
after a tsleep().
 - Fix two places where the invariant is violated.
 - correct a few comments here and there
 - If we're still following a lock dependancy chain after maxlockdepth
processes and haven't gotten back to the start, assume that we're in a
cycle anyway and return EDEADLK.

Fix is a superset of an existing fix in FreeBSD, but independantly
derived.

Fixes kern/3860.
2000-06-12 14:33:04 +00:00
sommerfeld e964d558a7 Fix assorted bugs around shutdown/reboot/panic time.
- add a new global variable, doing_shutdown, which is nonzero if
vfs_shutdown() or panic() have been called.
- in panic, set RB_NOSYNC if doing_shutdown is already set on entry
so we don't reenter vfs_shutdown if we panic'ed there.
 - in vfs_shutdown, don't use proc0's process for sys_sync unless
curproc is NULL.
 - in lockmgr, attribute successful locks to proc0 if doing_shutdown
&& curproc==NULL, and  panic if we can't get the lock right away; avoids the
spurious lockmgr DIAGNOSTIC panic from the ddb reboot command.
 - in subr_pool, deal with curproc==NULL in the doing_shutdown case.
 - in mfs_strategy, bitbucket writes if doing_shutdown, so we don't
wedge waiting for the mfs process.
 - in ltsleep, treat ((curproc == NULL) && doing_shutdown) like the
panicstr case.

Appears to fix: kern/9239, kern/10187, kern/9367.
May also fix kern/10122.
2000-06-10 18:44:43 +00:00
assar 6c734cd283 make vfs_getnewfsid only take one argument and fetch the name of the
filesystem from the supplied mount argument.  also make makefstype
take a const parameter.  update all the callers.
2000-06-10 18:27:01 +00:00
oki 41608c00a3 PE/COFF (Win32) compatible binary support (experimental).
It currentry supports only i386.
2000-06-09 22:38:56 +00:00
thorpej 6ea30ef2e8 Use ltsleep(). 2000-06-08 05:50:59 +00:00
thorpej fcc7898856 Change tsleep() to ltsleep(), which takes an interlock argument. The
interlock is released once the scheduler is locked, so that a race
between a sleeper and an awakener is prevented in a multiprocessor
environment.  Provide a tsleep() macro that provides the old API.
2000-06-08 05:50:37 +00:00
soren 14573dc679 defopt SYSCALL_DEBUG. 2000-06-06 18:26:32 +00:00
thorpej 1e0957307e Make this build as a regression test with the latest simple lock
changes.
2000-06-06 17:32:50 +00:00
thorpej 0a3a6e34f8 Oops, missed a couple of places where CMSG_*() should be used. No
functional change in this case, but the code is now correct.
2000-06-05 16:29:45 +00:00
thorpej 724a90318e - Fix file descriptor passing AGAIN. This has apparently been broken
on LP64 systems (and probably the SPARC) since the __cmsg_alignbytes()
  changes went in.
- Change file descriptor passing to use CMSG_DATA(), not (cm + 1).  This
  pretty much has to be done in order to make it work properly on LP64,
  and considering that it's been broken this long...
- Use CMSG_SPACE() to determine the mbuf length needed for a given
  control message, and CMSG_LEN() to stash in the cmsg_len member.
2000-06-05 06:06:07 +00:00
cgd cffb580806 Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
2000-06-04 19:14:14 +00:00
mycroft 9dcdff8f25 Add stubs for PE/COFF. 2000-06-04 16:26:11 +00:00
thorpej 5b281c5932 Move schedticks and cp_time into schedstate_percpu. Also, allow
non-primary CPUs to call hardclock(), but make them bail about
before updating global timekeeping state (that's the job of the
primary CPU).
2000-06-03 20:42:42 +00:00
cgd 8d519faff4 fix type of sysctl_ntptime 'where' arg in defined(NTP) case 2000-06-02 18:22:44 +00:00
simonb 7e6435a651 White space nit in previous. 2000-06-02 16:05:49 +00:00
simonb 38cc1b3975 Add new sysctl node "KERN_SYSVIPC_INFO" with "KERN_SYSVIPC_MSG_INFO",
"KERN_SYSVIPC_SEM_INFO" and "KERN_SYSVIPC_SHM_INFO" to return the
info and data structures for the relevent SysV IPC types.  The return
structures use fixed-size types and should be compat32 safe.  All
user-visible changes are protected with
	#if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)

Make all variable declarations extern in msg.h, sem.h and shm.h and
add relevent variable declarations to sysv_*.c and remove unneeded
header files from those .c files.

Make compat14 SysV IPC conversion functions and sysctl_file() static.

Change the data pointer to "void *" in sysctl_clockrate(),
sysctl_ntptime(), sysctl_file() and sysctl_doeproc().
2000-06-02 15:53:03 +00:00
cgd 00b28e7a52 another mod of opportunity: const poison. (cfprint_t should take
const char * as second arg, too, but that's Hard.)  also, convert use
of "(char *)0" to NULL.
2000-06-02 01:48:50 +00:00
cgd a556975be3 __P and K&R declarations -> ANSI protos + declarations. tweak NetBSD IDs,
and __KERNEL_RCSID to subr_autoconf.c.
2000-06-02 01:31:52 +00:00
pk e1859436f1 Fix lossage when transferring a pointer value into an off_t var. 2000-06-01 18:30:03 +00:00