Commit Graph

120235 Commits

Author SHA1 Message Date
Ruslan Ermilov
fc37aef9c0 Fix type of argument. 2005-12-03 09:00:43 +00:00
Bruce Evans
1186054263 Restored removal of the special handling needed for a result of +-0.
It was lost in rev.1.9.  The log message for rev.1.9 says that the
special case of +-0 is handled twice, but it was only handled once,
so it became unhandled, and this happened to break half of the cases
that return +-0:
- round-towards-minus-infinity:  0   <  x < 1:  result was -0 not  0
- round-to-nearest:             -0.5 <= x < 0:  result was  0 not -0
- round-towards-plus-infinity:  -1   <  x < 0:  result was  0 not -0
- round-towards-zero:           -1   <  x < 0:  result was  0 not -0
2005-12-03 09:00:29 +00:00
Ruslan Ermilov
61df86c1ed Break hard sentence break. 2005-12-03 08:52:07 +00:00
Doug Barton
a0cdeaec14 Add an entry explaining the changes which add local scripts
to the base rcorder.
2005-12-03 07:51:07 +00:00
Bruce Evans
3fc5a433e9 Simplified the fix in rev.1.3. Instead of using long double for
TWO52[sx] to trick gcc into correctly converting TWO52[sx]+x to double
on assignment to "double w", force a correct assignment by assigning
to *(double *)&w.  This is cleaner and avoids the double rounding
problem on machines that evaluate double expressions in double
precision.  It is not necessary to convert w-TWO52[sx] to double
precision on return as implied in the comment in rev.1.3, since
the difference is exact.
2005-12-03 07:38:35 +00:00
Bruce Evans
7441377544 Fixed rint(x) in the following cases:
(1) In round-to-nearest mode, on all machines, fdlibm rint() never
    worked for |x| = n+0.75 where n is an even integer between 262144
    and 524286 inclusive (2*131072 cases).  To avoid double rounding
    on some machines, we begin by adjusting x to a value with the 0.25
    bit not set, essentially by moving the 0.25 bit to a lower bit
    where it works well enough as a guard, but we botched the adjustment
    when log2(|x|) == 18 (2*2**52 cases) and ended up just clearing
    the 0.25 bit then.  Most subcases still worked accidentally since
    another lower bit serves as a guard.  The case of odd n worked
    accidentally because the rounding goes the right way then.  However,
    for even n, after mangling n+0.75 to 0.5, rounding gives n but the
    correct result is n+1.
(2) In round-towards-minus-infinity mode, on all machines, fdlibm rint()
    never for x = n+0.25 where n is any integer between -524287 and
    -262144 inclusive (262144 cases).  In these cases, after mangling
    n+0.25 to n, rounding gives n but the correct result is n-1.
(3) In round-towards-plus-infinity mode, on all machines, fdlibm rint()
    never for x = n+0.25 where n is any integer between 262144 and
    524287 inclusive (262144 cases).  In these cases, after mangling
    n+0.25 to n, rounding gives n but the correct result is n+1.

A variant of this bug was fixed for the float case in rev.1.9 of s_rintf.c,
but the analysis there is incomplete (it only mentions (1)) and the fix
is buggy.

Example of the problem with double rounding: rint(1.375) on a machine
which evaluates double expressions with just 1 bit of extra precision
and is in round-to-nearest mode.  We evaluate the result using
(double)(2**52 + 1.375) - 2**52.  Evaluating 2**52 + 1.375 in (53+1) bit
prcision gives 2**52 + 1.5 (first rounding).  (Second) rounding of this
to double gives 2**52 + 2.0.  Subtracting 2**52 from this gives 2.0 but
we want 1.0.  Evaluating 2**52 + 1.375 in double precision would have
given the desired intermediate result of 2**52 + 1.0.

The double rounding problem is relatively rare, so the botched adjustment
can be fixed for most machines by removing the entire adjustment.  This
would be a wrong fix (using it is 1 of the bugs in rev.1.9 of s_rintf.c)
since fdlibm is supposed to be generic, but it works in the following cases:
- on all machines that evaluate double expressions in double precision,
  provided either long double has the same precision as double (alpha,
  and i386's with precision forced to double) or my earlier fix to use
  a long double 2**52 is modified to avoid using long double precision.
- on all machines that evaluate double expressions in many more than 11
  bits of extra precision.  The 1 bit of extra precision in the example
  is the worst case.  With N bits of extra precision, it sufices to
  adjust the bit N bits below the 0.5 bit.  For N >= about 52 there is
  no such bit so the adjustment is both impossible and unnecessary.  The
  fix in rev.1.9 of s_rintf.c apparently depends on corresponding magic
  in float precision: on all supported machines N is either 0 or >= 24,
  so double rounding doesn't occur in practice.
- on all machines that don't use fdlibm rint*() (i386's).
So under FreeBSD, the double rounding problem only affects amd64 now, but
should only affect i386 in future (when double expressions are evaluated
in long double precision).
2005-12-03 07:23:30 +00:00
Doug Ambrisko
c26efd485e Switch BUILD_ARCH in Makefile to use uname -p suggested by ru.
Switch strncpy to strlcpy suggested by gad and issue found by pjd.
Add to uname(3) man page describing:
	UNAME_s
	UNAME_r
	UNAME_v
	UNAME_m
Add to getosreldate(3) man page describing:
	OSVERSION

Submitted by:	ru, pjd/gad
Reviewed by:	ru (man pages)
2005-12-03 05:11:07 +00:00
David Xu
8fcc657635 Remove implementation-defined, it has already been described in NOTES
section.
2005-12-03 02:49:04 +00:00
David Xu
ce45c6d3d7 Remove implementation-defined sentences. 2005-12-03 02:31:18 +00:00
Craig Rodrigues
748e259bc4 Simplify parsing of mount options by passing
"rw" option down to kernel, since vfs_donmount() can now parse it.
2005-12-03 01:57:58 +00:00
David Xu
0e263b06af Add option P1003_1B_MQUEUE. 2005-12-03 01:40:38 +00:00
David Xu
951ac754b9 Fix lots of markup and content bug.
Submitted by: ru
2005-12-03 01:34:41 +00:00
Brooks Davis
b09abb4b2c Don't bogusly depend on dhclient. It's now run either by
/etc/rc.d/netif or from devd rather than by the startup scripts.
2005-12-03 01:33:06 +00:00
Craig Rodrigues
ec528a3472 - Add "rw" mount option to global_opts.
- In vfs_donmount(), parse "ro", "noro", and "rw", in order to set or
  unset the MNT_RDONLY filesystem flag.
2005-12-03 01:26:27 +00:00
Eric Anholt
69b9fffc84 Merge DRM CVS as of 2005-12-02, adding i915 DRM support thanks to Alexey Popov,
and a new r300 PCI ID.
2005-12-03 01:23:50 +00:00
Eric Anholt
c703850cb4 Make cleaner diffs by munging the $FreeBSD$s from the FreeBSD CVS sources back
into the new sources.
2005-12-03 00:43:57 +00:00
Eric Anholt
8ec9a6c5a6 Add support for i915 GMCH AGP. This diff is a combination of work by myself
and some fixes from Motomichi Matsuzaki.  Testing involved many people, but the
final, successful testing was from rwatson who endured several rounds of "it
crashes at XYZ stage" "oh, please correct this typo and try again."  The Linux
driver, and to a small extent the limited specs, were both used as a reference
for how to program the chipset.

PR:		kern/80396
Submitted by:	Martin Mersberger
2005-12-02 23:51:36 +00:00
Peter Grehan
e2b03d4d48 Register definitions for the ancient via6522. This 20+ year-old chip
still exists as a cell in the Macio asic on Apples, and is used to communicate
through the shift register with the external PMU microcontroller.
2005-12-02 22:36:14 +00:00
Ruslan Ermilov
6affdd3055 "-o rw" is invalid and undocumented mount option that
is only present for fstab(5) compatibility, and is
otherwise ignored by mount(8) (not passed to mount_*
programs, and not passed to nmount(2)).

"-u -o rw" worked with an old mount(8) with mount_ufs.c
because "-o rw" was stripped and simple "-u" caused an
update of UFS from read-only to read-write, due to
inability of mount(2) to track changes in options
(MNT_RDONLY is either set or not).

"-u" no longer causes the transition from RO to RW,
now that mount(8) was converted to use nmount(2), so
an explicit change to RW is required.  Keep up with
this change, and use "-uw" to mount root read-write.
2005-12-02 21:33:43 +00:00
Doug Barton
97ec6eba65 Brooks pointed out a case where tmp needs to be run after
mountcritremote, so force it the other way instead.
2005-12-02 20:35:23 +00:00
Doug Barton
0f3ce2b32c Introduce startup scripts from the local_startup directories to
the base rcorder. This is accomplished by running rcorder twice,
first to get all the disks mounted (through mountcritremote),
then again to include the local_startup directories.

This dramatically changes the behavior of rc.d/localpkg, as
all "local" scripts that have the new rc.d semantics are now
run in the base rcorder, so only scripts that have not been
converted yet will run in rc.d/localpkg.

Make a similar change in rc.shutdown, and add some functions in
rc.subr to support these changes.

Bump __FreeBSD_version to reflect this change.
2005-12-02 20:06:07 +00:00
Doug Barton
0eeba503f6 Force this script to run before mountcritremote to avoid
non-deterministic behavior when introducing local_startup
scripts to rcorder.
2005-12-02 19:54:57 +00:00
Alan Cox
4e067a8592 Change pmap_enter_quick() to use the vm_prot_t parameter introduced in
revision 1.179 to correctly set/clear execute permission on the mapping
it creates.  Thus, mmap(2)ing a memory resident file will not result in
the file being mapped with execute permission when execute permission was
not requested.

Eliminate an unneeded Instruction Memory Barrier (IMB) in
pmap_enter_quick().  Since there was no previous (instruction) mapping
for the given virtual address prior to pmap_enter_quick(), there can be
no instructions from the given virtual address in the pipeline that need
flushing.

MFC after: 1 week
2005-12-02 18:02:54 +00:00
David Xu
5b40ce27b2 Add option P1003_1B_MQUEUE for POSIX message queue. 2005-12-02 14:23:39 +00:00
David Xu
5ee2d4ac5a 1. Cleanup including.
2. Set configuration value for CTL_P1003_1B_MESSAGE_PASSING.
2005-12-02 14:09:32 +00:00
David Xu
0e6a74358e syscall -> system call. 2005-12-02 13:50:56 +00:00
Bruce Evans
5792e54aa9 Fixed roundf(). The following cases never worked in FreeBSD:
- in round-towards-minus-infinity mode, on all machines, roundf(x) never
  worked for 0 < |x| < 0.5 (2*0x3effffff cases in all, or almost half of
  float space).  It was -0 for 0 < x < 0.5 and 0 for -0.5 < x < 0, but
  should be 0 and -0, respectively.  This is because t = ceilf(|x|) = 1
  for these args, and when we adjust t from 1 to 0 by subtracting 1, we
  get -0 in this rounding mode, but we want and expected to get 0.
- in round-towards-minus-infinity, round towards zero and round-to-nearest
  modes, on machines that evaluate float expressions in float precision
  (most machines except i386's), roundf(x) never worked for |x| =
  <float value immediately below 0.5> (2 cases in all).  It was +-1 but
  should have been +-0.  This is because t = ceilf(|x|) = 1 for these
  args, and when we try to classify |x| by subtracting it from 1 we
  get an unexpected rounding error -- the result is 0.5 after rounding
  to float in all 3 rounding modes, so we we have forgotten the
  difference between |x| and 0.5 and end up returning the same value
  as for +-0.5.

The fix is to use floorf() instead of ceilf() and to add 1 instead of
-1 in the adjustment.  With floorf() all the expressions used are
always evaluated exactly so there are no rounding problems, and with
adjustments of +1 we don't go near -0 when adjusting.

Attempted to fix round() and roundl() by cloning the fix for roundf().
This has only been tested for round(), only on args representable as
floats.  Double expressions are evaluated in double precision even on
i386's, so round(0.5-epsilon) was broken even on i386's.  roundl()
must be completely broken on i386's since long double precision is not
really supported.  There seem to be no other dependencies on the
precision.
2005-12-02 13:45:06 +00:00
John Baldwin
80f049d359 Add a missing newline to a printf.
MFC after:	1 week
2005-12-02 13:35:14 +00:00
Søren Schmidt
ddaf769709 Update the ICH7 support so it deals better with chips without AHCI.
Update Intel MatrixRAID support to be able to pick up RAID0+1 (RAID10)
and RAID5 arrays without panic'ing.
This has the side effect of now also supporting multiple volumes on
MatrixRAID's now I have the metadata better understood..

HW sponsored by:	Mullet Scandinavia AB
2005-12-02 10:13:53 +00:00
David Xu
4ea655e4bb Fix markup. 2005-12-02 09:04:35 +00:00
Eric Anholt
45160a070a Restore the enabling of debugging by default by the DRM_DEBUG kernel option.
It remains controlled by hw.dri.*.debug no matter what.

PR:		kern/85479
Submitted by:	Oliver Fromme <olli@secnetix.de>
2005-12-02 08:53:51 +00:00
Gleb Smirnoff
9d6457b44c On the 82571 and newer chipset the ICR register is meaningful only
if the E1000_ICR_INT_ASSERTED bit is set.

Submitted by:	Jack Vogel
2005-12-02 08:33:56 +00:00
David Xu
a6de716d7e 1. Check if message priority is less than MQ_PRIO_MAX.
2. Use getnanotime instead of getnanouptime.
3. Don't free message in _mqueue_send, mqueue_send will free it.
2005-12-02 08:23:49 +00:00
David Xu
06a7aa696e Define MQ_PRIO_MAX, it seems it is the only place
the definition will be shared by kernel and userland.
2005-12-02 07:45:28 +00:00
Doug Ambrisko
00bb0c6bdf Unbreak build when I fluff the clean-up of __FBSDID diff reduction
before commit.

pointyhat++
2005-12-02 04:55:05 +00:00
David Xu
4b609e4caa Remove mqueuefs from LINKS, it is no longer needed for nmount interface.
Noticed by: rodrigc
2005-12-02 04:25:54 +00:00
Craig Rodrigues
30cb180f7c Remove unsupported "dev" option from comments of mntopts.h.
Requested by:	jkoshy
2005-12-02 03:55:02 +00:00
David Xu
e94466c604 messqge queue has been implemented, set _POSIX_MESSAGE_PASSING to 200112L. 2005-12-02 02:52:17 +00:00
David Xu
ea8fe575cd barrier and spin_lock had already been implemented in libpthread and
libthr for a long time, set both _POSIX_BARRIERS and _POSIX_SPIN_LOCKS
to 200112L.
2005-12-02 02:36:13 +00:00
David Xu
780523024c We've already implemented all TMO functions, set _POSIX_TIMEOUTS to 200112L. 2005-12-02 02:33:28 +00:00
Marcel Moolenaar
8df1ebe9aa Fix the misalignment bugs differently than was done in the previous
commit. Copy the ethernet address into a local buffer, which we know
is sufficiently aligned for the width of the memory accesses that we
do. This also eliminates all suspicious and potentionally harmful
casts.

In collaboration with: ru
2005-12-02 01:23:20 +00:00
Doug Ambrisko
d630a05f40 Add support to easily build FreeBSD unpacked in a chroot of another
FreeBSD machine.  To do this add the man 1 uname changes to __xuname.c
so we can override the settings it reports.  Add OSVERSION override
to getosreldate.  Finally which Makefile.inc1 to use uname -m instead
of  sysctl -n hw.machine_arch to get the arch. type.

With these change you can put a complete FreeBSD OS image into a
chroot set:
	UNAME_s=FreeBSD
	UNAME_r=4.7-RELEASE
	UNAME_v="FreeBSD $UNAME_r #1: Fri Jul 22 20:32:52 PDT 2005 fake@fake:/usr/obj/usr/src/sys/FAKE"
	UNAME_m=i386
	UNAME_p=i386
	OSVERSION=470000
on an amd64 or i386 and it just work including building ports and using
pkg_add -r etc.  The caveat for this example is that these patches
have to be applied to FreeBSD 4.7 and the uname(1) changes need to
be merged.  This also addresses issue with libtool.

This is usefull for when a build machine has been trashed for an
old release and we want to do a build on a new machine that FreeBSD
4.7 won't run on ...
2005-12-02 00:50:30 +00:00
Maksim Yevmenkin
d19ff8f1d2 Add bluetooth.device.conf(5) man page
MFC after:	3 days
2005-12-02 00:17:33 +00:00
Colin Percival
6382a7be43 Make "missing dependency" errors more useful by indicating which port
is trying to depend upon the non-existent port.

Suggested by:	kris
MFC after:	3 days
2005-12-01 22:14:44 +00:00
Ruslan Ermilov
ee3e1c4c08 Sync usage() with SYNOPSIS. 2005-12-01 22:03:34 +00:00
Ruslan Ermilov
855b068a9a Add -q to usage(). 2005-12-01 21:59:24 +00:00
Ruslan Ermilov
1332b4bd91 Install the mqueue.h header. 2005-12-01 21:46:01 +00:00
Philip Paeps
0ed0acce8d Preserve /etc/sysctl.conf when doing a binary update. This prevents, for
instance, the dreaded shared memory problem in PostgreSQL coming back to
haunt you after a binary update.

PR:		89817
Submitted by:	edwin
MFC after:	2 days
2005-12-01 21:39:43 +00:00
Ruslan Ermilov
6a4cb6fd25 Fix the type of "eaddr" to guarantee the required alignment.
Suggested by:	marcel
2005-12-01 21:18:04 +00:00
John Baldwin
267b051a81 - Use .fn to markup untimeout in two places it was missing.
- Reword a confusing sentence.

PR:		docs/89810
Submitted by:	Marius Nuennerich marius dot nuennerich at gmx dot net
MFC after:	3 days
2005-12-01 19:16:35 +00:00