Commit Graph

2816 Commits

Author SHA1 Message Date
jdolecek 943f2b4f8a make COMPAT_11 or COMPAT_12 imply EXEC_ELF_NOTELESSS
use #if for the execsw entries, to allow 'options EXEC_ELF_NOTELESS=0'
  to override this

This addresses kern/13520 and kern/14409 by Matthew Green.
2002-03-23 09:50:54 +00:00
jdolecek 083f26646d rename EXEC_ELF_CATCHALL to EXEC_ELF_NOTELESS 2002-03-23 09:40:55 +00:00
jdolecek 225f07a8d4 Make sure file descriptor is properly FILE_UNUSE()d in error case
of writev(2).
Problem found by Alistair G. Crooks.
2002-03-22 18:58:59 +00:00
christos 195539260e emulation specific sysctls. 2002-03-20 00:27:25 +00:00
oki 075769476a Use /emul/pecoff as prefix to run PE/COFF binaries. 2002-03-18 07:11:06 +00:00
christos 18c7399ada oops, forgot to commit the caller of exithook... 2002-03-17 23:41:30 +00:00
christos 22839acdb9 use the exithook mechanism to clean up semaphores. 2002-03-17 22:21:58 +00:00
christos f7d98e2451 - merge all the hook insertion and deletion code so that we don't create
a fourth copy.
- add exithook to be executed when a process exits.
2002-03-17 22:19:20 +00:00
atatat 31144d9976 Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command".  ERESTART is -1, which can lead to
confusion.  ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4.  No ioctl code should now return -1 anywhere.  The
ioctl() system call is now properly restartable.
2002-03-17 19:40:26 +00:00
thorpej 53df727d27 Add a new ptrace request, PT_IO, as proposed by Artur Grabowski
on the <bsd-api-discuss@wasabisystems.com> mailing list.  PT_IO
is a more general inferior I/D space I/O mechanism.  FreeBSD and
OpenBSD have also added PT_IO.

From lha@stacken.kth.se, kern/15945.
2002-03-17 17:02:45 +00:00
simonb 1f467013b2 White space nits. 2002-03-17 11:15:49 +00:00
simonb 21d2b8b53d We don't need to include <uvm/uvm_extern.h> before <sys/sysctl.h> anymore. 2002-03-17 11:10:43 +00:00
chs 4d4825010d fix bread() to return errors from reading past the end of the device.
back in rev. 1.51, bread() and breadn() were changed to assume that
if B_DONE is set on a buffer returned by bio_doread(), that the buffer
must have already been in the cache, and thus the overall bread() should
return success.  but if the requested buffer is not in the cache and
is past the end of the device, bounds_check_with_label() will set B_ERROR
on the buffer and the caller will call biodone(), which will cause bread()
to think the buffer was already in the cache and thus return success.
to fix this, undo rev. 1.51 and instead have biowait() treat both B_DONE
and B_DELWRI as indicators that it doesn't need to sleep waiting for an
i/o to complete.
2002-03-16 23:49:59 +00:00
mjacob ad97873103 size_t is a long on alpha. I forget whether there's actually a 'best'
kernel printf format arg to print size_t in NetBSD, but coercing the
arg to long probably works well enough.
2002-03-16 22:44:41 +00:00
eeh 8bf657ddf1 Don't forget to allocate space for the property name's trailing NUL. 2002-03-15 20:33:50 +00:00
jdolecek fcc4c4d402 Merge the update to FreeBSD rev 1.95.
Changes:
* MP locking changes (mostly FreeBSD specific)
  XXXSMP the MP locking macros are noops on NetBSD for now
* kevent fix (FreeBSD rev. 1.87): when the last reader/writer
  disconnects, ensure that anybody who is waiting for the kevent
  on the other end of the pipe gets EV_EOF
* kill __P
2002-03-13 21:50:24 +00:00
simonb f81b8604f8 Move 'struct pool_cache_group' definition into <sys/pool.h> 2002-03-13 10:57:18 +00:00
simonb 4067afd322 Remove two instances of an "error" variable that is only ever assigned to
but not used.
2002-03-13 08:12:58 +00:00
thorpej d100f2ae43 Put back pool_prime(); the i386 mp pmap uses it. 2002-03-09 18:06:54 +00:00
bjh21 dca4ae94d6 When checking that a potentially-unsigned enum is >= 0, assign it to an int
first.  This is necessary to avoid warnings with -fshort-enums.  Casting
to an int really should be enough, but turns out not to be.

This change will be documented in doc/HACKS.
2002-03-09 13:22:52 +00:00
thorpej 59a96297ef Fix a couple of typos in simple_{,un}lock()'s. 2002-03-09 05:14:33 +00:00
thorpej c4a2ca6a3e Remove pool_prime(). Nothing uses it, and how it should be used it not
really well-defined in the absense of PR_STATIC.
2002-03-09 01:56:27 +00:00
thorpej e21319b482 Make mbpool and mclpool use the new drain hook facaility. Adjust
m_reclaim() to match the drain hook signature.  This allows us to
delete m_retry() and m_retryhdr(), as the pool allocator will now
perform the reclaimation step for us.

From art@openbsd.org.
2002-03-09 01:46:32 +00:00
thorpej 4be86fcc13 If, when a page becomes idle, the backend allocator is waiting for
resources, release the page immediately, rather than letting it sit
around cached.

From art@openbsd.org.
2002-03-09 01:37:19 +00:00
thorpej d54150e78a Remove PR_MALLOCOK and PR_STATIC. The former wasn't actually used,
and the latter, while there was some code tested the bit, was woefully
incomplete and also unused by anything.  Besides, PR_STATIC functionality
could be better handled by backend allocators anyhow.

From art@openbsd.org
2002-03-09 01:33:33 +00:00
thorpej ce635a702a Add a missing simple_unlock. 2002-03-08 21:43:54 +00:00
thorpej 8cdc6121b7 Add an optional "drain" client callback, which can be set by the new
pool_set_drain_hook().  This hook is called in three cases:
* When a pool has hit the hard limit, just before either erroring
  out or sleeping.
* When a backend allocator fails to allocate memory.
* Just before trying to reclaim pages in pool_reclaim().

This hook requests the client to try and free some items back to
the pool.

From art@openbsd.org.
2002-03-08 21:41:59 +00:00
thorpej 7c94c68f10 Remove PR_FREEHEADER; nothing uses it anymore.
From art@openbsd.org.
2002-03-08 20:51:25 +00:00
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
nathanw 3f0d660168 Make the debugging printfs compile:
- printf format checking doesn't like %x for pointers; use %p like we should.
 - LP64 fixes.
2002-03-05 23:28:58 +00:00
simonb bc7301d415 nlinesw is already declared in <sys/conf.h>. 2002-03-04 02:32:58 +00:00
simonb 8ecad242b9 Use <sys/disk.h> for the prototype of disk_init() rather than declaring
our own locally.
2002-03-04 02:30:27 +00:00
simonb 9a942a34e0 Don't use local extern declarations for the mountroot variable or
declare local prototypes for nfs_mountroot() or md_root_setconf().
2002-03-04 02:25:21 +00:00
mrg d3b3f3e560 move the COMPAT_SUNOS TIOCGPGRP handling in the compat sunos code proper.
this is the final fix needed for it to run properly as an LKM.  no more
COMPAT_SUNOS hacks around the tree!
2002-03-02 12:30:43 +00:00
thorpej 92eb54d5a5 Don't assign NULL to non-pointer variables. 2002-02-28 04:43:16 +00:00
manu 89e46d8a99 Reworked the o32/n32 matching scheme. IRIX uses some e_flags in the ELF
header to distinguish between o32, n32 and n64 ABIs. We now use this.
This suppress the need of the mips_option test, which had some fake positive.
This also removes the mandatory ordering of n32 vs o32 in the exec switch
(exec_conf.c)
2002-02-21 21:53:00 +00:00
christos 8ec87caa7f ICANON is in lflags, by Neelkanth Natu 2002-02-17 19:34:42 +00:00
enami 3528e53ca0 Use sizeof correctly. Fixes PR#15613. 2002-02-16 02:11:43 +00:00
enami 233c254079 - Wrap long line.
- Remove unnecessary semi-colon.
2002-02-16 02:07:56 +00:00
simonb 14ac06f0bd Add a "show event" ddb command to show the event counters. 2002-02-15 11:18:26 +00:00
chs b744097a5f allow writing to write-only mappings. fixes PR 3493. 2002-02-14 07:08:02 +00:00
thorpej daaeb3910f const char *mclpool_warnmsg -> const char mclpool_warnmsg[]
Noted by Matt Thomas.
2002-02-12 00:52:33 +00:00
jdolecek 5798a9a710 Switch default for pipes to the faster John S. Dyson's implementation.
Old, socketpair-based ones are available with option PIPE_SOCKETPAIR.
2002-02-11 18:11:41 +00:00
chs 9784635eb6 getblk()'s "block size invariant" isn't valid for VBLK vnodes
since bounds_check_with_label() will truncate a buffer that crosses
the end of the partition.  adjust the assertion to account for this.
fixes PRs 7938, 12156, 12698, 13076, 13210 and 13288.
2002-02-10 23:14:18 +00:00
bouyer 149c671b66 extent_alloc_subregion1(): when a candidate region doesn't fit after being
rounded up to respect boundary limits, adjust newstart and last before
skiping to the next region. Otherwise we may check the same candidate
region against the start of the next region, no the one immediatly following
the hole, leading to corrupted map.

This fixes the panic seen on sparc64 with scsi drivers, and probably fixes
PR 15489.
2002-02-09 01:00:09 +00:00
christos 980af1007c Andrew Brown found that we overflowed all cases in the TTLINEDNAMELEN.
ouch.
2002-02-08 18:36:53 +00:00
thorpej 7380aa1467 Add a "ddb" command (if DDB is configured into the kernel) for
easy, convenient dropping into DDB at the "root device: " prompt.
Useful if your console can't do it w/o actually taking an interrupt
and you want to, say, look at the boot messages.
2002-02-08 00:58:58 +00:00
chs 90503a3cda add an assert (hopefully to find where we recycle vnodes without
freeing all the pages, like I've seen recently).
2002-02-05 07:50:58 +00:00
tls eeda20f137 Kick DEFAULT_MAXPTYS from 256 to 992 2002-02-02 07:18:55 +00:00
kleink 12135360cf fcntl(..., F_GETOWN, ...): fix LP64-BE bug; raised by der Mouse
on tech-kern.
2002-01-31 22:17:33 +00:00