]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoAdd myself to committers-src.dot, and note kib is my mentor.
gjb [Tue, 4 Jun 2013 16:02:00 +0000 (16:02 +0000)]
Add myself to committers-src.dot, and note kib is my mentor.

Approved by: kib (mentor)

11 years agoEliminate unnecessary vm object locking from tmpfs_nocacheread().
alc [Tue, 4 Jun 2013 15:40:45 +0000 (15:40 +0000)]
Eliminate unnecessary vm object locking from tmpfs_nocacheread().

11 years agoBuild fix: Only <sys/cdefs.h> should be included before __FBSDID().
jhb [Tue, 4 Jun 2013 15:35:37 +0000 (15:35 +0000)]
Build fix:  Only <sys/cdefs.h> should be included before __FBSDID().
<sys/param.h> needs to be included after any "opt_foo.h" headers so it
sees the same set of defined macros as other headers.

11 years agoImprove r250890, so that we stop processing of a message with zero
glebius [Tue, 4 Jun 2013 11:19:08 +0000 (11:19 +0000)]
Improve r250890, so that we stop processing of a message with zero
descriptors as early as possible, and assert that number of descriptors
is positive in unp_freerights().

Reviewed by: mjg, pjd, jilles

11 years agoFlag isp(4) as supporting unmapped I/O; all necessary conversion actually
marius [Tue, 4 Jun 2013 11:05:57 +0000 (11:05 +0000)]
Flag isp(4) as supporting unmapped I/O; all necessary conversion actually
already has been done as part of r246713.

Reviewed by: mjacob

11 years agoFix the passing of time on Armada XP.
gber [Tue, 4 Jun 2013 09:33:03 +0000 (09:33 +0000)]
Fix the passing of time on Armada XP.

In order to become independent of Coherency Fabric frequency, configure
Timer and Watchdog to operate in 25MHz mode.

Submitted by: Zbigniew Bodek <zbb@semihalf.com>

11 years agoImplement pmap_copy() for ARMv6/v7.
gber [Tue, 4 Jun 2013 09:21:18 +0000 (09:21 +0000)]
Implement pmap_copy() for ARMv6/v7.

Copy the given range of mappings from the source map to the
destination map, thereby reducing the number of VM faults on fork.

Submitted by:   Zbigniew Bodek <zbb@semihalf.com>
Sponsored by:   The FreeBSD Foundation, Semihalf

11 years agomdoc: convert .Fd to .In, which is much nicer.
joel [Tue, 4 Jun 2013 07:37:06 +0000 (07:37 +0000)]
mdoc: convert .Fd to .In, which is much nicer.

11 years agoMatch the options of the kernel.
obrien [Tue, 4 Jun 2013 06:38:01 +0000 (06:38 +0000)]
Match the options of the kernel.

11 years agoUpdate a comment.
alc [Tue, 4 Jun 2013 05:44:52 +0000 (05:44 +0000)]
Update a comment.

11 years agoAdd man links for expl(3) and expm1l(3).
das [Tue, 4 Jun 2013 05:41:38 +0000 (05:41 +0000)]
Add man links for expl(3) and expm1l(3).

11 years agoUse f_shell_escape() instead of forking to awk. In this case, the
dteske [Tue, 4 Jun 2013 03:47:21 +0000 (03:47 +0000)]
Use f_shell_escape() instead of forking to awk. In this case, the
replacement comes with a great performance increase (as f_shell_escape()
uses the built-in based f_replaceall() which out-performs forking to
awk(1)). This should also improve readability slightly.

11 years agoUse a case-statement instead of multiple (separate even) if-statements.
dteske [Tue, 4 Jun 2013 03:38:16 +0000 (03:38 +0000)]
Use a case-statement instead of multiple (separate even) if-statements.

11 years agoComments.
dteske [Tue, 4 Jun 2013 03:37:35 +0000 (03:37 +0000)]
Comments.

11 years agoSimilar to r251236, r251242, and r251244. Introduce new function-pair to
dteske [Tue, 4 Jun 2013 03:30:44 +0000 (03:30 +0000)]
Similar to r251236, r251242, and r251244. Introduce new function-pair to
dialog(1) API in dialog.subr responsible for retrieving menu-choice data
(for the --menu widget).

Add f_dialog_menuitem_store()/f_dialog_menuitem_fetch() for storing and
retrieving the menuitem (not the tag) from a --menu widget result.

The dialog --menu widget returns the `tag' from the tag/item pair of choices
for a menu list. Because the menu list is often local to the function that
is displaying it, the ability to dereference this into the item is not
possible unless you use a global. This changes things so the function (upon
successful return of dialog) dereferences the tag into the item and stores
it for later retrieval using these functions.

NOTE: Tags are dereferenced into items using f_dialog_menutag2item().

11 years agoAdd the combined (mixed) diversity support capability bit for the
adrian [Tue, 4 Jun 2013 02:56:56 +0000 (02:56 +0000)]
Add the combined (mixed) diversity support capability bit for the
AR9285/AR9485.

11 years agoRelax the object locking in vm_pageout_map_deactivate_pages() and
alc [Tue, 4 Jun 2013 02:28:47 +0000 (02:28 +0000)]
Relax the object locking in vm_pageout_map_deactivate_pages() and
vm_pageout_object_deactivate_pages().  A read lock suffices.

Sponsored by: EMC / Isilon Storage Division

11 years agocxgbe(4): Provide accurate hit count for filters on T5 cards. The
np [Tue, 4 Jun 2013 02:25:25 +0000 (02:25 +0000)]
cxgbe(4): Provide accurate hit count for filters on T5 cards.  The
location within the TCB and the size have both changed.

MFC after: 1 week

11 years agoFix a code typo (missing `eval') which lead to improperly-sized menu when
dteske [Tue, 4 Jun 2013 00:42:31 +0000 (00:42 +0000)]
Fix a code typo (missing `eval') which lead to improperly-sized menu when
displaying packages (menu was always maximum height). The problem was
introduced by SVN r251232.

11 years agoPad the PCPU MD struct, to satisfy an assert added with the projects/counters
jhibbits [Tue, 4 Jun 2013 00:40:26 +0000 (00:40 +0000)]
Pad the PCPU MD struct, to satisfy an assert added with the projects/counters
branch import.

PR: ports/179173,ports/179164

11 years agoFix menu accenting for the package category list. The single-space indent
dteske [Tue, 4 Jun 2013 00:38:19 +0000 (00:38 +0000)]
Fix menu accenting for the package category list. The single-space indent
for duplicate initial-characters was removed for making comparisons but was
not put back.

11 years agoWhitespace and comments.
dteske [Tue, 4 Jun 2013 00:35:57 +0000 (00:35 +0000)]
Whitespace and comments.

11 years agoImprove debugging for f_dialog_*_constrain() to print constrained rather
dteske [Tue, 4 Jun 2013 00:30:05 +0000 (00:30 +0000)]
Improve debugging for f_dialog_*_constrain() to print constrained rather
than unconstrained values.

11 years agobmake does not like universe_${target}_prologue in the .ORDER
sjg [Mon, 3 Jun 2013 23:51:46 +0000 (23:51 +0000)]
bmake does not like universe_${target}_prologue in the .ORDER
when there is an explicit dependency for it anyway.
Remove it so both bmake and fmake do the same thing.

Reviewed by: OBrien

11 years agoFixing a typo.
hiren [Mon, 3 Jun 2013 22:22:53 +0000 (22:22 +0000)]
Fixing a typo.

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

11 years agoFix a typo: XPORT_SPI should be tested against transport, nor protocol.
delphij [Mon, 3 Jun 2013 21:52:19 +0000 (21:52 +0000)]
Fix a typo: XPORT_SPI should be tested against transport, nor protocol.

Submitted by: Sascha Wildner <swildner dragonflybsd org>
Reviewed by: mjacob
MFC after: 2 weeks

11 years agoAdd ATOMIC_*_LOCK_FREE constants.
ed [Mon, 3 Jun 2013 20:52:20 +0000 (20:52 +0000)]
Add ATOMIC_*_LOCK_FREE constants.

These constants are part of the C standard. Both Clang and GCC seem to
export these constants under the name __GCC_ATOMIC_*_LOCK_FREE.

11 years agoext2fs: space vs tab.
pfg [Mon, 3 Jun 2013 20:33:05 +0000 (20:33 +0000)]
ext2fs: space vs tab.

Obtained from: Christoph Mallon
MFC after: 3 days

11 years agoChange a comma to a semicolon.
kargl [Mon, 3 Jun 2013 20:09:22 +0000 (20:09 +0000)]
Change a comma to a semicolon.

Remove a blank line that crept into the declarations.

Fix a comment to show a sign on a NaN.

11 years agoext2fs: Small cosmetic fixes.
pfg [Mon, 3 Jun 2013 20:02:45 +0000 (20:02 +0000)]
ext2fs: Small cosmetic fixes.

Make a long macro readable and sort a header.

Obtained from: Christoph Mallon
MFC after: 3 days

11 years agold80 and ld128 implementations of expm1l(). This code started life
kargl [Mon, 3 Jun 2013 19:51:32 +0000 (19:51 +0000)]
ld80 and ld128 implementations of expm1l().  This code started life
as a fairly faithful implementation of the algorithm found in

PTP Tang, "Table-driven implementation of the Expm1 function
in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 18,
211-222 (1992).

Over the last 18-24 months, the code has under gone significant
optimization and testing.

Reviewed by: bde
Obtained from: bde (most of the optimizations)

11 years agoFix the order of TX shutdown and reset.
adrian [Mon, 3 Jun 2013 19:39:37 +0000 (19:39 +0000)]
Fix the order of TX shutdown and reset.

* Grab the reset lock first, so any subsequent interrupt, TX, RX work
  will fail

* Then shut down interrupts

* Then wait for TX/RX to finish running

At this point no further work will be running, so it's safe to do the
reset path code.

PR: kern/179232

11 years agoFix two comments that got lost in the disentanglement of the larger diff.
kargl [Mon, 3 Jun 2013 19:29:03 +0000 (19:29 +0000)]
Fix two comments that got lost in the disentanglement of the larger diff.

11 years agoFix receive on the AR9285 (Kite) with only one antenna connected.
adrian [Mon, 3 Jun 2013 19:14:29 +0000 (19:14 +0000)]
Fix receive on the AR9285 (Kite) with only one antenna connected.

The main problem here is that fast and driver RX diversity isn't actually
configured; I need to figure out why that is.  That said, this makes
the single-antenna connected AR9285 and AR2427 (AR9285 w/ no 11n) work
correctly.

PR: kern/179269

11 years agold80/s_expl.c:
kargl [Mon, 3 Jun 2013 19:13:44 +0000 (19:13 +0000)]
ld80/s_expl.c:

* Use integral numerical constants, and let the compiler do the
  conversion to long double.

ld128/s_expl.c:

* Use integral numerical constants, and let the compiler do the
  conversion to long double.
* Use the ENTERI/RETURNI macros, which are no-ops on ld128.  This
  however makes the ld80 and ld128 identical.

Reviewed by: bde (as part of larger diff)

11 years agoMicro-optimization: move the unary mius operator to operate
kargl [Mon, 3 Jun 2013 18:57:35 +0000 (18:57 +0000)]
Micro-optimization: move the unary mius operator to operate
on a literal constant.

Obtained from: bde

11 years agoAdd a comment to note that bde supplied most, if not all,
kargl [Mon, 3 Jun 2013 18:53:40 +0000 (18:53 +0000)]
Add a comment to note that bde supplied most, if not all,
of the optimizations.

11 years agoext2fs: Update Block Group Descriptor struct.
pfg [Mon, 3 Jun 2013 18:52:14 +0000 (18:52 +0000)]
ext2fs: Update Block Group Descriptor struct.

Uncover some, previously reserved, fields that are used by Ext4.
These are currently unused but it is good to have them for future
reference.

Reviewed by: bde
MFC after: 3 days

11 years agold80/s_expl.c:
kargl [Mon, 3 Jun 2013 18:51:34 +0000 (18:51 +0000)]
ld80/s_expl.c:

* In the special case x = -Inf or -NaN, use a micro-optimization
  to eliminate the need to access u.xbits.man.

* Fix an off-by-one for small arguments |x| < 0x1p-65.

ld128/s_expl.c:

* In the special case x = -Inf or -NaN, use a micro-optimization
  to eliminate the need to access u.xbits.manh and u.xbits.manl.

* Fix an off-by-one for small arguments |x| < 0x1p-114.

Obtained from: bde

11 years agold80/s_expl.c:
kargl [Mon, 3 Jun 2013 18:40:00 +0000 (18:40 +0000)]
ld80/s_expl.c:

* Update the evaluation of the polynomial.  This allows the removal
  of the now unused variables t23 and t45.

ld128/s_expl.c:

* Update the evaluation of the polynomial and the intermediate
  result t.  This update allows several numerical constants to be
  written as double rather than long double constants.   Update
  the constants as appropriate.

Obtained from: bde

11 years agoRename a few P2, P3, ... coefficients to A2, A3, ... missed in
kargl [Mon, 3 Jun 2013 18:18:08 +0000 (18:18 +0000)]
Rename a few P2, P3, ... coefficients to A2, A3, ... missed in
my previous commit.

11 years agoUpdate a comment to reflect that we are using an endpoint of
kargl [Mon, 3 Jun 2013 18:14:18 +0000 (18:14 +0000)]
Update a comment to reflect that we are using an endpoint of
an interval instead of a midpoint.

11 years agoAdd a u suffix to the IEEEl2bits unions o_threshold and u_threshold,
kargl [Mon, 3 Jun 2013 18:07:04 +0000 (18:07 +0000)]
Add a u suffix to the IEEEl2bits unions o_threshold and u_threshold,
and use macros to access the e component of the unions.  This allows
the portions of the code in ld80 to be identical to the ld128 code.

Obtained from: bde

11 years agoIntroduce the macro LOG2_INTERVAL, which is log2(number of intervals).
kargl [Mon, 3 Jun 2013 17:51:08 +0000 (17:51 +0000)]
Introduce the macro LOG2_INTERVAL, which is log2(number of intervals).
Use the macroi as a micro-optimization to convert a subtraction and
division to a shift.

Obtained from: bde

11 years ago- Fix a couple of inverted panic messages for shared/exclusive mismatches
jhb [Mon, 3 Jun 2013 17:41:11 +0000 (17:41 +0000)]
- Fix a couple of inverted panic messages for shared/exclusive mismatches
  of a lock within a single thread.
- Fix handling of interlocks in WITNESS by properly requiring the interlock
  to be held exactly once if it is specified.

11 years agoWhitespace.
kargl [Mon, 3 Jun 2013 17:40:52 +0000 (17:40 +0000)]
Whitespace.

11 years agoAssert that interrupts are enabled in the trap handlers on x86 before
kib [Mon, 3 Jun 2013 17:40:05 +0000 (17:40 +0000)]
Assert that interrupts are enabled in the trap handlers on x86 before
calling generic code to deliver signals.

Discussed with: bde
Tested by: pho
MFC after: 1 week

11 years ago- Handle the recursed/not recursed flags with RA_RLOCKED in rw_assert().
jhb [Mon, 3 Jun 2013 17:38:57 +0000 (17:38 +0000)]
- Handle the recursed/not recursed flags with RA_RLOCKED in rw_assert().
- Tweak a panic message.

11 years agoBe more generous when donating the current thread time to the owner of
kib [Mon, 3 Jun 2013 17:36:43 +0000 (17:36 +0000)]
Be more generous when donating the current thread time to the owner of
the vnode lock while iterating over the free vnode list.  Instead of
yielding, pause for 1 tick.  The change is reported to help in some
virtualized environments.

Submitted by: Roger Pau Monn? <roger.pau@citrix.com>
Discussed with: jilles
Tested by: pho
MFC after: 2 weeks

11 years ago* Rename the polynomial coefficients from P2, P3, ... to A2, A3, ....
kargl [Mon, 3 Jun 2013 17:36:26 +0000 (17:36 +0000)]
* Rename the polynomial coefficients from P2, P3, ... to A2, A3, ....
  The names now coincide with the name used in PTP Tang's paper.

* Rename the variable from s to tbl to better reflect that
  this is a table, and to be consistent with the naming scheme
  in s_exp2l.c

Reviewed by: bde (as part of larger diff)

11 years agoRemove irrelevant comments.
kib [Mon, 3 Jun 2013 17:30:40 +0000 (17:30 +0000)]
Remove irrelevant comments.

Discussed with: alc
MFC after: 3 days

11 years agocxgbe(4): t4fw_cfg must be explicitly loaded if the driver is being
np [Mon, 3 Jun 2013 17:30:21 +0000 (17:30 +0000)]
cxgbe(4): t4fw_cfg must be explicitly loaded if the driver is being
loaded via loader.conf.

Submitted by: jwd@
MFC after: 3 days

11 years ago* Style(9). Start non-Copyright fancy formatted comments with /**.
kargl [Mon, 3 Jun 2013 17:24:46 +0000 (17:24 +0000)]
* Style(9).   Start non-Copyright fancy formatted comments with /**.

Reviewed by: bde (as part of larger diff)

11 years agold80/s_expl.c:
kargl [Mon, 3 Jun 2013 17:21:43 +0000 (17:21 +0000)]
ld80/s_expl.c:

* Update Copyright years to include 2013.

ld128/s_expl.c:

* Correct and update Copyright years.  This code originated from
  the ld80 version, so it should reflect the same time period.

Reviewed by: bde (as part of larger diff)

11 years agoAdd libiconv based versions of *c16*() and *c32*().
ed [Mon, 3 Jun 2013 17:17:56 +0000 (17:17 +0000)]
Add libiconv based versions of *c16*() and *c32*().

I initially thought wchar_t was locale independent, but this seems to be
only the case on Linux. This means that we cannot depend on the *wc*()
routines to implement *c16*() and *c32*(). Instead, use the Citrus
libiconv that is part of libc.

I'll see if there is anything I can do to make the existing functions
somewhat useful in case the system is built without libiconv in the
nearby future. If not, I'll simply remove the broken implementations.

Reviewed by: jilles, gabor

11 years agoUpdate jemalloc to version 3.4.0.
jasone [Mon, 3 Jun 2013 14:36:28 +0000 (14:36 +0000)]
Update jemalloc to version 3.4.0.

11 years agoSwitch to 2-clause license
emaste [Mon, 3 Jun 2013 13:11:48 +0000 (13:11 +0000)]
Switch to 2-clause license

Approved by: luigi@

11 years agoSpecify a maximum TSO length limiting the segment chain to what the
andre [Mon, 3 Jun 2013 13:00:33 +0000 (13:00 +0000)]
Specify a maximum TSO length limiting the segment chain to what the
Xen host side can handle after defragmentation.

This prevents the driver from throwing away too long TSO chains and
improves the performance on Amazon AWS instances with 10GigE virtual
interfaces to the normally expected throughput.

Submitted by: cperciva (earlier version)
Reviewed by: cperciva
Tested by: cperciva
MFC after: 1 week

11 years agoAllow drivers to specify a maximum TSO length in bytes if they are
andre [Mon, 3 Jun 2013 12:55:13 +0000 (12:55 +0000)]
Allow drivers to specify a maximum TSO length in bytes if they are
limited in the amount of data they can handle at once.

Drivers can set ifp->if_hw_tsomax before calling ether_ifattach() to
change the limit.

The lowest allowable size is IP_MAXPACKET / 8 (8192 bytes) as anything
less wouldn't be very useful anymore.  The upper limit is still at
IP_MAXPACKET (65536 bytes).  Raising it requires further auditing of
the IPv4/v6 code path's as the length field in the IP header would
overflow leading to confusion in firewalls and others packet handler on
the real size of the packet.

The placement into "struct ifnet" is a bit hackish but the best place
that was found.  When the stack/driver boundary is updated it should
be handled in a better way.

Submitted by: cperciva (earlier version)
Reviewed by: cperciva
Tested by: cperciva
MFC after: 1 week (using spare struct members to preserve ABI)

11 years agoSwitch to 2-clause license
emaste [Mon, 3 Jun 2013 12:43:09 +0000 (12:43 +0000)]
Switch to 2-clause license

Approved by: bms@

11 years agoBump __FreeBSD_version for the addition of the following functions to libm:
das [Mon, 3 Jun 2013 09:33:51 +0000 (09:33 +0000)]
Bump __FreeBSD_version for the addition of the following functions to libm:
  cacos, cacosf, cacosh, cacoshf,
  casin, casinf, casinh, casinhf,
  catan, catanf, catanh, catanhf,
  logl, log2l, log10l, log1pl
I am hoping kargl@ will commit expl and expm1l soon, in which case this
bump will cover those, too.

Requested by: danfe

11 years agoAdd more tests for log functions. A few are commented out because the
das [Mon, 3 Jun 2013 09:15:15 +0000 (09:15 +0000)]
Add more tests for log functions.  A few are commented out because the
long double versions don't pass yet.  (They are rather nit-picky cases,
so there's ongoing discussion with Bruce about whether it is worth the
performance cost.)

11 years agoAdd logl, log2l, log10l, and log1pl.
das [Mon, 3 Jun 2013 09:14:31 +0000 (09:14 +0000)]
Add logl, log2l, log10l, and log1pl.

Submitted by: bde

11 years agoDo not map the shared page COW. If the process wired its address
kib [Mon, 3 Jun 2013 04:32:53 +0000 (04:32 +0000)]
Do not map the shared page COW.  If the process wired its address
space, fork(2) would cause shadowing of the physical object and
copying of the shared page into private copy, effectively preventing
updates for the exported timehands structure and stopping the clock.

Specify the maximum allowed permissions for the page to be read and
execute, preventing write from the user mode.

Reported and tested by: <huanghwh@yahoo.com>
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

11 years agoSince the cause of the problems with the __fillcontextx() was
kib [Mon, 3 Jun 2013 04:22:42 +0000 (04:22 +0000)]
Since the cause of the problems with the __fillcontextx() was
identified, unify the code of check_deferred_signal() for all
architectures, making the variant under #ifdef x86 common.

Tested by: marius (sparc64)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

11 years agoMFamd64: when printing the trap information, show the %esp value.
kib [Mon, 3 Jun 2013 04:19:21 +0000 (04:19 +0000)]
MFamd64: when printing the trap information, show the %esp value.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoWhen auto-sizing the buffer cache, limit the amount of physical memory
kib [Mon, 3 Jun 2013 04:16:48 +0000 (04:16 +0000)]
When auto-sizing the buffer cache, limit the amount of physical memory
used as the estimation of size, to 32GB.  This provides around 100K of
buffer headers and corresponding KVA for buffer map at the peak.
Sizing the cache larger is not useful, also resulting in the wasting
and exhausting of KVA for large machines.

Reported and tested by: bdrewery
Sponsored by: The FreeBSD Foundation

11 years agoThe vm_page lock is not needed around the call to vm_page_insert().
kib [Mon, 3 Jun 2013 04:11:42 +0000 (04:11 +0000)]
The vm_page lock is not needed around the call to vm_page_insert().

Submitted by: alc
MFC after: 1 week

11 years agoRequire that the page lock is held, instead of the object lock, when
alc [Mon, 3 Jun 2013 01:22:54 +0000 (01:22 +0000)]
Require that the page lock is held, instead of the object lock, when
clearing the page's PGA_REFERENCED flag.  Since we are typically
manipulating the page's act_count field when we are clearing its
PGA_REFERENCED flag, the page lock is already held everywhere that we clear
the PGA_REFERENCED flag.  So, in fact, this revision only changes some
comments and an assertion.  Nonetheless, it will enable later changes to
object locking in the pageout code.

Introduce vm_page_assert_locked(), which completely hides the implementation
details of the page lock from the caller, and use it in
vm_page_aflag_clear().  (The existing vm_page_lock_assert() could not be
used in vm_page_aflag_clear().)  Over the coming weeks, I expect that we'll
either eliminate or replace the various uses of vm_page_lock_assert() with
vm_page_assert_locked().

Reviewed by: attilio
Sponsored by: EMC / Isilon Storage Division

11 years agoMove ppp.8.m4 back to ppp.8 and de-ifdef it.
brian [Sun, 2 Jun 2013 23:56:38 +0000 (23:56 +0000)]
Move ppp.8.m4 back to ppp.8 and de-ifdef it.

Requested by: joel

MFC after: 1 week

11 years agoLike r250701, introduce another handy function for truncating variables to a
dteske [Sun, 2 Jun 2013 23:25:27 +0000 (23:25 +0000)]
Like r250701, introduce another handy function for truncating variables to a
specific byte-length. Works like vsnprintf(3).

11 years agoFix a typo. In this case, the typo caused the f_noyes() invocation to
dteske [Sun, 2 Jun 2013 23:23:29 +0000 (23:23 +0000)]
Fix a typo. In this case, the typo caused the f_noyes() invocation to
display a global instead of the passed-argument; however since the global
always has the same value as the passed argument, it made no difference in
the realtime operation.

11 years agoFix a bug in which the user's choice to Cancel was not recognized. This was
dteske [Sun, 2 Jun 2013 23:20:46 +0000 (23:20 +0000)]
Fix a bug in which the user's choice to Cancel was not recognized. This was
caused by the standard (and correct) behavior of the shell to discard the
return status of lvalue-operands in a pipe-chain.

The solution is to not pipe the file-acquisition directly into sort(1) but
instead store the output (allowing immediate testing of the return status)
and later sort it.

11 years agoFix a bug that would cause a spurious warning to appear to appear in an
dteske [Sun, 2 Jun 2013 23:18:27 +0000 (23:18 +0000)]
Fix a bug that would cause a spurious warning to appear to appear in an
edge-case. The case was that you have been through the FTP setup once before
and on the second time through, you cancel at the re-selection of a new FTP
server.

The spurious warning was "device_media: not found" and was caused because
the underlying call to f_device_network_down() did not check to see if the
network device existed before attempting to shut it down.

Add checks to make sure we don't forge ahead unless the device exists.

11 years agoFix a bug in which the user's choice to Cancel was not properly recognized.
dteske [Sun, 2 Jun 2013 23:15:12 +0000 (23:15 +0000)]
Fix a bug in which the user's choice to Cancel was not properly recognized.

11 years agoChange the name of a couple of functions in `usermgmt/user_input.subr' to
dteske [Sun, 2 Jun 2013 23:12:32 +0000 (23:12 +0000)]
Change the name of a couple of functions in `usermgmt/user_input.subr' to
make their purpose more clear by their names:

f_dialog_input_change() and
f_dialog_input_expire()

Are now (respectively):

f_dialog_input_expire_password() and
f_dialog_input_expire_account()

Upon revisit to this portion of code, the former names were too confusing.

11 years agoFix a copy/paste error within a comment.
dteske [Sun, 2 Jun 2013 23:08:21 +0000 (23:08 +0000)]
Fix a copy/paste error within a comment.

11 years agoAdd some additional debugging to the common media library.
dteske [Sun, 2 Jun 2013 23:06:33 +0000 (23:06 +0000)]
Add some additional debugging to the common media library.

11 years agoMake some obvious consolidations in local declaration for readability.
dteske [Sun, 2 Jun 2013 23:05:01 +0000 (23:05 +0000)]
Make some obvious consolidations in local declaration for readability.

11 years agoStandardize NULL initialization to be consistent.
dteske [Sun, 2 Jun 2013 23:02:56 +0000 (23:02 +0000)]
Standardize NULL initialization to be consistent.

11 years agoUse f_isset() (introduced by r250317) instead of `f_quietly f_getvar ...'.
dteske [Sun, 2 Jun 2013 22:54:36 +0000 (22:54 +0000)]
Use f_isset() (introduced by r250317) instead of `f_quietly f_getvar ...'.

11 years agoMake proper use of locals in f_dialog_init().
dteske [Sun, 2 Jun 2013 22:45:54 +0000 (22:45 +0000)]
Make proper use of locals in f_dialog_init().

11 years agoImprovements to whitespace and comments.
dteske [Sun, 2 Jun 2013 22:34:40 +0000 (22:34 +0000)]
Improvements to whitespace and comments.

11 years agoFix option processing from the library layer to address unexpected
dteske [Sun, 2 Jun 2013 22:04:39 +0000 (22:04 +0000)]
Fix option processing from the library layer to address unexpected
behavior(s); e.g., `-Xd' versus `-dX' did not produce the same results.

The libraries common.subr and dialog.subr automatically process the
arguments passed to the program and enable/disable functionality without the
need to process the arguments within your program. For example, if "$@"
contains `-d', common.subr will see this and enable debugging regardless of
whether you process "$@" yourself or not (this automatic processing can
easily be disabled for custom scripts that don't want it; see the afore-
mentioned scripts for additional details).

NOTE: common.subr stores a copy of "$@" in $ARGV for convenient (and
repeated) processing by libraries such as dialog.subr which provide such
transparent functionality for the consuming script(s).

However, the libraries don't know if a program wants to accept `extra'
options. Flags are not really a problem, because the library can be
programmed to silently ignore unknown flags. The trouble comes into play
when the program wants to define an option that takes an argument.

For example:

bsdconfig -D logfile -X

In the above example, the library uses getopts to process $ARGV and if it
doesn't know that `-D' takes an argument, the option processing will
prematurely terminate on `logfile' (this is standard/correct behavior for
getopts but is undesired in our situation where we have partially off-loaded
main argument processing).

The problem is solved by allowing the program to define an extra set of
options to be included in each library's handling of $ARGV. Only options
that require arguments are truly necessary to be pre-specified in this new
manner.

11 years agoStandardize the way functions build their arguments leading up to a dialog
dteske [Sun, 2 Jun 2013 20:02:50 +0000 (20:02 +0000)]
Standardize the way functions build their arguments leading up to a dialog
invocation. Specifically, "top-load" your arguments and in the order in-
which they will be displayed. For example, many [if not all] widgets display
information in the following order, top-to-bottom (visually):

+ backtitle (displayed behind the widget at top-left)
+ title (at the top of the `window')
+ prompt text (just below the title and above whatever widget you choose)
+ Depending on widget, _one_ of the following:
  - menu list
  - radio list
  - check list
  - text input box with initial text
  - [Xdialog(1)] 2x or 3x text input boxes
  - [dialog(1)] a multi-part form
  - progress bar
  - etc. (many more widget choices)
+ buttons (right below the selected widget)
+ [dialog(1)] the hline (displayed at bottom of `window')

NOTE: Xdialog(1) accepts and silently ignores --hline

When building local arguments for your dialog invocation, if the value can't
be cleanly loaded into a local, add "# Calculated below" to the end of the
local declaration while retaining the block order of argument declarations.

Move other local declarations that are not associated with this top-loading
the dialog arguments to right-above where they are first-used.

Also, standardize on the names of the arguments. For example, always use
$prompt (instead of sometimes $msg and sometimes $prompt); use $menu_list
or $shell_list or $radio_list for those respective widgets; ad nauseum.

While we're doing this, flush-out full arguments for many invocations that
were passing NULL strings (making it unapparent if you were staring at this
one invocation what argument that NULL string was supposed to represent).

Last, while we're in startup/rcconf let's remove the unnecessary use of a
GLOBAL (RCCONF_MENU_LIST) for the menu_list.

11 years agoRemove unnecessary #include's.
alc [Sun, 2 Jun 2013 18:10:16 +0000 (18:10 +0000)]
Remove unnecessary #include's.

11 years agoCorrect check to see if file changes.
eadler [Sun, 2 Jun 2013 18:10:07 +0000 (18:10 +0000)]
Correct check to see if file changes.

Reported by: swildner@DragonFlyBSD.org
Reviewed by: des

11 years agoAdd 'static' where able.
eadler [Sun, 2 Jun 2013 17:55:00 +0000 (17:55 +0000)]
Add 'static' where able.

11 years agoReduce the scope of the VM object locking in brelse(). In my tests, this
alc [Sun, 2 Jun 2013 16:18:03 +0000 (16:18 +0000)]
Reduce the scope of the VM object locking in brelse().  In my tests, this
change reduced the total number of VM object lock acquisitions by brelse()
by 74%.

Sponsored by: EMC / Isilon Storage Division

11 years agoCorrect the TD size computation. npkt should reflect the number of packets
hselasky [Sun, 2 Jun 2013 12:28:29 +0000 (12:28 +0000)]
Correct the TD size computation. npkt should reflect the number of packets
remaining after the current TRB has been executed. Refer to section 4.11.2.4
of the XHCI specification for USB.

MFC after: 1 week

11 years agoCorrect TRB type for multi TRB transfers of non-NORMAL type, like isochronous.
hselasky [Sun, 2 Jun 2013 12:16:58 +0000 (12:16 +0000)]
Correct TRB type for multi TRB transfers of non-NORMAL type, like isochronous.
Only the first TRB should be markes as special. Subsequent ones should be
marked as NORMAL. Optimise away TD first variable.

MFC after: 1 week

11 years agoUse the correct constant for 8000 IRQ/s.
hselasky [Sun, 2 Jun 2013 12:00:16 +0000 (12:00 +0000)]
Use the correct constant for 8000 IRQ/s.

MFC after: 1 week

11 years agoBlock event interrupts when we don't need it as soon as possible.
hselasky [Sun, 2 Jun 2013 11:58:31 +0000 (11:58 +0000)]
Block event interrupts when we don't need it as soon as possible.
Typically this feature is used for isochronous transfers.
This reduces the amount of XHCI interrupting.

MFC after: 1 week

11 years agoConvert old make variable modifiers :U and :L to bmake :tu and :tl.
tijl [Sun, 2 Jun 2013 11:44:23 +0000 (11:44 +0000)]
Convert old make variable modifiers :U and :L to bmake :tu and :tl.

Reviewed by: sjg

11 years agoDon't set the start ISOC ASAP bit for non-isochronous TRBs.
hselasky [Sun, 2 Jun 2013 10:54:47 +0000 (10:54 +0000)]
Don't set the start ISOC ASAP bit for non-isochronous TRBs.

MFC after: 1 week

11 years agoUse LIST_EMPTY when appropriate.
tuexen [Sun, 2 Jun 2013 10:35:08 +0000 (10:35 +0000)]
Use LIST_EMPTY when appropriate.

MFC after: 1 week

11 years agoCorrect some XHCI streams mode transfer handling found by code inspection.
hselasky [Sun, 2 Jun 2013 10:32:57 +0000 (10:32 +0000)]
Correct some XHCI streams mode transfer handling found by code inspection.
The existing streams mode support is not working and has not been tested
due to lack of hardware which supports the given feature.

MFC after: 1 week

11 years ago- Update Oleg Moskalenko's email address
gabor [Sun, 2 Jun 2013 09:43:48 +0000 (09:43 +0000)]
- Update Oleg Moskalenko's email address

Requested by: Oleg Moskalenko <mom040267@gmail.com>

11 years agoImprove the dialog(1) API in dialog.subr by adding f_dialog_default_store()
dteske [Sun, 2 Jun 2013 09:02:12 +0000 (09:02 +0000)]
Improve the dialog(1) API in dialog.subr by adding f_dialog_default_store()
and f_dialog_default_fetch(). Operating similar to functions introduced by
SVN r251236 and r251242, these functions operate as a pair for helping track
the default-item data (for the --menu, --checklist, and --radiolist
widgets).

This replaces the direct usage of a global to store the data with an
abstract method for readability and to centralize the code.

11 years agoSimilar to r251236, improve the portion of dialog(1) API in dialog.subr
dteske [Sun, 2 Jun 2013 05:45:25 +0000 (05:45 +0000)]
Similar to r251236, improve the portion of dialog(1) API in dialog.subr
responsible for retrieving stored input (for the --inputbox and --password
widgets).

When we (Ron McDowell and I) developed the first version of bsdconfig, it
used temporary files to store responses from dialog(1). That hasn't been
true for a very long time, so the need to always execute some clean-up
function is long-deprecated. The function that used to perform these clean-
up routines for these widgets was f_dialog_inputstr().

We really don't need f_dialog_inputstr() for its originally designed purpose
as all dialog invocations no longer require temporary files.

Just as in r251236, redesign f_dialog_inputstr() in the following four ways:

1. Rename f_dialog_inputstr() to f_dialog_inputstr_fetch()
2. Introduce the new first-argument of $var_to_set to reduce forking
3. Create a corresponding f_dialog_inputstr_store() to abstract storage
4. Offload the sanitization to a new function, f_dialog_line_sanitize()

It should be noted that f_dialog_line_sanitize() -- unlike its cousin from
SVN r251236, f_dialog_data_sanitize() -- trims leading/trailing whitespace
from the user's input. This helps prevent errors and common mistakes caused
by the fact that the new cdialog implementation allows the right-arrow
cursor key to go beyond the last byte of realtime input (adding whitespace
at the end of the typed value).

While we're centralizing the sanitization, let's rewrite f_dialog_input()
while we're here to likewise reduce forking. The f_dialog_input() function
now expects the first argument of $var_to_set instead of producing results
on standard-out.

These changes greatly improve readability and also improve performance.