Commit Graph

119678 Commits

Author SHA1 Message Date
Ruslan Ermilov
e4a93f1ef8 Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
Bruce Evans
c01611e437 As for __kernel_cosf() and __kernel_sinf(), use a fairly optimal minimax
polynomial for __kernel_tanf().  The old one was the double-precision
polynomial with coefficients truncated to float.  Truncation is not
a good way to convert minimax polynomials to lower precision.  Optimize
for efficiency and use the lowest-degree polynomial that gives a
relative error of less than 1 ulp.  It has degree 13 instead of 27,
and happens to be 2.5 times more accurate (in infinite precision) than
the old polynomial (the maximum error is 0.017 ulps instead of 0.041
ulps).

Unlike for cosf and sinf, the old accuracy was close to being inadequate
-- the polynomial for double precision has a max error of 0.014 ulps
and nearly this small an error is needed.  The new accuracy is also a
bit small, but exhaustive checking shows that even the old accuracy
was enough.  The increased accuracy reduces the maximum relative error
in the final result on amd64 -O1 from 0.9588 ulps to 0.9044 ulps.
2005-11-10 17:43:49 +00:00
Robert Watson
a0ec558af0 Correct a number of serious and closely related bugs in the UNIX domain
socket file descriptor garbage collection code, which is intended to
detect and clear cycles of orphaned file descriptors that are "in-flight"
in a socket when that socket is closed before they are received.  The
algorithm present was both run at poor times (resulting in recursion and
reentrance), and also buggy in the presence of parallelism.  In order to
fix these problems, make the following changes:

- When there are in-flight sockets and a UNIX domain socket is destroyed,
  asynchronously schedule the garbage collector, rather than running it
  synchronously in the current context.  This avoids lock order issues
  when the garbage collection code reenters the UNIX domain socket code,
  avoiding lock order reversals, deadlocks, etc.  Run the code
  asynchronously in a task queue.

- In the garbage collector, when skipping file descriptors that have
  entered a closing state (i.e., have f_count == 0), re-test the FDEFER
  flag, and decrement unp_defer.  As file descriptors can now transition
  to a closed state, while the garbage collector is running, it is no
  longer the case that unp_defer will remain an accurate count of
  deferred sockets in the mark portion of the GC algorithm.  Otherwise,
  the garbage collector will loop waiting waiting for unp_defer to reach
  zero, which it will never do as it is skipping file descriptors that
  were marked in an earlier pass, but now closed.

- Acquire the UNIX domain socket subsystem lock in unp_discard() when
  modifying the unp_rights counter, or a read/write race is risked with
  other threads also manipulating the counter.

While here:

- Remove #if 0'd code regarding acquiring the socket buffer sleep lock in
  the garbage collector, this is not required as we are able to use the
  socket buffer receive lock to protect scanning the receive buffer for
  in-flight file descriptors on the socket buffer.

- Annotate that the description of the garbage collector implementation
  is increasingly inaccurate and needs to be updated.

- Add counters of the number of deferred garbage collections and recycled
  file descriptors.  This will be removed and is here temporarily for
  debugging purposes.

With these changes in place, the unp_passfd regression test now appears
to be passed consistently on UP and SMP systems for extended runs,
whereas before it hung quickly or panicked, depending on which bug was
triggered.

Reported by:	Philip Kizer <pckizer at nostrum dot com>
MFC after:	2 weeks
2005-11-10 16:06:04 +00:00
Tim Kientzle
4a483830a2 Use .Nx macro for NetBSD.
Thanks to: Ruslan Ermilov
2005-11-10 15:42:51 +00:00
Maxime Henrion
86e79d090b Mention the non-standardness of the -I option in ls(1).
Spotted by:	ru
MFC after:	3 days
2005-11-10 14:26:50 +00:00
Robert Watson
742be7821c Add the f_msgcount field to the set of struct file fields printed in show
files.

MFC after:	1 week
2005-11-10 13:26:29 +00:00
Hartmut Brandt
c6adb7badd s/Three file/Three files/
Submitted by:	ru
2005-11-10 13:12:06 +00:00
Hartmut Brandt
da41a1d420 Remove hard sentence breaks. Correct the width calculation for the list
indent.

Submitted by:	ru
2005-11-10 12:08:17 +00:00
Hartmut Brandt
af1fee9b7c Don't include bsd.init.mk so early - it's just not needed here.
Use . instead of ${.OBJDIR}.
Move DEFSDIR and BMIBSDIR under the resp. .if clauses so that they
get defined only if DEFS and BMIBS are defined.

Submitted by:	ru
2005-11-10 12:07:12 +00:00
Gleb Smirnoff
7f7364b113 Give a try to autoconfiguring the number of transmit and receive
descriptors depending on chip revision.
2005-11-10 11:44:37 +00:00
Robert Watson
2be165c93e Expanet of details printed for each file descriptor to include it's
garbage collection flags.  Reformat generally to make this fit and
leave some room for future expansion.

MFC after:	1 week
2005-11-10 11:35:59 +00:00
Gleb Smirnoff
1a5d3a92f2 - Document last change to ARP behavior.
- Document several undocumented sysctl variables.
- Fix spelling of few diagnostics.
2005-11-10 11:35:53 +00:00
Robert Watson
b4e507aafa Add a DDB "show files" command to list the current open file list, some
state about each open file, and identify the first process in the process
table that references the file.  This is helpful in debugging leaks of
file descriptors.

MFC after:	1 week
2005-11-10 10:42:50 +00:00
Ralf S. Engelschall
b89ad281dc Backout r1.11...
> >   There is no need to explicitly add "status" to $extra_commands in
> >   the /etc/rc.d/pf script as it is implicitly added by /etc/rc.subr's
> >   run_rc_command() because of the existing $pf_program.
> >
> >   Submitted by:   Christoph Schug <chris@schug.net>

...because as yar@ points out: "[...] you were relying on evil
side-effects of the variable being named *_program. hose side-effect
have been eliminated since rc.subr rev. 1.42. [...] The point is that
the default "status" method is for rc.d scripts that handle startup and
shutdown of conventional daemons, and not for custom tasks like the pf
case."

The change is still valid in RELENG_6 (and still doesn't have to be
backed out) as long as rc.subr:r1.42 is not MFC'ed to RELENG_6, too.
2005-11-10 10:40:15 +00:00
Søren Schmidt
527332a9d3 add set/read max address 48bit versions 2005-11-10 10:29:04 +00:00
Hartmut Brandt
b89b4d4d9a Use the new bsd.snmpmod.mk makefile to build the modules. The -I pointers
into the contrib directory are still necessary for some of the Makefiles,
because the C-sources there use non-canonical includes ("" includes) to get
at the header files.
2005-11-10 10:14:57 +00:00
Hartmut Brandt
1fea9479b2 Use the canonical include name for snmpmod.h. The build infrastructure takes
already care to pick up the correct version of the file depending on how
we build.
2005-11-10 10:12:01 +00:00
Hartmut Brandt
59ee90cb1a This is a short man page which describes bsd.snmpmod.mk. It documents
only the features that this file layers on top of bsd.lib.mk and should
therefore cross-reference to bsd.lib.mk, which doesn't exist.
2005-11-10 10:09:42 +00:00
Hartmut Brandt
3c2659d809 Add a .mk file for building modules for the SNMP daemon. This may be
use in-tree as well as for 3rd party modules. This file is more or less
what was in usr.sbin/bsnmpd/modules/Makefile.inc with some modifications
and omissions. Usage examples can be found under usr.sbin/bsnmpd/modules/*.

Idea by:	phk
2005-11-10 10:03:22 +00:00
Tim Kientzle
2d8e1893d4 Credit NetBSD as the source for the /rescue concept.
While I'm here, update my own email address.

Thanks to: Luke Mewburn for pointing out the oversight.
2005-11-10 06:36:06 +00:00
David Xu
832703a4f3 Since union wait was removed in revision 1.17 (3 years, 5 months ago),
type casting version of macro _W_INT is no longer needed.

Discussed with: yongari
2005-11-10 05:00:20 +00:00
Bill Paul
e73e17729b Implement RtlZeroMemory() and RtlCopyMemory(). This seems to allow
the Broadcom Win64 wireless driver for the BCM4318 to work on amd64.
2005-11-10 02:22:55 +00:00
Maxime Henrion
7b7d153b21 Add a -I option to disable the automatic -A flag for the super-user.
PR:		bin/86710
Submitted by:	Marcus Alves Grando
MFC after:	3 days
2005-11-10 00:02:32 +00:00
Christian Brueffer
6fe8148234 em(4) works on all archs now, so this can be removed. 2005-11-09 22:05:41 +00:00
Doug White
16e35dcc39 This is a workaround for a complicated issue involving VFS cookies and devfs.
The PR and patch have the details. The ultimate fix requires architectural
changes and clarifications to the VFS API, but this will prevent the system
from panicking when someone does "ls /dev" while running in a shell under the
linuxulator.

This issue affects HEAD and RELENG_6 only.

PR:		88249
Submitted by:	"Devon H. O'Dell" <dodell@ixsystems.com>
MFC after:	3 days
2005-11-09 22:03:50 +00:00
Robert Watson
f8a9ed1fa7 Fix typo in recent comment tweak.
Submitted by:	jkim
MFC after:	1 week
2005-11-09 22:02:02 +00:00
Robert Watson
794bf8edc7 Add unix_passfd, a simple set of regression tests for UNIX domain socket
file descriptor passing.  These tests are not all currently passed.
2005-11-09 21:41:20 +00:00
Robert Watson
923633b4b5 In closef(), remove the assumption that there is a thread associated
with the file descriptor.  When a file descriptor is closed as a result
of garbage collecting a UNIX domain socket, the file descriptor will
not have any associated thread, so the logic to identify advisory locks
held by that thread is not appropriate.  Check the thread for NULL to
avoid this scenario.  Expand an existing comment to say a bit more about
this.

MFC after:	1 week
2005-11-09 20:54:25 +00:00
Jean-Yves Lefort
73c0fce2e1 Unbreak second joystick (joy1) support.
PR:		kern/46734
Submitted by:	Richard Airlie <richard@darq.net>
Approved by:	netchild
2005-11-09 20:26:00 +00:00
Warner Losh
5d56add2ba General consensus is that it would be even better to run this in a
thread context.  While it doesn't matter too much at the moment, in
the future we could be back in the same boat if/when more restrictions
are placed (or enforced) in a SWI.

Suggested by: njl, bde, jhb, scottl
2005-11-09 16:22:56 +00:00
Gleb Smirnoff
7d62e533fb - Introduce two more stat counters, counting number of RX
overruns and number of watchdog timeouts.
- Do not log(9) RX overrun events, since this pessimizes
  things under load [1].
- Do not increase if->if_oerrors in em_watchdog(), since
  this leads to counter slipping back, when if->if_oerrors
  is recalculated in em_update_stats_counters(). Instead
  increase watchdog counter in em_watchdog() and take it
  into account in em_update_stats_counters().

Submitted by:	ade [1]
2005-11-09 15:23:54 +00:00
John Baldwin
26b7bd707c Use intptr_t casts to convert void * <--> int to make 64-bit archs happy. 2005-11-09 15:15:59 +00:00
Ruslan Ermilov
b5f6749117 Align output. 2005-11-09 15:12:57 +00:00
Ruslan Ermilov
5240dcdb07 Make IFP2NG() usable as an lvalue. 2005-11-09 13:34:43 +00:00
Ruslan Ermilov
303989a2f3 Use sparse initializers for "struct domain" and "struct protosw",
so they are easier to follow for the human being.
2005-11-09 13:29:16 +00:00
Yoshihiro Takahashi
643d537fcd MFi386: Remove obsolete options. 2005-11-09 12:26:37 +00:00
Yoshihiro Takahashi
1ba0023e33 Fix pc98 build. 2005-11-09 12:22:26 +00:00
Peter Grehan
c0c35fd489 No longer needed: replaced by mmu_if.m/pmap_dispatch.c/mmu_oea.c 2005-11-09 10:28:51 +00:00
Pav Lucistnik
ca965aa706 Add new ports-net-im collection. 2005-11-09 10:16:26 +00:00
Peter Grehan
cc18cfc704 Apply r1.103 to correct place.
pmap.c on PowerPC is now a combo of mmu_if.m, pmap_dispatch.c
and mmu_oea.c

(I forgot to delete pmap.c from CVS in last jumbo commit)
2005-11-09 09:54:33 +00:00
Pyun YongHyeon
15757a936d Uncomment em(4) as it's now working. 2005-11-09 08:49:46 +00:00
Pyun YongHyeon
8baab09e5e Connect em(4) build on sparc64. 2005-11-09 08:46:02 +00:00
Pyun YongHyeon
94e3c643cd Make em(4) work on big-endian architectures.
- disable jumbo frame support on strict alignment architectures due
   to the limitation of hardware. The driver needs a fix-up code for
   RX side. The fix will show up in near future.
 - fix endian issue for 82544 on PCI-X bus. I couldn't test this as
   I don't have the NIC/hardware.
 - prefer PCIR_BAR to hardcoded EM_MMBA.
 - Properly checks for for 64bit BAR [1]
 - replace inl/outl with bus_space(9) [1]
 - fix endian issue on VLAN handling.
 - reorder header files and remove unnecessary one.

Reviewed by:	cognet
No response from:	pdeuskar, tackerman
Obtained from:	OpenBSD [1]
2005-11-09 08:43:18 +00:00
Alan Cox
7a35a21e7b Reimplement the reclamation of PV entries. Specifically, perform
reclamation synchronously from get_pv_entry() instead of
asynchronously as part of the page daemon.  Additionally, limit the
reclamation to inactive pages unless allocation from the PV entry zone
or reclamation from the inactive queue fails.  Previously, reclamation
destroyed mappings to both inactive and active pages.  get_pv_entry()
still, however, wakes up the page daemon when reclamation occurs.  The
reason being that the page daemon may move some pages from the active
queue to the inactive queue, making some new pages available to future
reclamations.

Print the "reclaiming PV entries" message at most once per minute, but
don't stop printing it after the fifth time.  This way, we do not give
the impression that the problem has gone away.

Reviewed by: tegge
2005-11-09 08:19:21 +00:00
David Xu
f4d8522334 WIFxxx macros requires an int type but p_xstat is short, convert it
to int before using the macros.

Bug reported by : Pyun YongHyeon pyunyh at gmail dot com
2005-11-09 07:58:16 +00:00
Warner Losh
161604d863 Kick off the suspend sequence from the keyboard in a SWI rather than
in the hardware interrupt context (even if it is likely just an
ithread).  We don't document that suspend/resume routines are run from
such a context and some of the things that happen in those routines
aren't interrupt safe.  Since there's no real need to run from that
context, this restores assumptions that suspend routines have made.

This fixes Thierry Herbelot's 'Trying to sleep while sleeping is
prohibited' problem.
2005-11-09 07:32:01 +00:00
Warner Losh
2002eaadb7 Clarify panic message, I parsed the old one 'trying to sleep while sleeping' 2005-11-09 07:28:52 +00:00
Warner Losh
43ce714039 Remove obsolete options 2005-11-09 04:30:55 +00:00
Warner Losh
51ef421d92 Add support for XBOX to the FreeBSD port. The xbox architecture is
nearly identical to wintel/ia32, with a couple of tweaks.  Since it is
so similar to ia32, it is optionally added to a i386 kernel.  This
port is preliminary, but seems to work well.  Further improvements
will improve the interaction with syscons(4), port Linux nforce driver
and future versions of the xbox.

This supports the 64MB and 128MB boxes.  You'll need the most recent
CVS version of Cromwell (the Linux BIOS for the XBOX) to boot.

Rink will be maintaining this port, and is interested in feedback.
He's setup a website http://xbox-bsd.nl to report the latest
developments.

Any silly mistakes are my fault.

Submitted by: Rink P.W. Springer rink at stack dot nl and
	Ed Schouten ed at fxq dot nl
2005-11-09 03:55:40 +00:00
Warner Losh
24ea970aff Improve diagnostic message. 2005-11-09 03:37:52 +00:00