]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoRename several audit functions in the global kernel symbol namespace to
rwatson [Mon, 25 Feb 2008 20:28:00 +0000 (20:28 +0000)]
Rename several audit functions in the global kernel symbol namespace to
have audit_ on the front:

- canon_path -> audit_canon_path
- msgctl_to_event -> audit_msgctl_to_event
- semctl_to_event -> audit_semctl_to_event

MFC after: 1 month

16 years agoMinor typo nit.
keramida [Mon, 25 Feb 2008 19:31:44 +0000 (19:31 +0000)]
Minor typo nit.

16 years agoSpell 'overwriting' correctly in a KASSERT() message.
keramida [Mon, 25 Feb 2008 19:28:27 +0000 (19:28 +0000)]
Spell 'overwriting' correctly in a KASSERT() message.

16 years agoModify VOP_ISLOCKED() and lockstatus() prototypes in order to reflect
attilio [Mon, 25 Feb 2008 19:12:01 +0000 (19:12 +0000)]
Modify VOP_ISLOCKED() and lockstatus() prototypes in order to reflect
'thread' argument axing.

16 years agoImplement from scratch a -l option for du(1), to match the same option
keramida [Mon, 25 Feb 2008 19:06:43 +0000 (19:06 +0000)]
Implement from scratch a -l option for du(1), to match the same option
of the GNU utility.  The default behavior of our original `du' is to
count hardlinked files only once for each invocation of the utility.
With the new -l option they count towards the final size every time
they are found.

PR: bin/117944
Submitted by: keramida
Reviewed by: des, obrien
MFC after: 2 weeks

16 years agoBump __FreeBSD_version in order to signal lockstatus() and VOP_ISLOCKED()
attilio [Mon, 25 Feb 2008 18:56:51 +0000 (18:56 +0000)]
Bump __FreeBSD_version in order to signal lockstatus() and VOP_ISLOCKED()
prototypes changing.

16 years agoAxe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it is
attilio [Mon, 25 Feb 2008 18:45:57 +0000 (18:45 +0000)]
Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it is
always curthread.

As KPI gets broken by this patch, manpages and __FreeBSD_version will be
updated by further commits.

Tested by: Andrea Barberio <insomniac at slackware dot it>

16 years agoUse a temporary array instead of the arg array y[] for calling
bde [Mon, 25 Feb 2008 18:28:58 +0000 (18:28 +0000)]
Use a temporary array instead of the arg array y[] for calling
__kernel_rem_pio2().  This simplifies analysis of aliasing and thus
results in better code for the usual case where __kernel_rem_pio2()
is not called.  In particular, when __ieee854_rem_pio2[f]() is inlined,
it normally results in y[] being returned in registers.  I couldn't
get this to work using the restrict qualifier.

In float precision, this saves 2-3% in most cases on amd64 and i386
(A64) despite it not being inlined in float precision yet.  In double
precision, this has high variance, with an average gain of 2% for
amd64 and 0.7% for i386 (but a much larger gain for usual cases) and
some losses.

16 years agoSort.
ru [Mon, 25 Feb 2008 16:29:54 +0000 (16:29 +0000)]
Sort.

Prodded by: obrien

16 years agoMake again BSD ar(1) the default system ar(1), now properly handling
ru [Mon, 25 Feb 2008 16:16:17 +0000 (16:16 +0000)]
Make again BSD ar(1) the default system ar(1), now properly handling
source upgrades by falling back to GNU ar(1) as necessary.  Option
WITH_BSDAR is gone.  Option _WITH_GNUAR to aid in upgrades is *not*
supposed to be set by the user.

Stop bootstrapping BSD ar(1) on the next __FreeBSD_version bump, as
there are no known bugs in it.  Bump __FreeBSD_version to anticipate
this and to flag the switch to BSD ar(1), should it be needed for
something.

Input from: obrien, des, kaiw

16 years agoSome PS/2 mice (at least the A4Tech X-7xx) need to be set to Intelli mode
rink [Mon, 25 Feb 2008 13:57:18 +0000 (13:57 +0000)]
Some PS/2 mice (at least the A4Tech X-7xx) need to be set to Intelli mode
first before they can be set to Explorer mode.

PR: kern/118578
Submitted by: Andriy Gapon <avg@icyb.net.ua> (I added some comments)
Reviewed by: philip
MFC after: 1 month

16 years agoChange __ieee754_rem_pio2f() to return double instead of float so that
bde [Mon, 25 Feb 2008 13:33:20 +0000 (13:33 +0000)]
Change __ieee754_rem_pio2f() to return double instead of float so that
this function and its callers cosf(), sinf() and tanf() don't waste time
converting values from doubles to floats and back for |x| > 9pi/4.
All these functions were optimized a few years ago to mostly use doubles
internally and across the __kernel*() interfaces but not across the
__ieee754_rem_pio2f() interface.

This saves about 40 cycles in cosf(), sinf() and tanf() for |x| > 9pi/4
on amd64 (A64), and about 20 cycles on i386 (A64) (except for cosf()
and sinf() in the upper range).  40 cycles is about 35% for |x| < 9pi/4
<= 2**19pi/2 and about 5% for |x| > 2**19pi/2.  The saving is much
larger on amd64 than on i386 since the conversions are not easy to
optimize except on i386 where some of them are automatic and others
are optimized invalidly.  amd64 is still about 10% slower in cosf()
and tanf() in the lower range due to conversion overhead.

This also gives a tiny speedup for |x| <= 9pi/4 on amd64 (by simplifying
the code).  It also avoids compiler bugs and/or additional slowness
in the conversions on (not yet supported) machines where double_t !=
double.

16 years agoAdd missing words.
brueffer [Mon, 25 Feb 2008 13:03:18 +0000 (13:03 +0000)]
Add missing words.

MFC after: 3 days

16 years agoFix some off-by-1 errors.
bde [Mon, 25 Feb 2008 11:43:20 +0000 (11:43 +0000)]
Fix some off-by-1 errors.

e_rem_pio2.c:
Float and double precision didn't work because init_jk[] was 1 too small.
It needs to be 2 larger than you might expect, and 1 larger than it was
for these precisions, since its test for recomputing needs a margin of
47 bits (almost 2 24-bit units).

init_jk[] seems to be barely enough for extended and quad precisions.
This hasn't been completely verified.  Callers now get about 24 bits
of extra precision for float, and about 19 for double, but only about
8 for extended and quad.  8 is not enough for callers that want to
produce extra-precision results, but current callers have rounding
errors of at least 0.8 ulps, so another 1/2**8 ulps of error from the
reduction won't affect them much.

Add a comment about some of the magic for init_jk[].

e_rem_pio2.c:
Double precision worked in practice because of a compensating off-by-1
error here.  Extended precision was asked for, and it executed exactly
the same code as the unbroken double precision.

e_rem_pio2f.c:
Float precision worked in practice because of a compensating off-by-1
error here.  Double precision was asked for, and was almost needed,
since the cosf() and sinf() callers want to produce extra-precision
results, at least internally so that their error is only 0.5009 ulps.
However, the extra precision provided by unbroken float precision is
enough, and the double-precision code has extra overheads, so the
off-by-1 error cost about 5% in efficiency on amd64 and i386.

16 years agoDecrease ping6's minimum allowed interval
silby [Mon, 25 Feb 2008 10:45:25 +0000 (10:45 +0000)]
Decrease ping6's minimum allowed interval
from .01 to .000001.

Note that due to the architecture of ping6,
you are still limited to kern.hz pings per
second.

MFC after: 2 weeks

16 years agounbreak printing 802.11 tx/rx rates
sam [Mon, 25 Feb 2008 01:28:14 +0000 (01:28 +0000)]
unbreak printing 802.11 tx/rx rates

MFC after: 3 days

16 years agoTeach PowerPC CPU identification routines to recognize e500 cores. Fix style
raj [Mon, 25 Feb 2008 00:09:23 +0000 (00:09 +0000)]
Teach PowerPC CPU identification routines to recognize e500 cores. Fix style
issues in this area.

Approved by: cognet (mentor)
MFp4: e500

16 years agoBump .Dd for revisions 1.83 and 1.84.
ceri [Sun, 24 Feb 2008 19:52:23 +0000 (19:52 +0000)]
Bump .Dd for revisions 1.83 and 1.84.

16 years agoTag -ilname and -lname as GNU extensions.
imp [Sun, 24 Feb 2008 19:46:27 +0000 (19:46 +0000)]
Tag -ilname and -lname as GNU extensions.
Correct their descriptions to indicate that it is the contents of the
symbolic link that are matched.

16 years agoLet PowerPC world optionally build with -msoft-float. For FPU-less PowerPC
raj [Sun, 24 Feb 2008 19:22:53 +0000 (19:22 +0000)]
Let PowerPC world optionally build with -msoft-float. For FPU-less PowerPC
variations (e500 currently), this provides a gcc-level FPU emulation and is an
alternative approach to the recently introduced kernel-level emulation
(FPU_EMU).

Approved by: cognet (mentor)
MFp4: e500

16 years agostyle(9) whitespace fix: A space is mandated after keyword 'return'.
kaiw [Sun, 24 Feb 2008 18:30:17 +0000 (18:30 +0000)]
style(9) whitespace fix: A space is mandated after keyword 'return'.

Submitted by:     jkoshy
Approved by:     jkoshy (mentor)

16 years agoSince the program is installed as 'bsdranlib', we need to
kaiw [Sun, 24 Feb 2008 18:07:46 +0000 (18:07 +0000)]
Since the program is installed as 'bsdranlib', we need to
check if it is invoked as 'bsdranlib'.

Reported by: Michael Plass <mfp49_freebsd [AT] plass-family [DOT] net>
Reviewed by: Michael Plass <mfp49_freebsd [AT] plass-family [DOT] net>
Reviewed by: jkoshy
Approved by: jkoshy (mentor)

16 years agoCorrect a long-standing error in vm_object_deallocate(). Specifically,
alc [Sun, 24 Feb 2008 18:03:56 +0000 (18:03 +0000)]
Correct a long-standing error in vm_object_deallocate().  Specifically,
only anonymous default (OBJT_DEFAULT) and swap (OBJT_SWAP) objects should
ever have OBJ_ONEMAPPING set.  However, vm_object_deallocate() was
setting it on device (OBJT_DEVICE) objects.  As a result,
vm_object_page_remove() could be called on a device object and if that
occurred pmap_remove_all() would be called on the device object's pages.
However, a device object's pages are fictitious, and fictitious pages do
not have an initialized pv list (struct md_page).

To date, fictitious pages have been allocated from zeroed memory,
effectively hiding this problem.  Now, however, the conversion of rotting
diagnostics to invariants in the amd64 and i386 pmaps has revealed the
problem.  Specifically, assertion failures have occurred during the
initialization phase of the X server on some hardware.

MFC after: 1 week
Discussed with: Kostik Belousov
Reported by: Michiel Boland

16 years agoHandle properly when insert zero size objects into the archive:
kaiw [Sun, 24 Feb 2008 17:57:29 +0000 (17:57 +0000)]
Handle properly when insert zero size objects into the archive:
Do not mmap 0-size objects and do not try to extract symbol from
0-size objects, but do treat 0-size objects as qualified objects and
accept them as an archive member. (A member with only the header part)

Note that GNU binutils ar on FreeBSD ignores 0-size objects, but on
Linux it accepts them. [1] But, since this is a rare usage, we can
safely ignore the compatibility issue.

Reported by: Michael Plass <mfp49_freebsd [AT] plass-family [DOT] net>
Pointed out by: Michael Plass <mfp49_freebsd [AT] plass-family [DOT] net> [1]
Reviewed by: Michael Plass <mfp49_freebsd [AT] plass-family [DOT] net>
Reviewed by: jkoshy
Approved by: jkoshy (mentor)

16 years agoDon't define DEBUG. No debugging required.
marcel [Sun, 24 Feb 2008 17:10:30 +0000 (17:10 +0000)]
Don't define DEBUG. No debugging required.

Pointy hat: marcel

16 years agoForced commit to fix message:
stefanf [Sun, 24 Feb 2008 16:55:42 +0000 (16:55 +0000)]
Forced commit to fix message:
Add a regression test for cd.c's revision 1.36.

16 years agoAdd a regression test for cd.c's revision 1.35.
stefanf [Sun, 24 Feb 2008 16:52:02 +0000 (16:52 +0000)]
Add a regression test for cd.c's revision 1.35.

16 years agoSplit updatepwd() into two smaller functions. The first one, findpwd(),
stefanf [Sun, 24 Feb 2008 16:50:55 +0000 (16:50 +0000)]
Split updatepwd() into two smaller functions.  The first one, findpwd(),
computes the new path and the second one, updatepwd(), updates the variables
PWD, OLDPWD and the path used for the pwd builtin according to the new
directory.  For a logical directory change, chdir() is now called between
those two functions, no longer causing wrong values to be stored in PWD etc. if
it fails.

PR: 64990, 101316, 120571

16 years agoIntroduce some functions in the vnode locks namespace and in the ffs
attilio [Sun, 24 Feb 2008 16:38:58 +0000 (16:38 +0000)]
Introduce some functions in the vnode locks namespace and in the ffs
namespace in order to handle lockmgr fields in a controlled way instead
than spreading all around bogus stubs:
- VN_LOCK_AREC() allows lock recursion for a specified vnode
- VN_LOCK_ASHARE() allows lock sharing for a specified vnode

In FFS land:
- BUF_AREC() allows lock recursion for a specified buffer lock
- BUF_NOREC() disallows recursion for a specified buffer lock

Side note: union_subr.c::unionfs_node_update() is the only other function
directly handling lockmgr fields. As this is not simple to fix, it has
been left behind as "sole" exception.

16 years agoCurrently, smb_co_init() uses the same lock name for the mutex interlock
attilio [Sun, 24 Feb 2008 16:26:52 +0000 (16:26 +0000)]
Currently, smb_co_init() uses the same lock name for the mutex interlock
and the lockmgr. Use different names in order to avoid WITNESS conflicts.

Reported by: Bryan Venteicher <bryanv at daemoninthecloset dot org>

16 years agoAdd table/tablearg support to ipfw's nat.
piso [Sun, 24 Feb 2008 15:37:45 +0000 (15:37 +0000)]
Add table/tablearg support to ipfw's nat.

MFC After: 1 week

16 years agoo Add module event handler.
akiyama [Sun, 24 Feb 2008 12:16:01 +0000 (12:16 +0000)]
o Add module event handler.
  Now ucom kernel module can unload properly.
o Update copyright year.

PR: usb/88966
MFC after: 1 week

16 years agoFix shutdown bug made by previous commit.
mav [Sun, 24 Feb 2008 10:13:32 +0000 (10:13 +0000)]
Fix shutdown bug made by previous commit.

16 years agoFix namespace collision with sparc macro
kmacy [Sun, 24 Feb 2008 07:19:31 +0000 (07:19 +0000)]
Fix namespace collision with sparc macro

16 years agoChange FreeBSD 7 so that it returns TCP options in
silby [Sun, 24 Feb 2008 05:13:20 +0000 (05:13 +0000)]
Change FreeBSD 7 so that it returns TCP options in
the same order that FreeBSD 6 and before did.  Doug
White and the other bloodhounds at ISC discovered that
while FreeBSD 7's ordering of options was more efficient,
it caused some cable modem routers to ignore the
SYN-ACKs ordered in this fashion.

The placement of sackOK after the timestamp option seems
to be the critical difference:

FreeBSD 6:
<mss 1460,nop,wscale 1,nop,nop,timestamp 3512155768 0,sackOK,eol>

FreeBSD 7.0:
<mss 1460,nop,wscale 3,sackOK,timestamp 1370692577 0>

FreeBSD 7.0 + this change:
<mss 1460,nop,wscale 3,nop,nop,timestamp 7371813 0,sackOK,eol>

MFC after: 1 week

16 years agoResolve warnings exposed by LINT.
marcel [Sun, 24 Feb 2008 03:01:26 +0000 (03:01 +0000)]
Resolve warnings exposed by LINT.
o  Put prototypes in a single header only.
o  Fix printf format specifiers.

16 years agoAfter finishing sending file data in sendfile(2), don't forget to send
cperciva [Sun, 24 Feb 2008 00:07:00 +0000 (00:07 +0000)]
After finishing sending file data in sendfile(2), don't forget to send
the provided trailers.  This has been broken since revision 1.240.

Submitted by: Dan Nelson
PR: kern/120948
"sounds ok to me" from: phk
MFC after: 3 days

16 years agoThe matching in -lname and -ilname are on the contents of the link
imp [Sun, 24 Feb 2008 00:01:06 +0000 (00:01 +0000)]
The matching in -lname and -ilname are on the contents of the link
itself, not on the type of the file.  As such, do a readlink to get
the symbolic link's contents and fail to match if the path isn't a
symbolic link.

Pointed out by: des@

16 years agoAdd prototype for __cmpd2().
marcel [Sat, 23 Feb 2008 22:40:05 +0000 (22:40 +0000)]
Add prototype for __cmpd2().

16 years agoAdd FPU_EMU.
marcel [Sat, 23 Feb 2008 22:32:16 +0000 (22:32 +0000)]
Add FPU_EMU.

16 years agoremove call to kdb_backtrace()
kmacy [Sat, 23 Feb 2008 21:18:13 +0000 (21:18 +0000)]
remove call to kdb_backtrace()

16 years agoHook-up the FPU emulator. It's optional upon FPU_EMU.
marcel [Sat, 23 Feb 2008 20:16:38 +0000 (20:16 +0000)]
Hook-up the FPU emulator. It's optional upon FPU_EMU.

16 years agoBring back (without advertising clause) cmpdi2.c. It's needed on PowerPC
marcel [Sat, 23 Feb 2008 20:10:49 +0000 (20:10 +0000)]
Bring back (without advertising clause) cmpdi2.c. It's needed on PowerPC
when the FP emulator is compiled-in.

16 years agoAdd a floating-point emulator so that a single userland or single ABI
marcel [Sat, 23 Feb 2008 20:05:26 +0000 (20:05 +0000)]
Add a floating-point emulator so that a single userland or single ABI
can run on processors that don't have a FPU. This is typically the
case for Book E processors. While a tuned system will probably want
to use soft-float (or use a processor that has a FPU if the usage is
FP intensive enough), allowing hard-float on FPU-less systems gives
great portability and flexibility.

Obtained from: NetBSD

16 years agoo Build and install the U-Boot loader as ubldr.
marcel [Sat, 23 Feb 2008 19:45:20 +0000 (19:45 +0000)]
o  Build and install the U-Boot loader as ubldr.
o  Don't build/install the manual pages or configuration
   files that are already installed by the OFW loader.
o  Hook the U-Boot loader to the build.

16 years agostyle(9) commit.
marcel [Sat, 23 Feb 2008 19:43:29 +0000 (19:43 +0000)]
style(9) commit.

16 years agoBump the default .Os version to FreeBSD 8.0.
ru [Sat, 23 Feb 2008 19:27:54 +0000 (19:27 +0000)]
Bump the default .Os version to FreeBSD 8.0.

16 years agoSetup the new bootinfo structure.
marcel [Sat, 23 Feb 2008 19:08:25 +0000 (19:08 +0000)]
Setup the new bootinfo structure.
While here, make local function static and update copyright.

16 years agoo Keep running on U-Boot's stack.
marcel [Sat, 23 Feb 2008 18:42:53 +0000 (18:42 +0000)]
o  Keep running on U-Boot's stack.
o  Disable interrupts while not running U-Boot code. We clobber
   registers that the U-Boot interrupt handlers assume to be
   fixed as per the U-Boot register usage. At this time this only
   applies to r14. U-Boot uses r2 now for what they used r29 for.
   After we restore r14 in preparation of doing the syscall, we
   re-enable interrupts. When we return from the syscall, we
   disable interrupts and restore the callee-saved r14.

16 years agoThe NFS file system support is conditional upon LOADER_NFS_SUPPORT,
marcel [Sat, 23 Feb 2008 18:36:13 +0000 (18:36 +0000)]
The NFS file system support is conditional upon LOADER_NFS_SUPPORT,
not LOADER_NET_SUPPORT.

16 years agoAdd __elfN(relocation_offset). It holds the offset between the virtual
marcel [Sat, 23 Feb 2008 18:33:50 +0000 (18:33 +0000)]
Add __elfN(relocation_offset). It holds the offset between the virtual
(link) address and the physical (load) address. Ideally, the mapping
between link and load addresses should be abstracted by the copyin(),
copyout() and readin() functions, so that we don't have to add kluges
in __elfN(loadimage)(). Then, we could also have paged virtual memory
for the kernel. This can be important under EFI, where you need to
allocate physical memory form the firmware if you want to work in all
scenarios.

16 years agoDefine the bootinfo structure for FreeBSD. It is not used on
marcel [Sat, 23 Feb 2008 18:01:45 +0000 (18:01 +0000)]
Define the bootinfo structure for FreeBSD. It is not used on
AIM, but it's used for BookE.

16 years agoo Include glue.h
marcel [Sat, 23 Feb 2008 17:58:12 +0000 (17:58 +0000)]
o  Include glue.h
o  Support multiple memory regions.

16 years agoo Build libuboot with -msoft-float like everything else.
marcel [Sat, 23 Feb 2008 17:56:17 +0000 (17:56 +0000)]
o  Build libuboot with -msoft-float like everything else.
o  Move the API prototypes to a separate header (glue.h)
o  Allow the platform to hint libuboot about where to look
   for the API signature. The uboot_address variable is
   expected to be defined by the platform.

16 years agoAdd the appropriate license information. This file is double
marcel [Sat, 23 Feb 2008 17:52:30 +0000 (17:52 +0000)]
Add the appropriate license information. This file is double
licensed under GPL and BSD.

Thanks to: raj@

16 years agoWe build ficl and libofw with -msoft-float. Build the loader
marcel [Sat, 23 Feb 2008 17:48:23 +0000 (17:48 +0000)]
We build ficl and libofw with -msoft-float. Build the loader
with -msoft-float too.

16 years agoImplement a number of primaries present in GNU find, but not present
imp [Sat, 23 Feb 2008 16:29:04 +0000 (16:29 +0000)]
Implement a number of primaries present in GNU find, but not present
in our find.

The following are nops because they aren't relevant to our find:
-ignore_readdir_race
-noignore_readdir_race
-noleaf
The following aliaes were created:
-gid -> -group [2]
-uid -> -user [2]
-wholename -> -path
-iwholename -> ipath
-mount -> -xdev
-d -> -depth [1]
The following new primaries were created:
-lname like -name, but matches symbolic links only)
-ilname like -lname but case insensitive
-quit exit(0)
-samefile returns true for hard links to the specified file
-true Always true
I changed one primary to match GNU find since I think our use of it violates
POLA
-false Always false (was an alias for -not!)

Also, document the '+' modifier for -execdir, as well as all of the above.
This was previously implemented.

Document the remaining 7 primaries that are in GNU find, but aren't yet
implemented in find(1)

[1] This was done in GNU find for compatibility with FreeBSD, yet they
mixed up command line args and primary args.

[2] -uid/-gid in GNU find ONLY takes a numeric arg, but that arg does the
normal range thing that.  GNU find -user and -uid also take a numberic arg,
but don't do the range processing.  find(1) does both for -user and -group,
so making -uid and -gid aliases is compatible for all non-error cases used
in GNU find.  While not perfect emulation, this seems a reasonable thing
for us.

16 years agoFix typo.
brueffer [Sat, 23 Feb 2008 14:34:52 +0000 (14:34 +0000)]
Fix typo.

16 years agoOptimize the 9pi/2 < |x| <= 2**19pi/2 case some more by avoiding an
bde [Sat, 23 Feb 2008 12:53:21 +0000 (12:53 +0000)]
Optimize the 9pi/2 < |x| <= 2**19pi/2 case some more by avoiding an
fabs(), a conditional branch, and sign adjustments of 3 variables for
x < 0 when the branch is taken.  In double precision, even when the
branch is perfectly predicted, this saves about 10 cycles or 10% on
amd64 (A64) and i386 (A64) for the negative half of the range, but
makes little difference for the positive half of the range.  In float
precision, it also saves about 4 cycles for the positive half of the
range on i386, and many more cycles in both halves on amd64 (28 in the
negative half and 11 in the positive half for tanf), but the amd64
times for float precision are anomalously slow so the larger
improvement is only a side effect.

Previous commits arranged for the x < 0 case to be handled simply:
- one part of the rounding method uses the magic number 0x1.8p52
  instead of the usual 0x1.0p52.  The latter is required for large |x|,
  but it doesn't work for negative x and we don't need it for large |x|.
- another part of the rounding method no longer needs to add `half'.
  It would have needed to add -half for negative x.
- removing the "quick check no cancellation" in the double precision
  case removed the need to take the absolute value of the quadrant
  number.

Add my noncopyright in e_rem_pio2.c

16 years agoFix tinderbox by removing call to kdb_backtrace
kmacy [Sat, 23 Feb 2008 06:19:16 +0000 (06:19 +0000)]
Fix tinderbox by removing call to kdb_backtrace

MFC after: 3 days

16 years agoAdd the groupmod '-d' option to pw to allow the deletion of existing users
scf [Sat, 23 Feb 2008 01:25:22 +0000 (01:25 +0000)]
Add the groupmod '-d' option to pw to allow the deletion of existing users
from a group without the need to perform the same operation by replacing
the existing list via the '-M' option.  The '-M' option requires someone
to fetch the existing members with pw, deleting the undesired members from
the list and sending the altered list back to pw.

Approved by: wes (mentor)
MFC after: 5 days

16 years agostyle(9) (verified no object changes)
scf [Sat, 23 Feb 2008 01:17:42 +0000 (01:17 +0000)]
style(9) (verified no object changes)

Approved by: wes (mentor)
MFC after: 5 days

16 years ago- update firmware to 5.0
kmacy [Sat, 23 Feb 2008 01:06:17 +0000 (01:06 +0000)]
- update firmware to 5.0
- add support for T3C
- add DDP support (zero-copy receive)
- fix TOE transmit of large requests
- fix shutdown so that sockets don't remain in CLOSING state indefinitely
- register listeners when an interface is brought up after tom is loaded
- fix setting of multicast filter
- enable link at device attach
- exit tick handler if shutdown is in progress
- add helper for logging TCB
- add sysctls for dumping transmit queues

- note that TOE wxill not be MFC'd until after 7.0 has been finalized

MFC after: 3 days

16 years agoThis patch adds a new ktrace(2) record type, KTR_STRUCT, whose payload
des [Sat, 23 Feb 2008 01:01:49 +0000 (01:01 +0000)]
This patch adds a new ktrace(2) record type, KTR_STRUCT, whose payload
consists of the null-terminated name and the contents of any structure
you wish to record.  A new ktrstruct() function constructs and emits a
KTR_STRUCT record.  It is accompanied by convenience macros for struct
stat and struct sockaddr.

In kdump(1), KTR_STRUCT records are handled by a dispatcher function
that runs stringent sanity checks on its contents before handing it
over to individual decoding funtions for each type of structure.
Currently supported structures are struct stat and struct sockaddr for
the AF_INET, AF_INET6 and AF_UNIX families; support for AF_APPLETALK
and AF_IPX is present but disabled, as I am unable to test it properly.

Since 's' was already taken, the letter 't' is used by ktrace(1) to
enable KTR_STRUCT trace points, and in kdump(1) to enable their
decoding.

Derived from patches by Andrew Li <andrew2.li@citi.com>.

PR: kern/117836
MFC after: 3 weeks

16 years agoip6(4) man page lacks documentation for TCLASS option.
bms [Fri, 22 Feb 2008 21:02:36 +0000 (21:02 +0000)]
ip6(4) man page lacks documentation for TCLASS option.

PR: docs/120945
Reviewed by: remko

16 years agoAvoid using FP-to-integer conversion for !(amd64 || i386) too. Use the
bde [Fri, 22 Feb 2008 18:43:23 +0000 (18:43 +0000)]
Avoid using FP-to-integer conversion for !(amd64 || i386) too.  Use the
FP-to-FP method to round to an integer on all arches, and convert this
to an int using FP-to-integer conversion iff irint() is not available.
This is cleaner and works well on at least ia64, where it saves 20-30
cycles or about 10% on average for 9Pi/4 < |x| <= 32pi/2 (should be
similar up to 2**19pi/2, but I only tested the smaller range).

After the previous commit to e_rem_pio2.c removed the "quick check no
cancellation" non-optimization, the result of the FP-to-integer
conversion is not needed so early, so using irint() became a much
smaller optimization than when it was committed.

An earlier commit message said that cos, cosf, sin and sinf were equally
fast on amd64 and i386 except for cos and sin on i386.  Actually, cos
and sin on amd64 are equally fast to cosf and sinf on i386 (~88 cycles),
while cosf and sinf on amd64 are not quite equally slow to cos and sin
on i386 (average 115 cycles with more variance).

16 years agoRemove the "quick check no cancellation" optimization for
bde [Fri, 22 Feb 2008 17:26:24 +0000 (17:26 +0000)]
Remove the "quick check no cancellation" optimization for
9pi/2 < |x| < 32pi/2 since it is only a small or negative optimation
and it gets in the way of further optimizations.  It did one more
branch to avoid some integer operations and to use a different
dependency on previous results.  The branches are fairly predictable
so they are usually not a problem, so whether this is a good
optimization depends mainly on the timing for the previous results,
which is very machine-dependent.  On amd64 (A64), this "optimization"
is a pessimization of about 1 cycle or 1%; on ia64, it is an
optimization of about 2 cycles or 1%; on i386 (A64), it is an
optimization of about 5 cycles or 4%; on i386 (Celeron P2) it is an
optimization of about 4 cycles or 3% for cos but a pessimization of
about 5 cycles for sin and 1 cycle for tan.  I think the new i386
(A64) slowness is due to an pipeline stall due to an avoidable
load-store mismatch (so the old timing was better), and the i386
(Celeron) variance is due to its branch predictor not being too good.

16 years agoOptimize the 9pi/2 < |x| <= 2**19pi/2 case on amd64 and i386 by avoiding
bde [Fri, 22 Feb 2008 15:55:14 +0000 (15:55 +0000)]
Optimize the 9pi/2 < |x| <= 2**19pi/2 case on amd64 and i386 by avoiding
the the double to int conversion operation which is very slow on these
arches.  Assume that the current rounding mode is the default of
round-to-nearest and use rounding operations in this mode instead of
faking this mode using the round-towards-zero mode for conversion to
int.  Round the double to an integer as a double first and as an int
second since the double result is needed much earler.

Double rounding isn't a problem since we only need a rough approximation.
We didn't support other current rounding modes and produce much larger
errors than before if called in a non-default mode.

This saves an average about 10 cycles on amd64 (A64) and about 25 on
i386 (A64) for x in the above range.  In some cases the saving is over
25%.  Most cases with |x| < 1000pi now take about 88 cycles for cos
and sin (with certain CFLAGS, etc.), except on i386 where cos and sin
(but not cosf and sinf) are much slower at 111 and 121 cycles respectivly
due to the compiler only optimizing well for float precision.  A64
hardware cos and sin are slower at 105 cycles on i386 and 110 cycles
on amd64.

16 years agoFixes a memory leak when VRF's are in play.
rrs [Fri, 22 Feb 2008 15:08:10 +0000 (15:08 +0000)]
Fixes a memory leak when VRF's are in play.

Submitted by: Prasad Narasimha (snprasad@cisco.com)
Reviewed by: rrs

16 years ago- Takes out stray ifdef code that should not have been present.
rrs [Fri, 22 Feb 2008 15:06:25 +0000 (15:06 +0000)]
- Takes out stray ifdef code that should not have been present.

16 years agoAdd an irint() function in inline asm for amd64 and i386. irint() is
bde [Fri, 22 Feb 2008 14:11:03 +0000 (14:11 +0000)]
Add an irint() function in inline asm for amd64 and i386.  irint() is
the same as lrint() except it returns int instead of long.  Though the
extern lrint() is fairly fast on these arches, it still takes about
12 cycles longer than the inline version, and 12 cycles is a lot in
applications where [li]rint() is used to avoid slow conversions that
are only a couple of times slower.

This is only for internal use.  The libm versions of *rint*() should
also be inline, but that would take would take more header engineering.
Implementing irint() instead of lrint() also avoids a conflict with
the extern declaration of the latter.

16 years agoOptimize the conversion to bits a little (by about 11 cycles or 16%
bde [Fri, 22 Feb 2008 11:59:05 +0000 (11:59 +0000)]
Optimize the conversion to bits a little (by about 11 cycles or 16%
on i386 (A64), 5 cycles on amd64 (A64), and 3 cycles on ia64).  gcc
tends to generate very bad code for accessing floating point values
as bits except when the integer accesses have the same width as the
floating point values, and direct accesses to bit-fields (as is common
only for long double precision) always gives such accesses.  Use the
expsign access method, which is good for 80-bit long doubles and
hopefully no worse for 128-bit long doubles.  Now the generated code
is less bad.  There is still unnecessary copying of the arg on amd64
and i386 and mysterious extra slowness on amd64.

16 years agoSanitize arguments to linux_mremap().
kib [Fri, 22 Feb 2008 11:47:56 +0000 (11:47 +0000)]
Sanitize arguments to linux_mremap().
Check that only MREMAP_FIXED and MREMAP_MAYMOVE flags are specified.
Check for the page alignment of the addr argument.

Submitted by: rdivacky
MFC after: 1 week

16 years agoFix essential bugs and warnings.
ru [Fri, 22 Feb 2008 10:28:03 +0000 (10:28 +0000)]
Fix essential bugs and warnings.

16 years agoOptimize the fixup for +-0 by using better classification for this case
bde [Fri, 22 Feb 2008 10:04:53 +0000 (10:04 +0000)]
Optimize the fixup for +-0 by using better classification for this case
and by using a table lookup to avoid a branch when this case occurs.
On i386, this saves 1-4 cycles out of about 64 for non-large args.

16 years agoHide BSD ar(1) under the MK_TOOLCHAIN option.
ru [Fri, 22 Feb 2008 09:31:23 +0000 (09:31 +0000)]
Hide BSD ar(1) under the MK_TOOLCHAIN option.

Reviewed by: obrien

16 years agoFix rintl() on signaling NaNs and unsupported formats.
bde [Fri, 22 Feb 2008 09:21:14 +0000 (09:21 +0000)]
Fix rintl() on signaling NaNs and unsupported formats.

16 years agoClean up created turds.
obrien [Fri, 22 Feb 2008 06:53:52 +0000 (06:53 +0000)]
Clean up created turds.

16 years agoWe build important toolchain statically. So build BSD 'ar' statically
obrien [Fri, 22 Feb 2008 06:51:26 +0000 (06:51 +0000)]
We build important toolchain statically.  So build BSD 'ar' statically
when its replacing GNU 'ar'.

16 years agoRe-introduce the new BSDLed 'ar' to the build.
obrien [Fri, 22 Feb 2008 06:47:45 +0000 (06:47 +0000)]
Re-introduce the new BSDLed 'ar' to the build.
It is installed as "bsdar" unless WANT_BSDAR is defined.

Discussed with: kaiw

16 years agoFix 'make checkdpadd'.
jkoshy [Fri, 22 Feb 2008 06:25:49 +0000 (06:25 +0000)]
Fix 'make checkdpadd'.

16 years agos/rcsid/__FBSDID/
das [Fri, 22 Feb 2008 02:30:36 +0000 (02:30 +0000)]
s/rcsid/__FBSDID/

16 years agoRemove an unused variable.
das [Fri, 22 Feb 2008 02:27:34 +0000 (02:27 +0000)]
Remove an unused variable.

16 years agoEliminate some warnings.
das [Fri, 22 Feb 2008 02:26:51 +0000 (02:26 +0000)]
Eliminate some warnings.

16 years agoMFC after: 4 weeks
davidch [Fri, 22 Feb 2008 00:46:22 +0000 (00:46 +0000)]
MFC after: 4 weeks

- Added loose RX MTU functionality to allow frames larger than 1500 bytes
  to be accepted even though the interface MTU is set to 1500.
- Implemented new TCP header splitting/jumbo frame support which uses
  two chains for receive traffic rather than the original single recevie
  chain.
- Added additional debug support code.

16 years ago-Fix display of nat range.
piso [Thu, 21 Feb 2008 22:55:54 +0000 (22:55 +0000)]
-Fix display of nat range.
-Whitespace elimination.

Bug spotted by: Luiz Otavio O Souza
MFC After: 3 days

16 years agoAdd some missing Xrefs to drivers.
brueffer [Thu, 21 Feb 2008 20:44:25 +0000 (20:44 +0000)]
Add some missing Xrefs to drivers.

MFC after: 3 days

16 years agoNote, as required by our agreement with IEEE/The Open Group, that the message
philip [Thu, 21 Feb 2008 19:16:57 +0000 (19:16 +0000)]
Note, as required by our agreement with IEEE/The Open Group, that the message
queue manual pages excerpt the POSIX standard.

Spotted by: Mindaugas Rasiukevicius <rmind -at- NetBSD.org>
Reviewed by: imp
MFC after: 1 day

16 years agoAdd support for the VIA USB2IDE bridge [1].
remko [Thu, 21 Feb 2008 19:07:08 +0000 (19:07 +0000)]
Add support for the VIA USB2IDE bridge [1].

PR: usb/95173
Submitted by: Goegele Hannes <diazepam@gmx.net>
Ben Kelly <bkelly at vadev dot org>
Tested by: blackend
Approved by: imp (mentor, blanket for simple patches)
X-MFC-After: 1 week

16 years agoIf 'WITH_BSDAR' is defined, install as gnu-<util_name>.
obrien [Thu, 21 Feb 2008 16:59:02 +0000 (16:59 +0000)]
If 'WITH_BSDAR' is defined, install as gnu-<util_name>.

16 years agoFix static linkage.
ru [Thu, 21 Feb 2008 16:29:52 +0000 (16:29 +0000)]
Fix static linkage.

16 years agoAdd LIBELF.
ru [Thu, 21 Feb 2008 16:29:31 +0000 (16:29 +0000)]
Add LIBELF.

16 years agoBack out previous commit. Restore Binutils ar as default. Disconnect
kaiw [Thu, 21 Feb 2008 16:12:46 +0000 (16:12 +0000)]
Back out previous commit. Restore Binutils ar as default. Disconnect
'BSD' ar to the build.

Requested by:  des

16 years ago* Connect ar(1) to the build and make it default ar. Rename GNU
kaiw [Thu, 21 Feb 2008 11:21:29 +0000 (11:21 +0000)]
* Connect ar(1) to the build and make it default ar.  Rename GNU
binutils ar and ranlib to gar and granlib, respectively.

* Introduce a temporary variable WITH_GNUAR as a safety net.
When buildworld with -DWITH_GNUAR, GNU binutils ar and ranlib
will install as default ones and 'BSD' ar will be disabled.

* Bump __FreeBSD_version to reflect the import of 'BSD' ar(1).

Approved by:  jkoshy (mentor)

16 years agoRemove WARNS from here and compile with default kernel flags.
ru [Thu, 21 Feb 2008 11:11:06 +0000 (11:11 +0000)]
Remove WARNS from here and compile with default kernel flags.
Switch off those warnings that ZFS sources do not pass.

16 years agoRemove WARNS from here and compile with default kernel flags.
ru [Thu, 21 Feb 2008 11:09:59 +0000 (11:09 +0000)]
Remove WARNS from here and compile with default kernel flags.

16 years agoImport ar(1) front-end. (aka 'BSD' ar)
kaiw [Thu, 21 Feb 2008 10:52:31 +0000 (10:52 +0000)]
Import ar(1) front-end. (aka 'BSD' ar)

Reviewed by:  jkoshy
Approved by: jkoshy (mentor)
Tested by: erwin (ports build test on pointyhat)
Sponsored by: Google Summer of Code 2007
Reviewed by (earlier version): Jaakko Heinonen <jh[AT]saunalahti.fi>
Tested by (earlier version): Steve Kargl <sgk[AT]troutmask.apl.washington.edu>
Tested by (earlier version): Martin Voros <martin_voros[AT]yahoo.com>
Tested by (earlier version): swell.k[AT]gmail.com
Tested by (earlier version): joel
Tested by (earlier version): Alexey Shuvaev <shuvaev[AT]physik.uni-wuerzburg.de>
Tested by (earlier version): Arjan van Leeuwen <avleeuwen[AT]gmail.com>

Thanks to gabor@ for building ports for it.
Thanks to erwin@ and kris@ for scheduling the ports build test on pointyhat.
And thanks to many others for their feedback.

16 years agoEnsure that the -s flag truncates the accounting data.
grog [Thu, 21 Feb 2008 07:12:56 +0000 (07:12 +0000)]
Ensure that the -s flag truncates the accounting data.

This problem has only been reported on the amd64 platform.

PR: bin/120293
Tested by: Callum Gibson
MFC after: 2 weeks

16 years agoSanity-check the block size.
kientzle [Thu, 21 Feb 2008 03:21:50 +0000 (03:21 +0000)]
Sanity-check the block size.

Thanks to: Joerg Sonnenberger
MFC after: 7 days

16 years agoDon't check the bpbSecPerTrack and bpbHeads fields of the BPB.
marcel [Thu, 21 Feb 2008 03:19:46 +0000 (03:19 +0000)]
Don't check the bpbSecPerTrack and bpbHeads fields of the BPB.
They are typically 0 on new ia64 systems. Since we don't use
either field, there's no harm in not checking.