Commit Graph

87428 Commits

Author SHA1 Message Date
das
f9ef9acefc Local patches:
- include extra system headers and add appropriate #defines
- use a spinlock to synchronize parts of gdtoa
- protect exported symbols with leading underscores

Reviewed by:	bde (briefly), mike (mentor), obrien
2003-03-12 20:20:22 +00:00
das
527307c752 This commit was generated by cvs2svn to compensate for changes in r112158,
which included commits to RCS files with non-trunk default branches.
2003-03-12 20:18:32 +00:00
das
db3a0f1435 Initial import of David Gay's gdtoa library for conversion between
strings and floating point.
2003-03-12 20:18:32 +00:00
jhb
0be30c484d - Various little style fixes.
- If SYSCTL_OUT() fails in sysctl_kern_proc_args(), return the error
  instead of ignoring it if we have new arguments for the process.
- If the new arguments for a process are too long, return ENOMEM instead of
  returning success but not doing the actual copy.

Submitted by:	bde
2003-03-12 20:17:40 +00:00
mtm
0dd1dbbc69 Ditch a static global and the mutex that protected it. Achieve the
desired strptime(3) reentrancy by adding an extra argument to _strptime()
instead.

Approved by:	markm (mentor)
MFC:		4 weeks
2003-03-12 19:22:57 +00:00
sobomax
d0852f7c93 Correct clock frequency for the IC Book Labs' cards, so that it's possible
to use speeds higher than 115200.

Sponsored by:	IC Book Labs
MFC after:	2 weeks
2003-03-12 17:56:03 +00:00
sobomax
673e556649 Add initial support for IC Book Labs Dreadnought x16 Pro 16-ports card. Since
this card is based on 16750 UART, modify sio(4) a bit to ignore 16750-specific
7th bit of MCR when probing card. This allows card to be detected and attached
as 16550A-compatible device. More work needs to be done in order to enable
nice 16750-specific features such as larger fifo buffer and higher speeds.

Sponsored by:	IC Book Labs
MFC after:	2 weeks
2003-03-12 17:20:24 +00:00
glewis
5d58a25622 Happy birthday to me :) 2003-03-12 16:59:30 +00:00
jhb
c615a78847 - Avoid dropping the proc lock around a simple permissions check and just
hold hold it across the check to avoid extra lock operations in the
  common case.
- Copy in the new args to a temporary pargs structure before we drop the
  reference to the old one.  Thus, if the copyin() fails, the process
  arguments are unchanged rather than being deleted.  Also, p_args is no
  longer NULL during the sysctl operation.
2003-03-12 16:14:55 +00:00
sos
f481f8fd98 Correct the last commit, only look for subfunctions on the same PCI slot. 2003-03-12 15:45:52 +00:00
orion
621cc343ad Correct CS4205 base vendor id.
Reported by:    Christophe Juniet and Mark Santcroos.
2003-03-12 15:11:25 +00:00
sam
cc02a7a61a correct two more flag misuses; m_tag* use malloc flags 2003-03-12 14:45:22 +00:00
ru
3716349b12 Update for FILE v3.41. 2003-03-12 14:37:01 +00:00
ru
bbd0f8e149 Simplify the assignment statement. 2003-03-12 14:32:46 +00:00
ru
a16b997a13 Record the sudden death of bsd.kern.mk and bsd.sgml.mk. 2003-03-12 14:31:36 +00:00
ru
908ba1df7f Record the BOG death here too. 2003-03-12 14:29:15 +00:00
dwmalone
c3d851cf20 Document the fact that hdestory calls free on the keys added with
hsearch(.., ENTER). Make the example reflect this.

PR:		49951
Submitted by:	Peter Jeremy <peterjeremy@optushome.com.au>
2003-03-12 14:18:14 +00:00
sos
0d86fbf68f Cleanup the probe code a bit. 2003-03-12 12:05:17 +00:00
tjr
f6c37686d2 Acquire sched_lock around use of FOREACH_KSEGRP_IN_PROC, accesses
to kg_nice and calls to sched_nice() in getpriority() and setpriority()
(really donice()).
2003-03-12 11:24:41 +00:00
tjr
6d0f5cbd9d In wait1(), remove the zombie process from zombproc before removing
it from its pgrp to avoid leaving zombies around with p_pgrp == NULL.
This bug was apparent as a NULL-dereference in the pid selection code
in fork1().
2003-03-12 11:10:04 +00:00
sos
2e48131eba Dont hang the channel on enclosures without sensors. 2003-03-12 10:59:35 +00:00
simokawa
378556d191 Put back including sys/devicestat.h for 4-stable. 2003-03-12 10:36:53 +00:00
kjc
fcc492f39d clean up the en driver since it will survice for a while by
Harti Brandt's effort.
remove the DMA test to detect problems of the first generation PCI chipsets
back in 1998.
it is no longer needed and has been the source of the false alarm that
the driver uses too much stack space.
2003-03-12 10:28:26 +00:00
seanc
4a339ff097 Update sendfile.2 to include a TUNING section that documents the
various tunables that are applicable to sendfile(2).  Update tuning.7
to mention a reference to sendfile.2.

Approved by:	keramida
2003-03-12 09:28:44 +00:00
jake
b63fe6bd15 - Added support for multiple page directory pages to pmap_pinit and
pmap_release.
- Merged pmap_release and pmap_release_free_page.  When pmap_release is
  called only the page directory page(s) can be left in the pmap pte object,
  since all page table pages will have been freed by pmap_remove_pages and
  pmap_remove.  In addition, there can only be one reference to the pmap and
  the page directory is wired, so the page(s) can never be busy.  So all there
  is to do is clear the magic mappings from the page directory and free the
  page(s).

Sponsored by:	DARPA, Network Associates Laboratories
2003-03-12 07:38:37 +00:00
tjr
f0e3a5f903 MFp4: Reduce code size by 26 bytes by only aligning the jump targets that
are at the top of loops.
2003-03-12 06:46:16 +00:00
tjr
0910468bea MFp4: Make `spanp' const. 2003-03-12 06:41:49 +00:00
sam
f0dd13fac1 correct malloc flag argument
Reported by:	Kris Kennaway <kris@obsecurity.org>
2003-03-12 06:08:48 +00:00
tjr
f752dd6ad2 MFp4: Pentium/Athlon-optimised implementation of wmemchr(). 2003-03-12 03:55:01 +00:00
kan
bc7c3815c9 Do not depend on namespace pollution, explicitly include sys/sx.h 2003-03-12 02:55:20 +00:00
sam
41acea6341 fix module building; drivers now require opt_{ubsec,hifn}.h 2003-03-11 23:20:43 +00:00
sam
14bd172b6f FIPS 140-2 rng data tester for h/w crypto devices. This driver periodically
monitors the entropy data harvested by crypto drivers to verify it complies
with FIPS 140-2.  If data fails any test then the driver discards it and
commences continuous testing of harvested data until it is deemed ok.
Results are collected in a statistics block and, optionally, reported on
the console.  In normal use the overhead associated with this driver is
not noticeable.

Note that drivers must (currently) be compiled specially to enable use.

Obtained from:	original code by Jason L. Wright
2003-03-11 22:54:44 +00:00
sam
2a882b1ef6 o add crypto driver glue for using the new rndtest driver/module; this is
conditional in each driver on foo_RNDTEST being defined_
o bring HIFN_DEBUG and UBSEC_DEBUG out to be visible options; they control
  the debugging printfs that are set with hw.foo.debug (e.g. hw.hifn.debug)
2003-03-11 22:47:06 +00:00
jhb
e6533f6bf4 Trim an extra blank line that snuck into the last commit. 2003-03-11 22:33:42 +00:00
sam
d57040d400 gack; revert previous commit; not only did I read things backward but
I was in the wrong tree
2003-03-11 22:23:19 +00:00
sam
6373628fe3 sync with current: reduce default maxbatch setting from 5 to 1
Reviewed by:	re (sort of, consider this part of my previous request)
2003-03-11 22:20:43 +00:00
kan
611c074961 Rename vfs_stdsync function to vfs_stdnosync which matches more
closely what function is really doing. Update all existing consumers
to use the new name.

Introduce a new vfs_stdsync function, which iterates over mount
point's vnodes and call FSYNC on each one of them in turn.

Make nwfs and smbfs use this new function instead of rolling their
own identical sync implementations.

Reviewed by:	jeff
2003-03-11 22:15:10 +00:00
jhb
96151e4e11 - Change witness_displaydescendants() to accept the indentation level as
a parameter instead of using the level of a given witness.  When
  recursing, pass an indent level of indent + 1.
- Make use of the information witness_levelall() provides in
  witness_display_list() to use an O(n) algorithm instead of an O(n^2)
  algo to decide which witnesses to display hierarchies from.  Basically,
  we only display a hierarchy for witnesses with a level of 0.
- Add a new per-witness flag that is reset at the start of
  witness_display() for all witness's and is set the first time a witness
  is displayed in witness_displaydescendants().  If a witness is
  encountered more than once in the lock order tree (which happens often),
  witness_displaydescendants() marks the later occurrences with the string
  "(already displayed)" and doesn't display the subtree under that
  witness.  This avoids duplicating large amounts of the lock order tree
  in the 'show witness' output in DDB.

All these changes serve to make 'show witness' a lot more readable and
useful than it was previously.
2003-03-11 22:14:21 +00:00
jhb
dca0c36d6f - Split the itismychild() function into two functions: insertchild()
adds a witness to the child list of a parent witness.  rebalancetree()
  runs through the entire tree removing direct descendants of witnesses
  who already have said child witness as an indirect descendant through
  another direct descendant.  itismychild() now calls insertchild()
  followed by rebalancetree() and no longer needs the evil hack of
  having static recursed variable.
- Add a function reparentchildren() that adds all the direct descendants
  of one witness as direct descendants of another witness.
- Change the return value of itismychild() and similar functions so that
  they return 0 in the case of failure due to lack of resources instead
  of 1.  This makes the return value more intuitive.
- Check the return value of itismychild() when defining the static lock
  order in witness_initialize().
- Don't try to setup a lock instance in witness_lock() if itismychild()
  fails.  Witness is hosed anyways so no need to do any more witness
  related activity at that point.  It also makes the code flow easier to
  understand.
- Add a new depart() function as the opposite of enroll().  When the
  reference count of a witness drops to 0 in witness_destroy(), this
  function is called on that witness.  First, it runs through the
  lock order tree using reparentchildren() to reparent direct descendants
  of the departing witness to each of the witness' parents in the tree.
  Next, it releases it's own child list and other associated resources.
  Finally it calls rebalanacetree() to rebalance the lock order tree.
- Sort function prototypes into something closer to alphabetical order.

As a result of these changes, there should no longer be 'dead' witnesses
in the order tree, and repeatedly loading and unloading a module should no
longer exhaust witness of its internal resources.

Inspired by:	gallatin
2003-03-11 22:07:35 +00:00
jhb
55683db41e Trim useless "../" leading strings from filenames passed into witness. 2003-03-11 21:53:12 +00:00
jhb
b658f5a0e5 Adjust style of #ifdef's and #endif's to be more consistent and in line
with recent additions to style(9).
2003-03-11 21:38:49 +00:00
des
251472ad11 Use floating point arithmetic to compute the ETA to avoid integer overflow
during slow transfers of large files.
2003-03-11 21:33:43 +00:00
jhb
c81d102698 Do the lock order check skip for the LOP_TRYLOCK case after the check for
recursing on a lock instead of before.  This fixes a bug where WITNESS
could get a little confused if you did an sx_tryslock() on a sx lock that
you already had an slock on.  WITNESS would still function correctly but
it could result in weirdness in the output of 'show locks'.  This also
makes it possible for mtx_trylock() to recurse on a lock.
2003-03-11 20:54:37 +00:00
jhb
f8c33ceb02 Rework the eventhandler locking for hopefully the last time. The scheme
used popped into my head during my morning commute a few weeks ago, but
it is also very similar (though a bit simpler) to a patch that mini@
developed a while ago.  Basically, each eventhandler list has a mutex and
a run count.  During an eventhandler invocation, the mutex is held while
we traverse the list but is dropped while we execute actual handlers.  Also,
a runcount counter is incremented at the start of an invocation and
decremented at the end of an invocation.  Adding to the list is not a big
deal since the reference of a thread currently executing the handlers
remains valid across an add operation.  Whether or not new handlers are
executed by threads currently executing the handlers for a given list is
indeterminate however.  The harder case is when a handler is removed from
the list.  If the runcount is zero, the handler is simply removed from the
list directly.  If the runcount is not zero, then another thread is
currently executing the handlers of this list, so the priority of this
handler is set to a magic value (currently -1) to mark it as dead.  Dead
handlers are not executed during an invocation.  If the runcount is zero
after it is decremented at the end of an invocation, then a new
eventhandler_prune_list() function is called to remove dead handlers from
the list.

Additional minor notes:
- All the common parts of EVENTHANDLER_INVOKE() and
  EVENTHANDLER_FAST_INVOKE() have been merged into a common
  _EVENTHANDLER_INVOKE() macro to reduce duplication and ease maintenance.
- KTR logging for eventhandlers is now available via the KTR_EVH mask.
- The global eventhander_mutex is no longer recursive.

Tested by:	scottl (SMP i386)
2003-03-11 20:17:00 +00:00
ru
2a056a3619 Fix and sync SYNOPSIS and usage().
Prodded by:	bde
2003-03-11 20:12:39 +00:00
jhb
92bb2c3db1 Retire the KTR_LOCKMGR bit and use it to log eventhandler messages
instead as KTR_EVH.
2003-03-11 20:07:22 +00:00
jhb
02cb185ca4 Axe the useless MTX_SLEEPABLE flag. mutexes are not sleepable locks.
Nothing used this flag and WITNESS would have panic'd during mtx_init()
if anything had.
2003-03-11 20:02:57 +00:00
jhb
d8ce0bfe99 Use a shorter and less redundant name for the sysctl tree lock. 2003-03-11 20:01:51 +00:00
jhb
a2e236cc46 Use the KTR_LOCK mask for logging events via KTR in lockmgr() rather
than KTR_LOCKMGR.  lockmgr locks are locks just like other locks.
2003-03-11 20:00:37 +00:00
jhb
015a14e080 Trim leading "../" sequences from filenames. 2003-03-11 19:56:16 +00:00