]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agosh: Get rid of unnecessary non-standard empty lists.
jilles [Mon, 16 Aug 2010 17:18:08 +0000 (17:18 +0000)]
sh: Get rid of unnecessary non-standard empty lists.

POSIX does not allow constructs like:
  if cmd; then fi
  { }
Add a colon dummy command, except in a test that verifies that such empty
lists do not cause crashes when used as a function definition.

13 years agoFix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
joel [Mon, 16 Aug 2010 15:18:30 +0000 (15:18 +0000)]
Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>

13 years agoAdd uma_zone_get_max() to obtain the effective limit after a call
andre [Mon, 16 Aug 2010 14:24:00 +0000 (14:24 +0000)]
Add uma_zone_get_max() to obtain the effective limit after a call
to uma_zone_set_max().

The UMA zone limit is not exactly set to the value supplied but
rounded up to completely fill the backing store increment (a page
normally).  This can lead to surprising situations where the number
of elements allocated from UMA is higher than the supplied limit
value.  The new get function reads back the effective value so that
the supplied limit value can be adjusted to the real limit.

Reviewed by: jeffr
MFC after: 1 week

13 years agoFix .Dd from last commit.
joel [Mon, 16 Aug 2010 12:37:17 +0000 (12:37 +0000)]
Fix .Dd from last commit.

Submitted by Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>

13 years agoMark functions and variables as static.
ed [Mon, 16 Aug 2010 12:19:36 +0000 (12:19 +0000)]
Mark functions and variables as static.

All these functions and variables are local to this compilation unit, so
there is no reason why we shouldn't mark them static. This slightly
reduces the binary size.

13 years agoIn setusercontext(), do not apply user settings unless running as the
des [Mon, 16 Aug 2010 11:32:20 +0000 (11:32 +0000)]
In setusercontext(), do not apply user settings unless running as the
user in question (usually but not necessarily because we were called
with LOGIN_SETUSER).  This plugs a hole where users could raise their
resource limits and expand their CPU mask.

MFC after: 3 weeks

13 years agoOld patch I had lying around: clean up and use stpcpy(3) instead of
des [Mon, 16 Aug 2010 11:22:12 +0000 (11:22 +0000)]
Old patch I had lying around: clean up and use stpcpy(3) instead of
sprintf(3).

13 years ago- Revert strlcpy() changes to memcpy() because it's more efficient and
gabor [Sun, 15 Aug 2010 22:15:04 +0000 (22:15 +0000)]
- Revert strlcpy() changes to memcpy() because it's more efficient and
  former may be safer but in this case it doesn't add extra
  safety [1]
- Fix -w option [2]
- Fix handling of GREP_OPTIONS [3]
- Fix --line-buffered
- Make stdin input imply --line-buffered so that tail -f can be piped
  to grep [4]
- Imply -h if single file is grepped, this is the GNU behaviour
- Reduce locking overhead to gain some more performance [5]
- Inline some functions to help the compiler better optimize the code
- Use shortcut for empty files [6]

PR: bin/149425 [6]
Prodded by: jilles [1]
Reported by: Alex Kozlov <spam@rm-rf.kiev.ua> [2] [3],
swell.k@gmail.com [2],
poyopoyo@puripuri.plala.or.jp [4]
Submitted by: scf [5],
Shuichi KITAGUCHI <ki@hh.iij4u.or.jp> [6]
Approved by: delphij (mentor)

13 years agoFixed a typo.
brueffer [Sun, 15 Aug 2010 21:37:30 +0000 (21:37 +0000)]
Fixed a typo.

PR: 148701
Submitted by: Glen Barber <glen.j.barber@gmail.com>
MFC after: 1 week

13 years agoFixed a typo and added a comma.
brueffer [Sun, 15 Aug 2010 21:34:50 +0000 (21:34 +0000)]
Fixed a typo and added a comma.

PR: 148681
Submitted by: Glen Barber <glen.j.barber@gmail.com>
MFC after: 1 week

13 years agoFinish renaming fstest to pjdfstest.
pjd [Sun, 15 Aug 2010 21:29:03 +0000 (21:29 +0000)]
Finish renaming fstest to pjdfstest.

13 years agoTie up some loose ends r88509 left behind:
brueffer [Sun, 15 Aug 2010 21:25:52 +0000 (21:25 +0000)]
Tie up some loose ends r88509 left behind:

- chooseproc() is long gone, MLINK choosethread instead
- Update NAME section for choosethread
- Mark chooseproc.9 for removal

PR:             149549
Submitted by:   pluknet
MFC after: 1 week

13 years agoGive fstest a more unique name: pjdfstest.
pjd [Sun, 15 Aug 2010 21:24:17 +0000 (21:24 +0000)]
Give fstest a more unique name: pjdfstest.
It is released from time to time and used outside FreeBSD, so it is good to
have a name one can google.

13 years agoUpdate copyright years.
pjd [Sun, 15 Aug 2010 21:20:40 +0000 (21:20 +0000)]
Update copyright years.

13 years agoMore tests.
pjd [Sun, 15 Aug 2010 21:19:42 +0000 (21:19 +0000)]
More tests.

13 years agosh: Fix break/continue/return sometimes not skipping the rest of dot script.
jilles [Sun, 15 Aug 2010 21:06:53 +0000 (21:06 +0000)]
sh: Fix break/continue/return sometimes not skipping the rest of dot script.

In our implementation and most others, a break or continue in a dot script
can break or continue a loop outside the dot script. This should cause all
further commands in the dot script to be skipped. However, cmdloop() did not
know about this and continued to parse and execute commands from the dot
script.

As described in the man page, a return in a dot script in a function returns
from the function, not only from the dot script. There was a similar issue
as with break and continue. In various other shells, the return appears to
return from the dot script, but POSIX seems not very clear about this.

13 years agoUse our standard section 4 SYNOPSIS. While here, fixed markup whitespace
brueffer [Sun, 15 Aug 2010 20:56:13 +0000 (20:56 +0000)]
Use our standard section 4 SYNOPSIS.  While here, fixed markup whitespace
and adapted an Xref.

13 years agoFix tx pause quanta and timer calculations.
np [Sun, 15 Aug 2010 20:52:15 +0000 (20:52 +0000)]
Fix tx pause quanta and timer calculations.

MFC after: 3 days

13 years agoAlways reset the XGMAC's XAUI PCS on a link up.
np [Sun, 15 Aug 2010 20:45:16 +0000 (20:45 +0000)]
Always reset the XGMAC's XAUI PCS on a link up.

MFC after: 3 days

13 years agowakeup is required if the adapter lock is released anywhere during
np [Sun, 15 Aug 2010 20:34:51 +0000 (20:34 +0000)]
wakeup is required if the adapter lock is released anywhere during
init and not just for the may_sleep case.

Pointed out by: Isilon
MFC after: 3 days

13 years agoNothing uses TARGET_EMULATOR, so gc it.
imp [Sun, 15 Aug 2010 19:07:44 +0000 (19:07 +0000)]
Nothing uses TARGET_EMULATOR, so gc it.

13 years agoFurther simplify the code, and update the manpage.
des [Sun, 15 Aug 2010 18:32:06 +0000 (18:32 +0000)]
Further simplify the code, and update the manpage.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>

13 years ago- Check that strtoul(3) succeeds to convert the entire string in a few
jh [Sun, 15 Aug 2010 17:49:41 +0000 (17:49 +0000)]
- Check that strtoul(3) succeeds to convert the entire string in a few
  places.
- In getasciilabel(), set the disk type only when a valid type is given.

PR: bin/86765
MFC after: 2 weeks

13 years agosh: Test that all bytes from 1 to 127 can be used in IFS.
jilles [Sun, 15 Aug 2010 17:14:05 +0000 (17:14 +0000)]
sh: Test that all bytes from 1 to 127 can be used in IFS.

This also passes on stable/8.

13 years agoCorrect the return code from _dns_gethostby*() to correspond
ume [Sun, 15 Aug 2010 16:28:08 +0000 (16:28 +0000)]
Correct the return code from _dns_gethostby*() to correspond
with h_errno.

Obtained from: NetBSD
MFC after: 2 weeks

13 years agoAdd missed dependency.
kib [Sun, 15 Aug 2010 15:33:01 +0000 (15:33 +0000)]
Add missed dependency.

Submitted by: gcooper
MFC after: 1 week

13 years agono-op commit to note that the example given in the previous commit is
des [Sun, 15 Aug 2010 14:55:32 +0000 (14:55 +0000)]
no-op commit to note that the example given in the previous commit is
a very bad one, since the shift does not actually overflow.  This is
a better example (assuming uint64_t = unsigned long long):

  ~0LLU >> 9             =   0x7fffffffffffffLLU
  ~0LLU >> 9 << 10       = 0xfffffffffffffc00LLU
  ~0LLU >> 9 << 10 >> 10 =   0x3fffffffffffffLLU

13 years agoFix the overflow test. It is possible for the result of an
des [Sun, 15 Aug 2010 14:50:03 +0000 (14:50 +0000)]
Fix the overflow test.  It is possible for the result of an
overflowing shift to be larger than the original value, e.g.

         (uint64_t)1 << 53 = 0x20000000000000
 ((uint64_t)1 << 53) << 10 = 0x8000000000000000

13 years agoMore tests (especially for lchmod(2)), less code duplication.
pjd [Sun, 15 Aug 2010 14:44:48 +0000 (14:44 +0000)]
More tests (especially for lchmod(2)), less code duplication.

13 years agoAdd convenience defines for hidden and default/exported attributes.
kib [Sun, 15 Aug 2010 14:38:01 +0000 (14:38 +0000)]
Add convenience defines for hidden and default/exported attributes.

MFC after: 2 weeks

13 years agoFix the interaction between 'ICMP fragmentation needed' MTU updates,
andre [Sun, 15 Aug 2010 13:25:18 +0000 (13:25 +0000)]
Fix the interaction between 'ICMP fragmentation needed' MTU updates,
path MTU discovery and the tcp_minmss limiter for very small MTU's.

When the MTU suggested by the gateway via ICMP, or if there isn't
any the next smaller step from ip_next_mtu(), is lower than the
floor enforced by net.inet.tcp.minmss (default 216) the value is
ignored and the default MSS (512) is used instead.  However the
DF flag in the IP header is still set in tcp_output() preventing
fragmentation by the gateway.

Fix this by using tcp_minmss as the MSS and clear the DF flag if
the suggested MTU is too low.  This turns off path MTU dissovery
for the remainder of the session and allows fragmentation to be
done by the gateway.

Only MTU's smaller than 256 are affected.  The smallest official
MTU specified is for AX.25 packet radio at 256 octets.

PR: kern/146628
Tested by: Matthew Luckie <mjl-at-luckie org nz>
MFC after: 1 week

13 years agoInitializing the new error variable to zero in syncache_socket()
andre [Sun, 15 Aug 2010 13:07:08 +0000 (13:07 +0000)]
Initializing the new error variable to zero in syncache_socket()
is not necessary.

Noticed by: bz

13 years agoFix indenting/whitespace issues introduced by me.
adrian [Sun, 15 Aug 2010 11:40:53 +0000 (11:40 +0000)]
Fix indenting/whitespace issues introduced by me.

13 years agoThe comment is misleading - that register setting seems to kick off the
adrian [Sun, 15 Aug 2010 11:32:05 +0000 (11:32 +0000)]
The comment is misleading - that register setting seems to kick off the
initial chip NF cal.

13 years agoAdd more logging points for failures in syncache_socket() to
andre [Sun, 15 Aug 2010 09:30:13 +0000 (09:30 +0000)]
Add more logging points for failures in syncache_socket() to
report when a new socket couldn't be created because one of
in_pcbinshash(), in6_pcbconnect() or in_pcbconnect() failed.

Logging is conditional on net.inet.tcp.log_debug being enabled.

MFC after: 1 week

13 years agoGiven the lag between introducing the options-compat and fixing the
imp [Sun, 15 Aug 2010 08:49:07 +0000 (08:49 +0000)]
Given the lag between introducing the options-compat and fixing the
bug in the config file was long, and merged to stable, we have to bump
the version here so that stable/8 kernels can have their required
version number bumped to make sure the right config is used.

MFC after: 3 days

13 years agoTurns out that it is a bad idea to have a missing compat option be a
imp [Sun, 15 Aug 2010 08:44:32 +0000 (08:44 +0000)]
Turns out that it is a bad idea to have a missing compat option be a
fatal condition.  While it works out really well for diagnosing the
case where you want it, but don't have it, it works really badly for
the case where you don't have it and don't want it.  Remove the printf
and exit pair.  Replate it with simple return to silently ignore this
condition.

This is needed to fix the COMPAT_IA32 being required in options.* in
stable, but we need to run this change through -current first...

MFC after: 3 days

13 years agoFix silly typo on my part (s/quotas_enable/quota_enable/)
dougb [Sat, 14 Aug 2010 22:28:07 +0000 (22:28 +0000)]
Fix silly typo on my part (s/quotas_enable/quota_enable/)

Submitted by: ed

13 years agoCorrectly spell janice and jimmy as janis and jimi (assuming
schweikh [Sat, 14 Aug 2010 21:48:22 +0000 (21:48 +0000)]
Correctly spell janice and jimmy as janis and jimi (assuming
the famous rock stars meant were Miss Joplin and Mr Hendrix.)

13 years agoWhen using TSO and sending more than TCP_MAXWIN sendalot is set
andre [Sat, 14 Aug 2010 21:41:33 +0000 (21:41 +0000)]
When using TSO and sending more than TCP_MAXWIN sendalot is set
and we loop back to 'again'.  If the remainder is less or equal
to one full segment, the TSO flag was not cleared even though
it isn't necessary anymore.  Enabling the TSO flag on a segment
that doesn't require any offloaded segmentation by the NIC may
cause confusion in the driver or hardware.

Reset the internal tso flag in tcp_output() on every iteration
of sendalot.

PR: kern/132832
Submitted by: Renaud Lienhart <renaud-at-vmware com>
MFC after: 1 week

13 years agoChange the messages of the ICMP bad port bandwidth limiter from
andre [Sat, 14 Aug 2010 21:04:27 +0000 (21:04 +0000)]
Change the messages of the ICMP bad port bandwidth limiter from
a kernel printf to a log output with the priority of LOG_NOTICE.

This way the messages still show up in /var/log/messages but no
longer spam the console every other second on busy servers that
are port scanned:
 "Limiting open port RST response from 114 to 100 packets/sec"

PR: kern/147352
Submitted by: Eugene Grosbein <eugen-at-eg sd rdtc ru>
MFC after: 1 week

13 years agoDisable TCP inflight limiter by default.
andre [Sat, 14 Aug 2010 20:40:55 +0000 (20:40 +0000)]
Disable TCP inflight limiter by default.

It was experimental and interferes with the normal congestion control
algorithms by instating a separate, possibly lower, ceiling for the
amount of data that is in flight to the remote host.  With high speed
internet connections the inflight limit frequently has been estimated
too low due to the noisy nature of the RTT measurements.

This code gives way for the upcoming pluggable congestion control
framework.  It is the task of the congestion control algorithm to
set the congestion window and amount of inflight data without external
interference.

Reviewed by: lstewart
MFC after: 1 week
Removal after: 1 month

13 years agoIntroduce IEEE80211_C_RATECTL, drivers which use the ratectl framework
bschmidt [Sat, 14 Aug 2010 20:12:10 +0000 (20:12 +0000)]
Introduce IEEE80211_C_RATECTL, drivers which use the ratectl framework
should set this capability.

MFC after: 2 weeks

13 years agoGive people some warning before removing enable_quotas
dougb [Sat, 14 Aug 2010 18:58:05 +0000 (18:58 +0000)]
Give people some warning before removing enable_quotas

13 years agoA local addition, not imported from ath9k.
adrian [Sat, 14 Aug 2010 15:48:18 +0000 (15:48 +0000)]
A local addition, not imported from ath9k.

AR_PHY_CALMODE is explicitly reset on interface reset for other chipsets;
this commit also sets it for the AR9160.

13 years ago* Merge in AR9160 initval updates from Linux-2.6.34.
adrian [Sat, 14 Aug 2010 15:46:18 +0000 (15:46 +0000)]
* Merge in AR9160 initval updates from Linux-2.6.34.
* Grab the AR_PHY_CCA and AR_PHY_EXT_CCA initvals from Linux wireless-testing.

Obtained from: Linux-2.6.34

13 years agoMerge in a fix for the power/(gain?) calculation. Apply it to both
adrian [Sat, 14 Aug 2010 15:29:21 +0000 (15:29 +0000)]
Merge in a fix for the power/(gain?) calculation. Apply it to both
the 5416/9160 and 9285 code paths.

Obtained from: OpenWRT r22123, 522-ath9k_pwrcal_fix.patch

13 years agoFix the calibration logic to correctly clamp the calculated coefficient.
adrian [Sat, 14 Aug 2010 15:28:15 +0000 (15:28 +0000)]
Fix the calibration logic to correctly clamp the calculated coefficient.

Obtained from: OpenWRT r22123, 521-ath9k_iqcal_fix.patch

13 years agoSimplify expand_number() by combining the (unrolled) loop with the
des [Sat, 14 Aug 2010 14:34:36 +0000 (14:34 +0000)]
Simplify expand_number() by combining the (unrolled) loop with the
switch.  Since expand_number() does not accept negative numbers, switch
from int64_t to uint64_t; this makes it easier to check for overflow.

MFC after: 3 weeks

13 years agoExport ath stats via snmp, rather than requiring a debugging interface
adrian [Sat, 14 Aug 2010 14:18:02 +0000 (14:18 +0000)]
Export ath stats via snmp, rather than requiring a debugging interface
and "athstats".

13 years agoIn rip6_input(), in case of multicast, we might skip the normal processing
bz [Sat, 14 Aug 2010 14:13:44 +0000 (14:13 +0000)]
In rip6_input(), in case of multicast, we might skip the normal processing
and go to the next iteration early if multicast filtering would decide that
this socket shall not receive the data.
Unlock the pcb in that case or we leak the read lock and next time trying
to get a write lock, would hang forever.

PR: kern/149608
Submitted by: Chris Luke (chrisy flirble.org)
MFC after: 3 days

13 years agoAdd a global counter of missed beacons.
adrian [Sat, 14 Aug 2010 14:01:12 +0000 (14:01 +0000)]
Add a global counter of missed beacons.

The existing missed beacon count is reset once a beacon isn't missed.

13 years agoInitialize ni_txrate after txparams have been setup. Some drivers
bschmidt [Sat, 14 Aug 2010 09:29:42 +0000 (09:29 +0000)]
Initialize ni_txrate after txparams have been setup. Some drivers
calculate various things prior to association based on ni_txrate and
rely on it being nonzero.

PR: kern/149185
MFC after: 2 weeks

13 years agoReset switchtime to zero rather than the current CPU ticker (TSC) value.
jkim [Fri, 13 Aug 2010 22:08:42 +0000 (22:08 +0000)]
Reset switchtime to zero rather than the current CPU ticker (TSC) value.
It is more appropriate in this context because TSC MSR is reset to zero
when the CPU is restarted from S3 and above.  Move acpi_resync_clock() back
to where it was before r211202.  It does not make a difference any more.

13 years agoConsistently use full pathnames for external commands.
jkim [Fri, 13 Aug 2010 21:23:13 +0000 (21:23 +0000)]
Consistently use full pathnames for external commands.

13 years ago- Use loops to avoid code duplication.
pjd [Fri, 13 Aug 2010 21:17:59 +0000 (21:17 +0000)]
- Use loops to avoid code duplication.
- More tests.

13 years agoDo not fork a subshell unnecessarily.
jkim [Fri, 13 Aug 2010 21:04:43 +0000 (21:04 +0000)]
Do not fork a subshell unnecessarily.

13 years agoEnforce ACPI timer as the timecounter hardware before we change sleep state
jkim [Fri, 13 Aug 2010 20:43:19 +0000 (20:43 +0000)]
Enforce ACPI timer as the timecounter hardware before we change sleep state
unless it is the current timer.  When we have resumed successfully, restore
the previous timecounter hardware if it was changed earlier.  Only the ACPI
timer is guaranteed to increase monotonically between S-state changes.

13 years agosh: Add a forgotten const.
jilles [Fri, 13 Aug 2010 20:29:43 +0000 (20:29 +0000)]
sh: Add a forgotten const.

13 years agoFix typo.
joel [Fri, 13 Aug 2010 20:27:40 +0000 (20:27 +0000)]
Fix typo.

13 years agoMake sure to disable RX MAC in alc_stop_mac(). Previously there
yongari [Fri, 13 Aug 2010 19:39:33 +0000 (19:39 +0000)]
Make sure to disable RX MAC in alc_stop_mac(). Previously there
was a logic error which it always enabled RX MAC.

13 years agoSimplify taskqueue_drain() by using proved macros.
pjd [Fri, 13 Aug 2010 19:20:35 +0000 (19:20 +0000)]
Simplify taskqueue_drain() by using proved macros.

13 years agoWhen moving an ethernet ifnet from one vnet to another, destroy the
zec [Fri, 13 Aug 2010 18:17:32 +0000 (18:17 +0000)]
When moving an ethernet ifnet from one vnet to another, destroy the
associated ng_ether netgraph node in the current vnet, and create a
new one in the target vnet.

Reviewed by: julian
MFC after: 3 days

13 years agoAvoid a memory leak.
mjacob [Fri, 13 Aug 2010 15:17:19 +0000 (15:17 +0000)]
Avoid a memory leak.

Submitted by: Dmitry Luhtionov via Alexander Motin
MFC after: 1 week

13 years agosh: Fix shadowing of sigset.
jilles [Fri, 13 Aug 2010 13:36:18 +0000 (13:36 +0000)]
sh: Fix shadowing of sigset.

13 years agoRename TARGET_XLR_XLS to CPU_RMI to match other CPU_xxx definitions.
jchandra [Fri, 13 Aug 2010 12:56:00 +0000 (12:56 +0000)]
Rename TARGET_XLR_XLS to CPU_RMI to match other CPU_xxx definitions.
use CPU_RMI all XLR configurations. Update ident string for N32 and
N64 kernels.

13 years agouse uintmax_t instead of uint64_t.
takawata [Fri, 13 Aug 2010 09:58:17 +0000 (09:58 +0000)]
use uintmax_t instead of uint64_t.

Pointed out by: des.

13 years ago- When there is no room for returning the result, nss backend
ume [Fri, 13 Aug 2010 06:39:54 +0000 (06:39 +0000)]
- When there is no room for returning the result, nss backend
  have to return ERANGE and terminate with NS_RETURN.
- When gethostbyname_r(3) and the friends end with an error,
  set errno to the value nss backend returns, and return errno
  value.

PR: kern/131623
MFC after: 2 weeks

13 years agoHook tpm.4 manual to hook.
takawata [Fri, 13 Aug 2010 05:01:44 +0000 (05:01 +0000)]
Hook tpm.4 manual to hook.

13 years agoHook tpm.4 manual to build.
takawata [Fri, 13 Aug 2010 04:00:35 +0000 (04:00 +0000)]
Hook tpm.4 manual to build.

13 years agoFix build on amd64 and ia64.
takawata [Fri, 13 Aug 2010 00:45:30 +0000 (00:45 +0000)]
Fix build on amd64 and ia64.

13 years agoThis depends on ACPI, so only build on i386:i386, amd64:amd64 and
imp [Thu, 12 Aug 2010 22:46:31 +0000 (22:46 +0000)]
This depends on ACPI, so only build on i386:i386, amd64:amd64 and
ia64:ia64.  It can't possibly work on pc98, or any of the embedded
platforms, since they lack ACPI.

13 years agoDescribe vfs.read_max and update vfs.hirunningspace documentation. While
ivoras [Thu, 12 Aug 2010 21:21:50 +0000 (21:21 +0000)]
Describe vfs.read_max and update vfs.hirunningspace documentation. While
there, update nits.

Considered viewed by: jeff, phk, rwatson

13 years agoFix buildworld -DNO_CLEAN when using with Perforce, which marks files as
will [Thu, 12 Aug 2010 20:46:49 +0000 (20:46 +0000)]
Fix buildworld -DNO_CLEAN when using with Perforce, which marks files as
read-only by default, meaning files copied can't be overwritten next time.

Reviewed by: imp
Approved by: ken (mentor)

13 years agoMore tests.
pjd [Thu, 12 Aug 2010 20:35:14 +0000 (20:35 +0000)]
More tests.

13 years agoAllow interrupt driven config hooks to be registered from config hook callbacks.
gibbs [Thu, 12 Aug 2010 19:50:40 +0000 (19:50 +0000)]
Allow interrupt driven config hooks to be registered from config hook callbacks.

Interrupt driven configuration hooks serve two purposes: they are a
mechanism for registering for a callback that is invoked once interrupt
services are available, and they hold off root device selection so long
as any configuration hooks are still active.  Before this change, it was
not possible to safely register additional hooks from the context of a
configuration hook callback.  The need for this feature arises when
interrupts are required to discover new devices (e.g. access to the XenStore
to find para-virtualized devices) which in turn also require the ability
to hold off root device selection until some lengthy, interrupt driven,
configuration task has completed (e.g. Xen front/back device driver
negotiation).

More specifically, the mutex protecting the list of active configuration
hooks is never held during a callback, and static information is used
to ensure proper ordering and only a single callback to each hook even
when faced with registration or removal of a hook during an active run.

Sponsored by: Spectra Logic Corporation
MFC after:      1 week.

13 years agoPortable Makefile.
pjd [Thu, 12 Aug 2010 19:45:27 +0000 (19:45 +0000)]
Portable Makefile.

13 years agoFix copy&pasted code - we want to create character device here.
pjd [Thu, 12 Aug 2010 19:43:40 +0000 (19:43 +0000)]
Fix copy&pasted code - we want to create character device here.

13 years agoProperly indent a continue statement. No functional changes.
gibbs [Thu, 12 Aug 2010 19:26:27 +0000 (19:26 +0000)]
Properly indent a continue statement.  No functional changes.

13 years agoAdd the half of time-of-day clock resolution when we adjust system time from
jkim [Thu, 12 Aug 2010 17:17:05 +0000 (17:17 +0000)]
Add the half of time-of-day clock resolution when we adjust system time from
time-of-day clock or vice versa.  For x86 systems, RTC resolution is one
second and we used to lose up to one second whenever we initialize system
time from RTC or write system time back to RTC.  With this change, margin
of error per conversion is roughly between -0.5 and +0.5 second rather
than between -1 and 0 second.  Note that it does not take care of errors
from getnanotime(9) (which is up to 1/hz second) or CLOCK_GETTIME() latency.
These are just too expensive to correct and it is not worthy of the cost.

13 years agoFix compile. It seemed better to have memguard.c include opt_vm.h in
mdf [Thu, 12 Aug 2010 16:54:43 +0000 (16:54 +0000)]
Fix compile.  It seemed better to have memguard.c include opt_vm.h in
case future compile-time knobs were added that it wants to use.
Also add include guards and forward declarations to vm/memguard.h.

Approved by:    zml (mentor)
MFC after:      1 month

13 years agoProvide description for 'machdep.disable_rtc_set' sysctl. Clean up style(9)
jkim [Thu, 12 Aug 2010 16:13:24 +0000 (16:13 +0000)]
Provide description for 'machdep.disable_rtc_set' sysctl.  Clean up style(9)
nits.  Remove a redundant return statement and an unnecessary variable.

13 years agoAllow user created symbolic links to cover device files and directories
jh [Thu, 12 Aug 2010 15:29:07 +0000 (15:29 +0000)]
Allow user created symbolic links to cover device files and directories
if the device file appears during or after the link creation.

User created symbolic links are now inserted at the head of the
directory entry list after the "." and ".." entries. A new directory
entry flag DE_COVERED indicates that an entry is covered by a symbolic
link.

PR: kern/114057
Reviewed by: kib
Idea from: kib
Discussed on: freebsd-current (mostly silence)

13 years agoFix crunchide to work on sparc64 and perhaps other 64 bit platforms.
adrian [Thu, 12 Aug 2010 14:16:57 +0000 (14:16 +0000)]
Fix crunchide to work on sparc64 and perhaps other 64 bit platforms.

I used the wrong type when setting st_name in the symbol table entry
struct. It's an Elf64_Word which is defined as an unsigned 32 bit int
on both 32 and 64 bit platforms.

To make things sensible, define some new macros to use as "word" macros
and use those, rather than simply using the explicit 32 bit macros.

13 years agoFix breakage on 64bit architecture by using inttypes.h macro.
takawata [Thu, 12 Aug 2010 13:58:46 +0000 (13:58 +0000)]
Fix breakage on 64bit architecture by using inttypes.h macro.

13 years agoRevert r211176:
attilio [Thu, 12 Aug 2010 13:46:43 +0000 (13:46 +0000)]
Revert r211176:
As long as interrupts are disabled and there is not explicit call to
sched_add() there can't be any preemption there, thus the calls may be
consistent.

Reported by: kib, jhb

13 years agoFix tindebox breakage about format warning.
takawata [Thu, 12 Aug 2010 11:01:38 +0000 (11:01 +0000)]
Fix tindebox breakage about format warning.

13 years agoSMP support in n64.
jchandra [Thu, 12 Aug 2010 11:00:45 +0000 (11:00 +0000)]
SMP support in n64.

- Enable KX and UX bits on CPU startup for non-boot CPUs
- Keep the KX bit when in userspace - XTLB handler needs it to access
  PCPU data
- revert r210638 partly - we don't need to enable KX on kernel entry
  now

Reviewed by: jmallett, imp

13 years agoImplement pmap changes suggested by alc@:
jchandra [Thu, 12 Aug 2010 10:09:28 +0000 (10:09 +0000)]
Implement pmap changes suggested by alc@:

1. Move dirty bit emulation code that is duplicted for kernel and user
in trap.c to a function pmap_emulate_modified() in pmap.c.

2. While doing dirty bit emulation, it is not necessary to update the
TLB entry on all CPUs using smp_rendezvous(), we can just update the
TLB entry on the current CPU, and let the other CPUs update their TLB
entry lazily if they get an exception.

Reviewed by: alc, neel

13 years agoOptimization for pmap_kenter(), call pmap_update_page() only when
jchandra [Thu, 12 Aug 2010 09:15:27 +0000 (09:15 +0000)]
Optimization for pmap_kenter(), call pmap_update_page() only when
necessary.  On SMP, pmap_update_page() can be costly as it needs a
a smp_rendezvous().

Reviewed by: alc, neel
Obtained from: jmallett (http://svn.freebsd.org/base/user/jmallett/octeon)

13 years agoRe-arrange the pmap calls that use smp_rendezvous() on SMP, so that their
jchandra [Thu, 12 Aug 2010 09:03:21 +0000 (09:03 +0000)]
Re-arrange the pmap calls that use smp_rendezvous() on SMP, so that their
per-cpu variants are also available to be called.  The per-cpu variants
are needed for some later optimizations.

Also remove unnecessary casts, do some style fixes.

Reviewed by: alc, neel

13 years ago* Fix indentation
adrian [Thu, 12 Aug 2010 08:39:54 +0000 (08:39 +0000)]
* Fix indentation
* Restore comment erroneously deleted from the previous commit

13 years agoThe buffers b_vflags field is not always properly protected by
kib [Thu, 12 Aug 2010 08:36:23 +0000 (08:36 +0000)]
The buffers b_vflags field is not always properly protected by
bufobj lock. If b_bufobj is not NULL, then bufobj lock should be
held when manipulating the flags. Not doing this sometimes leaves
BV_BKGRDINPROG to be erronously set, causing softdep' getdirtybuf() to
stuck indefinitely in "getbuf" sleep, waiting for background write to
finish which is not actually performed.

Add BO_LOCK() in the cases where it was missed.

In collaboration with: pho
Tested by: bz
Reviewed by: jeff
MFC after: 1 month

13 years agoSoftdep_process_worklist() should unsuspend not only before processing
kib [Thu, 12 Aug 2010 08:35:24 +0000 (08:35 +0000)]
Softdep_process_worklist() should unsuspend not only before processing
the worklist (in softdep_process_journal), but also after flushing the
workitems. Might be, we should even do this before bwillwrite() too, but
this seems to be not needed for now.

Fs might be suspended during processing the queue, and then there is
nobody around to unsuspend.

In collaboration with: pho
Tested by: bz
Reviewed by: jeff

13 years agoLoading the NF CCA values may take longer than expected to occur.
adrian [Thu, 12 Aug 2010 06:20:54 +0000 (06:20 +0000)]
Loading the NF CCA values may take longer than expected to occur.
If it does, don't then try reprogramming the NF "cap" values (ie
what values are the "maximum" value the NF can be) - instead,
just leave the current CCA value as the NF cap.

This was inspired by some similar work from ath9k. It isn't
a 100% complete solution (as there may be some reason where a
high NF CCA/cap is written, causing the baseband to stop thinking it
is able to transmit, leading to stuck beacon and interface reset)
which I'll investigate and look at fixing in a later commit.

Obtained from: Linux

13 years agoUse ar5212IsNFCalInProgress() to check for NF calibration progress.
adrian [Thu, 12 Aug 2010 06:14:26 +0000 (06:14 +0000)]
Use ar5212IsNFCalInProgress() to check for NF calibration progress.

13 years agoFix indentation.
adrian [Thu, 12 Aug 2010 06:12:39 +0000 (06:12 +0000)]
Fix indentation.

13 years agoEnsure that the correct rxchainmask is used when doing calibration in the
adrian [Thu, 12 Aug 2010 06:11:44 +0000 (06:11 +0000)]
Ensure that the correct rxchainmask is used when doing calibration in the
AR5416 and later chipsets.

ath_hal_calibrateN() calls the HAL calibrateN function with rxchainmask=0x1.
This is not necessarily the case for AR5416 and later chipsets.

13 years agoInternal NF calibration should not occur in parallel with any other
adrian [Thu, 12 Aug 2010 06:08:36 +0000 (06:08 +0000)]
Internal NF calibration should not occur in parallel with any other
calibration. Ensure that the NF calibration completes before continuing
with the rest of the calibration setup process.

13 years agoAdd a couple of functions to check NF calibration progress / completion.
adrian [Thu, 12 Aug 2010 06:06:14 +0000 (06:06 +0000)]
Add a couple of functions to check NF calibration progress / completion.