Re: svn commit: r213270 - head/etc/rc.d

2010-09-30 Thread Doug Barton

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 9/29/2010 6:08 AM, Ed Maste wrote:
| Author: emaste
| Date: Wed Sep 29 13:08:23 2010
| New Revision: 213270
| URL: http://svn.freebsd.org/changeset/base/213270
|
| Log:
|/etc/rc.d/defaultroute currently bails immediately if all interfaces
|set to use DHCP have no carrier.  This can cause grief as it may take
|some time for link to be established, and defaultroute may terminate
|before this happens.
|
|Introduce a defaultroute_carrier_delay variable and then wait that long
|in defaultroute before bailing if no interfaces have carrier.  With the
|default settings defaultroute will wait for five seconds for this, and
|the original 30 second wait for a default route to appear is unchanged.
|Note that there is in discussion an alternative approach to the broader
|problem of waiting for DHCP-configured routes.  However, this change
|addresses a real problem in the current defaultroute script.
|
|Discussed on:  freebsd-rc@

Ed,

I'm always excited to see people take an interest in rc.d, especially
when they post stuff for review. When I posted this message:
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=17533+0+current/freebsd-rc
it was intended to be a request for you to review Jeremy's more generic
solution to see if it was suitable for your needs, and correspondingly a
request to hold off committing your solution until that question was
answered. I apologize if I wasn't clear about that. While I think your
approach here is creative, I'd rather see a more generic solution to the
system needs network connectivity before proceeding past point X problem.

Could you please back this (and your related changes) out, and evaluate
Jeremy's script? I, and other users have evaluated it for some time now
and found it effective; and I'd like to see it committed, especially now
that Jeremy has updated it.


Thanks,

Doug

- -- 


... and that's just a little bit of history repeating.
-- Propellerheads

Improve the effectiveness of your Internet presence with
a domain name makeover!http://SupersetSolutions.com/

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (MingW32)

iQEcBAEBCAAGBQJMpC9WAAoJEFzGhvEaGryEZi4H/3eojCGkfCvrWv79gr8H/cBH
MwSVzDJvKiNakXk8/+BW2qoT0B+TWELSZ3VYt5s0pvJIUV6/0IjchEn8V8keCJUv
6gIYUgfeiLi6Ie9CtsF2igRAT8ZTVifJfCCUf4UI6wE7n7r6dAUmotloBhqREhn+
BU4C35653wNAsbs1QVw9GQWbPCbBNpikxXLExj/Xo5o0rh2VsKxF6BfVuUUwFrjp
QB5eQsEVk+68QFAzSwNEcXfW9882BnioTg7+vAZaUf5tzjseSiLB8EwuLf8dM3Ic
EG23/QZInRiT4Atx8UKRPqhiMeLvdnDQjue0bKRIibCh9Zt83OT03Mkhzx9JRwQ=
=2XcL
-END PGP SIGNATURE-
___
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: r213294 - head/gnu/usr.bin/binutils/libbfd

2010-09-30 Thread Rui Paulo
Author: rpaulo
Date: Thu Sep 30 07:12:09 2010
New Revision: 213294
URL: http://svn.freebsd.org/changeset/base/213294

Log:
  Remove target peigen.c so that make doesn't warn us about it.

Modified:
  head/gnu/usr.bin/binutils/libbfd/Makefile.amd64

Modified: head/gnu/usr.bin/binutils/libbfd/Makefile.amd64
==
--- head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Thu Sep 30 04:23:03 
2010(r213293)
+++ head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Thu Sep 30 07:12:09 
2010(r213294)
@@ -31,5 +31,3 @@ elf64-amd64-fbsd.c: ${.CURDIR}/elf-fbsd-
 pepigen.c: peXXigen.c
sed -e s/XX/pep/g ${.ALLSRC}  ${.TARGET}
 
-peigen.c: peXXigen.c
-   sed -e s/XX/pe/g ${.ALLSRC}  ${.TARGET}
___
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: r213297 - head/lib/libthr/thread

2010-09-30 Thread David Xu
Author: davidxu
Date: Thu Sep 30 12:59:56 2010
New Revision: 213297
URL: http://svn.freebsd.org/changeset/base/213297

Log:
  change code to use unwind.h.

Modified:
  head/lib/libthr/thread/thr_exit.c
  head/lib/libthr/thread/thr_private.h

Modified: head/lib/libthr/thread/thr_exit.c
==
--- head/lib/libthr/thread/thr_exit.c   Thu Sep 30 11:43:54 2010
(r213296)
+++ head/lib/libthr/thread/thr_exit.c   Thu Sep 30 12:59:56 2010
(r213297)
@@ -58,13 +58,13 @@ static void thread_unwind(void) __dead2;
 static void thread_uw_init(void);
 static _Unwind_Reason_Code thread_unwind_stop(int version,
_Unwind_Action actions,
-   _Unwind_Exception_Class exc_class,
+   int64_t exc_class,
struct _Unwind_Exception *exc_obj,
struct _Unwind_Context *context, void *stop_parameter);
 /* unwind library pointers */
 static _Unwind_Reason_Code (*uwl_forcedunwind)(struct _Unwind_Exception *,
_Unwind_Stop_Fn, void *);
-static _Unwind_Word (*uwl_getcfa)(struct _Unwind_Context *);
+static unsigned long (*uwl_getcfa)(struct _Unwind_Context *);
 
 static void
 thread_uw_init(void)
@@ -106,7 +106,7 @@ _Unwind_ForcedUnwind(struct _Unwind_Exce
return (*uwl_forcedunwind)(ex, stop_func, stop_arg);
 }
 
-_Unwind_Word
+unsigned long
 _Unwind_GetCFA(struct _Unwind_Context *context)
 {
return (*uwl_getcfa)(context);
@@ -129,7 +129,7 @@ thread_unwind_cleanup(_Unwind_Reason_Cod
 
 static _Unwind_Reason_Code
 thread_unwind_stop(int version, _Unwind_Action actions,
-   _Unwind_Exception_Class exc_class,
+   int64_t exc_class,
struct _Unwind_Exception *exc_obj,
struct _Unwind_Context *context, void *stop_parameter)
 {

Modified: head/lib/libthr/thread/thr_private.h
==
--- head/lib/libthr/thread/thr_private.hThu Sep 30 11:43:54 2010
(r213296)
+++ head/lib/libthr/thread/thr_private.hThu Sep 30 12:59:56 2010
(r213297)
@@ -71,7 +71,8 @@
 #include thread_db.h
 
 #ifdef _PTHREAD_FORCED_UNWIND
-#include unwind-generic.h
+#define _BSD_SOURCE
+#include unwind.h
 #endif
 
 typedef TAILQ_HEAD(pthreadlist, pthread) pthreadlist;
___
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: r213270 - head/etc/rc.d

2010-09-30 Thread Ed Maste
On Wed, Sep 29, 2010 at 11:33:58PM -0700, Doug Barton wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256
 
 On 9/29/2010 6:08 AM, Ed Maste wrote:
 | Author: emaste
 | Date: Wed Sep 29 13:08:23 2010
 | New Revision: 213270
 | URL: http://svn.freebsd.org/changeset/base/213270
...

 Could you please back this (and your related changes) out, and evaluate
 Jeremy's script? I, and other users have evaluated it for some time now
 and found it effective; and I'd like to see it committed, especially now
 that Jeremy has updated it.

Backing this out doesn't improve anything, so I'm not going to do that.
This change is an improvement to what's in the tree today, and the
original author of this script agreed with the approach.  I will review
Jeremy's script as time permits; if it is a viable replacement for
defaultroute then we can just replace defaultroute with it, and my
change can then end up in /dev/null.

-Ed
___
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: r213298 - head/sbin/mount

2010-09-30 Thread Jaakko Heinonen
Author: jh
Date: Thu Sep 30 13:31:35 2010
New Revision: 213298
URL: http://svn.freebsd.org/changeset/base/213298

Log:
  Fix printing of the rw mount option in fstab(5) format (-p option).
  fstab(5) format requires that one of rw, rq or ro is always
  specified.
  
  PR:   bin/123021
  Reviewed by:  keramida, rodrigc
  MFC after:2 weeks

Modified:
  head/sbin/mount/mount.c

Modified: head/sbin/mount/mount.c
==
--- head/sbin/mount/mount.c Thu Sep 30 12:59:56 2010(r213297)
+++ head/sbin/mount/mount.c Thu Sep 30 13:31:35 2010(r213298)
@@ -850,10 +850,18 @@ void
 putfsent(struct statfs *ent)
 {
struct fstab *fst;
-   char *opts;
+   char *opts, *rw;
int l;
 
+   opts = NULL;
+   /* flags2opts() doesn't return the rw option. */
+   if ((ent-f_flags  MNT_RDONLY) != 0)
+   rw = NULL;
+   else
+   rw = catopt(NULL, rw);
+
opts = flags2opts(ent-f_flags);
+   opts = catopt(rw, opts);
 
if (strncmp(ent-f_mntfromname, below, 7) == 0 ||
strncmp(ent-f_mntfromname, above, 7) == 0) {
@@ -861,10 +869,6 @@ putfsent(struct statfs *ent)
+1));
}
 
-   /*
-* rw is not a real mount option; this is why we print NULL as rw
-* if opts is still NULL here.
-*/
l = strlen(ent-f_mntfromname);
printf(%s%s%s%s, ent-f_mntfromname,
l  8 ? \t : ,
@@ -876,13 +880,9 @@ putfsent(struct statfs *ent)
l  16 ? \t : ,
l  24 ? \t :  );
printf(%s\t, ent-f_fstypename);
-   if (opts == NULL) {
-   printf(%s\t, rw);
-   } else {
-   l = strlen(opts);
-   printf(%s%s, opts,
-   l  8 ? \t :  );
-   }
+   l = strlen(opts);
+   printf(%s%s, opts,
+   l  8 ? \t :  );
free(opts);
 
if ((fst = getfsspec(ent-f_mntfromname)))
___
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: r213281 - head/lib/libc/amd64/gen

2010-09-30 Thread Dimitry Andric

On 2010-09-30 05:46, Bruce Evans wrote:
...

This file probably shouldn't exist, especially on amd64.  There are 4 or 5
versions of ldexp(), and this file implements what seems to be the worst
one, even without the bug.

First, it shouldn't exist since it is a libm function.  It exists for the
historical reason that its object file has always been in libc.  This
causes organizational problems.


It also makes it impossible to throw it out of libc, as there are many
applications that expect it in there.  Luckily, it seems to be only
ldexp for which this is the case, not ldexpl or ldexpf. :)



The second version is in fdlibm.  This wasn't imported into FreeBSD.  It
calls scalbn() after checking some cases.  I think it shouldn't check
anything.  In FreeBSD it could be a weak alias to scalbn().

The third version is in fdlibm.  This one is named scalbn().  FreeBSD has
it.  FreeBSD aliases ldexpl() to scalbn() iff long doubles are the same as
doubles.  FreeBSD also has scalbnf().  This came from NetBSD/Cygnus's
extension of fdlibm.  FreeBSD aliases ldexpf() to scalbnf() (or is it
the other way?).


We alias scalbnf() to ldexpf(), apparently.



The fourth version is in the FreeBSD arch-dependent directories of
lib/msun for at least amd64 and i386.  These are also named scalbn().
These aren't in fdlibm, but came from NetBSD.  These are written in
non-inline asm and are similar to the ones in libc.  They are a couple
of instructions shorter, due to never using a frame pointer (unless
profiling) and avoiding an fxch or two.  They aren't aliased to aything,
and don't have float versions.

The fifth version, which might not exist, is gcc's builtin.  I think it
doesn't really exist, but gcc says it has a builtin ldexp() and I had to
fight with this to test this.  gcc normally made the dubious optimization
of moving ldexp() out of a test loop.  But ldexp() has side effects.


The version in libc/gen/ldexp.c is just a copy of msun/src/s_scalbn.c,
with some things like copysign() directly pasted in.  It even has:

/* @(#)fdlibm.h 5.1 93/09/24 */

at the top.



Testing indicates that the fdlibm C version is 2.5 times faster than the
asm versions on amd64 on a core2 (ref9), while on i386 the C version is
only 1.5 times faster.  The C code is a bit larger so benefits more from
being called from a loop.  The asm code uses a slow i387 instruction, and
on i387 it hhs to do expensive moves from xmm registers to i387 ones and
back.

Times for 100 million calls:

  amd64 libc ldexp:  3.18 seconds
  amd64 libm asm scalbn: 2.96
  amd64 libm C scalbn:   1.30
  i386  libc ldexp:  3.13
  i386  libm asm scalbn: 2.86
  i386  libm C scalbn:   2.11


Seeing these results, I propose to just delete
lib/libc/amd64/gen/ldexp.c and lib/libc/i386/gen/ldexp.c, which will
cause the amd64 and i386 builds to automatically pick up
lib/libc/gen/ldexp.c instead, which effectively is the fdlibm
implementation.  (And no more clang workarounds needed. :)
___
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: r213300 - head/usr.bin/csup

2010-09-30 Thread John Baldwin
Author: jhb
Date: Thu Sep 30 14:28:48 2010
New Revision: 213300
URL: http://svn.freebsd.org/changeset/base/213300

Log:
  If an RCS file is truncated, rcsfile_getdelta() will return NULL.  Instead
  of faulting, check for NULL.  However, returning an error would cause csup
  to just abort the entire update.  Instead, break out of the loop and
  return ok.  The attempts to update the file will trigger a MD5 failure which
  will cause csup to download the entire file as a fixup.
  
  Reviewed by:  lulf
  MFC after:1 week

Modified:
  head/usr.bin/csup/rcsparse.c

Modified: head/usr.bin/csup/rcsparse.c
==
--- head/usr.bin/csup/rcsparse.cThu Sep 30 13:44:55 2010
(r213299)
+++ head/usr.bin/csup/rcsparse.cThu Sep 30 14:28:48 2010
(r213300)
@@ -318,6 +318,14 @@ parse_deltatexts(struct rcsfile *rf, yys
d = rcsfile_getdelta(rf, revnum);
free(revnum);
 
+   /*
+* XXX: The RCS file is corrupt, but lie and say it is ok.
+* If it is actually broken, then the MD5 mismatch will
+* trigger a fixup.
+*/
+   if (d == NULL)
+   return (0);
+
/* log string */
asserttoken(sp, KEYWORD);
asserttoken(sp, STRING);
___
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: r213301 - head/sys/dev/ata/chipsets

2010-09-30 Thread Alexander Motin
Author: mav
Date: Thu Sep 30 16:09:52 2010
New Revision: 213301
URL: http://svn.freebsd.org/changeset/base/213301

Log:
  Revert r132291.
  Restore setting PIO/WDMA timings for VIA UDMA133 controllers.
  Linux disables only AST register writing there, but no all timings.

Modified:
  head/sys/dev/ata/chipsets/ata-via.c

Modified: head/sys/dev/ata/chipsets/ata-via.c
==
--- head/sys/dev/ata/chipsets/ata-via.c Thu Sep 30 14:28:48 2010
(r213300)
+++ head/sys/dev/ata/chipsets/ata-via.c Thu Sep 30 16:09:52 2010
(r213301)
@@ -352,8 +352,7 @@ ata_via_old_setmode(device_t dev, int ta
piomode = mode;
}
/* Set WDMA/PIO timings */
-   if (ctlr-chip-cfg1 != VIA133)
-   pci_write_config(parent, reg - 0x08,timings[ata_mode2idx(piomode)], 
1);
+   pci_write_config(parent, reg - 0x08,timings[ata_mode2idx(piomode)], 1);
return (mode);
 }
 
___
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: r213302 - head/sys/dev/acpica

2010-09-30 Thread Alexander Motin
Author: mav
Date: Thu Sep 30 16:23:01 2010
New Revision: 213302
URL: http://svn.freebsd.org/changeset/base/213302

Log:
  Do not use regular interrupts on NVidia HPETs. NVidia MCP5x chipsets have
  number of unexplained interrupt problems. For some reason, using HPET
  interrupts there breaks HDA sound. Legacy route mode interrupts reported
  to work fine there.

Modified:
  head/sys/dev/acpica/acpi_hpet.c

Modified: head/sys/dev/acpica/acpi_hpet.c
==
--- head/sys/dev/acpica/acpi_hpet.c Thu Sep 30 16:09:52 2010
(r213301)
+++ head/sys/dev/acpica/acpi_hpet.c Thu Sep 30 16:23:01 2010
(r213302)
@@ -58,6 +58,7 @@ __FBSDID($FreeBSD$);
 
 #define HPET_VENDID_AMD0x4353
 #define HPET_VENDID_INTEL  0x8086
+#define HPET_VENDID_NVIDIA 0x10de
 
 ACPI_SERIAL_DECL(hpet, ACPI HPET support);
 
@@ -492,6 +493,12 @@ hpet_attach(device_t dev)
if (vendor == HPET_VENDID_AMD)
sc-allowed_irqs = 0x;
/*
+* NVidia MCP5x chipsets have number of unexplained interrupt
+* problems. For some reason, using HPET interrupts breaks HDA sound.
+*/
+   if (vendor == HPET_VENDID_NVIDIA  rev = 0x01)
+   sc-allowed_irqs = 0x;
+   /*
 * Neither QEMU nor VirtualBox report supported IRQs correctly.
 * The only way to use HPET there is to specify IRQs manually
 * and/or use legacy_route. Legacy_route mode work on both.
___
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: r213303 - head/sys/kern

2010-09-30 Thread Andriy Gapon
Author: avg
Date: Thu Sep 30 16:45:27 2010
New Revision: 213303
URL: http://svn.freebsd.org/changeset/base/213303

Log:
  kmem_size* sysctls: hint that these are also tunables
  
  MFC after:1 week

Modified:
  head/sys/kern/kern_malloc.c

Modified: head/sys/kern/kern_malloc.c
==
--- head/sys/kern/kern_malloc.c Thu Sep 30 16:23:01 2010(r213302)
+++ head/sys/kern/kern_malloc.c Thu Sep 30 16:45:27 2010(r213303)
@@ -187,19 +187,19 @@ struct {
 static uma_zone_t mt_zone;
 
 u_long vm_kmem_size;
-SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RD, vm_kmem_size, 0,
+SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, vm_kmem_size, 0,
 Size of kernel memory);
 
 static u_long vm_kmem_size_min;
-SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RD, vm_kmem_size_min, 0,
+SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RDTUN, vm_kmem_size_min, 0,
 Minimum size of kernel memory);
 
 static u_long vm_kmem_size_max;
-SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RD, vm_kmem_size_max, 0,
+SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RDTUN, vm_kmem_size_max, 0,
 Maximum size of kernel memory);
 
 static u_int vm_kmem_size_scale;
-SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RD, vm_kmem_size_scale, 0,
+SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RDTUN, 
vm_kmem_size_scale, 0,
 Scale factor for kernel memory size);
 
 /*
___
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: r213304 - head/sys/kern

2010-09-30 Thread Andriy Gapon
Author: avg
Date: Thu Sep 30 16:47:01 2010
New Revision: 213304
URL: http://svn.freebsd.org/changeset/base/213304

Log:
  debug.kdb.stop_cpus sysctl: hint that this is also a tunable
  
  MFC after:1 week

Modified:
  head/sys/kern/subr_kdb.c

Modified: head/sys/kern/subr_kdb.c
==
--- head/sys/kern/subr_kdb.cThu Sep 30 16:45:27 2010(r213303)
+++ head/sys/kern/subr_kdb.cThu Sep 30 16:47:01 2010(r213304)
@@ -95,7 +95,7 @@ SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_c
  */
 #ifdef SMP
 static int kdb_stop_cpus = 1;
-SYSCTL_INT(_debug_kdb, OID_AUTO, stop_cpus, CTLTYPE_INT | CTLFLAG_RW,
+SYSCTL_INT(_debug_kdb, OID_AUTO, stop_cpus, CTLFLAG_RW | CTLFLAG_TUN,
 kdb_stop_cpus, 0, stop other CPUs when entering the debugger);
 TUNABLE_INT(debug.kdb.stop_cpus, kdb_stop_cpus);
 #endif
___
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: r213305 - in head/sys: gdb kern sys

2010-09-30 Thread Andriy Gapon
Author: avg
Date: Thu Sep 30 17:05:23 2010
New Revision: 213305
URL: http://svn.freebsd.org/changeset/base/213305

Log:
  there must be only one SYSINIT with SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY order
  
  SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY should only be used to call
  scheduler() function which turns the initial thread into swapper proper
  and thus there is no further SYSINIT processing.
  Other SYSINITs with SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY may get ordered
  after scheduler() and thus never executed.  That particular relative
  order is semi-arbitrary.
  
  Thus, change such places to use SI_ORDER_MIDDLE.
  Also, use SI_ORDER_MIDDLE instead of correct, but less appealing,
  SI_ORDER_ANY - 1.
  
  MFC after:1 week

Modified:
  head/sys/gdb/gdb_cons.c
  head/sys/kern/kern_ntptime.c
  head/sys/sys/sched.h

Modified: head/sys/gdb/gdb_cons.c
==
--- head/sys/gdb/gdb_cons.c Thu Sep 30 16:47:01 2010(r213304)
+++ head/sys/gdb/gdb_cons.c Thu Sep 30 17:05:23 2010(r213305)
@@ -126,7 +126,7 @@ oktousecallout(void *data __unused)
 {
calloutok = 1;
 }
-SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, oktousecallout, NULL);
+SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, oktousecallout, NULL);
 
 static void
 gdb_cnputc(struct consdev *cp, int c)

Modified: head/sys/kern/kern_ntptime.c
==
--- head/sys/kern/kern_ntptime.cThu Sep 30 16:47:01 2010
(r213304)
+++ head/sys/kern/kern_ntptime.cThu Sep 30 17:05:23 2010
(r213305)
@@ -1035,5 +1035,5 @@ start_periodic_resettodr(void *arg __unu
periodic_resettodr, NULL);
 }
 
-SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY - 1,
+SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE,
start_periodic_resettodr, NULL);

Modified: head/sys/sys/sched.h
==
--- head/sys/sys/sched.hThu Sep 30 16:47:01 2010(r213304)
+++ head/sys/sys/sched.hThu Sep 30 17:05:23 2010(r213305)
@@ -173,7 +173,7 @@ static void name ## _add_proc(void *dumm
#name, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE,  \
ptr, 0, sysctl_dpcpu_long, LU, descr);\
 }  \
-SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, name ## _add_proc, NULL);
+SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, name ## _add_proc, NULL);
 
 #defineSCHED_STAT_DEFINE(name, descr)  
\
 DPCPU_DEFINE(unsigned long, name); \
___
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: r213305 - in head/sys: gdb kern sys

2010-09-30 Thread mdf
On Thu, Sep 30, 2010 at 10:05 AM, Andriy Gapon a...@freebsd.org wrote:
 Author: avg
 Date: Thu Sep 30 17:05:23 2010
 New Revision: 213305
 URL: http://svn.freebsd.org/changeset/base/213305

 Log:
  there must be only one SYSINIT with SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY order

  SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY should only be used to call
  scheduler() function which turns the initial thread into swapper proper
  and thus there is no further SYSINIT processing.

Does this imply that scheduler() shouldn't be called from a sysinit at
all, and instead a hand-call after processing all the boot-time
sysinit's would make more sense?  This prevents the bug from
reoccuring, and also prevents bugs with adding a SYSINIT that runs at
SI_SUB_RUN_SCHEDULER + 1 time.

Thanks,
matthew

  Other SYSINITs with SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY may get ordered
  after scheduler() and thus never executed.  That particular relative
  order is semi-arbitrary.

  Thus, change such places to use SI_ORDER_MIDDLE.
  Also, use SI_ORDER_MIDDLE instead of correct, but less appealing,
  SI_ORDER_ANY - 1.

  MFC after:    1 week

 Modified:
  head/sys/gdb/gdb_cons.c
  head/sys/kern/kern_ntptime.c
  head/sys/sys/sched.h

 Modified: head/sys/gdb/gdb_cons.c
 ==
 --- head/sys/gdb/gdb_cons.c     Thu Sep 30 16:47:01 2010        (r213304)
 +++ head/sys/gdb/gdb_cons.c     Thu Sep 30 17:05:23 2010        (r213305)
 @@ -126,7 +126,7 @@ oktousecallout(void *data __unused)
  {
        calloutok = 1;
  }
 -SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, oktousecallout, NULL);
 +SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, oktousecallout, 
 NULL);

  static void
  gdb_cnputc(struct consdev *cp, int c)

 Modified: head/sys/kern/kern_ntptime.c
 ==
 --- head/sys/kern/kern_ntptime.c        Thu Sep 30 16:47:01 2010        
 (r213304)
 +++ head/sys/kern/kern_ntptime.c        Thu Sep 30 17:05:23 2010        
 (r213305)
 @@ -1035,5 +1035,5 @@ start_periodic_resettodr(void *arg __unu
            periodic_resettodr, NULL);
  }

 -SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY - 1,
 +SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE,
        start_periodic_resettodr, NULL);

 Modified: head/sys/sys/sched.h
 ==
 --- head/sys/sys/sched.h        Thu Sep 30 16:47:01 2010        (r213304)
 +++ head/sys/sys/sched.h        Thu Sep 30 17:05:23 2010        (r213305)
 @@ -173,7 +173,7 @@ static void name ## _add_proc(void *dumm
            #name, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE,              \
            ptr, 0, sysctl_dpcpu_long, LU, descr);                    \
  }                                                                      \
 -SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, name ## _add_proc, NULL);
 +SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, name ## _add_proc, 
 NULL);

  #define        SCHED_STAT_DEFINE(name, descr)                                
   \
     DPCPU_DEFINE(unsigned long, name);                                 \

___
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: r213306 - head/sys/pci

2010-09-30 Thread Pyun YongHyeon
Author: yongari
Date: Thu Sep 30 17:37:08 2010
New Revision: 213306
URL: http://svn.freebsd.org/changeset/base/213306

Log:
  Rename rl_setmulti() to rl_rxfilter() as rl_rxfilter() will handle
  IFF_ALLMULTI/IFF_PROMISC as well as multicast filter configuration.
  Rewrite RX filter logic to reduce number of register accesses and
  make it handle promiscuous/allmulti toggling without controller
  reinitialization.
  
  Previously rl(4) counted on controller reinitialization to reprogram
  promiscuous configuration but r211767 resulted in avoiding
  controller reinitialization whenever promiscuous mode is toggled.
  To address this, keep track of driver's view of interface state and
  handle IFF_ALLMULTI/IFF_PROMISC changes without reinitializing
  controller. This should fix a regression introduced in r211267.
  
  While I'm here remove unnecessary variable reassignment in ioctl
  handler.
  
  PR:   kern/151079
  MFC after:1 week

Modified:
  head/sys/pci/if_rl.c

Modified: head/sys/pci/if_rl.c
==
--- head/sys/pci/if_rl.cThu Sep 30 17:05:23 2010(r213305)
+++ head/sys/pci/if_rl.cThu Sep 30 17:37:08 2010(r213306)
@@ -203,7 +203,7 @@ static void rl_read_eeprom(struct rl_sof
 static void rl_reset(struct rl_softc *);
 static int rl_resume(device_t);
 static int rl_rxeof(struct rl_softc *);
-static void rl_setmulti(struct rl_softc *);
+static void rl_rxfilter(struct rl_softc *);
 static int rl_shutdown(device_t);
 static void rl_start(struct ifnet *);
 static void rl_start_locked(struct ifnet *);
@@ -655,54 +655,51 @@ rl_miibus_statchg(device_t dev)
  * Program the 64-bit multicast hash filter.
  */
 static void
-rl_setmulti(struct rl_softc *sc)
+rl_rxfilter(struct rl_softc *sc)
 {
struct ifnet*ifp = sc-rl_ifp;
int h = 0;
uint32_thashes[2] = { 0, 0 };
struct ifmultiaddr  *ifma;
uint32_trxfilt;
-   int mcnt = 0;
 
RL_LOCK_ASSERT(sc);
 
rxfilt = CSR_READ_4(sc, RL_RXCFG);
-
+   rxfilt = ~(RL_RXCFG_RX_ALLPHYS | RL_RXCFG_RX_BROAD |
+   RL_RXCFG_RX_MULTI);
+   /* Always accept frames destined for this host. */
+   rxfilt |= RL_RXCFG_RX_INDIV;
+   /* Set capture broadcast bit to capture broadcast frames. */
+   if (ifp-if_flags  IFF_BROADCAST)
+   rxfilt |= RL_RXCFG_RX_BROAD;
if (ifp-if_flags  IFF_ALLMULTI || ifp-if_flags  IFF_PROMISC) {
rxfilt |= RL_RXCFG_RX_MULTI;
-   CSR_WRITE_4(sc, RL_RXCFG, rxfilt);
-   CSR_WRITE_4(sc, RL_MAR0, 0x);
-   CSR_WRITE_4(sc, RL_MAR4, 0x);
-   return;
-   }
-
-   /* first, zot all the existing hash bits */
-   CSR_WRITE_4(sc, RL_MAR0, 0);
-   CSR_WRITE_4(sc, RL_MAR4, 0);
-
-   /* now program new ones */
-   if_maddr_rlock(ifp);
-   TAILQ_FOREACH(ifma, ifp-if_multiaddrs, ifma_link) {
-   if (ifma-ifma_addr-sa_family != AF_LINK)
-   continue;
-   h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
-   ifma-ifma_addr), ETHER_ADDR_LEN)  26;
-   if (h  32)
-   hashes[0] |= (1  h);
-   else
-   hashes[1] |= (1  (h - 32));
-   mcnt++;
+   if (ifp-if_flags  IFF_PROMISC)
+   rxfilt |= RL_RXCFG_RX_ALLPHYS;
+   hashes[0] = 0x;
+   hashes[1] = 0x;
+   } else {
+   /* Now program new ones. */
+   if_maddr_rlock(ifp);
+   TAILQ_FOREACH(ifma, ifp-if_multiaddrs, ifma_link) {
+   if (ifma-ifma_addr-sa_family != AF_LINK)
+   continue;
+   h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
+   ifma-ifma_addr), ETHER_ADDR_LEN)  26;
+   if (h  32)
+   hashes[0] |= (1  h);
+   else
+   hashes[1] |= (1  (h - 32));
+   }
+   if_maddr_runlock(ifp);
+   if (hashes[0] != 0 || hashes[1] != 0)
+   rxfilt |= RL_RXCFG_RX_MULTI;
}
-   if_maddr_runlock(ifp);
-
-   if (mcnt)
-   rxfilt |= RL_RXCFG_RX_MULTI;
-   else
-   rxfilt = ~RL_RXCFG_RX_MULTI;
 
-   CSR_WRITE_4(sc, RL_RXCFG, rxfilt);
CSR_WRITE_4(sc, RL_MAR0, hashes[0]);
CSR_WRITE_4(sc, RL_MAR4, hashes[1]);
+   CSR_WRITE_4(sc, RL_RXCFG, rxfilt);
 }
 
 static void
@@ -1807,7 +1804,6 @@ rl_init_locked(struct rl_softc *sc)
 {
struct ifnet*ifp = sc-rl_ifp;
struct mii_data *mii;
-   uint32_trxcfg = 0;
uint32_teaddr[2];
 

Re: svn commit: r213298 - head/sbin/mount

2010-09-30 Thread Alexander Best
hooray! :)

thanks a bunch.

-- 
a13x
___
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: r213308 - in head/lib/libc: amd64/gen i386/gen

2010-09-30 Thread Dimitry Andric
Author: dim
Date: Thu Sep 30 19:20:21 2010
New Revision: 213308
URL: http://svn.freebsd.org/changeset/base/213308

Log:
  Retire the amd64 and i386 specific inline assembly versions of ldexp.c,
  as they are slower than the generic version in C, at least on modern
  hardware.  This leaves us with just five implementations.
  
  Suggested by: bde
  Approved by:  rpaulo (mentor)

Deleted:
  head/lib/libc/amd64/gen/ldexp.c
  head/lib/libc/i386/gen/ldexp.c
___
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: r213312 - head/contrib/tzdata

2010-09-30 Thread Edwin Groothuis
Author: edwin
Date: Thu Sep 30 22:00:21 2010
New Revision: 213312
URL: http://svn.freebsd.org/changeset/base/213312

Log:
  MFV of 213310, tzdata2010m
  
  - Fix historical data for Hongkong
  - Fix location description for Antarctica/Vostok

Modified:
  head/contrib/tzdata/asia
  head/contrib/tzdata/zone.tab
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/asia
==
--- head/contrib/tzdata/asiaThu Sep 30 21:57:09 2010(r213311)
+++ head/contrib/tzdata/asiaThu Sep 30 22:00:21 2010(r213312)
@@ -1,4 +1,4 @@
-# @(#)asia 8.61
+# @(#)asia 8.62
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -547,8 +547,8 @@ RuleHK  1953only-   Nov 1   
3:300   -
 Rule   HK  19541964-   Mar Sun=18 3:301:00S
 Rule   HK  1954only-   Oct 31  3:300   -
 Rule   HK  19551964-   Nov Sun=1  3:300   -
-Rule   HK  19651977-   Apr Sun=16 3:301:00S
-Rule   HK  19651977-   Oct Sun=16 3:300   -
+Rule   HK  19651976-   Apr Sun=16 3:301:00S
+Rule   HK  19651976-   Oct Sun=16 3:300   -
 Rule   HK  1973only-   Dec 30  3:301:00S
 Rule   HK  1979only-   May Sun=8  3:301:00S
 Rule   HK  1979only-   Oct Sun=16 3:300   -

Modified: head/contrib/tzdata/zone.tab
==
--- head/contrib/tzdata/zone.tabThu Sep 30 21:57:09 2010
(r213311)
+++ head/contrib/tzdata/zone.tabThu Sep 30 22:00:21 2010
(r213312)
@@ -1,5 +1,5 @@
 # pre
-# @(#)zone.tab 8.37
+# @(#)zone.tab 8.38
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -41,7 +41,7 @@ AQ-6448-06406 Antarctica/Palmer   Palmer 
 AQ -6736+06253 Antarctica/Mawson   Mawson Station, Holme Bay
 AQ -6835+07758 Antarctica/DavisDavis Station, Vestfold Hills
 AQ -6617+11031 Antarctica/CaseyCasey Station, Bailey Peninsula
-AQ -7824+10654 Antarctica/Vostok   Vostok Station, S Magnetic Pole
+AQ -7824+10654 Antarctica/Vostok   Vostok Station, Lake Vostok
 AQ -6640+14001 Antarctica/DumontDUrville   Dumont-d'Urville 
Station, Terre Adelie
 AQ -690022+0393524 Antarctica/SyowaSyowa Station, E Ongul I
 AQ -5430+15857 Antarctica/MacquarieMacquarie Island Station, 
Macquarie Island
___
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: r213308 - in head/lib/libc: amd64/gen i386/gen

2010-09-30 Thread Bruce Evans

On Thu, 30 Sep 2010, Dimitry Andric wrote:


Log:
 Retire the amd64 and i386 specific inline assembly versions of ldexp.c,
 as they are slower than the generic version in C, at least on modern
 hardware.  This leaves us with just five implementations.

 Suggested by:  bde
 Approved by:   rpaulo (mentor)


Thanks.

I suppose it has had enough testing.  I just tested it on a Celeron 366
(late 90's P2 arch).  The C version is faster there too:

libc asm ldexp:  1.98 seconds
libm asm scalbn: 1.91
libm C   scalbn: 1.84

While there, I noticed that the libm asm scalbn is still using RCSID(),
like many of the older libm asm functions.  This is not just a style
bug.  RCSID() and __RCSID() are compatibility cruft that should never
be used.  The RCSID() in i386/include/asm.h is especially bad.  It
bloats the text section with $FreeBSD$ strings using .text; .asciz
__FBSDID() normally uses .ident which normally puts the strings in a
better place.

Are there only 5 implementations left? :-)  arm is the only arch that
still has one in libc.  amd64 are i386 the only arches that have asm
versions of scalbn in libm.  They are there for float and long double
precision too.  This is especially silly for float precision since the
integer versions are especially easy to make efficient for float
precision.  OTOH, long double precision is probably still faster in
asm.  There are also silly scalbln* interfaces (taking a long for the
exponent).  These are only implemented in C (as wrappers).

Bruce



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: r213317 - head/usr.bin/man

2010-09-30 Thread Gordon Tetlow
Author: gordon
Date: Fri Oct  1 03:59:18 2010
New Revision: 213317
URL: http://svn.freebsd.org/changeset/base/213317

Log:
  Implementaiton of man, manpath, whatis, and apropos written entirely in sh.
  
  Features of this new version in favor of the old one:
  BSD licensed -- old one is GPL.
  Imports configuration from /etc/man.conf and LOCALBASE/etc/man.d/*.conf
  allowing ports to extend the base functionality. The pluggable
  configuration can supplement the manual search path (retiring use.perl),
  add locales, and override language specific toolsets (attempt to merge
  the japanese/man port into the base system as much as possible).
  
  Much effort has been made to make this version mirror the functionality
  of the existing implementation. For 99% of users, it should be a drop in
  replacement.
  
  PR:   gnu/143271, gnu/4419
  Reviewed by:  dougb (previous versions)
  Approved by:  wes (mentor)

Added:
  head/usr.bin/man/
  head/usr.bin/man/Makefile   (contents, props changed)
  head/usr.bin/man/apropos.1   (contents, props changed)
  head/usr.bin/man/man.1   (contents, props changed)
  head/usr.bin/man/man.conf.5   (contents, props changed)
  head/usr.bin/man/man.sh   (contents, props changed)
  head/usr.bin/man/manpath.1   (contents, props changed)

Added: head/usr.bin/man/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/man/Makefile   Fri Oct  1 03:59:18 2010(r213317)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+SCRIPTS= man.sh
+LINKS= ${BINDIR}/man ${BINDIR}/apropos \
+   ${BINDIR}/man ${BINDIR}/manpath \
+   ${BINDIR}/man ${BINDIR}/whatis
+
+MAN=   man.1 manpath.1 apropos.1 man.conf.5
+MLINKS=apropos.1 whatis.1
+
+.include bsd.prog.mk

Added: head/usr.bin/man/apropos.1
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/man/apropos.1  Fri Oct  1 03:59:18 2010(r213317)
@@ -0,0 +1,88 @@
+.\-
+.\  Copyright (c) 2010 Gordon Tetlow
+.\  All rights reserved.
+.\
+.\  Redistribution and use in source and binary forms, with or without
+.\  modification, are permitted provided that the following conditions
+.\  are met:
+.\  1. Redistributions of source code must retain the above copyright
+.\ notice, this list of conditions and the following disclaimer.
+.\  2. Redistributions in binary form must reproduce the above copyright
+.\ notice, this list of conditions and the following disclaimer in the
+.\ documentation and/or other materials provided with the distribution.
+.\
+.\  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\  SUCH DAMAGE.
+.\
+.\ $FreeBSD$
+.\
+.Dd September 1, 2010
+.Dt APROPOS 1
+.Os
+.Sh NAME
+.Nm apropos ,
+.Nm whatis
+.Nd keyword search whatis documentation databases
+.Sh SYNOPSIS
+.Nm
+.Op Fl d
+.Ar keyword ...
+.Nm whatis
+.Op Fl d
+.Ar keyword ...
+.Sh DESCRIPTION
+The
+.Nm
+utility searches a set of databases looking for documentation matching each
+.Ar keyword
+and displays the results.
+The
+.Nm whatis
+utility does the same search but only on complete words.
+.Bl -tag -width .Fl d
+.It Fl d
+Print extra debugging information.
+.El
+.Pp
+The
+.Ar keyword
+is simply passed to
+.Xr grep 1
+allowing for extended regular expression matches.
+.Sh ENVIRONMENT
+The following environment variables affect the execution of
+.Nm :
+.Bl -tag -width .Ev PAGER
+.It Ev MANLOCALES , MANPATH , PATH
+Used to find the location of the
+.Nm whatis
+database files. See
+.Xr manpath 1
+for additional information.
+.It Ev PAGER
+Program used to display files.
+If unset,
+.Ic more -s
+is used.
+.El
+.Sh DIAGNOSTICS
+The
+.Nm
+utility exits 0 if a keyword matched and 1 if no keywords are matched or no
+.Nm whatis
+databases are found.
+.Sh SEE ALSO
+.Xr grep 1 ,
+.Xr makewhatis 1 ,
+.Xr man 1 ,
+.Xr manpath 1 ,
+.Xr man.conf 5

Added: head/usr.bin/man/man.1
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/man/man.1  Fri Oct  1 03:59:18 2010(r213317)
@@ -0,0 +1,299 @@
+.\-
+.\  Copyright