]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoConvert panic()s to KASSERT()s. This is an optimisation for
glebius [Mon, 23 Jan 2012 16:31:46 +0000 (16:31 +0000)]
Convert panic()s to KASSERT()s. This is an optimisation for
hashdestroy() since in absence of INVARIANTS a compiler
will drop the entire for() cycle.

12 years agoPart of r230482 didn't actually work. Revert it for now. This means PR
nwhitehorn [Mon, 23 Jan 2012 16:17:54 +0000 (16:17 +0000)]
Part of r230482 didn't actually work. Revert it for now. This means PR
161047 isn't actually fixed.

PR: bin/161047

12 years agoDo a test in a better way. Editing files after testing them is never wise.
nwhitehorn [Mon, 23 Jan 2012 15:50:16 +0000 (15:50 +0000)]
Do a test in a better way. Editing files after testing them is never wise.

12 years agoPer popular demand, if installing from a graphics terminal, run the
nwhitehorn [Mon, 23 Jan 2012 15:44:52 +0000 (15:44 +0000)]
Per popular demand, if installing from a graphics terminal, run the
installer on a VTY with no kernel messages (VTY 2), show the installer
log in real time on VTY 3, and spawn a shell on VTY 4.

PR: bin/161047, bin/161048
MFC after: 2 weeks

12 years agoIn ng_socket(4) expose less kernel internals to userland. This commit
glebius [Mon, 23 Jan 2012 15:39:45 +0000 (15:39 +0000)]
In ng_socket(4) expose less kernel internals to userland. This commit
breaks ABI, but makes probability of ABI breakage in future less.

12 years agoConvert locks that protect name hash, ID hash and typelist from
glebius [Mon, 23 Jan 2012 15:17:14 +0000 (15:17 +0000)]
Convert locks that protect name hash, ID hash and typelist from
mutex(9) to rwlock(9) based locks.

While here remove dropping lock when processing NGM_LISTNODES,
and NGM_LISTTYPES generic commands. We don't need to drop it
since memory allocation is done with M_NOWAIT.

12 years agoMechanically add a config for all missing drivers.
netchild [Mon, 23 Jan 2012 11:37:40 +0000 (11:37 +0000)]
Mechanically add a config for all missing drivers.

No cross-referencing was added to the configs, so no
automatic linking to the documentation of other subsystems.

Drivers which already contain doxygen markup:
agp ath bktr bxe cxgb cxgbe dpt drm e1000 iir
ixgbe mwl nxge ofw pccard siba wpi xen

12 years agoFix two nits in previous commit pointed out by pjd@.
des [Mon, 23 Jan 2012 09:23:07 +0000 (09:23 +0000)]
Fix two nits in previous commit pointed out by pjd@.

MFC after: 3 weeks

12 years agoAdd C11 macros describing subnormal numbers to float.h.
das [Mon, 23 Jan 2012 06:36:41 +0000 (06:36 +0000)]
Add C11 macros describing subnormal numbers to float.h.

Reviewed by: bde

12 years agoMake procstat -l to work with the new version of kern.proc.rlimit.
trociny [Sun, 22 Jan 2012 20:26:46 +0000 (20:26 +0000)]
Make procstat -l to work with the new version of kern.proc.rlimit.

Submitted by: Andrey Zonov <andrey at zonov.org>
MFC after: 2 weeks

12 years agoChange kern.proc.rlimit sysctl to:
trociny [Sun, 22 Jan 2012 20:25:00 +0000 (20:25 +0000)]
Change kern.proc.rlimit sysctl to:

- retrive only one, specified limit for a process, not the whole
  array, as it was previously (the sysctl has been added recently and
  has not been backported to stable yet, so this change is ok);

- allow to set a resource limit for another process.

Submitted by: Andrey Zonov <andrey at zonov.org>
Discussed with: kib
Reviewed by: kib
MFC after: 2 weeks

12 years agoIncrease snd_hda(4) default maximal buffer size from 16K to 64K and
mav [Sun, 22 Jan 2012 15:44:20 +0000 (15:44 +0000)]
Increase snd_hda(4) default maximal buffer size from 16K to 64K and
maximal from 64K to 256K.

We usually don't need 750 sound interrupts per second (1.3ms latency)
when playing 192K/24/8 stream. 187 should be better. On usual 48K/16/2
it is just enough for hw.snd.latency=9 at hw.snd.latency_profile=1 with
23 and 6 interrupts per second.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

12 years agoDocument the values for hw.snd.default_auto.
stefanf [Sun, 22 Jan 2012 14:04:42 +0000 (14:04 +0000)]
Document the values for hw.snd.default_auto.

12 years agosh: Fix $? in the first command of a 'for'.
jilles [Sun, 22 Jan 2012 14:00:33 +0000 (14:00 +0000)]
sh: Fix $? in the first command of a 'for'.

In the first command of a 'for', $? should be the exit status of the last
pipeline (command substitution in the word list or command before 'for'),
not always 0.

12 years agoConnect VirtIO-related manpages to the build.
brueffer [Sun, 22 Jan 2012 13:51:20 +0000 (13:51 +0000)]
Connect VirtIO-related manpages to the build.

12 years agoClarify the implementation-defined behaviour in case of close(2)
kib [Sun, 22 Jan 2012 11:58:17 +0000 (11:58 +0000)]
Clarify the implementation-defined behaviour in case of close(2)
returning error.

MFC after: 1 week

12 years agoFix typo.
kib [Sun, 22 Jan 2012 11:35:50 +0000 (11:35 +0000)]
Fix typo.

Submitted by: John Marino <draco marino st>
MFC after: 3 days

12 years ago- Replace "wtmp" with "utx.log" because last(1) no longer reads wtmp.
hrs [Sun, 22 Jan 2012 11:34:24 +0000 (11:34 +0000)]
- Replace "wtmp" with "utx.log" because last(1) no longer reads wtmp.
- A real filename is now shown in an output report when "-f file" is specified.
- Add Xr lastlogin into last(1) manual page.

Reviewed by: ed
MFC after: 1 week

12 years agoFree memory that won't be used in child.
pjd [Sun, 22 Jan 2012 11:20:42 +0000 (11:20 +0000)]
Free memory that won't be used in child.

MFC after: 1 week

12 years agoThe sys/uio.h header is needed only for readv(2), preadv(2), writev(2) and
pjd [Sun, 22 Jan 2012 11:15:48 +0000 (11:15 +0000)]
The sys/uio.h header is needed only for readv(2), preadv(2), writev(2) and
pwritev(2). Document it more precisely.

Reviewed by: jilles
MFC after: 3 days

12 years agoTDF_* flags should be used with td_flags field and TDP_* flags should be used
pjd [Sun, 22 Jan 2012 11:01:36 +0000 (11:01 +0000)]
TDF_* flags should be used with td_flags field and TDP_* flags should be used
with td_pflags field. Correct two places where it was not the case.

Discussed with: kib
MFC after: 1 week

12 years agoUse provided name when allocating ksid domain. It isn't really used on FreeBSD,
pjd [Sun, 22 Jan 2012 10:58:17 +0000 (10:58 +0000)]
Use provided name when allocating ksid domain. It isn't really used on FreeBSD,
but should fix a panic when pool is imported from another OS that is using this.

MFC after: 1 week

12 years agoFix several glitches in IPv6-related knobs:
hrs [Sun, 22 Jan 2012 10:57:32 +0000 (10:57 +0000)]
Fix several glitches in IPv6-related knobs:

- ipv6_enable + ipv6_gateway_enable should unset ACCEPT_RTADV by default for
  backward compatibility.

- Configurations in ipv6_prefix_IF should be recognized even if there is no
  ifconfig_IF_ipv6.

- DAD wait should be performed at once, not on a per-interface basis, if
  possible.  This fixes an issue that a system with a lot of IPv6-capable
  interfaces takes too long for booting.

MFC after: 1 week

12 years agoMake #error messages string-literals and remove punctuation.
bz [Sun, 22 Jan 2012 10:41:58 +0000 (10:41 +0000)]
Make #error messages string-literals and remove punctuation.

Reported by: bde (for ip_divert)
Reviewed by: bde
MFC after: 3 days

12 years agoComplete rewrite of the snd_hda(4) volume control.
mav [Sun, 22 Jan 2012 10:24:12 +0000 (10:24 +0000)]
Complete rewrite of the snd_hda(4) volume control.

Previous code was relatively dumb. During CODEC probe it was tracing signals
and statically binding amplifier controls to the OSS mixer controls. To set
volume it just set all bound amplifier controls proportionally to mixer
level, not looking on their hierarchy and amplification levels/offsets.

New code is much smarter. It also traces signals during probe, but mostly
to find out possible amplification control rages in dB for each specific
signal. To set volume it retraces each affected signal again and sets
amplifiers controls recursively to reach desired amplification level in dB.
It would be nice to export values in dB to user, but unluckily our OSS mixer
API is too simple for that.

As result of this change:
 - cascaded amplifiers will work together to reach maximal precision.
If some input has 0/+40dB preamplifier with 10dB step and -10/+10dB mixer
with 1dB step after it, new code will use both to provide 0/+40dB control
with 1dB step! We could even get -10/+50dB range there, but that is
intentionally blocked for now.
 - different channels of multichannel associations on non-uniform CODECs
such as VIA VT1708S will have the same volume, not looking that control
ranges are different. It was not good when fronts were 12dB louder.
 - for multiplexed recording, when we can record from only one source at
a time, we can now use recording amplifier controls to set different
volume levels for different inputs if they have no own controls of they
are less precise. If recording source change, amplifiers will be
reconfigured.

To improve out-of-the-box behavior, ignore default volume levels set by
sound(4) and use own, more reasonable: +20dB for mics, -10dB for analog
output volume and 0dB for the rest of controls. sound(4) defaults of 75%
mean absolutely random things for different controls of different CODECs
because of very different control ranges.
Together with further planned automatic recording source selection this
should allow users to get fine playback and recording without touching
mixer first.
Note that existing users should delete /var/db/mixer*-state and reboot
or trigger CODEC reconfiguration to get new default values.

MFC after: 2 months
Sponsored by: iXsystems, Inc.

12 years agoGeneral cleanup.
brueffer [Sun, 22 Jan 2012 10:16:24 +0000 (10:16 +0000)]
General cleanup.

Prodded by: grehan

12 years agoMerge illumos revisions 13540, 13562:
mm [Sun, 22 Jan 2012 08:06:36 +0000 (08:06 +0000)]
Merge illumos revisions 13540, 13562:

illumos rev 13540 [1]:
Removal of pyzfs broke delegation for volumes

illumos rev 13562 [2]:
zfs allow arguments not parsed correctly after pyzfs removal

References:
https://www.illumos.org/issues/1726 [1]
https://www.illumos.org/issues/1977 [2]

Obtained from: illumos (issues #1726, #1977)
MFC after: 1 week

12 years agoMark the taskqueue as the _net80211_ taskqueue.
adrian [Sun, 22 Jan 2012 05:30:29 +0000 (05:30 +0000)]
Mark the taskqueue as the _net80211_ taskqueue.

This makes it much easier to determine whether an event occurs in the
net80211 taskqueue (which was called "ath0 taskq") or the ath driver
taskqueue (which is also called "ath0 taskq".)

12 years agoBring over the visibility control tool for Monthadar's wtap project.
adrian [Sun, 22 Jan 2012 04:51:00 +0000 (04:51 +0000)]
Bring over the visibility control tool for Monthadar's wtap project.

This allows basic control over which wtap nodes can see which other
wtap nodes.

12 years agoFix ip_divert handling of inet and inet6 and module building some more.
bz [Sun, 22 Jan 2012 02:16:31 +0000 (02:16 +0000)]
Fix ip_divert handling of inet and inet6 and module building some more.

Properly sort the "carp" case in modules/Makefile after it was renamed.

Reported by: bde (most)
Reviewed by: bde
MFC after: 3 days

12 years agoClean up some #endif comments removing from short sections. Add #endif
bz [Sun, 22 Jan 2012 02:13:19 +0000 (02:13 +0000)]
Clean up some #endif comments removing from short sections.  Add #endif
comments to longer, also refining strange ones.

Properly use #ifdef rather than #if defined() where possible.  Four
#if defined(PCBGROUP) occurances (netinet and netinet6) were ignored to
avoid conflicts with eventually upcoming changes for RSS.

Reported by: bde (most)
Reviewed by: bde
MFC after: 3 days

12 years agoRemove the nc_time and nc_ticks elements from struct namecache, and
kib [Sun, 22 Jan 2012 01:11:06 +0000 (01:11 +0000)]
Remove the nc_time and nc_ticks elements from struct namecache, and
provide struct namecache_ts which is the old struct namecache. Only
allocate struct namecache_ts if non-null struct timespec *tsp was
passed to cache_enter_time, otherwise use struct namecache.

Change struct namecache allocation and deallocation macros into static
functions, since logic becomes somewhat twisty.  Provide accessor for
the nc_name member of struct namecache to hide difference between
struct namecache and namecache_ts.

The aim of the change is to not waste 20 bytes per small namecache
entry.

Reviewed by:  jhb
MFC after: 2 weeks
X-MFC-note:  after r230394

12 years agoDramatically optimize listing snapshots when user requests only snapshot
pjd [Sat, 21 Jan 2012 21:12:53 +0000 (21:12 +0000)]
Dramatically optimize listing snapshots when user requests only snapshot
names and wants to sort them by name, ie. when executes:

# zfs list -t snapshot -o name -s name

Because only name is needed we don't have to read all snapshot properties.

Below you can find how long does it take to list 34509 snapshots from a single
disk pool before and after this change with cold and warm cache:

before:

# time zfs list -t snapshot -o name -s name > /dev/null
cold cache: 525s
warm cache: 218s

after:

# time zfs list -t snapshot -o name -s name > /dev/null
cold cache: 1.7s
warm cache: 1.1s

MFC after: 1 week

12 years agosh: Remove "kill" example function, which is superseded by the kill builtin
jilles [Sat, 21 Jan 2012 20:39:17 +0000 (20:39 +0000)]
sh: Remove "kill" example function, which is superseded by the kill builtin

MFC after: 1 week

12 years agoFix minor memory leak.
pjd [Sat, 21 Jan 2012 20:13:37 +0000 (20:13 +0000)]
Fix minor memory leak.

MFC after: 3 days

12 years agoUse getcontextx(3) internal API instead of getcontext(2) to provide
kib [Sat, 21 Jan 2012 18:06:18 +0000 (18:06 +0000)]
Use getcontextx(3) internal API instead of getcontext(2) to provide
the signal handlers with the context information in the deferrred
case.

Only enable the use of getcontextx(3) in the deferred signal delivery
code on amd64 and i386. Sparc64 seems to have some undetermined issues
with interaction of alloca(3) and signal delivery.

Tested by: flo (who also provided sparc64 harware access for me), pho
Discussed with: marius
MFC after: 1 month

12 years agoAdd API for obtaining extended machine context states that cannot be
kib [Sat, 21 Jan 2012 18:00:28 +0000 (18:00 +0000)]
Add API for obtaining extended machine context states that cannot be
fit into existing mcontext_t.

On i386 and amd64 do return the extended FPU states using
getcontextx(3). For other architectures, getcontextx(3) returns the
same information as getcontext(2).

Tested by:  pho
MFC after:  1 month

12 years agoAdopt to new layout of struct pcb.
kib [Sat, 21 Jan 2012 17:50:14 +0000 (17:50 +0000)]
Adopt to new layout of struct pcb.

MFC after: 1 month

12 years agoAdd support for the extended FPU states on amd64, both for native
kib [Sat, 21 Jan 2012 17:45:27 +0000 (17:45 +0000)]
Add support for the extended FPU states on amd64, both for native
64bit and 32bit ABIs.  As a side-effect, it enables AVX on capable
CPUs.

In particular:

- Query the CPU support for XSAVE, list of the supported extensions
  and the required size of FPU save area. The hw.use_xsave tunable is
  provided for disabling XSAVE, and hw.xsave_mask may be used to
  select the enabled extensions.

- Remove the FPU save area from PCB and dynamically allocate the
  (run-time sized) user save area on the top of the kernel stack,
  right above the PCB. Reorganize the thread0 PCB initialization to
  postpone it after BSP is queried for save area size.

- The dumppcb, stoppcbs and susppcbs now do not carry the FPU state as
  well. FPU state is only useful for suspend, where it is saved in
  dynamically allocated suspfpusave area.

- Use XSAVE and XRSTOR to save/restore FPU state, if supported and
  enabled.

- Define new mcontext_t flag _MC_HASFPXSTATE, indicating that
  mcontext_t has a valid pointer to out-of-struct extended FPU
  state. Signal handlers are supplied with stack-allocated fpu
  state. The sigreturn(2) and setcontext(2) syscall honour the flag,
  allowing the signal handlers to inspect and manipilate extended
  state in the interrupted context.

- The getcontext(2) never returns extended state, since there is no
  place in the fixed-sized mcontext_t to place variable-sized save
  area. And, since mcontext_t is embedded into ucontext_t, makes it
  impossible to fix in a reasonable way.  Instead of extending
  getcontext(2) syscall, provide a sysarch(2) facility to query
  extended FPU state.

- Add ptrace(2) support for getting and setting extended state; while
  there, implement missed PT_I386_{GET,SET}XMMREGS for 32bit binaries.

- Change fpu_kern KPI to not expose struct fpu_kern_ctx layout to
  consumers, making it opaque. Internally, struct fpu_kern_ctx now
  contains a space for the extended state. Convert in-kernel consumers
  of fpu_kern KPI both on i386 and amd64.

First version of the support for AVX was submitted by Tim Bird
<tim.bird am sony com> on behalf of Sony. This version was written
from scratch.

Tested by: pho (previous version), Yamagi Burmeister <lists yamagi org>
MFC after: 1 month

12 years agoAdd support for the DesignWare USB 2.0 OTG controller chipset.
hselasky [Sat, 21 Jan 2012 13:31:38 +0000 (13:31 +0000)]
Add support for the DesignWare USB 2.0 OTG controller chipset.
Currently the code is not built by any modules. That will
be fixed later. The Atmel ARM bus interface file part of this
commit is just for sake of example. All registers and bits are
declared like macros and not C-structures like in official
Synopsis header files. This driver mostly origins from the
musb_otg.c driver in FreeBSD except that the chip specific
programming has been replaced by the one for DWC 2.0 USB OTG.
Some parts related to system suspend and resume have been left
like empty functions for the future. USB suspend and resume is
fully supported.

12 years agoReplace the beerware license on mdconfig(8) with standard 2-clause BSD.
trasz [Sat, 21 Jan 2012 11:48:48 +0000 (11:48 +0000)]
Replace the beerware license on mdconfig(8) with standard 2-clause BSD.

Approved by: phk@

12 years agoRevert r230390.
andreast [Sat, 21 Jan 2012 11:42:40 +0000 (11:42 +0000)]
Revert r230390.

12 years agoFix the hwmp code to handle nodes in a "line" topology.
adrian [Sat, 21 Jan 2012 00:42:28 +0000 (00:42 +0000)]
Fix the hwmp code to handle nodes in a "line" topology.

For example, this particular topology didn't work correctly from all
nodes:

[A] - [B] - [C] - [D]

Submitted by: Monthadar Al Jaberi <monthadar@gmail.com>
Reviewed by: bschmidt, adrian

12 years agoChange the hwmp debugging to use %6D rather than ether_sprintf().
adrian [Sat, 21 Jan 2012 00:38:18 +0000 (00:38 +0000)]
Change the hwmp debugging to use %6D rather than ether_sprintf().

This allows for multiple MAC addresses to be printed on the same
debugging line.  ether_sprintf() uses a static char buffer and
thus isn't very useful here.

Submitted by: Monthadar Al Jaberi <monthadar@gmail.com>

12 years agoUse separate buffer for global path to avoid overflow of path buffer.
mm [Sat, 21 Jan 2012 00:06:21 +0000 (00:06 +0000)]
Use separate buffer for global path to avoid overflow of path buffer.

Reviewed by: jamie@
MFC after: 3 weeks

12 years agoWe use port_index field of struct octusb_qh to reference USB state
gonzo [Fri, 20 Jan 2012 23:37:04 +0000 (23:37 +0000)]
We use port_index field of struct octusb_qh to reference USB state
of root HUB. Although it is initialized with port index of the
device's parent hub, which is worng. So track the USB tree up to
root HUB  and initialize this filed ptroprly

Rename port_index to root_port_index in order to reflect its
real semantics.

12 years agoAdd one more copyright line accidentially removed in r228103
mm [Fri, 20 Jan 2012 22:56:57 +0000 (22:56 +0000)]
Add one more copyright line accidentially removed in r228103

MFC after: 3 days

12 years agoWhen creating the jails /dev/log symlink, do it by full path to avoid
brooks [Fri, 20 Jan 2012 22:55:19 +0000 (22:55 +0000)]
When creating the jails /dev/log symlink, do it by full path to avoid
creating stray "log" symlinks if the mount fails.  That apparently
happens in some ezjail configs.

PR: conf/143084
Submitted by: Dirk Engling <erdgeist at erdgeist.org>
Reviewed by: simon
MFC after: 2 weeks

12 years agoAdd accidentially removed copyright lines in r228103
mm [Fri, 20 Jan 2012 22:55:16 +0000 (22:55 +0000)]
Add accidentially removed copyright lines in r228103

Reported by: pjd
MFC after: 3 days

12 years agoReplace GPLd headers from the Maestro3 driver with BSD licensed
pfg [Fri, 20 Jan 2012 22:37:10 +0000 (22:37 +0000)]
Replace GPLd headers from the Maestro3 driver with BSD licensed
versions derived from /usr/ports/audio/oss.

The particular headers used were taken from the
attic/drv/oss_allegro directory and are mostly identical
to the previous files.

The Maestro3 driver is now free from the GPL.

NOTE: due to lack of testers this driver is being
considered for deprecation and removal.

PR: kern/153920
Approved by: jhb (mentor)
MFC after: 2 weeks

12 years agoThis commit adds profiling support for powerpc64. Now we can do application
andreast [Fri, 20 Jan 2012 22:34:19 +0000 (22:34 +0000)]
This commit adds profiling support for powerpc64. Now we can do application
profiling and kernel profiling. To enable kernel profiling one has to build
kgmon(8). I will enable the build once I managed to build and test powerpc
(32-bit) kernels with profiling support.

- add a powerpc64 PROF_PROLOGUE for _mcount.
- add macros to avoid adding the PROF_PROLOGUE in certain assembly entries.
- apply these macros where needed.
- add size information to the MCOUNT function.

MFC after: 3 weeks, together with r230291

12 years agoPrevent an error resulting from signed/unsigned comparison on systems
nwhitehorn [Fri, 20 Jan 2012 22:24:39 +0000 (22:24 +0000)]
Prevent an error resulting from signed/unsigned comparison on systems
that do not comply with the OF spec.

Submitted by: Anders Gavare
MFC after: 1 week

12 years agoBy default turn off prefetch when listing snapshots.
pjd [Fri, 20 Jan 2012 22:04:59 +0000 (22:04 +0000)]
By default turn off prefetch when listing snapshots.
In my tests it makes listing snapshots 19% faster with cold cache and
47% faster with warm cache.

MFC after: 1 week

12 years agoRemove another unused token.
pjd [Fri, 20 Jan 2012 21:49:56 +0000 (21:49 +0000)]
Remove another unused token.

MFC after: 3 days

12 years agoRemove unused token 'port'.
pjd [Fri, 20 Jan 2012 21:45:24 +0000 (21:45 +0000)]
Remove unused token 'port'.

MFC after: 3 days

12 years agoClose a race in NFS lookup processing that could result in stale name cache
jhb [Fri, 20 Jan 2012 20:02:01 +0000 (20:02 +0000)]
Close a race in NFS lookup processing that could result in stale name cache
entries on one client when a directory was renamed on another client.  The
root cause for the stale entry being trusted is that each per-vnode nfsnode
structure has a single 'n_ctime' timestamp used to validate positive name
cache entries.  However, if there are multiple entries for a single vnode,
they all share a single timestamp.  To fix this, extend the name cache
to allow filesystems to optionally store a timestamp value in each name
cache entry.  The NFS clients now fetch the timestamp associated with
each name cache entry and use that to validate cache hits instead of the
timestamps previously stored in the nfsnode.  Another part of the fix is
that the NFS clients now use timestamps from the post-op attributes of
RPCs when adding name cache entries rather than pulling the timestamps out
of the file's attribute cache.  The latter is subject to races with other
lookups updating the attribute cache concurrently.  Some more details:
- Add a variant of nfsm_postop_attr() to the old NFS client that can return
  a vattr structure with a copy of the post-op attributes.
- Handle lookups of "." as a special case in the NFS clients since the name
  cache does not store name cache entries for ".", so we cannot get a
  useful timestamp.  It didn't really make much sense to recheck the
  attributes on the the directory to validate the namecache hit for "."
  anyway.
- ABI compat shims for the name cache routines are present in this commit
  so that it is safe to MFC.

MFC after: 2 weeks

12 years agoPull in r148240 from upstream llvm trunk:
dim [Fri, 20 Jan 2012 19:18:11 +0000 (19:18 +0000)]
Pull in r148240 from upstream llvm trunk:

  Make sure the non-SSE lowering for fences correctly clobbers EFLAGS.
  PR11768.

In particular, this fixes segfaults during the build of devel/icu on
i386.  The __sync_synchronize() builtin used for implementing icu's
internal barrier could lead to incorrect behaviour.

MFC after: 3 days

12 years agoMap foreign architecture names to FreeBSD naming convention.
rmh [Fri, 20 Jan 2012 18:55:56 +0000 (18:55 +0000)]
Map foreign architecture names to FreeBSD naming convention.

Approved by: kib (mentor)

12 years agoAdd the .opd section, this is helps booting a profiled kernel.
andreast [Fri, 20 Jan 2012 18:52:31 +0000 (18:52 +0000)]
Add the .opd section, this is helps booting a profiled kernel.
Adjust the OUTPUT_ARCH and use the builtin ALIGN() to adjust the data segment.

12 years agoDisable GUPROF on archs other than i386/amd64 since the fine details are not
andreast [Fri, 20 Jan 2012 18:49:47 +0000 (18:49 +0000)]
Disable GUPROF on archs other than i386/amd64 since the fine details are not
implemented.

12 years ago/etc/netstart: remove invocation of dhclient
rea [Fri, 20 Jan 2012 17:25:15 +0000 (17:25 +0000)]
/etc/netstart: remove invocation of dhclient

dhclient is no longer a real service, it is a helper script
for /etc/rc.d/netif and devd.  Its direct invocation isn't
needed to bring the network up.

Approved by: jhb

12 years agodhclient: don't use syslog for logging non-DHCP interface errors
rea [Fri, 20 Jan 2012 17:19:50 +0000 (17:19 +0000)]
dhclient: don't use syslog for logging non-DHCP interface errors

We should show the error to user, but it doesn't deserve syslog.

Approved by: jhb

12 years agoRemove a superfluous INET6 check (no opt_inet6.h included anyway).
bz [Fri, 20 Jan 2012 17:18:54 +0000 (17:18 +0000)]
Remove a superfluous INET6 check (no opt_inet6.h included anyway).

MFC after: 3 days

12 years agoConditionalize the __floatunsisf and __floatunsidf functions, added in
das [Fri, 20 Jan 2012 14:44:21 +0000 (14:44 +0000)]
Conditionalize the __floatunsisf and __floatunsidf functions, added in
NetBSD's rev 1.6 of this file, on !defined(SOFTFLOAT_FOR_GCC).  These
functions are provided by libgcc, so we don't need them.  This should
unbreak mips.

12 years agoFix a problem when using the CBAPI.
tuexen [Fri, 20 Jan 2012 13:26:11 +0000 (13:26 +0000)]
Fix a problem when using the CBAPI.
While there, remove an old comment which does not apply anymore.

12 years agoDon't print the nmount(2) provided error message if it is empty.
jh [Fri, 20 Jan 2012 12:59:12 +0000 (12:59 +0000)]
Don't print the nmount(2) provided error message if it is empty.

12 years agoIf we're booting there is no need to waste time determining if the service
dougb [Fri, 20 Jan 2012 10:31:27 +0000 (10:31 +0000)]
If we're booting there is no need to waste time determining if the service
is running or not.

PR: conf/150752
Submitted by: YIN Xiaofeng <75394094@qq.com>

12 years agoChange mount_fs() to not exit on error. The "failok" mount option
jh [Fri, 20 Jan 2012 10:06:28 +0000 (10:06 +0000)]
Change mount_fs() to not exit on error. The "failok" mount option
requires that errors are passed to the caller.

PR: 163668
Reviewed by: Garrett Cooper

12 years ago- Clean up checkpath().
jh [Fri, 20 Jan 2012 07:29:29 +0000 (07:29 +0000)]
- Clean up checkpath().
- Remove unneeded sysexits.h include.

No functional change.

Submitted by: bde

12 years agoFix a small nit noted by bde: exp_x should be of type float, not double.
das [Fri, 20 Jan 2012 07:02:42 +0000 (07:02 +0000)]
Fix a small nit noted by bde: exp_x should be of type float, not double.

12 years agoAdd a change I missed in r230367 (don't inline arm's fenv.h functions).
das [Fri, 20 Jan 2012 07:01:58 +0000 (07:01 +0000)]
Add a change I missed in r230367 (don't inline arm's fenv.h functions).

12 years agoRemove an errant `#define dprintf printf'. It seems to be leftover
das [Fri, 20 Jan 2012 06:59:29 +0000 (06:59 +0000)]
Remove an errant `#define dprintf printf'.  It seems to be leftover
debugging code that nothing depends on. (I've had this in my tree for
years without issue.)

12 years agoThese tests check whether the compiler evaluates floating-point
das [Fri, 20 Jan 2012 06:57:21 +0000 (06:57 +0000)]
These tests check whether the compiler evaluates floating-point
expressions properly.  Some of the tests depend on the compiler
implementing C99's FENV_ACCESS pragma, and only commercial compilers
do; those tests are currently skipped.  If any of the enabled tests
fail, then odds are the libm regression tests will fail also.
This should make it easier to diagnose reported problems on platforms
I don't have.

Currently, gcc passes all the tests that don't depend on FENV_ACCESS
on amd64 and sparc64.  Clang fails a few on amd64 (see clang bug
11406).  Both gcc and clang fare poorly on i386, which has well-known
issues.

12 years agoDon't inline fenv.h functions on arm for now. Inlining makes sense:
das [Fri, 20 Jan 2012 06:54:30 +0000 (06:54 +0000)]
Don't inline fenv.h functions on arm for now.  Inlining makes sense:
the function bodies require only 2 to 10 instructions.  However, it
leads to application binaries that refer to a private ABI, namely, the
softfloat innards in libc.  This could complicate future changes in
the implementation of the floating-point emulation layer, so it seems
best to have programs refer to the official fe* entry points in libm.

12 years agoAdd parentheses where required. Without them, `sizeof LDBL_MAX'
das [Fri, 20 Jan 2012 06:51:41 +0000 (06:51 +0000)]
Add parentheses where required.  Without them, `sizeof LDBL_MAX'
is a syntax error and shouldn't be, while `1 FLT_ROUNDS' isn't a
syntax error and should be.  Thanks to bde for the examples.

12 years agoMerge in the latest SoftFloat changes from NetBSD. (NetBSD isn't the
das [Fri, 20 Jan 2012 06:16:14 +0000 (06:16 +0000)]
Merge in the latest SoftFloat changes from NetBSD.  (NetBSD isn't the
original vendor, but we're using their heavily modified version.)
This brings in functions for long double emulation (both extended and
quad formats), which may be useful for testing, and also for replacing
libc/sparc64/fpu/.

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:39:26 +0000 (01:39 +0000)]
Fix warning when compiling with gcc46:
error: variable 'clnt_stat' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:39:16 +0000 (01:39 +0000)]
Fix warning when compiling with gcc46:
error: variable 'flags' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:39:08 +0000 (01:39 +0000)]
Fix warning when compiling with gcc46:
error: variable 'a' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:39:01 +0000 (01:39 +0000)]
Fix warning when compiling with gcc46:
error: variable 'fd' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:38:52 +0000 (01:38 +0000)]
Fix warning when compiling with gcc46:
error: variable 'target' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:38:44 +0000 (01:38 +0000)]
Fix warning when compiling with gcc46:
error: variable 'i2c' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:38:35 +0000 (01:38 +0000)]
Fix warning when compiling with gcc46:
        error: variable 'parentrecnum' set but not used

Approved by:    dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:      3 days

12 years agoFix a variety of warnings when compiling with gcc46
eadler [Fri, 20 Jan 2012 01:38:28 +0000 (01:38 +0000)]
Fix a variety of warnings when compiling with gcc46

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:38:21 +0000 (01:38 +0000)]
Fix warning when compiling with gcc46:
        error: variable 'temp' set but not used

Approved by: dim
Approved by: cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:38:12 +0000 (01:38 +0000)]
Fix warning when compiling with gcc46:
error: variable 'dirp' set but not used
error: variable 'dirplen' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:38:05 +0000 (01:38 +0000)]
Fix warning when compiling with gcc46:
error: variable 'now' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:37:56 +0000 (01:37 +0000)]
Fix warning when compiling with gcc46:
error: variable 'current_cpu' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:37:49 +0000 (01:37 +0000)]
Fix warning when compiling with gcc46:
        error: variable 'len' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:37:39 +0000 (01:37 +0000)]
Fix warning when compiling with gcc46:
error: variable 'extra_async_bytes' set but not used

Approved by:    dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC After: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:37:31 +0000 (01:37 +0000)]
Fix warning when compiling with gcc46:
error: variable 'addrs' set but not used

Approved by: dim
Approved by: cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC After: 3 days

12 years agoFix warning when compiling with gcc46:
eadler [Fri, 20 Jan 2012 01:37:23 +0000 (01:37 +0000)]
Fix warning when compiling with gcc46:
error: variable 'hostname' set but not used

Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after: 3 days

12 years agoMartin Cracauer reported a problem to freebsd-current@ under the
rmacklem [Fri, 20 Jan 2012 00:58:51 +0000 (00:58 +0000)]
Martin Cracauer reported a problem to freebsd-current@ under the
subject "Data corruption over NFS in -current". During investigation
of this, I came across an ugly bogusity in the new NFS client where
it replaced the cr_uid with the one used for the mount. This was
done so that "system operations" like the NFSv4 Renew would be
performed as the user that did the mount. However, if any other
thread shares the credential with the one doing this operation,
it could do an RPC (or just about anything else) as the wrong cr_uid.
This patch fixes the above, by using the mount credentials instead of
the one provided as an argument for this case. It appears
to have fixed Martin's problem.
This patch is needed for NFSv4 mounts and NFSv3 mounts against
some non-FreeBSD servers that do not put post operation attributes
in the NFSv3 Statfs RPC reply.

Tested by: Martin Cracauer (cracauer at cons.org)
Reviewed by: jhb
MFC after: 2 weeks

12 years agoUse shared lock for the executable vnode in the exec path after the
kib [Thu, 19 Jan 2012 23:03:31 +0000 (23:03 +0000)]
Use shared lock for the executable vnode in the exec path after the
VV_TEXT changes are handled. Assert that vnode is exclusively locked at
the places that modify VV_TEXT.

Discussed with: alc
MFC after: 3 weeks

12 years agoProperly return success once a matching VPD entry is found in
jhb [Thu, 19 Jan 2012 21:38:19 +0000 (21:38 +0000)]
Properly return success once a matching VPD entry is found in
pci_get_vpd_readonly_method().  Previously the loop was always running
to completion and falling through to failing with ENXIO.

PR: kern/164313
Submitted by: Chuck Tuffli  chuck tuffli net
MFC after: 1 week

12 years agoReflect tunable name change made in r230337.
yongari [Thu, 19 Jan 2012 20:31:29 +0000 (20:31 +0000)]
Reflect tunable name change made in r230337.

12 years agoOops, fix logic error introduced in r230337.
yongari [Thu, 19 Jan 2012 20:28:58 +0000 (20:28 +0000)]
Oops, fix logic error introduced in r230337.

12 years agoRename dev.bge.%d.msi_disable to dev.bge.%d.msi which matches
yongari [Thu, 19 Jan 2012 20:21:59 +0000 (20:21 +0000)]
Rename dev.bge.%d.msi_disable to dev.bge.%d.msi which matches
enable/disable and default it to on.

Suggested by: jhb

12 years agoFix a logic error which resulted in putting PHY into sleep when WOL
yongari [Thu, 19 Jan 2012 20:13:16 +0000 (20:13 +0000)]
Fix a logic error which resulted in putting PHY into sleep when WOL
is active.  If WOL is active driver should not put PHY into sleep.
This change makes WOL work on RTL8168E.

12 years agoQuiet some clang warnings when compiling CTL.
ken [Thu, 19 Jan 2012 18:42:03 +0000 (18:42 +0000)]
Quiet some clang warnings when compiling CTL.

ctl_error.c,
ctl_error.h: Take out the ctl_sense_format enumeration, and use
scsi_sense_data_type instead.

Remove ctl_get_sense_format() and switch ctl_build_ua()
over to using scsi_sense_data_type.

ctl_backend_ramdisk.c,
ctl_backend_block.c:
Use C99 structure initializers instead of GNU initializers.

ctl.c: Switch over to using the SCSI sense format enumeration
instead of the CTL-specific enumeration.

Submitted by: dim (partially)
MFC after: 1 month