Re: svn commit: r231987 - in head/sys/mips/cavium: . octe

2012-02-24 Thread Juli Mallett
On Tue, Feb 21, 2012 at 17:30, Oleksandr Tymoshenko  wrote:
> Author: gonzo
> Date: Wed Feb 22 01:30:25 2012
> New Revision: 231987
> URL: http://svn.freebsd.org/changeset/base/231987
>
> Log:
>  Refctor address assignment for Octeon's ethernet ports:
>
>  - Centralize address assignment
>  - Make sure managment ports get first MAC address in pool

It was the case that this would happen, now we're relying on object
link order to do the right thing, which I think is a mistake.  This is
a fix for a bug introduced by this patch.

I don't like the idea of handing out MAC addresses to ports as they're
configured, as this *does* break things if you don't have the octm
driver in your kernel, but do have management ports.

Your bootloader comes up, uses the same logic we were using to assign
MACs (which is the gold standard in publicly-available Octeonland,
even if there are private bootloaders and kernels which did
differently), and then when the kernel boots, the MAC assigned to the
physical ports is different.  If you use DHCP + bootp on the
management port to boot up, and then configure octe0 via DHCP, your
lease moves from one physical port to another.  In my experience,
before I fixed things to match bootloader behavior, this could result
in mysterious and exciting behavior involving long delays in
connectivity at boot.

And of course, now you'll get a different MAC for octe0 based on
whether octm is in your kernel or not.  Which is its own set of fun.
The Octeon hardware doesn't need a per-port MAC you can read because
there is a consistent way to allocate them to ports that is easy to
follow.  I don't see the benefit in handing them out dynamically,
especially relying in link order to get it right.  The previous method
had shortcomings and a load of comments since there were dragons in
the vicinity.  This introduces a lot more magic, actually-confusing
behavior, etc., and has few comments, and none that catch eyes in the
right places.

If we want to abstract this out into cvm_assign_mac_address so that
downstream consumers of this code (or upstream, as the case may be)
can do their own thing, I'd suggest passing down the interface number,
whether it's a management port, etc., and restoring the original,
consistent logic, in that function.  This has the potential to be
markedly-astonishing.  What happens if we add support for loading octe
and octm as modules (which has been requested by consumers of the
Octeon code in the past)?  Yikes!

>  - Properly propagate fail if address allocation failed
>
>  Submitted by: Andrew Duane 
>
> Modified:
>  head/sys/mips/cavium/files.octeon1
>  head/sys/mips/cavium/if_octm.c
>  head/sys/mips/cavium/octe/ethernet-common.c
>  head/sys/mips/cavium/octe/ethernet-common.h
>  head/sys/mips/cavium/octe/ethernet-rgmii.c
>  head/sys/mips/cavium/octe/ethernet-sgmii.c
>  head/sys/mips/cavium/octe/ethernet-spi.c
>  head/sys/mips/cavium/octe/ethernet-xaui.c
>  head/sys/mips/cavium/octe/ethernet.c
>
> Modified: head/sys/mips/cavium/files.octeon1
> ==
> --- head/sys/mips/cavium/files.octeon1  Wed Feb 22 01:23:14 2012        
> (r231986)
> +++ head/sys/mips/cavium/files.octeon1  Wed Feb 22 01:30:25 2012        
> (r231987)
> @@ -24,6 +24,10 @@ mips/cavium/cryptocteon/cryptocteon.c                o
>  mips/mips/octeon_cop2_swtch.S                  standard
>  mips/mips/octeon_cop2.c                                standard
>
> +# octm must be first, so management ports get the first MAC addresses
> +mips/cavium/if_octm.c                          optional octm
> +contrib/octeon-sdk/cvmx-mgmt-port.c            optional octm
> +
>  mips/cavium/octe/ethernet.c                    optional octe
>  mips/cavium/octe/ethernet-mv88e61xx.c          optional octe 
> octeon_vendor_lanner
>  mips/cavium/octe/ethernet-common.c             optional octe
> @@ -39,10 +43,6 @@ mips/cavium/octe/mv88e61xxphy.c                      option
>  mips/cavium/octe/octe.c                                optional octe
>  mips/cavium/octe/octebus.c                     optional octe
>
> -mips/cavium/if_octm.c                          optional octm
> -
> -contrib/octeon-sdk/cvmx-mgmt-port.c            optional octm
> -
>  mips/cavium/octopci.c                          optional pci
>  mips/cavium/octopci_bus_space.c                        optional pci
>
>
> Modified: head/sys/mips/cavium/if_octm.c
> ==
> --- head/sys/mips/cavium/if_octm.c      Wed Feb 22 01:23:14 2012        
> (r231986)
> +++ head/sys/mips/cavium/if_octm.c      Wed Feb 22 01:30:25 2012        
> (r231987)
> @@ -63,6 +63,7 @@
>  #include 
>  #include 
>  #include 
> +#include "octe/ethernet-common.h"
>
>  struct octm_softc {
>        struct ifnet *sc_ifp;
> @@ -176,9 +177,10 @@ octm_attach(device_t dev)
>        /*
>         * Set MAC address for this management port.
>         */
> -       mac = 0;
> -    

Re: svn commit: r232074 - head/sys/cam/ctl

2012-02-24 Thread Alexander Best
On Thu Feb 23 12, Dimitry Andric wrote:
> Author: dim
> Date: Thu Feb 23 21:34:14 2012
> New Revision: 232074
> URL: http://svn.freebsd.org/changeset/base/232074
> 
> Log:
>   Use a better way to silence unneeded internal declaration warnings in
>   several sys/cam/ctl files.

is the clang version in base able to do complete universe builds for i386 and
amd64 without the need for NO_WERROR= and WERROR= now?

cheers.
alex

ps: are there any plans to add support for compiling kernel+userland with clang
tot? maybe this can be accomplished by doing something like

echo "WITH_CLANG_TOT=yes" >> /etc/src.conf

which will turn all -Wformat-invalid-specifier and -Wformat-extra-args errors
into warnings (because clang tot doesn't support -fformat-extensions)?


>   
>   Suggested by:   ed
>   Reviewed by:ken
>   MFC after:  1 week
> 
> Modified:
>   head/sys/cam/ctl/ctl_private.h
> 
> Modified: head/sys/cam/ctl/ctl_private.h
> ==
> --- head/sys/cam/ctl/ctl_private.hThu Feb 23 21:32:32 2012
> (r232073)
> +++ head/sys/cam/ctl/ctl_private.hThu Feb 23 21:34:14 2012
> (r232074)
> @@ -297,7 +297,7 @@ struct ctl_page_index {
>  #define  CTL_PAGE_DEFAULT0x02
>  #define  CTL_PAGE_SAVED  0x03
>  
> -static struct ctl_page_index page_index_template[] = {
> +static const struct ctl_page_index page_index_template[] = {
>   {SMS_FORMAT_DEVICE_PAGE, 0, sizeof(struct scsi_format_page), NULL,
>CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL},
>   {SMS_RIGID_DISK_PAGE, 0, sizeof(struct scsi_rigid_disk_page), NULL,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r232103 - head/sys/vm

2012-02-24 Thread Konstantin Belousov
Author: kib
Date: Fri Feb 24 10:41:58 2012
New Revision: 232103
URL: http://svn.freebsd.org/changeset/base/232103

Log:
  Place the if() at the right location, to activate the v_writecount
  accounting for shared writeable mappings for all filesystems, not only
  for the bypass layers.
  
  Submitted by: alc
  Pointy hat to:kib
  MFC after:20 days

Modified:
  head/sys/vm/vm_mmap.c

Modified: head/sys/vm/vm_mmap.c
==
--- head/sys/vm/vm_mmap.c   Fri Feb 24 07:54:08 2012(r232102)
+++ head/sys/vm/vm_mmap.c   Fri Feb 24 10:41:58 2012(r232103)
@@ -1272,10 +1272,10 @@ vm_mmap_vnode(struct thread *td, vm_size
VFS_UNLOCK_GIANT(vfslocked);
return (error);
}
-   if (locktype == LK_EXCLUSIVE) {
-   *writecounted = TRUE;
-   vnode_pager_update_writecount(obj, 0, objsize);
-   }
+   }
+   if (locktype == LK_EXCLUSIVE) {
+   *writecounted = TRUE;
+   vnode_pager_update_writecount(obj, 0, objsize);
}
} else if (vp->v_type == VCHR) {
error = vm_mmap_cdev(td, objsize, prot, maxprotp, flagsp,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r232104 - head/sys/kern

2012-02-24 Thread Konstantin Belousov
Author: kib
Date: Fri Feb 24 11:02:35 2012
New Revision: 232104
URL: http://svn.freebsd.org/changeset/base/232104

Log:
  Restore the return statement erronously removed in the r232048.
  
  Submitted by: cognet
  Pointy hat to:kib (reuse the one I already got today)
  MFC after:13 days

Modified:
  head/sys/kern/kern_exit.c

Modified: head/sys/kern/kern_exit.c
==
--- head/sys/kern/kern_exit.c   Fri Feb 24 10:41:58 2012(r232103)
+++ head/sys/kern/kern_exit.c   Fri Feb 24 11:02:35 2012(r232104)
@@ -916,6 +916,7 @@ loop:
 
if (status)
*status = SIGCONT;
+   return (0);
}
PROC_UNLOCK(p);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r232074 - head/sys/cam/ctl

2012-02-24 Thread Dimitry Andric
On 2012-02-24 10:38, Alexander Best wrote:
> is the clang version in base able to do complete universe builds for i386 and
> amd64 without the need for NO_WERROR= and WERROR= now?

"universe" means all arches, and all kernel configs, so no.  The status
for head with clang is as follows:

- buildworld with default options, e.g. no WITH_XXX or WITHOUT_XXX
  settings, will complete without any (fatal) warnings.
- buildkernel of the default GENERIC config still has one warning left,
  in sys/dev/mps/mps_sas.c.  It should be simple to fix, but I'm
  checking it with Ken first.
- The LINT kernel configs probably have many warnings left.  I haven't
  tested those extensively.

As soon as world & kernel compile without warnings, I'd like to have a
tinderbox that continually builds with clang.  So head won't be
regressing any more. :)


> ps: are there any plans to add support for compiling kernel+userland with 
> clang
> tot? maybe this can be accomplished by doing something like
> 
> echo "WITH_CLANG_TOT=yes" >> /etc/src.conf

I'm not working on this at the moment.  Pawel Worach (CC'd) has a
buildbot setup that builds FreeBSD daily with clang ToT.  Apparently
just a few patches are needed.


> which will turn all -Wformat-invalid-specifier and -Wformat-extra-args errors
> into warnings (because clang tot doesn't support -fformat-extensions)?

It would be better to push our format extensions upstream, I think.
Though the option should probably be renamed to something else, e.g.
-ffreebsd-extensions, or such.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r232074 - head/sys/cam/ctl

2012-02-24 Thread Alexander Best
On Fri Feb 24 12, Dimitry Andric wrote:
> On 2012-02-24 10:38, Alexander Best wrote:
> > is the clang version in base able to do complete universe builds for i386 
> > and
> > amd64 without the need for NO_WERROR= and WERROR= now?
> 
> "universe" means all arches, and all kernel configs, so no.  The status
> for head with clang is as follows:

i meant with TARGETS=i386 amd64 set. i think this will only do a universe build
for those arches.

> 
> - buildworld with default options, e.g. no WITH_XXX or WITHOUT_XXX
>   settings, will complete without any (fatal) warnings.
> - buildkernel of the default GENERIC config still has one warning left,
>   in sys/dev/mps/mps_sas.c.  It should be simple to fix, but I'm
>   checking it with Ken first.
> - The LINT kernel configs probably have many warnings left.  I haven't
>   tested those extensively.
> 
> As soon as world & kernel compile without warnings, I'd like to have a
> tinderbox that continually builds with clang.  So head won't be
> regressing any more. :)

yeah good idea. :)

> 
> 
> > ps: are there any plans to add support for compiling kernel+userland with 
> > clang
> > tot? maybe this can be accomplished by doing something like
> > 
> > echo "WITH_CLANG_TOT=yes" >> /etc/src.conf
> 
> I'm not working on this at the moment.  Pawel Worach (CC'd) has a
> buildbot setup that builds FreeBSD daily with clang ToT.  Apparently
> just a few patches are needed.
> 
> 
> > which will turn all -Wformat-invalid-specifier and -Wformat-extra-args 
> > errors
> > into warnings (because clang tot doesn't support -fformat-extensions)?
> 
> It would be better to push our format extensions upstream, I think.
> Though the option should probably be renamed to something else, e.g.
> -ffreebsd-extensions, or such.

i'm still confused regarding the actual politics regarding this change.
everytime this comes up i get a different answer. the last one was that since
the special printf format is only used for kernel code, the -fformat-extensions
code within clang base shouldn't be pushed upstream.

personally i like the idea of pushing it upstream and renaming it to
-ffreebsd-extensions. that would make it easier to import new clang versions
and it would be a lot easier to build freebsd with clang tot.

maybe pushing the -fformat-extensions code upstream could happen before freebsd
10.0 gets released.

thanks for your answer.

cheers.
alex
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r232105 - in head/usr.bin/calendar/calendars: hr_HR.ISO8859-2 ru_RU.KOI8-R

2012-02-24 Thread Sergey A. Osokin
Author: osa (ports committer)
Date: Fri Feb 24 11:40:20 2012
New Revision: 232105
URL: http://svn.freebsd.org/changeset/base/232105

Log:
  Add underscore symbol to the end of definition strings
  to keep all calendar files are consistency.
  
  Approved by:  edwin
  MFC after:1 week

Modified:
  head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.all
  head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.praznici
  head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.all

Modified: head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.all
==
--- head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.allFri Feb 
24 11:02:35 2012(r232104)
+++ head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.allFri Feb 
24 11:40:20 2012(r232105)
@@ -4,9 +4,9 @@
  * $FreeBSD$
  */
 
-#ifndef _hr_HR_ISO8859_2_all
-#define _hr_HR_ISO8859_2_all
+#ifndef _hr_HR_ISO8859_2_all_
+#define _hr_HR_ISO8859_2_all_
 
 #include 
 
-#endif /* !_hr_HR_ISO8859_2_all */
+#endif /* !_hr_HR_ISO8859_2_all_ */

Modified: head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.praznici
==
--- head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.praznici   Fri Feb 
24 11:02:35 2012(r232104)
+++ head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/calendar.praznici   Fri Feb 
24 11:40:20 2012(r232105)
@@ -4,8 +4,8 @@
  * $FreeBSD$
  */
 
-#ifndef _hr_HR_ISO8859_2_praznici
-#define _hr_HR_ISO8859_2_praznici
+#ifndef _hr_HR_ISO8859_2_praznici_
+#define _hr_HR_ISO8859_2_praznici_
 
 LANG=hr_HR.ISO8859-2
 
@@ -41,4 +41,4 @@ Easter+39 Uza�a��e
 03/NedjeljaLastPo�etak ljetnog vremena
 10/NedjeljaLastKraj ljetnog vremena
 
-#endif /* !_hr_HR_ISO8859_2_praznici */
+#endif /* !_hr_HR_ISO8859_2_praznici_ */

Modified: head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.all
==
--- head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.all   Fri Feb 24 
11:02:35 2012(r232104)
+++ head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.all   Fri Feb 24 
11:40:20 2012(r232105)
@@ -4,8 +4,8 @@
  * $FreeBSD$
  */
 
-#ifndef _ru_RU_KOI8_R_all
-#define _ru_RU_KOI8_R_all
+#ifndef _ru_RU_KOI8_R_all_
+#define _ru_RU_KOI8_R_all_
 
 #include 
 #include 
@@ -13,4 +13,4 @@
 #include 
 #include 
 
-#endif /* !_ru_RU_KOI8_R_all */
+#endif /* !_ru_RU_KOI8_R_all_ */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r232108 - head/usr.bin/xargs

2012-02-24 Thread Jilles Tjoelker
Author: jilles
Date: Fri Feb 24 12:35:17 2012
New Revision: 232108
URL: http://svn.freebsd.org/changeset/base/232108

Log:
  xargs: If a utility exits with 255 or a signal, write an error message.
  
  If a utility called by xargs exits with status 255 or because of a signal,
  POSIX requires writing an error message.
  
  PR:   165155
  Submitted by: Matthew Story matthewstory gmail com

Modified:
  head/usr.bin/xargs/xargs.c

Modified: head/usr.bin/xargs/xargs.c
==
--- head/usr.bin/xargs/xargs.c  Fri Feb 24 12:32:50 2012(r232107)
+++ head/usr.bin/xargs/xargs.c  Fri Feb 24 12:35:17 2012(r232108)
@@ -281,7 +281,7 @@ parse_input(int argc, char *argv[])
case EOF:
/* No arguments since last exec. */
if (p == bbp) {
-   waitchildren(*argv, 1);
+   waitchildren(*av, 1);
exit(rval);
}
goto arg1;
@@ -368,7 +368,7 @@ arg2:
}
prerun(argc, av);
if (ch == EOF || foundeof) {
-   waitchildren(*argv, 1);
+   waitchildren(*av, 1);
exit(rval);
}
p = bbp;
@@ -608,8 +608,11 @@ waitchildren(const char *name, int waita
 * If utility signaled or exited with a value of 255,
 * exit 1-125.
 */
-   if (WIFSIGNALED(status) || WEXITSTATUS(status) == 255)
-   exit(1);
+   if (WIFSIGNALED(status))
+   errx(1, "%s: terminated with signal %d, aborting",
+   name, WTERMSIG(status));
+   if (WEXITSTATUS(status) == 255)
+   errx(1, "%s: exited with status 255, aborting", name);
if (WEXITSTATUS(status))
rval = 1;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r232114 - head/tools/test/netfibs

2012-02-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Feb 24 14:13:06 2012
New Revision: 232114
URL: http://svn.freebsd.org/changeset/base/232114

Log:
  Update scripts to work around two sh(1) bugs found in stable/8:
  1) _x=$((_x + 1)) does not work while x=$((x + 1)) does.
  2) Parameter Expansion, esp. "${x%%bar}" does not work if quoted.
  
  Correct typos and improve some details forwarding.sh already
  had in initiator, esp. related to ipfw accepting if the default
  is deny.
  
  Add an extra stat call to the "delay" function in addition to the
  touch which together is still a lot faster than sleep 1 but seems
  to help a lot more to mitigate the unrelated kernel race seen.
  
  Sponsored by:   Cisco Systems, Inc.

Modified:
  head/tools/test/netfibs/README
  head/tools/test/netfibs/forwarding.sh
  head/tools/test/netfibs/initiator.sh
  head/tools/test/netfibs/reflector.sh

Modified: head/tools/test/netfibs/README
==
--- head/tools/test/netfibs/README  Fri Feb 24 13:22:57 2012
(r232113)
+++ head/tools/test/netfibs/README  Fri Feb 24 14:13:06 2012
(r232114)
@@ -35,7 +35,7 @@ initiator.sh and reflector.sh
output.  A special value of 42 will enable sh(1) xtrace printing.
 
The output format is modeled after Test::Harness Perl as used in
-   tools/regression/ but not always complaint following the test case name.
+   tools/regression/ but not always compliant following the test case name.
 
NOTE: at the time of writing reflector.sh can trigger kernel races
unrelated to multi-FIB test leading to a panic(9).  "delay" calls

Modified: head/tools/test/netfibs/forwarding.sh
==
--- head/tools/test/netfibs/forwarding.sh   Fri Feb 24 13:22:57 2012
(r232113)
+++ head/tools/test/netfibs/forwarding.sh   Fri Feb 24 14:13:06 2012
(r232114)
@@ -222,36 +222,36 @@ _reachability_check()
 
 reachability_check()
 {
-   local _i _rc
+   local _i rc
 
# Try to reach all control addresses on other nodes.
# We need to loop for a while as we cannot expect all to be up
# the very same moment.
i=1
-   _rc=42
-   while test ${_rc} -ne 0 -a ${i} -le ${WAITS}; do
+   rc=42
+   while test ${rc} -ne 0 -a ${i} -le ${WAITS}; do
print_debug "${i}/${WAITS} trying to ping6 control addresses."
-   _rc=0
+   rc=0
set +e
case ${node} in
left)   _reachability_check ${MIDDLELEFTADDR}
-   _rc=$((_rc + $?))
+   rc=$((rc + $?))
_reachability_check ${MIDDLERIGHTADDR}
-   _rc=$((_rc + $?))
+   rc=$((rc + $?))
_reachability_check ${RIGHTADDR}
-   _rc=$((_rc + $?))
+   rc=$((rc + $?))
;;
middle) _reachability_check ${LEFTADDR}
-   _rc=$((_rc + $?))
+   rc=$((rc + $?))
_reachability_check ${RIGHTADDR}
-   _rc=$((_rc + $?))
+   rc=$((rc + $?))
;;
right)  _reachability_check ${MIDDLERIGHTADDR}
-   _rc=$((_rc + $?))
+   rc=$((rc + $?))
_reachability_check ${MIDDLELEFTADDR}
-   _rc=$((_rc + $?))
+   rc=$((rc + $?))
_reachability_check ${LEFTADDR}
-   _rc=$((_rc + $?))
+   rc=$((rc + $?))
;;
esac
set -e
@@ -390,14 +390,14 @@ test_icmp6()
 
 test_ulp_reflect_one()
 {
-   local _txt _opts _port _fib
+   local _txt _opts port fib
_txt="$1"
_opts="$2"
-   _port=$3
-   _fib=$4
+   port=$3
+   fib=$4
 
-   print_debug "./reflect -p $((_port + 1 + _fib)) -t ${_txt}" "${_opts}"
-   ./reflect -p $((_port + 1 + _fib)) -t ${_txt} ${_opts}
+   print_debug "./reflect -p $((port + 1 + fib)) -t ${_txt}" "${_opts}"
+   ./reflect -p $((port + 1 + fib)) -t ${_txt} ${_opts}
print_debug "reflect '${_txt}' terminated without error."
 }
 
@@ -463,19 +463,19 @@ nc_send_recv()
 
 test_ulp()
 {
-   local _maxfibs _msg _addr _port _fib i _txt testno _rc _reply
-   _maxfibs=$1
+   local maxfibs _msg _addr port fib i _txt testno _rc _reply
+   maxfibs=$1
_msg="$2"
_addr=$3
-   _port=$4
-   _fib=$5
+   port=$4
+   fib=$5
 
-   printf "1..%d\n" $((${_maxfibs} * 2))
+   printf "1..%d\n" $((${maxfibs} * 2))
testno=1
i=0
-   while test ${i} -lt ${_maxfibs}; do
+   while test ${i} -lt ${maxfibs}; do
 
-   if test ${i} -eq $((

Re: svn commit: r232065 - head/sys/dev/fb

2012-02-24 Thread Bruce Evans

On Thu, 23 Feb 2012, Jung-uk Kim wrote:


On Thursday 23 February 2012 07:24 pm, Doug Barton wrote:

On 02/23/2012 16:17, Jung-uk Kim wrote:

I remember there were some discussions in developers@ that
"2009-2012" is more appropriate than "2009, 2010, 2012" or
"2009-2010, 2012", if my memory serves.  Anyone?


"2009, 2010, 2012" is as synonym for "2009-2010, 2012" and I see it
both ways. That's not the issue. (However, if it were 2008-2010
that is generally preferred vs. listing all 3 years individually.)

The issue is that it's a basic tenet of copyright law that you
cannot claim copyright in a year that you didn't actually make any
changes. This makes sense if you think about it ... your rights
from the last year you changed something don't expire at the end of
that year, and if you didn't make changes in 2011 you don't have
any new material that needs protection.


Make changes or publish them?  What about limited publication?


I am not a lawyer but I do know the date is optional, at least in the
US.  I just googled a bit.  Some people say "first-last" form is
fine.  Some say otherwise.  Also, it seems it depends on where they
live.  Is there any authoritative answer from the Foundation, I
wonder?


For instance:

Copyright 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993,
1994 The Regents of the University of California.  All rights
reserved.


Yeah, I know that example very well.  I've seen that copyright notice
for two decades or so. :-)


Did they not work on it in 1981, 1982, 1984, 1985, 1987, 1988, 1990?
Seems unlikely :-).  Of course, they just didn't publish it.  Gaps
won't exist now, since there is more pressure to publish and a public
repository gives a publication every nanosecond.

I look (sic) forward to reading the 2000-4000 copyright, which resembles
$(jot 2000 2000).

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r232116 - head/sys/nfsclient

2012-02-24 Thread John Baldwin
Author: jhb
Date: Fri Feb 24 17:26:06 2012
New Revision: 232116
URL: http://svn.freebsd.org/changeset/base/232116

Log:
  Adjust the nfs_skip_wcc_data_onerr setting so that it does not block
  post-op attributes for ENOENT errors now that the name caching logic
  depends on working post-op attributes.
  
  MFC after:2 weeks

Modified:
  head/sys/nfsclient/nfs_krpc.c

Modified: head/sys/nfsclient/nfs_krpc.c
==
--- head/sys/nfsclient/nfs_krpc.c   Fri Feb 24 15:34:36 2012
(r232115)
+++ head/sys/nfsclient/nfs_krpc.c   Fri Feb 24 17:26:06 2012
(r232116)
@@ -603,13 +603,15 @@ tryagain:
if (error == ESTALE)
nfs_purgecache(vp);
/*
-* Skip wcc data on NFS errors for now.  NetApp filers
-* return corrupt postop attrs in the wcc data for NFS
-* err EROFS.  Not sure if they could return corrupt
-* postop attrs for others errors.
+* Skip wcc data on non-ENOENT NFS errors for now.
+* NetApp filers return corrupt postop attrs in the
+* wcc data for NFS err EROFS.  Not sure if they could
+* return corrupt postop attrs for others errors.
+* Blocking ENOENT post-op attributes breaks negative
+* name caching, so always allow it through.
 */
if ((nmp->nm_flag & NFSMNT_NFSV3) &&
-   !nfs_skip_wcc_data_onerr) {
+   (!nfs_skip_wcc_data_onerr || error == ENOENT)) {
*mrp = mrep;
*mdp = md;
*dposp = dpos;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r232108 - head/usr.bin/xargs

2012-02-24 Thread Bruce Evans

On Fri, 24 Feb 2012, Jilles Tjoelker wrote:


Log:
 xargs: If a utility exits with 255 or a signal, write an error message.

 If a utility called by xargs exits with status 255 or because of a signal,
 POSIX requires writing an error message.


Is an exit status of 255 really possible?  I thought that there was
magic for the top bit.  But testing reminded me that at the level of
a single exit(), the magic in the top bit is for signals, and showed
that WIFSIGNALED() is broken for signal 127:

% #include 
% 
% #include 

% #include 
% #include 
% #include 
% 
% int

% main(void)
% {
%   int status;
% 
% 	switch (fork()) {

%   case -1:
%   default:
%   wait(&status);
%   printf("CONTINUED = %d\n", WIFCONTINUED(status));
%   printf("EXITED = %d\n", WIFEXITED(status));
%   printf("SIGNALED = %d\n", WIFSIGNALED(status));
%   printf("STOPPED = %d\n", WIFSTOPPED(status));
%   printf("EXITSTATUS = %d\n", WEXITSTATUS(status));
%   printf("TERMSIG = %d\n", WTERMSIG(status));
%   printf("COREDUMP = %d\n", WCOREDUMP(status));
%   printf("STOPSIG = %d\n", WSTOPSIG(status));
%   printf("status = %#x\n", status);
%   exit(0);
%   case 0:
%   kill(getpid(), 127);
%   }
% }

This prints SIGNALED = 0 and STOPPED = 1, when it should print
SIGNALED = 1 and STOPPED = 0.  This is because the special _WSTATUS()
of 127 is _WSTOPPED and this cannot be distinguished from an actual
signal 127.  Probably this signal should be disallowed.  (The magic
in the top bit is just the core dump flag.  Signals 128-255 are
already disallowed, so they don't give ambiguity.)

Utilities are quite broken near here too:
- under FreeBSD-~5.2:
  - bash-1(1) exit status messages, bash-1 builtin kill, kill(1), killall(1),
and time(1) don't support signals >= 32, and give cryptic error messages
  - kill(2) with signal 127 works, but after ktracing processes killed by it,
kdump(1) dumps core.
  - kill(2) with signal 126 works, but bash-1 exits when a sub-process
does this.  (Bash-1 also exits for kill on a nonexisting process.)
After ktrace is run under /bin/sh, kdump dumps core.
  - kill(2) with signal 32 works, but bash-1 is broken as for signal 126.
kdump now doesn't dump core, but prints PSIG(null).

- under -current:
  - utilities still don't support signals >= 32, but give better error
messages.
  - kill(2) with signal 127 works, but bash prints the bogus termination
message "Stopped ..." for it.  Apparently it us confused by the above
bug in WIFSTOPPED()/WIFSIGNALED().  Job control is broken by this,
but the breakage is not very noticeable -- the jobs command shows
many jobs for the dead processes, and you can clean it out by trying
to resume these jobs.
  - /bin/sh is similarly confused, but prints "Suspended ..." instead of
"Stopped ...".
  - kdump now works.

Support for 128 signals was added to the kernel in 1999 in time for
FreeBSD-4, so even FreeBSD-5 userland shouldn't be so broken.  However,
ISTR a PR about problems with specifically signal 127, and thought
that is was already disallowed.


Modified: head/usr.bin/xargs/xargs.c
==
--- head/usr.bin/xargs/xargs.c  Fri Feb 24 12:32:50 2012(r232107)
+++ head/usr.bin/xargs/xargs.c  Fri Feb 24 12:35:17 2012(r232108)
@@ -608,8 +608,11 @@ waitchildren(const char *name, int waita
 * If utility signaled or exited with a value of 255,
 * exit 1-125.
 */


This comment didn't match the code before (the code always exited with
status 1), and is now further from matching the code.

This comment is hard to parse.


-   if (WIFSIGNALED(status) || WEXITSTATUS(status) == 255)
-   exit(1);
+   if (WIFSIGNALED(status))
+   errx(1, "%s: terminated with signal %d, aborting",
+   name, WTERMSIG(status));


This misclassifies signal 127 due to the above bug.


+   if (WEXITSTATUS(status) == 255)
+   errx(1, "%s: exited with status 255, aborting", name);
if (WEXITSTATUS(status))
rval = 1;


Neither WIFSTOPPED() nor WIFEXITED() are tested, so the result of the
misclassification is turning signal 127 into a normal exit with status
0.  A normal WIFSTOPPED() should not get here, else job control would
just break xargs, so the bug can probably be worked around by turning
WIFSTOPPED() into WIFSIGNALED() here, or just blindly using WTERMSIG()
!= 0 to classify signals.

The messages have a grammar error (comma splice).


}



The magic for the top bit is when exit statuses are combined with
signal statuses and bits are lost by forcing them through an 8-bit
filter (perhaps another exit()).  Shells report signal n 

svn commit: r232118 - head/sys/net

2012-02-24 Thread Andrew Thompson
Author: thompsa
Date: Fri Feb 24 17:50:36 2012
New Revision: 232118
URL: http://svn.freebsd.org/changeset/base/232118

Log:
  Only look for a usable MAC address for the bridge ID from ports within our
  bridge, this allows us to have more than one independent bridge in the same
  STP domain.
  
  PR:   kern/164369
  Submitted by: Nikos Vassiliadis (earlier version)
  MFC after:2 weeks

Modified:
  head/sys/net/bridgestp.c

Modified: head/sys/net/bridgestp.c
==
--- head/sys/net/bridgestp.cFri Feb 24 17:50:23 2012(r232117)
+++ head/sys/net/bridgestp.cFri Feb 24 17:50:36 2012(r232118)
@@ -2013,24 +2013,33 @@ bstp_reinit(struct bstp_state *bs)
struct bstp_port *bp;
struct ifnet *ifp, *mif;
u_char *e_addr;
+   void *bridgeptr;
static const u_char llzero[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */
 
BSTP_LOCK_ASSERT(bs);
 
+   if (LIST_EMPTY(&bs->bs_bplist))
+   goto disablestp;
+
mif = NULL;
+   bridgeptr = LIST_FIRST(&bs->bs_bplist)->bp_ifp->if_bridge;
+   KASSERT(bridgeptr != NULL, ("Invalid bridge pointer"));
/*
 * Search through the Ethernet adapters and find the one with the
-* lowest value. The adapter which we take the MAC address from does
-* not need to be part of the bridge, it just needs to be a unique
-* value.
+* lowest value. Make sure the adapter which we take the MAC address
+* from is part of this bridge, so we can have more than one independent
+* bridges in the same STP domain.
 */
IFNET_RLOCK_NOSLEEP();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
if (ifp->if_type != IFT_ETHER)
-   continue;
+   continue;   /* Not Ethernet */
+
+   if (ifp->if_bridge != bridgeptr)
+   continue;   /* Not part of our bridge */
 
if (bstp_addr_cmp(IF_LLADDR(ifp), llzero) == 0)
-   continue;
+   continue;   /* No mac address set */
 
if (mif == NULL) {
mif = ifp;
@@ -2042,21 +2051,8 @@ bstp_reinit(struct bstp_state *bs)
}
}
IFNET_RUNLOCK_NOSLEEP();
-
-   if (LIST_EMPTY(&bs->bs_bplist) || mif == NULL) {
-   /* Set the bridge and root id (lower bits) to zero */
-   bs->bs_bridge_pv.pv_dbridge_id =
-   ((uint64_t)bs->bs_bridge_priority) << 48;
-   bs->bs_bridge_pv.pv_root_id = bs->bs_bridge_pv.pv_dbridge_id;
-   bs->bs_root_pv = bs->bs_bridge_pv;
-   /* Disable any remaining ports, they will have no MAC address */
-   LIST_FOREACH(bp, &bs->bs_bplist, bp_next) {
-   bp->bp_infois = BSTP_INFO_DISABLED;
-   bstp_set_port_role(bp, BSTP_ROLE_DISABLED);
-   }
-   callout_stop(&bs->bs_bstpcallout);
-   return;
-   }
+   if (mif == NULL)
+   goto disablestp;
 
e_addr = IF_LLADDR(mif);
bs->bs_bridge_pv.pv_dbridge_id =
@@ -2084,6 +2080,20 @@ bstp_reinit(struct bstp_state *bs)
 
bstp_assign_roles(bs);
bstp_timer_start(&bs->bs_link_timer, BSTP_LINK_TIMER);
+   return;
+
+disablestp:
+   /* Set the bridge and root id (lower bits) to zero */
+   bs->bs_bridge_pv.pv_dbridge_id =
+   ((uint64_t)bs->bs_bridge_priority) << 48;
+   bs->bs_bridge_pv.pv_root_id = bs->bs_bridge_pv.pv_dbridge_id;
+   bs->bs_root_pv = bs->bs_bridge_pv;
+   /* Disable any remaining ports, they will have no MAC address */
+   LIST_FOREACH(bp, &bs->bs_bplist, bp_next) {
+   bp->bp_infois = BSTP_INFO_DISABLED;
+   bstp_set_port_role(bp, BSTP_ROLE_DISABLED);
+   }
+   callout_stop(&bs->bs_bstpcallout);
 }
 
 static int
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r232119 - head/share/man/man4

2012-02-24 Thread Jung-uk Kim
Author: jkim
Date: Fri Feb 24 17:53:24 2012
New Revision: 232119
URL: http://svn.freebsd.org/changeset/base/232119

Log:
  Fix mdoc style nits.  Start new sentences on new lines.
  
  Reported by:  brueffer

Modified:
  head/share/man/man4/amdtemp.4

Modified: head/share/man/man4/amdtemp.4
==
--- head/share/man/man4/amdtemp.4   Fri Feb 24 17:50:36 2012
(r232118)
+++ head/share/man/man4/amdtemp.4   Fri Feb 24 17:53:24 2012
(r232119)
@@ -80,7 +80,8 @@ tunable:
 .Bl -tag -width indent
 .It Va dev.amdtemp.%d.sensor_offset
 .El
-Add the given offset to the temperature of the sensor.  Default is 0.
+Add the given offset to the temperature of the sensor.
+Default is 0.
 .Sh SEE ALSO
 .Xr loader 8 ,
 .Xr sysctl 8
@@ -98,10 +99,10 @@ For Family 10h and later processors,
 .Do
 (the reported temperature) is a non-physical temperature measured on
 an arbitrary scale and it does not represent an actual physical
-temperature like die or case temperature.  Instead, it specifies
-the processor temperature relative to the point at which the system
-must supply the maximum cooling for the processor's specified maximum
-case temperature and maximum thermal power dissipation
+temperature like die or case temperature.
+Instead, it specifies the processor temperature relative to the point
+at which the system must supply the maximum cooling for the processor's
+specified maximum case temperature and maximum thermal power dissipation
 .Dc
 according to
 .Rs
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r232072 - head/usr.bin/kdump

2012-02-24 Thread Bruce Evans

On Thu, 23 Feb 2012, John Baldwin wrote:


Log:
 Pretty-print the advice constants passed to posix_fadvise(2).



Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Thu Feb 23 21:07:16 2012(r232071)
+++ head/usr.bin/kdump/kdump.c  Thu Feb 23 21:08:21 2012(r232072)
@@ -1014,6 +1014,15 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
}
capname(arg);
break;
+   case SYS_posix_fadvise:
+   print_number(ip,narg,c);
+   print_number(ip,narg,c);
+   print_number(ip,narg,c);
...


Any chance of prettyprinting the sources too?  The (macro) definition
was already uglyprinted, but kdump is fairly KNF-conformant (unlike
truss), and doesn't use uglyprinting when invoking print_number()
except for here.


Modified: head/usr.bin/kdump/mksubr
==
--- head/usr.bin/kdump/mksubr   Thu Feb 23 21:07:16 2012(r232071)
+++ head/usr.bin/kdump/mksubr   Thu Feb 23 21:08:21 2012(r232072)
@@ -340,6 +340,7 @@ auto_or_type "accessmodename"  "
auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+"
"sys/acl.h"
auto_or_type "capname" "CAP_[A-Z]+[[:space:]]+0x[01248]{16}ULL"   
"sys/capability.h"
auto_switch_type "extattrctlname"  "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" 
"sys/extattr.h"
+auto_switch_type "fadvisebehavname""POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+"  
"sys/fcntl.h"
auto_or_type "flagsname"   "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+"   
"sys/fcntl.h"
auto_or_type "flockname"   "LOCK_[A-Z]+[[:space:]]+0x[0-9]+"  
"sys/fcntl.h"
auto_or_type "getfsstatflagsname"  "MNT_[A-Z]+[[:space:]]+[1-9][0-9]*"
"sys/mount.h"


It's hard to avoid uglyprinting here.  The regexps alone make it unreadable.

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r232074 - head/sys/cam/ctl

2012-02-24 Thread Bruce Evans

On Fri, 24 Feb 2012, Alexander Best wrote:


On Fri Feb 24 12, Dimitry Andric wrote:

On 2012-02-24 10:38, Alexander Best wrote:

which will turn all -Wformat-invalid-specifier and -Wformat-extra-args errors
into warnings (because clang tot doesn't support -fformat-extensions)?


It would be better to push our format extensions upstream, I think.
Though the option should probably be renamed to something else, e.g.
-ffreebsd-extensions, or such.


It is only for format extensions.  The idea is that a C compiler that
supports warning about unsupported printf formats must warn about
uses of format extensions (no matter whose they are) unless instructed
not to do so.  It seems excessive to have separate flags
-fbsd-format-extensions -ffreebsd-format-extensions
-fotherbsd-format-extensions -fgnu-format-extensions
-flinux-format-extensions ..., so I used a single flag.  If
-fbsd-format-extensions existed, then it would have only %b as an
extension.

Anyway, clang already supports -fformat-extensions.  The following
compiles with this, but fails messily without it:

% #include 
% 
% void

% foo(void)
% {
%   printf("0x%b\n", 1, "\1foo");
% }

gcc (FreeBSD-gcc) complains about %#b, but clang doesn't.  I don't know
if %#b is valid, but it should be.


i'm still confused regarding the actual politics regarding this change.
everytime this comes up i get a different answer. the last one was that since
the special printf format is only used for kernel code, the -fformat-extensions
code within clang base shouldn't be pushed upstream.


Is it only the FreeBSD version of clang that has it?  Does FreeBSD has any
other significant local changes?  The flag should be push upstream, but
there are likely to always be OS-specific details.  For example, if %#b
is indeed invalid and someone fixes the kernel to support it, you don't
want to have to wait for the upstream sources to be synchronized before
using %#b.

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r232127 - head/sys/netinet6

2012-02-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Feb 24 20:06:04 2012
New Revision: 232127
URL: http://svn.freebsd.org/changeset/base/232127

Log:
  In selectroute() add a missing fibnum argument to an in6_rtalloc()
  call in an #if 0 section.
  
  In in6_selecthlim() optimize a case where in6p cannot be NULL due to an
  earlier check.
  
  More consistently use u_int instead of int for fibnum function arguments.
  
  Sponsored by: Cisco Systems, Inc.
  MFC after:3 days

Modified:
  head/sys/netinet6/in6_src.c
  head/sys/netinet6/ip6_output.c
  head/sys/netinet6/ip6_var.h

Modified: head/sys/netinet6/in6_src.c
==
--- head/sys/netinet6/in6_src.c Fri Feb 24 19:29:50 2012(r232126)
+++ head/sys/netinet6/in6_src.c Fri Feb 24 20:06:04 2012(r232127)
@@ -129,10 +129,10 @@ VNET_DEFINE(int, ip6_prefer_tempaddr) = 
 
 static int selectroute __P((struct sockaddr_in6 *, struct ip6_pktopts *,
struct ip6_moptions *, struct route_in6 *, struct ifnet **,
-   struct rtentry **, int, int));
+   struct rtentry **, int, u_int));
 static int in6_selectif __P((struct sockaddr_in6 *, struct ip6_pktopts *,
struct ip6_moptions *, struct route_in6 *ro, struct ifnet **,
-   struct ifnet *, int));
+   struct ifnet *, u_int));
 
 static struct in6_addrpolicy *lookup_addrsel_policy(struct sockaddr_in6 *);
 
@@ -518,7 +518,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso
 static int
 selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
 struct ip6_moptions *mopts, struct route_in6 *ro,
-struct ifnet **retifp, struct rtentry **retrt, int norouteok, int fibnum)
+struct ifnet **retifp, struct rtentry **retrt, int norouteok, u_int fibnum)
 {
int error = 0;
struct ifnet *ifp = NULL;
@@ -630,7 +630,7 @@ selectroute(struct sockaddr_in6 *dstsock
*satosin6(&ron->ro_dst) = *sin6_next;
}
if (ron->ro_rt == NULL) {
-   in6_rtalloc(ron); /* multi path case? */
+   in6_rtalloc(ron, fibnum); /* multi path case? */
if (ron->ro_rt == NULL ||
!(ron->ro_rt->rt_flags & RTF_LLINFO)) {
if (ron->ro_rt) {
@@ -761,7 +761,7 @@ selectroute(struct sockaddr_in6 *dstsock
 static int
 in6_selectif(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
 struct ip6_moptions *mopts, struct route_in6 *ro, struct ifnet **retifp,
-struct ifnet *oifp, int fibnum)
+struct ifnet *oifp, u_int fibnum)
 {
int error;
struct route_in6 sro;
@@ -836,7 +836,7 @@ in6_selectroute(struct sockaddr_in6 *dst
 int
 in6_selectroute_fib(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
 struct ip6_moptions *mopts, struct route_in6 *ro,
-struct ifnet **retifp, struct rtentry **retrt, int fibnum)
+struct ifnet **retifp, struct rtentry **retrt, u_int fibnum)
 {
 
return (selectroute(dstsock, opts, mopts, ro, retifp,
@@ -867,8 +867,7 @@ in6_selecthlim(struct inpcb *in6p, struc
ro6.ro_dst.sin6_family = AF_INET6;
ro6.ro_dst.sin6_len = sizeof(struct sockaddr_in6);
ro6.ro_dst.sin6_addr = in6p->in6p_faddr;
-   in6_rtalloc(&ro6, in6p ? in6p->inp_inc.inc_fibnum :
-   RT_DEFAULT_FIB);
+   in6_rtalloc(&ro6, in6p->inp_inc.inc_fibnum);
if (ro6.ro_rt) {
lifp = ro6.ro_rt->rt_ifp;
RTFREE(ro6.ro_rt);

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Fri Feb 24 19:29:50 2012
(r232126)
+++ head/sys/netinet6/ip6_output.c  Fri Feb 24 20:06:04 2012
(r232127)
@@ -142,7 +142,7 @@ static int ip6_insertfraghdr __P((struct
 static int ip6_insert_jumboopt(struct ip6_exthdrs *, u_int32_t);
 static int ip6_splithdr(struct mbuf *, struct ip6_exthdrs *);
 static int ip6_getpmtu __P((struct route_in6 *, struct route_in6 *,
-   struct ifnet *, struct in6_addr *, u_long *, int *, int));
+   struct ifnet *, struct in6_addr *, u_long *, int *, u_int));
 static int copypktopts(struct ip6_pktopts *, struct ip6_pktopts *, int);
 
 
@@ -1324,7 +1324,7 @@ ip6_insertfraghdr(struct mbuf *m0, struc
 static int
 ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro,
 struct ifnet *ifp, struct in6_addr *dst, u_long *mtup,
-int *alwaysfragp, int fibnum)
+int *alwaysfragp, u_int fibnum)
 {
u_int32_t mtu = 0;
int alwaysfrag = 0;

Modified: head/sys/netinet6/ip6_var.h
==
--- head/sys/netinet6/ip6_var.h Fri Feb 24 19:29:50 2012(r232126)
+++ head/sys/netinet6/ip6_var.h Fri Feb 24 20:06:04 2012(r232127)
@@ -447,7 +447,7 @@ int in6_selectroute __P((struct sockaddr
s

svn commit: r232128 - head/usr.bin/kdump

2012-02-24 Thread John Baldwin
Author: jhb
Date: Fri Feb 24 20:12:53 2012
New Revision: 232128
URL: http://svn.freebsd.org/changeset/base/232128

Log:
  Fix style in previous commit.
  
  Submitted by: bde

Modified:
  head/usr.bin/kdump/kdump.c

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Fri Feb 24 20:06:04 2012(r232127)
+++ head/usr.bin/kdump/kdump.c  Fri Feb 24 20:12:53 2012(r232128)
@@ -1015,9 +1015,9 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
capname(arg);
break;
case SYS_posix_fadvise:
-   print_number(ip,narg,c);
-   print_number(ip,narg,c);
-   print_number(ip,narg,c);
+   print_number(ip, narg, c);
+   print_number(ip, narg, c);
+   print_number(ip, narg, c);
(void)putchar(',');
fadvisebehavname((int)*ip);
ip++;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r232072 - head/usr.bin/kdump

2012-02-24 Thread John Baldwin
On Friday, February 24, 2012 12:57:23 pm Bruce Evans wrote:
> On Thu, 23 Feb 2012, John Baldwin wrote:
> 
> > Log:
> >  Pretty-print the advice constants passed to posix_fadvise(2).
> 
> > Modified: head/usr.bin/kdump/kdump.c
> > 
==
> > --- head/usr.bin/kdump/kdump.c  Thu Feb 23 21:07:16 2012
> > (r232071)
> > +++ head/usr.bin/kdump/kdump.c  Thu Feb 23 21:08:21 2012
> > (r232072)
> > @@ -1014,6 +1014,15 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
> > }
> > capname(arg);
> > break;
> > +   case SYS_posix_fadvise:
> > +   print_number(ip,narg,c);
> > +   print_number(ip,narg,c);
> > +   print_number(ip,narg,c);
> > ...
> 
> Any chance of prettyprinting the sources too?  The (macro) definition
> was already uglyprinted, but kdump is fairly KNF-conformant (unlike
> truss), and doesn't use uglyprinting when invoking print_number()
> except for here.

Oops, I originally did this on 8 where it still has the wrong style.
I'll fix.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r232108 - head/usr.bin/xargs

2012-02-24 Thread Jilles Tjoelker
On Sat, Feb 25, 2012 at 04:27:35AM +1100, Bruce Evans wrote:
> On Fri, 24 Feb 2012, Jilles Tjoelker wrote:
> > Log:
> >  xargs: If a utility exits with 255 or a signal, write an error message.

> >  If a utility called by xargs exits with status 255 or because of a signal,
> >  POSIX requires writing an error message.

> Is an exit status of 255 really possible?  I thought that there was
> magic for the top bit.

exit() takes 8 bits of exit status which are all returned by wait4().

> But testing reminded me that at the level of a single exit(), the
> magic in the top bit is for signals, and showed that WIFSIGNALED() is
> broken for signal 127:

> [snip]

> This prints SIGNALED = 0 and STOPPED = 1, when it should print
> SIGNALED = 1 and STOPPED = 0.  This is because the special _WSTATUS()
> of 127 is _WSTOPPED and this cannot be distinguished from an actual
> signal 127.  Probably this signal should be disallowed.  (The magic
> in the top bit is just the core dump flag.  Signals 128-255 are
> already disallowed, so they don't give ambiguity.)

PR kern/19402 describes this problem. Changeset r152973 (November 2005)
changed SIGRTMAX so portable programs cannot know about signals 127 and
128 anymore. Programs compiled before that change may use them (but only
after r151306 (October 2005)), since it is common to use the first few
or the last few realtime signals.

Perhaps these signals can now be forbidden by the kernel, or replaced by
a harmless value for old binaries.

> Utilities are quite broken near here too:
> - under -current:
>- utilities still don't support signals >= 32, but give better error
>  messages.

kill(1) (both /bin/kill and the 9.x/10.x sh builtin) has passed
arbitrary signal numbers to kill(2) for quite a while.

> > Modified: head/usr.bin/xargs/xargs.c
> > ==
> > --- head/usr.bin/xargs/xargs.c  Fri Feb 24 12:32:50 2012
> > (r232107)
> > +++ head/usr.bin/xargs/xargs.c  Fri Feb 24 12:35:17 2012
> > (r232108)
> > @@ -608,8 +608,11 @@ waitchildren(const char *name, int waita
> >  * If utility signaled or exited with a value of 255,
> >  * exit 1-125.
> >  */

> This comment didn't match the code before (the code always exited with
> status 1), and is now further from matching the code.

> This comment is hard to parse.

It seems to repeat a POSIX requirement. I suppose it can go away as it
doesn't really say anything the code doesn't say.

> > -   if (WIFSIGNALED(status) || WEXITSTATUS(status) == 255)
> > -   exit(1);
> > +   if (WIFSIGNALED(status))
> > +   errx(1, "%s: terminated with signal %d, aborting",
> > +   name, WTERMSIG(status));

> This misclassifies signal 127 due to the above bug.

> > +   if (WEXITSTATUS(status) == 255)
> > +   errx(1, "%s: exited with status 255, aborting", name);
> > if (WEXITSTATUS(status))
> > rval = 1;

> Neither WIFSTOPPED() nor WIFEXITED() are tested, so the result of the
> misclassification is turning signal 127 into a normal exit with status
> 0.  A normal WIFSTOPPED() should not get here, else job control would
> just break xargs, so the bug can probably be worked around by turning
> WIFSTOPPED() into WIFSIGNALED() here, or just blindly using WTERMSIG()
> != 0 to classify signals.

I don't think xargs should work around that bug, particularly not by
introducing unspecified behaviour (the value of WTERMSIG(x) when
!WIFSIGNALED(x)).

> The messages have a grammar error (comma splice).

GNU xargs has a semicolon instead of a comma. Is that better?

> > }
> >

> The magic for the top bit is when exit statuses are combined with
> signal statuses and bits are lost by forcing them through an 8-bit
> filter (perhaps another exit()).  Shells report signal n as $? =
> (0x80 | n).  When n is 127, shells are not quite confused enough to
> turn the status into 0 -- they just turn n into 0, giving status 0x80.

In fact, POSIX only requires that $? be greater than 128 and kill -l $?
return the name of the signal without "SIG".

-- 
Jilles Tjoelker
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r232108 - head/usr.bin/xargs

2012-02-24 Thread Bruce Evans

On Fri, 24 Feb 2012, Jilles Tjoelker wrote:


On Sat, Feb 25, 2012 at 04:27:35AM +1100, Bruce Evans wrote:
...

Utilities are quite broken near here too:
- under -current:
   - utilities still don't support signals >= 32, but give better error
 messages.


kill(1) (both /bin/kill and the 9.x/10.x sh builtin) has passed
arbitrary signal numbers to kill(2) for quite a while.


Apparently I got confused by testing several versions.  In -current,
the bugs are just that:
- bash-4.2 builtin kill doesn't understand signals >= 32, despite
  supposedly being configured for FreeBSD
- bash-4.2 prints confusing termination messages which made me think
  that /bin/kill didn't work:
  - for signal 127, it prints "Stopped ..."
  - for signal 126, it prints "Unknown signal: 126".  I didn't notice
this was printed by bash(1) and not by kill(1).

A bug in builtin kill turned up: with kill(1), both bash and sh print
the termination message immediately, with builtin kill neither prints
it until a newline is entered.


Modified: head/usr.bin/xargs/xargs.c
==
--- head/usr.bin/xargs/xargs.c  Fri Feb 24 12:32:50 2012(r232107)
+++ head/usr.bin/xargs/xargs.c  Fri Feb 24 12:35:17 2012(r232108)
@@ -608,8 +608,11 @@ waitchildren(const char *name, int waita
 * If utility signaled or exited with a value of 255,
 * exit 1-125.
 */



This comment didn't match the code before (the code always exited with
status 1), and is now further from matching the code.



This comment is hard to parse.


It seems to repeat a POSIX requirement. I suppose it can go away as it
doesn't really say anything the code doesn't say.


It's harder to parse than I thought :-).  FreeBSD man pages are very
bad about distinguishing POSIX requirements from what the implementation
does (they mostly give the implementation behaviour without saying that).
Some source code says "POSIX requires...".


This misclassifies signal 127 due to the above bug.



+   if (WEXITSTATUS(status) == 255)
+   errx(1, "%s: exited with status 255, aborting", name);
if (WEXITSTATUS(status))
rval = 1;



Neither WIFSTOPPED() nor WIFEXITED() are tested, so the result of the
misclassification is turning signal 127 into a normal exit with status
0.  A normal WIFSTOPPED() should not get here, else job control would
just break xargs, so the bug can probably be worked around by turning
WIFSTOPPED() into WIFSIGNALED() here, or just blindly using WTERMSIG()
!= 0 to classify signals.


I don't think xargs should work around that bug, particularly not by
introducing unspecified behaviour (the value of WTERMSIG(x) when
!WIFSIGNALED(x)).


OK.  So it needs to be disallowed in the kernel.

I wonder how 0177 came to mean stopped.  The kernel doesn't use _WSTOPPED,
and doesn't seem to use 0177 or 0x7f.


The messages have a grammar error (comma splice).


GNU xargs has a semicolon instead of a comma. Is that better?


Yes.

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r232132 - head/sys/dev/acpica/Osd

2012-02-24 Thread Jung-uk Kim
Author: jkim
Date: Fri Feb 24 23:15:21 2012
New Revision: 232132
URL: http://svn.freebsd.org/changeset/base/232132

Log:
  Fix a long-standing bug for AcpiOsGetTimer().  time_t is 32-bit on i386 and
  it needs proper casting before multiplication.
  
  MFC after:3 days

Modified:
  head/sys/dev/acpica/Osd/OsdSchedule.c

Modified: head/sys/dev/acpica/Osd/OsdSchedule.c
==
--- head/sys/dev/acpica/Osd/OsdSchedule.c   Fri Feb 24 20:42:47 2012
(r232131)
+++ head/sys/dev/acpica/Osd/OsdSchedule.c   Fri Feb 24 23:15:21 2012
(r232132)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2000 Michael Smith
  * Copyright (c) 2000 BSDi
- * Copyright (c) 2007-2009 Jung-uk Kim 
+ * Copyright (c) 2007-2012 Jung-uk Kim 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -248,8 +248,8 @@ AcpiOsGetTimer(void)
 KASSERT(cold == 0, ("acpi: timer op not yet supported during boot"));
 
 binuptime(&bt);
-t = ((UINT64)1000 * (uint32_t)(bt.frac >> 32)) >> 32;
-t += bt.sec * 1000;
+t = (uint64_t)bt.sec * 1000;
+t += ((uint64_t)1000 * (uint32_t)(bt.frac >> 32)) >> 32;
 
 return (t);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r232143 - head/sys/i386/linux

2012-02-24 Thread Konstantin Belousov
Author: kib
Date: Sat Feb 25 01:33:39 2012
New Revision: 232143
URL: http://svn.freebsd.org/changeset/base/232143

Log:
  Do not write to the user address directly, use suword().
  
  Reported by:  Bengt Ahlgren 
  MFC after:1 week

Modified:
  head/sys/i386/linux/linux_sysvec.c

Modified: head/sys/i386/linux/linux_sysvec.c
==
--- head/sys/i386/linux/linux_sysvec.c  Sat Feb 25 01:20:53 2012
(r232142)
+++ head/sys/i386/linux/linux_sysvec.c  Sat Feb 25 01:33:39 2012
(r232143)
@@ -227,11 +227,11 @@ linux_fixup(register_t **stack_base, str
argv = *stack_base;
envp = *stack_base + (imgp->args->argc + 1);
(*stack_base)--;
-   **stack_base = (intptr_t)(void *)envp;
+   suword(*stack_base, (intptr_t)(void *)envp);
(*stack_base)--;
-   **stack_base = (intptr_t)(void *)argv;
+   suword(*stack_base, (intptr_t)(void *)argv);
(*stack_base)--;
-   **stack_base = imgp->args->argc;
+   suword(*stack_base, imgp->args->argc);
return (0);
 }
 
@@ -286,7 +286,7 @@ elf_linux_fixup(register_t **stack_base,
imgp->auxargs = NULL;
 
(*stack_base)--;
-   **stack_base = (register_t)imgp->args->argc;
+   suword(*stack_base, (register_t)imgp->args->argc);
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r232144 - in head: lib/libc/gen lib/libthr/thread sys/kern sys/sys

2012-02-24 Thread David Xu
Author: davidxu
Date: Sat Feb 25 02:12:17 2012
New Revision: 232144
URL: http://svn.freebsd.org/changeset/base/232144

Log:
  In revision 231989, we pass a 16-bit clock ID into kernel, however
  according to POSIX document, the clock ID may be dynamically allocated,
  it unlikely will be in 64K forever. To make it future compatible, we
  pack all timeout information into a new structure called _umtx_time, and
  use fourth argument as a size indication, a zero means it is old code
  using timespec as timeout value, but the new structure also includes flags
  and a clock ID, so the size argument is different than before, and it is
  non-zero. With this change, it is possible that a thread can sleep
  on any supported clock, though current kernel code does not have such a
  POSIX clock driver system.

Modified:
  head/lib/libc/gen/sem.c
  head/lib/libc/gen/sem_new.c
  head/lib/libthr/thread/thr_umtx.c
  head/sys/kern/kern_umtx.c
  head/sys/sys/_umtx.h
  head/sys/sys/umtx.h

Modified: head/lib/libc/gen/sem.c
==
--- head/lib/libc/gen/sem.c Sat Feb 25 01:33:39 2012(r232143)
+++ head/lib/libc/gen/sem.c Sat Feb 25 02:12:17 2012(r232144)
@@ -312,15 +312,24 @@ _libc_sem_unlink_compat(const char *name
 }
 
 static int
-_umtx_wait_uint(volatile unsigned *mtx, unsigned id, const struct timespec 
*timeout)
+_umtx_wait_uint(volatile unsigned *mtx, unsigned id, const struct timespec 
*abstime)
 {
-   if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 &&
-   timeout->tv_nsec <= 0))) {
-   errno = ETIMEDOUT;
-   return (-1);
+   struct _umtx_time *tm_p, timeout;
+   size_t tm_size;
+
+   if (abstime == NULL) {
+   tm_p = NULL;
+   tm_size = 0;
+   } else {
+   timeout._clockid = CLOCK_REALTIME;
+   timeout._flags = UMTX_ABSTIME;
+   timeout._timeout = *abstime;
+   tm_p = &timeout;
+   tm_size = sizeof(timeout);
}
return _umtx_op(__DEVOLATILE(void *, mtx),
-   UMTX_OP_WAIT_UINT_PRIVATE, id, NULL, __DECONST(void*, timeout));
+   UMTX_OP_WAIT_UINT_PRIVATE, id, 
+   (void *)tm_size, __DECONST(void*, tm_p));
 }
 
 static int
@@ -355,7 +364,6 @@ int
 _libc_sem_timedwait_compat(sem_t * __restrict sem,
const struct timespec * __restrict abstime)
 {
-   struct timespec ts, ts2;
int val, retval;
 
if (sem_check_validity(sem) != 0)
@@ -384,13 +392,11 @@ _libc_sem_timedwait_compat(sem_t * __res
errno = EINVAL;
return (-1);
}
-   clock_gettime(CLOCK_REALTIME, &ts);
-   TIMESPEC_SUB(&ts2, abstime, &ts);
}
atomic_add_int(&(*sem)->nwaiters, 1);
pthread_cleanup_push(sem_cancel_handler, sem);
_pthread_cancel_enter(1);
-   retval = _umtx_wait_uint(&(*sem)->count, 0, abstime ? &ts2 : 
NULL);
+   retval = _umtx_wait_uint(&(*sem)->count, 0, abstime);
_pthread_cancel_leave(0);
pthread_cleanup_pop(0);
atomic_add_int(&(*sem)->nwaiters, -1);

Modified: head/lib/libc/gen/sem_new.c
==
--- head/lib/libc/gen/sem_new.c Sat Feb 25 01:33:39 2012(r232143)
+++ head/lib/libc/gen/sem_new.c Sat Feb 25 02:12:17 2012(r232144)
@@ -339,15 +339,23 @@ usem_wake(struct _usem *sem)
 }
 
 static __inline int
-usem_wait(struct _usem *sem, const struct timespec *timeout)
+usem_wait(struct _usem *sem, const struct timespec *abstime)
 {
-   if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 &&
-   timeout->tv_nsec <= 0))) {
-   errno = ETIMEDOUT;
-   return (-1);
+   struct _umtx_time *tm_p, timeout;
+   size_t tm_size;
+
+   if (abstime == NULL) {
+   tm_p = NULL;
+   tm_size = 0;
+   } else {
+   timeout._clockid = CLOCK_REALTIME;
+   timeout._flags = UMTX_ABSTIME;
+   timeout._timeout = *abstime;
+   tm_p = &timeout;
+   tm_size = sizeof(timeout);
}
-   return _umtx_op(sem, UMTX_OP_SEM_WAIT, 0, NULL,
-   __DECONST(void*, timeout));
+   return _umtx_op(sem, UMTX_OP_SEM_WAIT, 0, 
+   (void *)tm_size, __DECONST(void*, tm_p));
 }
 
 int
@@ -381,7 +389,6 @@ int
 _sem_timedwait(sem_t * __restrict sem,
const struct timespec * __restrict abstime)
 {
-   struct timespec ts, ts2;
int val, retval;
 
if (sem_check_validity(sem) != 0)
@@ -408,11 +415,9 @@ _sem_timedwait(sem_t * __restrict sem,
errno = EINVAL;
return (-1);
   

svn commit: r232145 - in head/sys: dev/re pci

2012-02-24 Thread Pyun YongHyeon
Author: yongari
Date: Sat Feb 25 04:54:51 2012
New Revision: 232145
URL: http://svn.freebsd.org/changeset/base/232145

Log:
  Use correct Config registers for RTL8139 family. Unlike RTL8168 and
  RTL810x family , RTL8139 has different register map for Config
  registers.
  
  While here, follow the lead of re(4) in WOL configuration.
   - Disable WOL_UCAST and WOL_MCAST capabilities by default.
   - Config5 register write does not need to unlock EEPROM access
 on RTL8139 family but unlocking EEPROM access does not affect
 its operation and make it consistent with re(4).
  
  Reported by:  Matt Renzelmann  mjr <> cs dot wisc dot edu

Modified:
  head/sys/dev/re/if_re.c
  head/sys/pci/if_rl.c
  head/sys/pci/if_rlreg.h

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Sat Feb 25 02:12:17 2012(r232144)
+++ head/sys/dev/re/if_re.c Sat Feb 25 04:54:51 2012(r232145)
@@ -1477,6 +1477,22 @@ re_attach(device_t dev)
break;
}
 
+   if (sc->rl_hwrev->rl_rev == RL_HWREV_8139CPLUS) {
+   sc->rl_cfg0 = RL_8139_CFG0;
+   sc->rl_cfg1 = RL_8139_CFG1;
+   sc->rl_cfg2 = 0;
+   sc->rl_cfg3 = RL_8139_CFG3;
+   sc->rl_cfg4 = RL_8139_CFG4;
+   sc->rl_cfg5 = RL_8139_CFG5;
+   } else {
+   sc->rl_cfg0 = RL_CFG0;
+   sc->rl_cfg1 = RL_CFG1;
+   sc->rl_cfg2 = RL_CFG2;
+   sc->rl_cfg3 = RL_CFG3;
+   sc->rl_cfg4 = RL_CFG4;
+   sc->rl_cfg5 = RL_CFG5;
+   }
+
/* Reset the adapter. */
RL_LOCK(sc);
re_reset(sc);
@@ -1484,12 +1500,12 @@ re_attach(device_t dev)
 
/* Enable PME. */
CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE);
-   cfg = CSR_READ_1(sc, RL_CFG1);
+   cfg = CSR_READ_1(sc, sc->rl_cfg1);
cfg |= RL_CFG1_PME;
-   CSR_WRITE_1(sc, RL_CFG1, cfg);
-   cfg = CSR_READ_1(sc, RL_CFG5);
+   CSR_WRITE_1(sc, sc->rl_cfg1, cfg);
+   cfg = CSR_READ_1(sc, sc->rl_cfg5);
cfg &= RL_CFG5_PME_STS;
-   CSR_WRITE_1(sc, RL_CFG5, cfg);
+   CSR_WRITE_1(sc, sc->rl_cfg5, cfg);
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
 
if ((sc->rl_flags & RL_FLAG_PAR) != 0) {
@@ -2951,32 +2967,32 @@ re_set_jumbo(struct rl_softc *sc, int ju
 
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG);
if (jumbo != 0) {
-   CSR_WRITE_1(sc, RL_CFG3, CSR_READ_1(sc, RL_CFG3) |
+   CSR_WRITE_1(sc, sc->rl_cfg3, CSR_READ_1(sc, sc->rl_cfg3) |
RL_CFG3_JUMBO_EN0);
switch (sc->rl_hwrev->rl_rev) {
case RL_HWREV_8168DP:
break;
case RL_HWREV_8168E:
-   CSR_WRITE_1(sc, RL_CFG4, CSR_READ_1(sc, RL_CFG4) |
-   0x01);
+   CSR_WRITE_1(sc, sc->rl_cfg4,
+   CSR_READ_1(sc, sc->rl_cfg4) | 0x01);
break;
default:
-   CSR_WRITE_1(sc, RL_CFG4, CSR_READ_1(sc, RL_CFG4) |
-   RL_CFG4_JUMBO_EN1);
+   CSR_WRITE_1(sc, sc->rl_cfg4,
+   CSR_READ_1(sc, sc->rl_cfg4) | RL_CFG4_JUMBO_EN1);
}
} else {
-   CSR_WRITE_1(sc, RL_CFG3, CSR_READ_1(sc, RL_CFG3) &
+   CSR_WRITE_1(sc, sc->rl_cfg3, CSR_READ_1(sc, sc->rl_cfg3) &
~RL_CFG3_JUMBO_EN0);
switch (sc->rl_hwrev->rl_rev) {
case RL_HWREV_8168DP:
break;
case RL_HWREV_8168E:
-   CSR_WRITE_1(sc, RL_CFG4, CSR_READ_1(sc, RL_CFG4) &
-   ~0x01);
+   CSR_WRITE_1(sc, sc->rl_cfg4,
+   CSR_READ_1(sc, sc->rl_cfg4) & ~0x01);
break;
default:
-   CSR_WRITE_1(sc, RL_CFG4, CSR_READ_1(sc, RL_CFG4) &
-   ~RL_CFG4_JUMBO_EN1);
+   CSR_WRITE_1(sc, sc->rl_cfg4,
+   CSR_READ_1(sc, sc->rl_cfg4) & ~RL_CFG4_JUMBO_EN1);
}
}
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
@@ -3089,7 +3105,7 @@ re_init_locked(struct rl_softc *sc)
if (sc->rl_hwrev->rl_rev == RL_HWREV_8169_8110SC ||
sc->rl_hwrev->rl_rev == RL_HWREV_8169_8110SCE) {
reg = 0x000fff00;
-   if ((CSR_READ_1(sc, RL_CFG2) & RL_CFG2_PCI66MHZ) != 0)
+   if ((CSR_READ_1(sc, sc->rl_cfg2) & RL_CFG2_PCI66MHZ) != 0)
reg |= 0x00ff;
if (sc->rl_hwrev->rl_rev == RL_HWREV_8169_8110SCE)
reg |= 0x00f0;
@@ -3254,7 +3270,8 @@ re_init_locked(struct rl_softc *sc)
if (sc->rl_testmode)
return;
 
-   CSR_WRITE_1(

svn commit: r232146 - head/usr.sbin/adduser

2012-02-24 Thread Daniel Eischen
Author: deischen
Date: Sat Feb 25 07:58:59 2012
New Revision: 232146
URL: http://svn.freebsd.org/changeset/base/232146

Log:
  When using uidstart in /etc/adduser.conf, get the next
  available user id and show it in the "Uid [xxx]" prompt.
  
  PR:   163863
  Submitted by: Moritz Wilhelmy (mw at wzff dot de)
  MFC after:2 weeks

Modified:
  head/usr.sbin/adduser/adduser.sh

Modified: head/usr.sbin/adduser/adduser.sh
==
--- head/usr.sbin/adduser/adduser.shSat Feb 25 04:54:51 2012
(r232145)
+++ head/usr.sbin/adduser/adduser.shSat Feb 25 07:58:59 2012
(r232146)
@@ -488,6 +488,7 @@ get_uid() {
_prompt=
 
if [ -n "$uuid" ]; then
+   uuid=`get_nextuid $uuid`
_prompt="Uid [$uuid]: "
else
_prompt="Uid (Leave empty for default): "
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"