Sean Farley [Sun, 3 Aug 2008 22:47:23 +0000 (22:47 +0000)]
Restructure and use different variables in the tests that involve
environ[0] to be more obvious that environ is not NULL before environ[0]
is tested. Although I believe the previous code worked, this change
improves code maintainability.
ctime() expects a time_t, but qup->dqblk.dqb_btime is an int32_t, so for
big endian platforms where time_t is 64bits (ie armeb and sparc64), it will
be a problem.
Use a temporary time_t to work around this.
Submitted by: Matthew Luckie <mjl AT luckie DOT org dot nz>
MFC after: 3 days
Restored from previous backing out (because that is OpenBSD way, so
assumed to be reviewd by them):
Stir directly from the kernel PRNG, without taking less random pid & time
bytes too (when it is possible).
The difference with OpenBSD code is that they have KERN_ARND sysctl for
that task, while we need to read /dev/random
Robert Watson [Sun, 3 Aug 2008 15:44:56 +0000 (15:44 +0000)]
Remove broken code to replace st_mode value with ACCESSPERMS when
lstat(2) is called on symlinks -- this code appears never to have
worked. The PR this addresses suggests that the intended
original behavior is the right one, but as bde points out in the
PR comments, we do actually support storing a mode on symlinks,
so returning it seems reasonable.
This is consistent with Mac OS X, which despite documentation to
the contrary does return the mode set on a symlink, but not some
other platforms. The Single Unix Spec requires only that the
returned bits be "meaningful", which seems at best unhelpful as
advice goes.
Calling linker_load_dependencies() while holding the module'
vnode lock may cause a LOR between kld_sx lock and vnode lock.
linker_load_dependencies() drops kld_sx, and another thread may attempt
to load the same kld.
Ed Schouten [Sun, 3 Aug 2008 10:32:17 +0000 (10:32 +0000)]
Disconnect drivers that haven't been ported to MPSAFE TTY yet.
As clearly mentioned on the mailing lists, there is a list of drivers
that have not been ported to the MPSAFE TTY layer yet. Remove them from
the kernel configuration files. This means people can now still use
these drivers if they explicitly put them in their kernel configuration
file, which is good.
People should keep in mind that after August 10, these drivers will not
work anymore. Even though owners of the hardware are capable of getting
these drivers working again, I will see if I can at least get them to a
compilable state (if time permits).
Warner Losh [Sat, 2 Aug 2008 23:29:35 +0000 (23:29 +0000)]
Add entry for Prism-3 based Siemens SpeedStream card. It has
identical packaging and model numbers, but has had the Prism-II chips
replaced by Prism-3. The wi driver was just updated with the new
entry.
David Schultz [Sat, 2 Aug 2008 19:17:00 +0000 (19:17 +0000)]
A few minor corrections, including some from bde:
- When y/x is huge, it's faster and more accurate to return pi/2
instead of pi - pi/2.
- There's no need for 3 lines of bit fiddling to compute -z.
- Fix a comment.
Sam Leffler [Sat, 2 Aug 2008 17:51:38 +0000 (17:51 +0000)]
Try to fixup last (inadvertent) commit: firmware_drain was never added so
yank it's description; likewise for the FIRMWARE_WAIT flag to firmware_put.
For the record, the last commit was to cleanup various mistakes and correct
the example of embedding to reflect the npe firmware now being distributed
with the system.
Scott Long [Sat, 2 Aug 2008 13:04:26 +0000 (13:04 +0000)]
Correctly set the interrupt enable and disable bits. The previous
code interfered with Performant mode and legacy interrupts. Also
remove a register read operation on the Simplq code that was
effectively a time-wasting no-op.
Fix software single-stepping: we need to check if the instruction is a
return instruction as well, or we'll stop single-stepping as soon as we'll
return from a function.
Ed Schouten [Sat, 2 Aug 2008 08:01:56 +0000 (08:01 +0000)]
Make the at91 uart(4) driver compile again.
As of r178766 this driver didn't compile anymore, because it missed a
switch()-statement. I'm getting tired of seeing this driver being broken
for two months already. When I run `make universe', everything passes,
except the BWCT kernel configuration file.
Warner Losh [Sat, 2 Aug 2008 07:20:30 +0000 (07:20 +0000)]
ixp425 parts aren't multicore, so remove the SMP option. They also
don't support the ioapic either, so remove that option too. These
were commented out, but could never be enabled, unlike the other
options in the file that are commented out.
David Schultz [Sat, 2 Aug 2008 06:02:42 +0000 (06:02 +0000)]
Teach fmtcheck() about wint_t, intmax_t, char *, intmax_t *, and
wide string arguments.
Also simplify the code that handles length modifiers and make it
more conservative. For instance, be explicit about the modifiers
allowed for %d, rather than assuming that anything other than L,
q, t, or z implies an int argument.
David Schultz [Sat, 2 Aug 2008 06:02:02 +0000 (06:02 +0000)]
POSIX says that octal escapes have the format \ddd in the format string,
but \0ddd in a %b argument, with a length restriction of 3 octal digits
in either case. This seems silly, but it needs to be right so it's possible
to write an octal escape followed by an ordinary digit. Solaris printf(1)
and GNU printf(1) also behave this way.
Example: "printf '\0752'" now produces "=2" instead of garbage.
David Schultz [Sat, 2 Aug 2008 03:56:22 +0000 (03:56 +0000)]
On i386, gcc truncates long double constants to double precision
at compile time regardless of the dynamic precision, and there's
no way to disable this misfeature at compile time. Hence, it's
impossible to generate the appropriate tables of constants for the
long double inverse trig functions in a straightforward way on i386;
this change hacks around the problem by encoding the underlying bits
in the table.
Note that these functions won't pass the regression test on i386,
even with the FPU set to extended precision, because the regression
test is similarly damaged by gcc. However, the tests all pass when
compiled with a modified version of gcc.
Alan Cox [Sat, 2 Aug 2008 03:43:54 +0000 (03:43 +0000)]
Enhance pmap_mapdev_attr(). Take advantage of recent enhancements to
pmap_change_attr() in order to use the direct map for any cache mode, not
just write-back mode.
It is worth noting that this change also eliminates a situation in which we
have two mappings to the same physical memory with different cache modes.
Submitted by: Magesh Dhasayyan (with some changes by me)
Discussed with: jhb
Sean Farley [Sat, 2 Aug 2008 02:34:35 +0000 (02:34 +0000)]
Detect if the application has cleared the environ variable by setting
the first value (environ[0]) to NULL. This is in addition to the
current detection of environ being replaced, which includes being set to
NULL. Without this fix, the environment is not truly wiped, but appears
to be by getenv() until an *env() call is made to alter the enviroment.
This change is necessary to support those applications that use this
method for clearing environ such as Dovecot and Postfix. Applications
such as Sendmail and the base system's env replace environ (already
detected). While neither of these methods are defined by SUSv3, it is
best to support them due to historic reasons and in lieu of a clean,
defined method.
Add extra units tests for clearing environ using four different methods:
1. Set environ to NULL pointer.
2. Set environ[0] to NULL pointer.
3. Set environ to calloc()'d NULL-terminated array.
4. Set environ to static NULL-terminated array.
Colin Percival [Sat, 2 Aug 2008 00:09:41 +0000 (00:09 +0000)]
Add "IDS" command to freebsd-update. This was present in the original
version of freebsd-update, but I took it out when I rewrote everything
and added FreeBSD Update to the base system because I didn't think it
was useful. It turns out that quite a few people liked it and wanted
it back.
Requested by: Royce Williams + others
MFC after: 2 weeks
Julian Elischer [Fri, 1 Aug 2008 22:21:03 +0000 (22:21 +0000)]
The IPFW code accepts the use of the tablearg keyword along with the skipto
keyword. But it doesn't work. Two options.. make it no longer accept it,
or actually make it work.. I chose the 2nd..
Allow the tablearg to be used to specify a skipto destination.
This is actually a very powerful construct if used correctly, or a sink
of cpu cycles if used badly.
Antoine Brodin [Fri, 1 Aug 2008 22:13:39 +0000 (22:13 +0000)]
Make "1000baseT" the description and "1000baseTX" the alias for
IFM_1000_T instead of the reverse. It is possible FreeBSD doesn't
even support 1000baseTX.
This changes ifconfig(8) output.
Requested by: gavin@ and bms@
See also: http://docs.freebsd.org/cgi/mid.cgi?20050307191901.H32508
John Baldwin [Fri, 1 Aug 2008 21:52:41 +0000 (21:52 +0000)]
Tweak the support for using ldd on 32-bit objects a bit further.
Specifically, build a 32-bit /usr/bin/ldd32 on amd64 which handles 32-bit
objects. Since it is a 32-bit binary, it can fork a child process which
can dlopen() a 32-bit shared library. The current 32-bit support in ldd
can't do this because it does the dlopen() from a 64-bit process. In order
to preserve an intuitive interface for users, the ldd binary automatically
execs /usr/bin/ldd32 for 32-bit objects. The end result is that ldd on
amd64 now transparently handles 32-bit shared libraries in addition to
32-bit binaries.
Annotate why we do not call BPF_CHECK_DIRECTION() in this tapping routine.
There is no way for the caller to tell us which direction this packet is
going. With the bpf_mtap{2} routines, we can check the interface pointer.
John Baldwin [Fri, 1 Aug 2008 21:33:07 +0000 (21:33 +0000)]
Use the new bus device_shutdown hook for performing the shutdown action
on the ee16 parts rather than explicitly registering an event handler
that wasn't being torn down on detach.
John Baldwin [Fri, 1 Aug 2008 20:39:18 +0000 (20:39 +0000)]
- Use an sx lock to serialize writes since they update the checksum.
- Remove D_NEEDGIANT as the rtc drivers already have their own locks, so
this doesn't need Giant.
I have worked hard to reduce diffs against the vendor branch. One
notable change in that respect is that we no longer prefer DSA over
RSA - the reasons for doing so went away years ago. This may cause
some surprises, as ssh will warn about unknown host keys even for
hosts whose keys haven't changed.
These two files have no local patches except to prevent expansion of the
original $FreeBSD$ keywords. Revert those changes, and simply disable
keyword expansion.
David Schultz [Fri, 1 Aug 2008 01:24:25 +0000 (01:24 +0000)]
Fix some problems with asinf(), acosf(), atanf(), and atan2f():
- Adjust several constants for float precision. Some thresholds
that were appropriate for double precision were never changed
when these routines were converted to float precision. This
has an impact on performance but not accuracy. (Submitted by bde.)
- Reduce the degrees of the polynomials used. A smaller degree
suffices for float precision.
- In asinf(), use double arithmetic in part of the calculation to
avoid a corner case and some complicated arithmetic involving a
division and some buggy constants. This improves performance and
accuracy.
Max error (ulps):
asinf acosf atanf
before 0.925 0.782 0.852
after 0.743 0.804 0.852
As bde points out, it's cheaper for asin*() and acos*() to use
polynomials instead of rational functions, but that's a task for
another day.