]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoRework coda_statfs(): no longer need to zero the statfs structure or
Robert Watson [Sat, 19 Jan 2008 16:39:14 +0000 (16:39 +0000)]
Rework coda_statfs(): no longer need to zero the statfs structure or
fill out all fields, just fill out the ones the file system knows
about.  Among other things, this causes the outpuf of "mount" and
"df" to make quite a bit more sense as /dev/cfs0 is specified as the
mountfrom name.

MFC after: 3 days

16 years agoUse STRICT_ASSIGN() instead of assorted direct volatile hacks to work
Bruce Evans [Sat, 19 Jan 2008 16:37:57 +0000 (16:37 +0000)]
Use STRICT_ASSIGN() instead of assorted direct volatile hacks to work
around assignments not working for gcc on i386.  Now volatile hacks
for rint() and rintf() don't needlessly pessimize so many arches
and the remaining pessimizations (for arm and powerpc) can be avoided
centrally.

This cleans up after s_rint.c 1.3 and 1.13 and s_rintf.c 1.3 and 1.9:
- s_rint.c 1.13 broke 1.3 by only using a volatile cast hack in 1 place
  when it was needed in 2 places, and the volatile cast hack stopped
  working with gcc-4.  These bugs only affected correctness tests on
  i386 since i386 normally uses asm rint() and doesn't support the
  extra precision mode that would break assignments of doubles.
- s_rintf.c 1.9 improved(?) on 1.3 by using a volatile variable hack
  instead of an extra-precision variable hack, but it declared 2
  variables as volatile when only 1 variable needed to be volatile.
  This only affected speed tests on i386 since i386 uses asm rintf().

16 years agoZero mi_rotovp and coda_ctlvp immediately after calling vrele() on the
Robert Watson [Sat, 19 Jan 2008 15:40:46 +0000 (15:40 +0000)]
Zero mi_rotovp and coda_ctlvp immediately after calling vrele() on the
vnodes during coda_unmount() in order to detect errant use of them
after the vnode references may no longer be valid.

No need to clear the VV_ROOT flag on mi_rootvp flag (especially after
the vnode reference is no longer valid) as this isn't done on other
file systems.

MFC after: 3 days

16 years agoDon't acquire an additional vnode reference to a vnode when it is opened
Robert Watson [Sat, 19 Jan 2008 15:39:10 +0000 (15:39 +0000)]
Don't acquire an additional vnode reference to a vnode when it is opened
and then release it when it is closed: we rely on the caller to keep the
vnode around with a valid reference.  This avoids vrele() destroying the
vnode vop_close() is being called from during a call to vop_close(), and
a crash due to lockmgr recursing the vnode lock when a Coda unmount
occurs.

MFC after: 3 days

16 years agoDon't declare functions as extern.
Robert Watson [Sat, 19 Jan 2008 14:32:44 +0000 (14:32 +0000)]
Don't declare functions as extern.

Move all extern variable definitions to associated .h files, move some
extern variable definitions between include files to place them more
appropriately.

MFC after: 3 days

16 years agoUse VOP_NULL rather than VOP_PANIC for Coda's vop_print routine, so as
Robert Watson [Sat, 19 Jan 2008 13:41:56 +0000 (13:41 +0000)]
Use VOP_NULL rather than VOP_PANIC for Coda's vop_print routine, so as
to avoid panicking in DDB show lockedvnods.

MFC after: 3 days

16 years agoLock the new directory vnode returned by coda_mkdir(), as this is required
Robert Watson [Sat, 19 Jan 2008 13:29:14 +0000 (13:29 +0000)]
Lock the new directory vnode returned by coda_mkdir(), as this is required
by FreeBSD's vnode locking protocol.

MFC after: 3 days

16 years agoBorrow the VM object associated with an underlying cache vnode with the
Robert Watson [Sat, 19 Jan 2008 13:27:14 +0000 (13:27 +0000)]
Borrow the VM object associated with an underlying cache vnode with the
Coda vnode derived from it, in the style of nullfs.  This allows files
in the Coda file system to be memory-mapped, such as with execve(2) or
mmap(2).

MFC after: 3 days
Reported by: Rune <u+openafsdev-sr55 at chalmers dot se>

16 years agoRemove files conditional on the obsolete MK_FORTRAN knob. They are already
Christian Brueffer [Fri, 18 Jan 2008 23:24:10 +0000 (23:24 +0000)]
Remove files conditional on the obsolete MK_FORTRAN knob.  They are already
listed in ObsoleteFiles.inc anyway.

Reported by: David Wolfskill
Approved by: rwatson (mentor)
MFC after: 3 days

16 years agoUse volatile hacks to make sure these functions generate an underflow
David Schultz [Fri, 18 Jan 2008 22:19:04 +0000 (22:19 +0000)]
Use volatile hacks to make sure these functions generate an underflow
exception when they're supposed to. Previously, gcc -O2 was optimizing
away the statement that generated it.

16 years agoexpm1(-big) generates an inexact exception but not underflow.
David Schultz [Fri, 18 Jan 2008 22:10:57 +0000 (22:10 +0000)]
expm1(-big) generates an inexact exception but not underflow.

16 years agoAdd a flag for Ethernet@WireSpeed capability and correct chip revisions.
Jung-uk Kim [Fri, 18 Jan 2008 22:09:50 +0000 (22:09 +0000)]
Add a flag for Ethernet@WireSpeed capability and correct chip revisions.
The idea was taken from OpenBSD and cross-referenced with Linux driver.

16 years agoFix some boolean logic errors. && vs & and other sillyness. *blush*
Peter Wemm [Fri, 18 Jan 2008 22:09:44 +0000 (22:09 +0000)]
Fix some boolean logic errors.  && vs & and other sillyness.  *blush*
This would prevent it from skipping non-present cpus in -P output.

Submitted by:  Pieter de Goeje <pieter@degoeje.nl>

16 years agoUpdate VOP_LOCK() and VOP_UNLOCK() prototypes.
Attilio Rao [Fri, 18 Jan 2008 22:09:29 +0000 (22:09 +0000)]
Update VOP_LOCK() and VOP_UNLOCK() prototypes.
Leave 'td' argument description as it is used by VOP_ISLOCKED(). It will
be axed in further commit.

16 years agoAdd some regression tests for libm's exponential functions. These
David Schultz [Fri, 18 Jan 2008 21:46:54 +0000 (21:46 +0000)]
Add some regression tests for libm's exponential functions. These
mostly just test corner cases rather than accuracy. Some of the
tests don't pass right now if you compile libm at -O2 due to gcc
constant-folding some things that it shouldn't. I'll fix that
shortly.

16 years agoHook up exp2l() and related docs to the build.
David Schultz [Fri, 18 Jan 2008 21:43:10 +0000 (21:43 +0000)]
Hook up exp2l() and related docs to the build.

16 years agoIntroduce a new log(3) manpage and move the relevant functions there.
David Schultz [Fri, 18 Jan 2008 21:43:00 +0000 (21:43 +0000)]
Introduce a new log(3) manpage and move the relevant functions there.
Document exp2l() in exp(3), and remove the quaint discussion of topics
such as what these functions were called on the HP-71B's variant of
BASIC.

16 years agoImplement exp2l(). There is one version for machines with 80-bit
David Schultz [Fri, 18 Jan 2008 21:42:46 +0000 (21:42 +0000)]
Implement exp2l(). There is one version for machines with 80-bit
long doubles (i386, amd64, ia64) and one for machines with 128-bit
long doubles (sparc64). Other platforms use the double version.
I've only done runtime testing on i386.

Thanks to bde@ for helpful discussions and bugfixes.

16 years agoAdd a new union member to access the exponent and sign of a long double
David Schultz [Fri, 18 Jan 2008 21:25:51 +0000 (21:25 +0000)]
Add a new union member to access the exponent and sign of a long double
in a single op. Idea from bde.

16 years agoFix mbuf pool watermark configuration (mismerged from OpenBSD in 1.132).
Jung-uk Kim [Fri, 18 Jan 2008 20:33:21 +0000 (20:33 +0000)]
Fix mbuf pool watermark configuration (mismerged from OpenBSD in 1.132).

Submitted by: sephe
MFC after: 3 days

16 years agoFix gratuitous whitespace bug
Christian S.J. Peron [Fri, 18 Jan 2008 19:57:21 +0000 (19:57 +0000)]
Fix gratuitous whitespace bug

MFC after: 1 week
Obtained from: TrustedBSD Project

16 years agoAdd a case for AUE_LISTEN. This removes the following console error message:
Christian S.J. Peron [Fri, 18 Jan 2008 19:50:34 +0000 (19:50 +0000)]
Add a case for AUE_LISTEN. This removes the following console error message:

"BSM conversion requested for unknown event 43140"

It should be noted that we need to audit the fd argument for this system
call.

Obtained from: TrustedBSD Project
MFC after: 1 week

16 years agoo FreeBSD 6.3-RELEASE added.
Maxim Konovalov [Fri, 18 Jan 2008 19:25:15 +0000 (19:25 +0000)]
o FreeBSD 6.3-RELEASE added.

16 years agoMove unlock of global UNIX domain socket lock slightly lower in
Robert Watson [Fri, 18 Jan 2008 19:16:03 +0000 (19:16 +0000)]
Move unlock of global UNIX domain socket lock slightly lower in
unp_connect(): it is expected to return with the lock held, and two
possible error paths otherwise returned with it unlocked.

The fix committed here is slightly different from the patch in the
PR, but along an alternative line suggested in the PR.

PR: 119778
MFC after: 3 days
Submitted by: James Juran <james dot juran at baesystems dot com>

16 years agoInclude the thread name (in addition to the proc name) in "info threads."
Ed Maste [Fri, 18 Jan 2008 18:57:27 +0000 (18:57 +0000)]
Include the thread name (in addition to the proc name) in "info threads."

16 years agoIn the rev. 1.153, the one place for converting minor number to unit
Konstantin Belousov [Fri, 18 Jan 2008 18:07:04 +0000 (18:07 +0000)]
In the rev. 1.153, the one place for converting minor number to unit
was missed. As result, pty_create_slave() may index out of the names[]
bounds, creating wrong slave tty names.

Tested by: kensmith
Reviewed by: jhb
MFC after: 3 days

16 years agoUse nfsrv_destroycache() only once, else it crashes the server.
Remko Lodder [Fri, 18 Jan 2008 17:03:36 +0000 (17:03 +0000)]
Use nfsrv_destroycache() only once, else it crashes the server.

PR: kern/118152
Submitted by: Bjoern Groenvall <bg at sics dot se>
Approved by: imp (mentor, a while ago already), jhb
MFC After: 3 days

16 years agorefactor code so it can run in a chroot without having to have /dev/mounted
Julian Elischer [Fri, 18 Jan 2008 17:02:14 +0000 (17:02 +0000)]
refactor code so it can run in a chroot without having to have /dev/mounted
MFC After: 1 week

16 years agopcib is compiled in when "device pci" is specified.
Christian Brueffer [Fri, 18 Jan 2008 17:00:44 +0000 (17:00 +0000)]
pcib is compiled in when "device pci" is specified.

Submitted by: marius
Reviewed by: imp

16 years agoStyle changes from avatar.
Doug Ambrisko [Fri, 18 Jan 2008 16:34:18 +0000 (16:34 +0000)]
Style changes from avatar.

Submitted by: avatar

16 years agoFirst real attempt at proper locking. The locking is a little complicated
Doug Ambrisko [Fri, 18 Jan 2008 16:31:24 +0000 (16:31 +0000)]
First real attempt at proper locking.  The locking is a little complicated
since the the command and data that is being built to be sent to or read
from the HW lives in the softc.  Commands are later run via an_setdef etc.
In the ioctl path various references are kept to the data stored in
the softc so it needs to be protected.  Almost think of the command
in the softc a global variable since it essentially is.  Since locking
wasn't done in this type of context the commands would get corrupted.

Thanks to avatar@ for catching some lock issues and dhw@ for testing.

Things are a lot more stable except for the MPI-350 cards.  My an(4)
remote laptop stays on the network now.

The driver should be changed so that it uses private memory that is passed
to the functions that talk to the card.  Then only those functions would
really need to grab locks.

Reviewed by: avatar@

16 years agoMake sure reading td_runtime in critical section since thread may be
David Xu [Fri, 18 Jan 2008 13:00:28 +0000 (13:00 +0000)]
Make sure reading td_runtime in critical section since thread may be
preempted and td_runtime will be modified.

16 years agoIn tcp_ctloutput(), don't hold the inpcb lock over sooptcopyin(), rather,
Robert Watson [Fri, 18 Jan 2008 12:19:50 +0000 (12:19 +0000)]
In tcp_ctloutput(), don't hold the inpcb lock over sooptcopyin(), rather,
drop the lock and then re-acquire it, revalidating TCP connection state
assumptions when we do so.  This avoids a potential lock order reversal
(and potential deadlock, although none have been reported) due to the
inpcb lock being held over a page fault.

MFC after: 1 week
PR: 102752
Reviewed by: bz
Reported by: Václav Haisman <v dot haisman at sh dot cvut dot cz>

16 years agoCorrect the sysconf variable name, _SC_CLK_TCK.
Ruslan Ermilov [Fri, 18 Jan 2008 12:13:05 +0000 (12:13 +0000)]
Correct the sysconf variable name, _SC_CLK_TCK.

16 years agoudf_vget() shall vgone() the vnode when the file_entry cannot be allocated
Konstantin Belousov [Fri, 18 Jan 2008 12:09:54 +0000 (12:09 +0000)]
udf_vget() shall vgone() the vnode when the file_entry cannot be allocated
or read from the volume. Otherwise, half-constructed vnode could be found
later and cause panic when accessed.

PR: 118322
MFC after: 1 week

16 years agoStill no new leapseconds: Bulletin C-35
Poul-Henning Kamp [Fri, 18 Jan 2008 09:34:39 +0000 (09:34 +0000)]
Still no new leapseconds: Bulletin C-35

16 years agoRemove a chunk of duplicated code, test the destination address against the
Andrew Thompson [Fri, 18 Jan 2008 09:34:09 +0000 (09:34 +0000)]
Remove a chunk of duplicated code, test the destination address against the
bridge the same way we check member interfaces.

16 years ago_POSIX_THREAD_CPUTIME is now supported.
David Xu [Fri, 18 Jan 2008 08:48:32 +0000 (08:48 +0000)]
_POSIX_THREAD_CPUTIME is now supported.

16 years agoUse m_collapse(9) to collapse mbuf chains instead of relying on
Pyun YongHyeon [Fri, 18 Jan 2008 08:32:08 +0000 (08:32 +0000)]
Use m_collapse(9) to collapse mbuf chains instead of relying on
shortest possible chain of mbufs of m_defrag(9). What we want is
chains of mbufs that can be safely stored to a Tx descriptor which
can have up to STGE_MAXTXSEGS mbufs. The ethernet controller does
not need to align Tx buffers on 32bit boundary. So the use of
m_defrag(9) was waste of time.

16 years agoAdd POSIX clock id CLOCK_THREAD_CPUTIME_ID, this can be used to measure
David Xu [Fri, 18 Jan 2008 07:04:42 +0000 (07:04 +0000)]
Add POSIX clock id CLOCK_THREAD_CPUTIME_ID, this can be used to measure
per-thread runtime in user code.

16 years agoI misread the Tinderbox error; this should really unbreak 64-bit builds.
Tim Kientzle [Fri, 18 Jan 2008 06:16:08 +0000 (06:16 +0000)]
I misread the Tinderbox error; this should really unbreak 64-bit builds.

Pointy hats, yep, keep 'em coming.  ;-/

16 years agoFix 64-bit build after my last commit. <sigh>
Tim Kientzle [Fri, 18 Jan 2008 06:08:39 +0000 (06:08 +0000)]
Fix 64-bit build after my last commit.  <sigh>

16 years agoThe previous commit caused the archive_write_disk interface to
Tim Kientzle [Fri, 18 Jan 2008 05:48:50 +0000 (05:48 +0000)]
The previous commit caused the archive_write_disk interface to
start obeying filesize limits; this test wasn't properly setting
file sizes before trying to write file data.

16 years agoIssues with hardlinks in newc-format files prompted me to
Tim Kientzle [Fri, 18 Jan 2008 05:05:58 +0000 (05:05 +0000)]
Issues with hardlinks in newc-format files prompted me to
write a new test to exercise the hardlink strategies used
by different archive formats (tar, old cpio, new cpio).
This uncovered two problems, both fixed by this commit:

1) Enforce file size when writing files to disk.

2) When restoring hardlink entries, if they have data associated, go
   ahead and open the file so we can write the data.

In particular, this fixes bsdtar/bsdcpio extraction of new cpio
formats where the "original" is empty and the subsequent "hardlink"
entry actually carries the data.  It also provides correct behavior
for old cpio archives where hardlinked entries have their bodies
stored multiple times in the archive; the last body should always be
the one that ends up in the final file.  The new pax format also
permits (but does not require) hardlinks to carry file data; again,
the last contents should always win.

Note that with any of these, a size of zero on a hardlink simply means
that the hardlink carries no data; it does not mean that the file has
zero size.  A non-zero size on a hardlink does provide the file size.

Thanks to: John Baldwin, for reminding me about this long-standing bug
    and sending me a simple example archive that prompted this test case

16 years agoReconnect the progress callback. It may not get called
Tim Kientzle [Fri, 18 Jan 2008 04:53:45 +0000 (04:53 +0000)]
Reconnect the progress callback.  It may not get called
as often as you might expect, but at least it will get called
now.

Thanks to: David Topham for asking how this got disconnected.

16 years agoSYSTEM_SCOPE_ONLY flag is no longer needed, it is the only mode libthr
David Xu [Fri, 18 Jan 2008 04:29:36 +0000 (04:29 +0000)]
SYSTEM_SCOPE_ONLY flag is no longer needed, it is the only mode libthr
supports.

16 years agoAdd a -P flag to display per-cpu cpu usage stats.
Peter Wemm [Fri, 18 Jan 2008 01:43:14 +0000 (01:43 +0000)]
Add a -P flag to display per-cpu cpu usage stats.

16 years agoIEEE 802.1D-2004 states, frames containing any of the group MAC Addresses
Andrew Thompson [Fri, 18 Jan 2008 00:19:10 +0000 (00:19 +0000)]
IEEE 802.1D-2004 states, frames containing any of the group MAC Addresses
specified in Table 7-10 in their destination address field shall not be relayed
by the Bridge. Add a check in bridge_forward() to adhere to this.

PR: kern/119744

16 years ago- Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and
John Baldwin [Thu, 17 Jan 2008 23:37:47 +0000 (23:37 +0000)]
- Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and
  re_defrag() and use m_collapse() instead.
- Replace a reference to ath_defrag() in a comment in if_wpi.c with
  m_collapse().

16 years agoAdd 'compat_freebsd[4567]' features corresponding to the kernel options
John Baldwin [Thu, 17 Jan 2008 22:46:32 +0000 (22:46 +0000)]
Add 'compat_freebsd[4567]' features corresponding to the kernel options
COMPAT_FREEBSD[4567].

MFC after: 1 week
Requested by: kris

16 years agoAdd a new 'add-kld <kld>' command to kgdb to make it easier to analyze
John Baldwin [Thu, 17 Jan 2008 21:43:12 +0000 (21:43 +0000)]
Add a new 'add-kld <kld>' command to kgdb to make it easier to analyze
crash dumps with kernel modules.  The command is basically a wrapper
around add-symbol-file except that it uses the kernel linker data
structures and the ELF section headers of the kld to calculate the
section addresses add-symbol-file needs.

The 'kld' parameter may either be an absolute path or a relative path.
kgdb looks for the kld in several locations checking for variants with
".symbols" or ".debug" suffixes in each location.  The first location it
tries is just opening the specified path (this handles absolute paths and
looks for the kld relative to the current directory otherwise).  Next
it tries to find the module in the same directory of the kernel image
being used.  If that fails it extracts the kern.module_path from the
kernel being debugged and looks in each of those paths.

The upshot is that for the common cases of debugging /boot/kernel/kernel
where the module is in either /boot/kernel or /boot/modules one can merely
do 'add-kld foo.ko'.

MFC after: 1 week

16 years ago- remove bogus_imm counter
Kip Macy [Thu, 17 Jan 2008 21:25:58 +0000 (21:25 +0000)]
- remove bogus_imm counter
- disable pcpu cluster cache by default until reference counting is handled
  correctly for held clusters - can be re-enable by sysctl

16 years agopromote ath_defrag to m_collapse (and retire private+unused
Sam Leffler [Thu, 17 Jan 2008 21:25:09 +0000 (21:25 +0000)]
promote ath_defrag to m_collapse (and retire private+unused
m_collapse from cxgb)

Reviewed by: pyun, jhb, kmacy
MFC after: 2 weeks

16 years agoRemove remnants of old *_FORTRAN build flags.
Christian Brueffer [Thu, 17 Jan 2008 20:51:58 +0000 (20:51 +0000)]
Remove remnants of old *_FORTRAN build flags.

Approved by: rwatson (mentor)
MFC after: 3 days

16 years agoRemove a conditional that is always true.
John Baldwin [Thu, 17 Jan 2008 20:15:15 +0000 (20:15 +0000)]
Remove a conditional that is always true.

MFC after: 2 weeks

16 years agoUse pause(9) instead of a tsleep() on a stack variable.
John Baldwin [Thu, 17 Jan 2008 20:11:58 +0000 (20:11 +0000)]
Use pause(9) instead of a tsleep() on a stack variable.

MFC after: 1 week

16 years agoNote the driver support PERC and LSI1078 based controllers.
Doug Ambrisko [Thu, 17 Jan 2008 19:36:13 +0000 (19:36 +0000)]
Note the driver support PERC and LSI1078 based controllers.

Prompted by: Vlad GALU

16 years agoCorrect that LSI 0060 is a mfi device and not mpt.
Doug Ambrisko [Thu, 17 Jan 2008 19:29:01 +0000 (19:29 +0000)]
Correct that LSI 0060 is a mfi device and not mpt.

16 years agoEliminate warnings by adding headers.
Ed Maste [Thu, 17 Jan 2008 18:59:59 +0000 (18:59 +0000)]
Eliminate warnings by adding headers.

16 years agoUse cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY().
John Baldwin [Thu, 17 Jan 2008 18:59:38 +0000 (18:59 +0000)]
Use cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY().

MFC after: 1 week

16 years agoRetire PMAP_DIAGNOSTIC. Any useful diagnostics that were conditionally
Alan Cox [Thu, 17 Jan 2008 18:25:52 +0000 (18:25 +0000)]
Retire PMAP_DIAGNOSTIC.  Any useful diagnostics that were conditionally
compiled under PMAP_DIAGNOSTIC are now KASSERT()s.  (Note: The kernel
option DIAGNOSTIC still disables inlining of certain pmap functions.)

Eliminate dead code from pmap_enter().  This code implemented an assertion.
On i386, an equivalent check is already implemented.  However, on amd64,
a small change is required to implement an equivalent check.

Eliminate \n from a nearby panic string.

Use KASSERT() to reimplement pmap_copy()'s two assertions.

16 years agoAdd a macro STRICT_ASSIGN() to help avoid the compiler bug that
Bruce Evans [Thu, 17 Jan 2008 17:02:11 +0000 (17:02 +0000)]
Add a macro STRICT_ASSIGN() to help avoid the compiler bug that
assignments and casts don't clip extra precision, if any.  The
implementation is to assign to a temporary volatile variable and read
the result back to assign to the original lvalue.

lib/msun currently 2 different hard-coded hacks to avoid the problem
in just a few places and needs it in a few more places.  One variant
uses volatile for the original lvalue.  This works but is slower than
necessary.  Another temporarily casts the lvalue to volatile.  This
broke with gcc-4.2.1 or earlier (gcc now stores to the lvalue but
doesn't load from it).

16 years agoAdd an alternative view of the bits in an 80-bit long double (64+16
Bruce Evans [Thu, 17 Jan 2008 16:39:07 +0000 (16:39 +0000)]
Add an alternative view of the bits in an 80-bit long double (64+16
instead of 32+32+15+1) on all arches that have such long doubles (amd64,
ia64 and i386).  Large objects should be be accessed in large units,
and the 32+32+15+1[+padding] decomposition asks for almost the opposite
of that, sometimes resulting in very slow accesses depending on how
well the compiler ignores what we ask for and converts to the best
units for the given machine.  E.g., on Athlons, there is a 10-20 cycle
penalty for accessing the middle 32-bit word immediately after an
80-bit store.

Whether actually using the alternative view is better is very machine-
dependent.  A 32+32+16 view is probably best with old 32-bit systems
and gcc through 4.2.1.  The compiler should mostly avoid the view and
generate best accesses, but gcc-4.2.1 is far from doing that.  I think
64+16 is best for now.  Similarly for doubles -- they should be using
64+0 especially on 64-bit machines, but fdlibm uses 32+32 extensively
for them.  Fortunately, in 64-bit mode for doubles, gcc already ignores
the 32+32-bit view and generates best accesses in many cases.

16 years agoTranslate from the i386. All FP constants and operations are evaluated
Bruce Evans [Thu, 17 Jan 2008 13:12:46 +0000 (13:12 +0000)]
Translate from the i386.  All FP constants and operations are evaluated
in the range and precision of their type(s) on amd64, but FLT_EVAL_METHOD
said that they were evalated in the "interesting" (buggy) i387 methods.
float_t was broken compatibly with FLT_EVAL_METHOD.

These definitions seem to be broken on powerpc and possibly on arm.
float_t is float on powerpc with gcc [-notraditional] according to
glibc, and FLT_EVAL_METHOD is marked with XXX on arm.

16 years agoUnbreak build by adding the missing parameter to pmap_enter().
Olivier Houchard [Thu, 17 Jan 2008 12:41:59 +0000 (12:41 +0000)]
Unbreak build by adding the missing parameter to pmap_enter().

16 years agoSync from OpenBSD r1.118, nuke clause 3 & 4.
Andrew Thompson [Thu, 17 Jan 2008 09:46:16 +0000 (09:46 +0000)]
Sync from OpenBSD r1.118, nuke clause 3 & 4.

16 years agoFix lock ordering panic by not calling ether_ioctl with port lock held
Kip Macy [Wed, 16 Jan 2008 21:33:34 +0000 (21:33 +0000)]
Fix lock ordering panic by not calling ether_ioctl with port lock held

Reported by: rrs

16 years agoFix some style nits.
Remko Lodder [Wed, 16 Jan 2008 19:36:21 +0000 (19:36 +0000)]
Fix some style nits.

Prodded by: brueffer
MFC After: 3 days

16 years agoANSIfy and remove register.
Xin LI [Wed, 16 Jan 2008 19:27:43 +0000 (19:27 +0000)]
ANSIfy and remove register.

Resulting binary verified with strip(1)+md5(1).

16 years agoAdd a header containing constants for the various HPET registers and their
John Baldwin [Wed, 16 Jan 2008 18:47:07 +0000 (18:47 +0000)]
Add a header containing constants for the various HPET registers and their
fields and update the code to match.  The PR served more as an inspiration
than providing the actual diffs.

MFC after: 1 week
PR: kern/112544

16 years agoUse a phony .POSIX target. This seems to be the way to
David E. O'Brien [Wed, 16 Jan 2008 17:16:36 +0000 (17:16 +0000)]
Use a phony .POSIX target.   This seems to be the way to
turn off the stuff in src/usr.bin/make/main.c rev 1.161.

16 years agoAdd a set of regression tests for the POSIX shm API (shm_open(2) and
John Baldwin [Wed, 16 Jan 2008 15:51:24 +0000 (15:51 +0000)]
Add a set of regression tests for the POSIX shm API (shm_open(2) and
shm_unlink(2)).

16 years agoRemove WITHOUT_FORTRAN from the XMAKE target, it doesn't exist anymore.
Christian Brueffer [Wed, 16 Jan 2008 15:05:49 +0000 (15:05 +0000)]
Remove WITHOUT_FORTRAN from the XMAKE target, it doesn't exist anymore.

Reviewed by: imp, kan
Approved by: rwatson (mentor)
MFC after: 3 days

16 years agoDont accidentally remove a filesocket which is still in use. This gives
Remko Lodder [Wed, 16 Jan 2008 13:54:40 +0000 (13:54 +0000)]
Dont accidentally remove a filesocket which is still in use. This gives
problems when the DRM driver is loaded and the AIXGL extension is loaded
, the AIXGL driver requests a drm_close and this will cause the radeon
driver to fail while starting X windows.

PR: kern/114688
Submitted by: vehemens <vehemens at verizon dot net>
Prodded by: Robert Noland
Approved by: imp (mentor, a while ago already), anholt
MFC After: 1 week

16 years agoBump manpage date for rev 1.27
Giorgos Keramidas [Wed, 16 Jan 2008 07:00:55 +0000 (07:00 +0000)]
Bump manpage date for rev 1.27

MFC after: 3 days

16 years agoDocument that loader(8) stops reading `loader.conf' when it
Giorgos Keramidas [Wed, 16 Jan 2008 06:59:22 +0000 (06:59 +0000)]
Document that loader(8) stops reading `loader.conf' when it
encounters a syntax error, and add a tip about adding first
the `vital' options and then experimental ones.

PR: docs/119658
Submitted by: Julian Stacey, jhs at berklix.org

16 years agoremove superfluous debug printfs
Kip Macy [Wed, 16 Jan 2008 02:39:33 +0000 (02:39 +0000)]
remove superfluous debug printfs

16 years agoRemove duplicate cpufreq levels, i.e. ones that are within 25 Mhz of each
Nate Lawson [Wed, 16 Jan 2008 01:05:21 +0000 (01:05 +0000)]
Remove duplicate cpufreq levels, i.e. ones that are within 25 Mhz of each
other.  The first one survives, the rest are removed.  So far, it appears
only some acpi_perf(4) BIOS tables have these invalid states, but address
this in the core to be sure to handle other potential driver data.

PR: kern/114722
Tested by: stefan.lambrev / moneybookers.com
MFC after: 3 days

16 years agoFix mbuf leak caused by freeing packet zone clusters but not their associated mbufs
Kip Macy [Wed, 16 Jan 2008 00:28:30 +0000 (00:28 +0000)]
Fix mbuf leak caused by freeing packet zone clusters but not their associated mbufs

- Track packet zone mbufs separately from other mbufs
- free packet zone buffers via m_free rather than trying to manage the refcount
  as with clusters - its refcount and management seems to be "special"

16 years agoput tx queue size back to 1024
Kip Macy [Wed, 16 Jan 2008 00:26:04 +0000 (00:26 +0000)]
put tx queue size back to 1024

16 years agoOptimize this a bit better.
David Schultz [Tue, 15 Jan 2008 23:31:24 +0000 (23:31 +0000)]
Optimize this a bit better.

Submitted by: bde (although these aren't all of his changes)

16 years agoUse '%zd' to print PIO_LEN since it involves a size_t (via sizeof()) to
John Baldwin [Tue, 15 Jan 2008 22:01:26 +0000 (22:01 +0000)]
Use '%zd' to print PIO_LEN since it involves a size_t (via sizeof()) to
appease the tinderbox on 32-bit platforms.

Tested on: amd64, i386

16 years agoDon't cache the new-bus name of a PCI device in the PCI conf structure,
John Baldwin [Tue, 15 Jan 2008 21:40:46 +0000 (21:40 +0000)]
Don't cache the new-bus name of a PCI device in the PCI conf structure,
but reread it from the device_t every time the device list is fetched.
Previously the device name in pciconf -l would not be updated when a driver
was unloaded or if a device was detached and attached to a different
driver.

MFC after: 1 week
PR: kern/104777
Submitted by: "Iasen Kostoff"  tbyte | otel net

16 years agoAdd optional support to mxge for MSI-X interrupts and multiple receive
Andrew Gallatin [Tue, 15 Jan 2008 20:34:49 +0000 (20:34 +0000)]
Add optional support to mxge for MSI-X interrupts and multiple receive
queues (which we call slices).  The NIC will steer traffic into up to
hw.mxge.max_slices different receive rings based on a configurable
hash type (hw.mxge.rss_hash_type).

Currently the driver defaults to using a single slice, so the default
behavior is unchanged.  Also, transmit from non-zero slices is
disabled currently.

16 years agoWITHOUT_FORTRAN was removed some time ago. Regen src.conf.5.
Christian Brueffer [Tue, 15 Jan 2008 19:54:17 +0000 (19:54 +0000)]
WITHOUT_FORTRAN was removed some time ago.  Regen src.conf.5.

PR: 119562
Submitted by: Daniel Rucci <dan@rucci.org>
MFC after: 3 days

16 years agoHide common prints under bootverbose.
Maxim Sobolev [Tue, 15 Jan 2008 19:21:08 +0000 (19:21 +0000)]
Hide common prints under bootverbose.

Obtained from: src/sys/dev/rr232x/osm_bsd.c, rev.1.2-1.3
MFC after: 2 weeks

16 years agoRemove some now-unused macros.
John Baldwin [Tue, 15 Jan 2008 18:55:52 +0000 (18:55 +0000)]
Remove some now-unused macros.

MFC after: 1 week

16 years agoFix a few minor issues based on a bug report and reading over the HPET
John Baldwin [Tue, 15 Jan 2008 18:50:47 +0000 (18:50 +0000)]
Fix a few minor issues based on a bug report and reading over the HPET
spec:
- Use read/modify/write cycles to enable and disable the HPET instead of
  writing 0 to reserved bits.
- Shutdown the HPET during suspend as encouraged by the spec.
- Fail to attach to an HPET with a period of zero.

MFC after: 1 week
PR: kern/119675 [3]
Reported by: Leo Bicknell | bicknell ufp.org

16 years agoMake test00 compilable again.
Maxim Sobolev [Tue, 15 Jan 2008 18:34:47 +0000 (18:34 +0000)]
Make test00 compilable again.

16 years agoHandle Zip archives that are "multi-part archives with only
Tim Kientzle [Tue, 15 Jan 2008 16:27:15 +0000 (16:27 +0000)]
Handle Zip archives that are "multi-part archives with only
one part" by simply ignoring the marker at the beginning
of the file.  (Zip archivers reserve four bytes at the beginning
of each part of a multi-part archive, if it happens to only
require one part, those four bytes get filled with a placeholder
that can be ignored.)

Thanks to: Marius Nuennerich,
 for pointing me to a Zip archive that libarchive couldn't handle
MFC after: 7 days

16 years agoPut back the openpty(3) and ptsname(3) fixes but don't disable ptsname(3)
John Baldwin [Tue, 15 Jan 2008 15:36:23 +0000 (15:36 +0000)]
Put back the openpty(3) and ptsname(3) fixes but don't disable ptsname(3)
on pts(4) devices this time.  This fixes the issues while leaving pts(4)
enabled on HEAD.

16 years agoFix accidental swap of "const" for "static" in mxge firmware byte arrays
Andrew Gallatin [Tue, 15 Jan 2008 15:04:40 +0000 (15:04 +0000)]
Fix accidental swap of "const" for "static" in mxge firmware byte arrays
caused by running my import script with the wrong args.

16 years agoBack out last commit, since it accidentally broke pts.
Colin Percival [Tue, 15 Jan 2008 13:59:13 +0000 (13:59 +0000)]
Back out last commit, since it accidentally broke pts.

The security fix will be re-committed soon, hopefully without breaking
anything.

16 years agoUpdate to firmware version 1.4.29 from 1.4.25. Relevant changes include:
Andrew Gallatin [Tue, 15 Jan 2008 13:29:32 +0000 (13:29 +0000)]
Update to firmware version 1.4.29 from 1.4.25.  Relevant changes include:

- Fix a bug introduced in 1.4.20 where speculative read by the processor in the
   write-only doorbell region would cause a target-abort (as opposed to simply
   returning random data). This could manifest itself as NMI or machine freeze
   depending on how the BIOS/OS/chipset configuration handles target-abort.

- Add support for new revisions of -R cards (with AEL1002/AEL1010 xaui->xfi)

- Increase an internal timing (dispatch engine): fix possible spurious reset
  (seen on very few cards).

16 years ago - When executing the 'tryself' branch in sched_pickcpu() look at the
Jeff Roberson [Tue, 15 Jan 2008 09:03:09 +0000 (09:03 +0000)]
 - When executing the 'tryself' branch in sched_pickcpu() look at the
   lowest priority on the queue for the current cpu vs curthread's
   priority.  In the case that curthread is waking up many threads of a
   lower priority as would happen with a turnstile_broadcast() or wakeup()
   of many threads this prevents them from all ending up on the current cpu.
 - In sched_add() make the relationship between a scheduled ithread and
   the current cpu advisory rather than strict.  Only give the ithread
   affinity for the current cpu if it's actually being scheduled from
   a hardware interrupt.  This prevents it from migrating when it simply
   blocks on a lock.

Sponsored by: Nokia

16 years ago- Simplify mb_free_ext_fast
Kip Macy [Tue, 15 Jan 2008 08:08:09 +0000 (08:08 +0000)]
- Simplify mb_free_ext_fast
- increase asserts for mbuf accounting
- track outstanding mbufs (maps very closely to leaked)
- actually only create one thread per port if !multiq
    Oddly enough this fixes the use after free

- move txq_segs to stack in t3_encap
- add checks that pidx doesn't move pass cidx
- simplify mbuf free logic in collapse mbufs routine

16 years agoFix some bugs in wall(1):
David Schultz [Tue, 15 Jan 2008 07:40:30 +0000 (07:40 +0000)]
Fix some bugs in wall(1):
- Handle wrapping correctly when \r appears in the input, and don't
  remove the \r from the output.
- For lines longer than 79 characters, don't drop every 80th character.
- Style: Braces around compound while statement.

PR: 114498
Submitted by: Niclas Zeising <niclas.zeising@gmail.com> (earlier version)

16 years agoIn getttyent(3), if /etc/ttys doesn't end in a newline, don't
David Schultz [Tue, 15 Jan 2008 06:50:50 +0000 (06:50 +0000)]
In getttyent(3), if /etc/ttys doesn't end in a newline, don't
freak out and keep trying to expand the buffer until realloc()
fails.

PR: 114398

16 years agoQuotacheck may possibly skip quota accounting for up to 2 files
Mike Pritchard [Tue, 15 Jan 2008 06:33:20 +0000 (06:33 +0000)]
Quotacheck may possibly skip quota accounting for up to 2 files
on a filesystem if the quota data files reside on a different
filesystem (e.g. the userquota=/somepath,groupquota=/somepath2
options are specified in /etc/fstab to place the quota files
somewhere other than the default location).

Fix quotacheck to only skip accounting if the quota data file
actually resides on the filesystem being checked.

16 years agoSupport uppercase hex digits in cpio archives.
Tim Kientzle [Tue, 15 Jan 2008 04:56:48 +0000 (04:56 +0000)]
Support uppercase hex digits in cpio archives.

Thanks to: Joshua Kwan
MFC after: 7 days