Commit Graph

3228 Commits

Author SHA1 Message Date
tsutsui d6458621a3 Fix too many arguments for format warning in #ifdef DIAGNOSTIC part
detected by gcc-3.x.
2003-02-22 12:42:28 +00:00
nathanw fb8a5b2205 Set P_WEXIT earlier; specifically, before a pool_get(, PR_WAITOK) that
could sleep.

Pointed out by enami.
2003-02-22 01:00:14 +00:00
jdolecek b4a06ab5af simplify timeout handling code in kqueue_scan() 2003-02-21 20:57:09 +00:00
skrll e8f64a20cb typo in comment. 2003-02-21 16:30:48 +00:00
matt b411ef736c In topdown mode, subtract the page rounded memory size of the psection,
not the rounded file size.  Otherwise if BSS needs more pages beyond
data you'll extend too far.
2003-02-21 03:53:43 +00:00
atatat df0a9badc6 Introduce "top down" memory management for mmap()ed allocations. This
means that the dynamic linker gets mapped in at the top of available
user virtual memory (typically just below the stack), shared libraries
get mapped downwards from that point, and calls to mmap() that don't
specify a preferred address will get mapped in below those.

This means that the heap and the mmap()ed allocations will grow
towards each other, allowing one or the other to grow larger than
before.  Previously, the heap was limited to MAXDSIZ by the placement
of the dynamic linker (and the process's rlimits) and the space
available to mmap was hobbled by this reservation.

This is currently only enabled via an *option* for the i386 platform
(though other platforms are expected to follow).  Add "options
USE_TOPDOWN_VM" to your kernel config file, rerun config, and rebuild
your kernel to take advantage of this.

Note that the pmap_prefer() interface has not yet been modified to
play nicely with this, so those platforms require a bit more work
(most notably the sparc) before they can use this new memory
arrangement.

This change also introduces a VM_DEFAULT_ADDRESS() macro that picks
the appropriate default address based on the size of the allocation or
the size of the process's text segment accordingly.  Several drivers
and the SYSV SHM address assignment were changed to use this instead
of each one picking their own "default".
2003-02-20 22:16:05 +00:00
jmc ff58e08182 Move simple_lock after the hashinit's to avoid possible sleeping/malloc'ing
with a simplelock held.
2003-02-20 02:49:51 +00:00
pk 9ead24ac7a Use lock_printf() in SPINLOCK_SPINCHECK() and SLOCK_TRACE(). 2003-02-19 22:34:42 +00:00
jdolecek 382f8f9883 if emulation uses elf32_copyargs(), it shouldn't use it's own idea
of how many AUX arguments are actually passed

this fixes PR kern/20423 by Shingo WATANABE
2003-02-19 09:44:42 +00:00
jdolecek 2e574d6a8b add "VT_SMBFS" to vnode_tags[]
constify vnode_tags[] and vnode_types[]
2003-02-18 20:37:38 +00:00
wiz 9ceb9b4b15 Add newline character to logname change warning.
Noted missing by Sean Davis on tech-kern.
2003-02-18 19:26:23 +00:00
dsl b80a5f24c5 KNF kern_prot.c 2003-02-18 08:37:41 +00:00
nathanw 0cfe2d1c69 Test p->p_sa instead of p->p_flag & P_SA, as the latter may have been
cleared by sigexit().
2003-02-17 23:45:47 +00:00
nathanw 1e8f36c002 Clear L_SA from all LWPs in sigexit() to prevent any upcalls or
sa_switch() invocations while exiting. Test P_SA instead of L_SA, out
of paranoia. Avoids a possible remrunqueue panic reported by Havard
Eidnes.

Release the kernel lock before calling the userret function to exit in
sigexit(). Problem noted by Paul Kranenburg.
2003-02-17 23:45:00 +00:00
nathanw a87506d477 Note yet another SMP danger spot. 2003-02-17 23:32:33 +00:00
christos e2b7a1ed43 Add a ttyprintf_nolock() to be called when we are printing the ttyinfo
stuff, since we already have the lock.
Adjust tputchar so that it does not lock, when NOLOCK is passed in flags.
2003-02-17 22:23:14 +00:00
christos e5323a474c - remove __STDC__ crap. It did not work anyway with pre-ansi compilers, since
va_start() takes one arg, and va_alist must be the only argument of a
  varyadic in the K&R world.
- pass flags to tputchar.
2003-02-17 22:21:52 +00:00
provos 9a5e533a1a do not demand LLSLEEP in p_stat; this does not seem to happen with lwps;
todo: a proper fix that takes lwps into consideration
2003-02-16 20:24:47 +00:00
jdolecek fa2b78c32c regen:
- added __sigtimedwait(2)
- g/c sigwaitinfo(2) slot, move sigqueue(2) slot and free slot #246
2003-02-15 20:56:48 +00:00
jdolecek c58bfd1c36 add __sigtimedwait(2) - wait for specified set of signals, with optional
timeout
the semantics of 'timeout' parameter differ to POSIX for the syscall
(not const, may be modified by kernel if interrupted from the wait) -
libc will provide appropriate wrapper

since sigwaitinfo(2) will be implemented as wrapper around sigtimedwait()
too, remove it's reserved slot and move sigqueue slot 'up', freeing
slot #246
2003-02-15 20:54:38 +00:00
dsl 9926e89884 Fix support for 16 character lognames
(approved by christos)
2003-02-15 18:47:41 +00:00
dsl aed442201d Fix support of 15 and 16 character lognames.
Warn if the logname is changed within a session - usually a missing setsid.
(approved by christos)
2003-02-15 18:10:15 +00:00
pk 9ca040e74e Make the memory allocation code MP-safe. 2003-02-14 21:51:36 +00:00
pk 9a853301e6 Use a mutex to protect the global list of open files. 2003-02-14 21:50:10 +00:00
pk 87978ebf11 Make cache insertion, removal and lookup MP-safe. 2003-02-14 21:39:46 +00:00
nathanw 49f53e20ea Make sa_yieldcall also allocate a new LWP for the cache if it's empty.
(XXX sa_yieldcall() and sa_switchcall() should be combined and take
arg as the function to call, but I'm somewhat nervous about void *
vs. void (*)()).
2003-02-14 20:45:12 +00:00
drochner 36e90ce9e3 fix typo in comment 2003-02-14 18:25:34 +00:00
pk d2b7e43b18 On pipe reads, check for EOF before FNONBLOCK to avoid spurious EAGAIN errors. 2003-02-14 13:16:44 +00:00
dsl db17a870e0 Split sys_wait4 so that code isn't duplicated in compat tree.
(approved by christos)
2003-02-14 10:11:56 +00:00
pk 3cba4a9f1b Make the pipe code mostly MP-safe. There are a few unaddressed race
conditions at points where it's necessary to access both the up-stream
and down-stream parts of the bi-directional pipe data structure. These
are marked `XXXSMP' in the code.

Also, since the changes are pretty invasive, there little point in keeping
all the "#ifdef FreeBSD" code around; so all of that has been stripped out.
2003-02-12 21:54:15 +00:00
yamt f4585f067a - don't compare c_time directly.
- in callout_hardclock, test if timeout_todo is empty or not
  before release the lock.
2003-02-11 09:43:37 +00:00
nathanw 158b157b2a Move stack allocation in case 1 of sa_switch() to after the
sau == NULL check, to avoid a stack leak in the error case.

Spotted by enami.
2003-02-11 00:03:47 +00:00
drochner d229e1e550 replace &(a?b:c) by (a?&b:&c), so that it looks more like an lvalue
(to lint at least)
approved by thorpej
2003-02-10 19:18:56 +00:00
nathanw 695bc028ab Since sadata_upcall_alloc(1) can sleep, call it before checking the
supply of stacks, to avoid a race. Problem pointed out by Lars
Heidieker on current-users.
2003-02-10 19:02:52 +00:00
atatat a8481319cb Add a kern.dump_on_panic sysctl variable (and documentation, and a
kernel config option) that controls whether the kernel dumps to the
dump device on panic.  Dumps can still be forced via the ``sync''
command from ddb.  Defaults to ``on''.
2003-02-10 00:35:15 +00:00
jdolecek 573bb6afc9 const msgs[] some more 2003-02-09 09:14:58 +00:00
nathanw b5a9638ee1 Adapt to the new conventions of proc_unstop() and don't try to call
setrunnable(NULL).
2003-02-07 21:44:45 +00:00
nathanw 4c99df7fcc Two fixes:
* Change the semantics of proc_unstop() slightly, so that it is
   responsible for making all stopped LWPs runnable, instead of
   all-but-one. Return value is a LWP that can be interrupted if doing
   so is necessary to take a signal. Adjust callers of proc_stop() to
   the new, simpler semantics.

 * When a non-continue signal is delivered to a stopped process and
   there is a LWP sleeping interruptably, call setrunnable() (by way
   of the 'out:' target in psignal1) instead of calling unsleep() so
   that it becomes LSSTOP in issignal() and continuable by
   proc_unstop(). Addresses PR kern/19990 by Martin Husemann, with
   suggestions from enami tsugutomo.
2003-02-07 21:43:18 +00:00
jdolecek 018aae11cd use LIST_FOREACH() macro in proc_stop()/proc_unstop()
rewrite contents of the loop in proc_unstop to be a bit more easily
comprehensible
2003-02-07 09:02:14 +00:00
pk 9d74642196 XXX ttioctl(): some drivers call back on us from t_param(), so delay acquiring
tty spin lock until after t_param() returns.

Require t_param() to unlock upon callback?
2003-02-06 12:21:21 +00:00
pk 1262bf7cb5 bdwrite(): remove check for MFS major device number (why was 255 changed
to 4096?). In any case, bdevsw_lookup() will take care of it.
2003-02-06 11:46:49 +00:00
pk 9df517d22e In getnewbuf(), release the buffer queue lock before calling bawrite() and
re-acquire it afterward.
2003-02-06 11:22:35 +00:00
pk 408ae56abd Require the bdirty() be called at splbio() and with the buffer interlock held.
This is essentially just a helper routine called from biodone() through
ffs softdep's I/O completion, to re-queue the buffer.
2003-02-06 09:46:46 +00:00
pk 338f31f581 Make the buffer cache code MP-safe. 2003-02-05 21:38:38 +00:00
pk bb52ffdf64 Make the tty subsystem MP-safe..
..as far as mere mortals are able to, since this code illustrates the finest
points that Italian haute cuisine has to offer.
2003-02-05 15:49:02 +00:00
briggs c17a890fc8 Fix DIAGNOSTIC printf format. 2003-02-05 15:38:14 +00:00
nakayama 8920acd333 Switch to use cycle counter (%tick) based microtime().
This is derived from alpha/microtime.c and i386/tsc_microtime.c,
and will share with both ports.

This should fix PR port-sparc64/18452.
(approved by martin)
2003-02-05 12:06:51 +00:00
pk e148067544 ltsleep(): deal with PNOEXITERR after re-taking the interlock (if necessary). 2003-02-04 20:15:59 +00:00
jdolecek f02bf3cc39 add XXX coment to sadata_upcall_alloc() noting this might need to zero memory
use 'l' for sa_yield() tsleep call; sa->sa_idle == l there
add DIAGNOSTIC printf on one more place in sa_upcall_userret() where
we kill process with SIGILL
2003-02-04 15:54:26 +00:00
jdolecek 920114e6e6 itimerfire(): fix bug in previous - if two or more timers would
fire close together, the second (and every other) timer would be
added to mask incorrectly - timerid value would be shifted twice,
and sa_upcall() would later kill process with SIGILL
2003-02-04 15:50:06 +00:00