svn commit: r209561 - in stable/8: etc tools/regression/lib/msun tools/regression/usr.bin/pkill tools/tools/ath/common tools/tools/termcap tools/tools/tinybsd/conf/default tools/tools/tinybsd/conf/vpn

2010-06-28 Thread Brian Somers
Author: brian
Date: Mon Jun 28 06:59:57 2010
New Revision: 209561
URL: http://svn.freebsd.org/changeset/base/209561

Log:
  MFC r209331 at stable/8/etc and stable/8/tools; Remove vestiges of 'slip'.
  
  PR:   145648
  Submitted by: alexbestms at wwu dot de and spam at rm-rf dot kiev dot ua

Modified:
  stable/8/etc/login.conf
  stable/8/tools/tools/tinybsd/conf/default/TINYBSD
  stable/8/tools/tools/tinybsd/conf/vpn/TINYBSD
Directory Properties:
  stable/8/etc/   (props changed)
  stable/8/tools/   (props changed)
  stable/8/tools/build/mk/   (props changed)
  stable/8/tools/build/options/   (props changed)
  stable/8/tools/kerneldoc/subsys/   (props changed)
  stable/8/tools/regression/acltools/   (props changed)
  stable/8/tools/regression/aio/aiotest/   (props changed)
  stable/8/tools/regression/bin/sh/   (props changed)
  stable/8/tools/regression/fifo/   (props changed)
  stable/8/tools/regression/geom/   (props changed)
  stable/8/tools/regression/lib/libc/   (props changed)
  stable/8/tools/regression/lib/msun/test-conj.t   (props changed)
  stable/8/tools/regression/mqueue/mqtest1/   (props changed)
  stable/8/tools/regression/mqueue/mqtest2/   (props changed)
  stable/8/tools/regression/mqueue/mqtest3/   (props changed)
  stable/8/tools/regression/mqueue/mqtest4/   (props changed)
  stable/8/tools/regression/mqueue/mqtest5/   (props changed)
  stable/8/tools/regression/poll/   (props changed)
  stable/8/tools/regression/posixsem/   (props changed)
  stable/8/tools/regression/priv/   (props changed)
  stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t   (props changed)
  stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t   (props changed)
  stable/8/tools/regression/usr.bin/pkill/pkill-_g.t   (props changed)
  stable/8/tools/regression/usr.bin/sed/   (props changed)
  stable/8/tools/test/   (props changed)
  stable/8/tools/tools/ath/   (props changed)
  stable/8/tools/tools/ath/common/dumpregs.h   (props changed)
  stable/8/tools/tools/ath/common/dumpregs_5210.c   (props changed)
  stable/8/tools/tools/ath/common/dumpregs_5211.c   (props changed)
  stable/8/tools/tools/ath/common/dumpregs_5212.c   (props changed)
  stable/8/tools/tools/ath/common/dumpregs_5416.c   (props changed)
  stable/8/tools/tools/nanobsd/   (props changed)
  stable/8/tools/tools/netrate/tcpp/   (props changed)
  stable/8/tools/tools/termcap/termcap.pl   (props changed)
  stable/8/tools/tools/vimage/   (props changed)

Modified: stable/8/etc/login.conf
==
--- stable/8/etc/login.conf Mon Jun 28 04:54:16 2010(r209560)
+++ stable/8/etc/login.conf Mon Jun 28 06:59:57 2010(r209561)
@@ -228,7 +228,7 @@ russian|Russian Users Accounts:\
 #
 #
 ##
-## The dialer class should be used for a dialup PPP/SLIP accounts
+## The dialer class should be used for a dialup PPP account
 ## Welcome messages/news suppressed
 ##
 #dialer:\
@@ -247,7 +247,7 @@ russian|Russian Users Accounts:\
 #
 #
 ##
-## Site full-time 24/7 PPP/SLIP connections
+## Site full-time 24/7 PPP connection
 ## - no time accounting, restricted to access via dialin lines
 ##
 #site:\
@@ -306,11 +306,6 @@ russian|Russian Users Accounts:\
 #  :tc=subscriber:
 #
 #
-#subslip|SLIP Subscriber Accounts:\
-#  :tc=dialer:\
-#  :tc=subscriber:
-#
-#
 #subshell|Shell Subscriber Accounts:\
 #  :tc=subscriber:
 #

Modified: stable/8/tools/tools/tinybsd/conf/default/TINYBSD
==
--- stable/8/tools/tools/tinybsd/conf/default/TINYBSD   Mon Jun 28 04:54:16 
2010(r209560)
+++ stable/8/tools/tools/tinybsd/conf/default/TINYBSD   Mon Jun 28 06:59:57 
2010(r209561)
@@ -143,7 +143,6 @@ device  wi  # 
WaveLAN/Intersil/Symbol 80
 device loop# Network loopback
 device random  # Entropy device
 device ether   # Ethernet support
-#devicesl  # Kernel SLIP
 device ppp # Kernel PPP
 device tun # Packet tunnel.
 device pty # Pseudo-ttys (telnet etc)

Modified: stable/8/tools/tools/tinybsd/conf/vpn/TINYBSD
==
--- stable/8/tools/tools/tinybsd/conf/vpn/TINYBSD   Mon Jun 28 04:54:16 
2010(r209560)
+++ stable/8/tools/tools/tinybsd/conf/vpn/TINYBSD   Mon Jun 28 06:59:57 
2010(r209561)
@@ -133,7 +133,6 @@ device  xe  # Xircom pccard Ethernet
 device loop# Network loopback
 device random  # Entropy device
 device ether   # Ethernet support
-#devicesl  # Kernel SLIP
 device ppp # Kernel PPP
 device tun # Packet tunnel.
 device pty # Pseudo-ttys (telnet etc)

svn commit: r209562 - in stable/8/release: picobsd/floppy.tree/sbin scripts

2010-06-28 Thread Brian Somers
Author: brian
Date: Mon Jun 28 07:03:18 2010
New Revision: 209562
URL: http://svn.freebsd.org/changeset/base/209562

Log:
  MFC r209332: Shoot a stray cat!
  
  PR:   145447
  Submitted by: u at netbeisser dot de

Modified:
  stable/8/release/scripts/ports-install.sh
Directory Properties:
  stable/8/release/   (props changed)
  stable/8/release/doc/en_US.ISO8859-1/hardware/   (props changed)
  stable/8/release/picobsd/   (props changed)
  stable/8/release/picobsd/floppy.tree/sbin/   (props changed)
  stable/8/release/picobsd/floppy.tree/sbin/dhclient-script   (props changed)
  stable/8/release/picobsd/qemu/   (props changed)

Modified: stable/8/release/scripts/ports-install.sh
==
--- stable/8/release/scripts/ports-install.sh   Mon Jun 28 06:59:57 2010
(r209561)
+++ stable/8/release/scripts/ports-install.sh   Mon Jun 28 07:03:18 2010
(r209562)
@@ -8,5 +8,5 @@ if [ `id -u` != 0 ]; then
exit 1
 fi
 echo Extracting ports tarball into ${DESTDIR}/usr
-cat ports.tgz | tar --unlink -xpzf - -C ${DESTDIR}/usr
+tar --unlink -xpzf ports.tgz -C ${DESTDIR}/usr
 exit 0
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209563 - stable/8/sys/boot/ficl

2010-06-28 Thread Brian Somers
Author: brian
Date: Mon Jun 28 07:15:30 2010
New Revision: 209563
URL: http://svn.freebsd.org/changeset/base/209563

Log:
  MFC r209361; Add a missing prototype
  
  PR:   145232
  Submitted by: gcooper

Modified:
  stable/8/sys/boot/ficl/ficl.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/boot/ficl/ficl.h
==
--- stable/8/sys/boot/ficl/ficl.h   Mon Jun 28 07:03:18 2010
(r209562)
+++ stable/8/sys/boot/ficl/ficl.h   Mon Jun 28 07:15:30 2010
(r209563)
@@ -757,6 +757,7 @@ voiddictAppendUNS  (FICL_DICT *p
 int dictCellsAvail (FICL_DICT *pDict);
 int dictCellsUsed  (FICL_DICT *pDict);
 voiddictCheck  (FICL_DICT *pDict, FICL_VM *pVM, int n);
+voiddictCheckThreshold(FICL_DICT* dp);
 FICL_DICT  *dictCreate(unsigned nCELLS);
 FICL_DICT  *dictCreateHashed(unsigned nCells, unsigned nHash);
 FICL_HASH  *dictCreateWordlist(FICL_DICT *dp, int nBuckets);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209564 - head/etc/mtree

2010-06-28 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 28 08:05:30 2010
New Revision: 209564
URL: http://svn.freebsd.org/changeset/base/209564

Log:
  Use spaces, not tabs.

Modified:
  head/etc/mtree/BSD.usr.dist

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Mon Jun 28 07:15:30 2010(r209563)
+++ head/etc/mtree/BSD.usr.dist Mon Jun 28 08:05:30 2010(r209564)
@@ -1231,15 +1231,15 @@
 pc-sysinstall
 backend
 ..
-   backend-partmanager
+backend-partmanager
 ..
-   backend-query
+backend-query
 ..
-   conf
+conf
 license
-   ..
+..
 ..
-   doc
+doc
 ..
 ..
 security
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209568 - stable/8/sys/netinet

2010-06-28 Thread Michael Tuexen
Author: tuexen
Date: Mon Jun 28 10:50:14 2010
New Revision: 209568
URL: http://svn.freebsd.org/changeset/base/209568

Log:
  MFC r209470,r209499
   * Implement sctp_does_stcb_own_this_addr() correclty. It was taking the
 wrong side into account.
   * sctp_findassociation_ep_addr() must check the local address if available.
   This fixes a bug where ABORT chunks were accepted even in the case where
   the local was not owned by the endpoint.
   Thanks to brucec for pointing out a bug in my first version of the fix.

Modified:
  stable/8/sys/netinet/sctp_pcb.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/netinet/sctp_pcb.c
==
--- stable/8/sys/netinet/sctp_pcb.c Mon Jun 28 08:30:10 2010
(r209567)
+++ stable/8/sys/netinet/sctp_pcb.c Mon Jun 28 10:50:14 2010
(r209568)
@@ -1010,6 +1010,149 @@ sctp_tcb_special_locate(struct sctp_inpc
return (NULL);
 }
 
+static int
+sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to)
+{
+   int loopback_scope, ipv4_local_scope, local_scope, site_scope;
+   int ipv4_addr_legal, ipv6_addr_legal;
+   struct sctp_vrf *vrf;
+   struct sctp_ifn *sctp_ifn;
+   struct sctp_ifa *sctp_ifa;
+
+   loopback_scope = stcb-asoc.loopback_scope;
+   ipv4_local_scope = stcb-asoc.ipv4_local_scope;
+   local_scope = stcb-asoc.local_scope;
+   site_scope = stcb-asoc.site_scope;
+   ipv4_addr_legal = ipv6_addr_legal = 0;
+   if (stcb-sctp_ep-sctp_flags  SCTP_PCB_FLAGS_BOUND_V6) {
+   ipv6_addr_legal = 1;
+   if (SCTP_IPV6_V6ONLY(stcb-sctp_ep) == 0) {
+   ipv4_addr_legal = 1;
+   }
+   } else {
+   ipv4_addr_legal = 1;
+   }
+
+   SCTP_IPI_ADDR_RLOCK();
+   vrf = sctp_find_vrf(stcb-asoc.vrf_id);
+   if (vrf == NULL) {
+   /* no vrf, no addresses */
+   SCTP_IPI_ADDR_RUNLOCK();
+   return (0);
+   }
+   if (stcb-sctp_ep-sctp_flags  SCTP_PCB_FLAGS_BOUNDALL) {
+   LIST_FOREACH(sctp_ifn, vrf-ifnlist, next_ifn) {
+   if ((loopback_scope == 0) 
+   SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) {
+   continue;
+   }
+   LIST_FOREACH(sctp_ifa, sctp_ifn-ifalist, next_ifa) {
+   if (sctp_is_addr_restricted(stcb, sctp_ifa))
+   continue;
+   switch (sctp_ifa-address.sa.sa_family) {
+#ifdef INET
+   case AF_INET:
+   if (ipv4_addr_legal) {
+   struct sockaddr_in *sin,
+  *rsin;
+
+   sin = sctp_ifa-address.sin;
+   rsin = (struct sockaddr_in *)to;
+   if ((ipv4_local_scope == 0) 
+   
IN4_ISPRIVATE_ADDRESS(sin-sin_addr)) {
+   continue;
+   }
+   if (sin-sin_addr.s_addr == 
rsin-sin_addr.s_addr) {
+   SCTP_IPI_ADDR_RUNLOCK();
+   return (1);
+   }
+   }
+   break;
+#endif
+#ifdef INET6
+   case AF_INET6:
+   if (ipv6_addr_legal) {
+   struct sockaddr_in6 *sin6,
+   *rsin6;
+
+   sin6 = sctp_ifa-address.sin6;
+   rsin6 = (struct sockaddr_in6 
*)to;
+   if 
(IN6_IS_ADDR_LINKLOCAL(sin6-sin6_addr)) {
+   if (local_scope == 0)
+   continue;
+   if (sin6-sin6_scope_id 
== 0) {
+   if 
(sa6_recoverscope(sin6) != 0)
+   
continue;
+

svn commit: r209569 - stable/8/sys/dev/ath/ath_hal/ar5416

2010-06-28 Thread Rui Paulo
Author: rpaulo
Date: Mon Jun 28 11:53:22 2010
New Revision: 209569
URL: http://svn.freebsd.org/changeset/base/209569

Log:
  MFC r209541, r209548:
Fix the AR_SREV_MERLIN_20_OR_LATER() check.

Modified:
  stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
==
--- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon Jun 28 10:50:14 
2010(r209568)
+++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon Jun 28 11:53:22 
2010(r209569)
@@ -612,7 +612,7 @@
 AH_PRIVATE((_ah))-ah_macRev == AR_XSREV_REVISION_MERLIN_20)
 #defineAR_SREV_MERLIN_20_OR_LATER(_ah) \
(AR_SREV_MERLIN_20(_ah) || \
-AH_PRIVATE((_ah))-ah_macVersion  AR_XSREV_VERSION_MERLIN)
+AH_PRIVATE((_ah))-ah_macVersion = AR_XSREV_VERSION_MERLIN)
 
 #defineAR_SREV_KITE(_ah) \
(AH_PRIVATE((_ah))-ah_macVersion == AR_XSREV_VERSION_KITE)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209570 - head/usr.bin/tcopy

2010-06-28 Thread Gavin Atkinson
Author: gavin
Date: Mon Jun 28 12:00:20 2010
New Revision: 209570
URL: http://svn.freebsd.org/changeset/base/209570

Log:
  Make WARNS=6 safe, mainly by casting to intmax_t and printing with %ju
  where needed.  Also, fix bad indentation on lines already affected by the
  above changes.
  
  Tested with:  make universe

Modified:
  head/usr.bin/tcopy/Makefile
  head/usr.bin/tcopy/tcopy.c

Modified: head/usr.bin/tcopy/Makefile
==
--- head/usr.bin/tcopy/Makefile Mon Jun 28 11:53:22 2010(r209569)
+++ head/usr.bin/tcopy/Makefile Mon Jun 28 12:00:20 2010(r209570)
@@ -3,6 +3,4 @@
 
 PROG=  tcopy
 
-WARNS?=1
-
 .include bsd.prog.mk

Modified: head/usr.bin/tcopy/tcopy.c
==
--- head/usr.bin/tcopy/tcopy.c  Mon Jun 28 11:53:22 2010(r209569)
+++ head/usr.bin/tcopy/tcopy.c  Mon Jun 28 12:00:20 2010(r209570)
@@ -87,6 +87,7 @@ main(int argc, char *argv[])
 
msg = stdout;
guesslen = 1;
+   outp = -1;
while ((ch = getopt(argc, argv, cs:vx)) != -1)
switch((char)ch) {
case 'c':
@@ -157,16 +158,16 @@ main(int argc, char *argv[])
if (nread = 0)
goto r1;
}
-   err(1, read error, file %d, record %qu, filen, 
record);
+   err(1, read error, file %d, record %ju, filen, 
(intmax_t)record);
} else if (nread != lastnread) {
if (lastnread != 0  lastnread != NOCOUNT) {
if (lastrec == 0  nread == 0)
-   fprintf(msg, %qu records\n, record);
+   fprintf(msg, %ju records\n, 
(intmax_t)record);
else if (record - lastrec  1)
-   fprintf(msg, records %qu to %qu\n,
-   lastrec, record);
+   fprintf(msg, records %ju to %ju\n,
+   (intmax_t)lastrec, 
(intmax_t)record);
else
-   fprintf(msg, record %qu\n, lastrec);
+   fprintf(msg, record %ju\n, 
(intmax_t)lastrec);
}
if (nread != 0)
fprintf(msg, file %d: block size %d: ,
@@ -184,10 +185,12 @@ r1:   guesslen = 0;
nw = write(outp, buff, nread);
if (nw != nread) {
if (nw == -1) {
-   warn(write error, file %d, record 
%qu, filen, record);
+   warn(write error, file %d, 
record %ju, filen,
+   (intmax_t)record);
} else {
-   warnx(write error, file %d, record 
%qu, filen, record);
-   warnx(write (%d) != read (%d), nw, 
nread);
+   warnx(write error, file %d, 
record %ju, filen,
+   (intmax_t)record);
+   warnx(write (%d) != read 
(%d), nw, nread);
}
errx(5, copy aborted);
}
@@ -200,8 +203,8 @@ r1: guesslen = 0;
break;
}
fprintf(msg,
-   file %d: eof after %qu records: %qu bytes\n,
-   filen, record, size);
+   file %d: eof after %ju records: %ju bytes\n,
+   filen, (intmax_t)record, (intmax_t)size);
needeof = 1;
filen++;
tsize += size;
@@ -210,7 +213,7 @@ r1: guesslen = 0;
}
lastnread = nread;
}
-   fprintf(msg, total length: %qu bytes\n, tsize);
+   fprintf(msg, total length: %ju bytes\n, (intmax_t)tsize);
(void)signal(SIGINT, oldsig);
if (op == COPY || op == COPYVERIFY) {
writeop(outp, MTWEOF);
@@ -281,11 +284,11 @@ intr(int signo __unused)
 {
if (record) {
if (record - lastrec  1)
-   fprintf(msg, records %qu to %qu\n, lastrec, record);
+   fprintf(msg, records %ju to %ju\n, (intmax_t)lastrec, 
(intmax_t)record);
else
-   fprintf(msg, record %qu\n, lastrec);
+   

svn commit: r209571 - in head/usr.bin/locate: bigram code

2010-06-28 Thread Gavin Atkinson
Author: gavin
Date: Mon Jun 28 12:04:55 2010
New Revision: 209571
URL: http://svn.freebsd.org/changeset/base/209571

Log:
  Various changes to make locate compilable with WARNS=6.  Note that there
  is still one issue on FreeBSD/arm (signed vs unsigned char) which prevents
  actually bumping this to WARNS=6 - I'm still considering the correct
  solution to this issue.
  
  Tested by:make universe

Modified:
  head/usr.bin/locate/bigram/locate.bigram.c
  head/usr.bin/locate/code/locate.code.c

Modified: head/usr.bin/locate/bigram/locate.bigram.c
==
--- head/usr.bin/locate/bigram/locate.bigram.c  Mon Jun 28 12:00:20 2010
(r209570)
+++ head/usr.bin/locate/bigram/locate.bigram.c  Mon Jun 28 12:04:55 2010
(r209571)
@@ -37,6 +37,7 @@
  * $FreeBSD$
  */
 
+#if 0
 #ifndef lint
 static char copyright[] =
 @(#) Copyright (c) 1989, 1993\n\
@@ -46,6 +47,7 @@ static char copyright[] =
 #ifndef lint
 static char sccsid[] = @(#)locate.bigram.c8.1 (Berkeley) 6/6/93;
 #endif /* not lint */
+#endif
 
 /*
  *  bigram  sorted_file_names | sort -nr | 
@@ -67,9 +69,9 @@ u_int bigram[UCHAR_MAX + 1][UCHAR_MAX + 
 int
 main(void)
 {
-   register u_char *cp;
-   register u_char *oldpath = buf1, *path = buf2;
-   register u_int i, j;
+   u_char *cp;
+   u_char *oldpath = buf1, *path = buf2;
+   u_int i, j;
 
while (fgets(path, sizeof(buf2), stdin) != NULL) {
 

Modified: head/usr.bin/locate/code/locate.code.c
==
--- head/usr.bin/locate/code/locate.code.c  Mon Jun 28 12:00:20 2010
(r209570)
+++ head/usr.bin/locate/code/locate.code.c  Mon Jun 28 12:04:55 2010
(r209571)
@@ -37,6 +37,7 @@
  * $FreeBSD$
  */
 
+#if 0
 #ifndef lint
 static char copyright[] =
 @(#) Copyright (c) 1989, 1993\n\
@@ -46,6 +47,7 @@ static char copyright[] =
 #ifndef lint
 static char sccsid[] = @(#)locate.code.c  8.1 (Berkeley) 6/6/93;
 #endif /* not lint */
+#endif
 
 /*
  * PURPOSE:sorted list compressor (works with a modified 'find'
@@ -122,14 +124,12 @@ int   bgindex(char *);
 void   usage(void);
 
 int
-main(argc, argv)
-   int argc;
-   char *argv[];
+main(int argc, char *argv[])
 {
-   register u_char *cp, *oldpath, *path;
+   u_char *cp, *oldpath, *path;
int ch, code, count, diffcount, oldcount;
+   u_int i, j;
FILE *fp;
-   register int i, j;
 
while ((ch = getopt(argc, argv, )) != -1)
switch(ch) {
@@ -256,10 +256,9 @@ main(argc, argv)
 
 #ifndef LOOKUP
 int
-bgindex(bg)/* Return location of bg in bigrams or -1. */
-   char *bg;
+bgindex(char *bg)  /* Return location of bg in bigrams or -1. */
 {
-   register char bg0, bg1, *p;
+   char bg0, bg1, *p;
 
bg0 = bg[0];
bg1 = bg[1];
@@ -271,7 +270,7 @@ bgindex(bg) /* Return location of bg i
 #endif /* !LOOKUP */
 
 void
-usage()
+usage(void)
 {
(void)fprintf(stderr,
usage: locate.code common_bigrams  list  squozen_list\n);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209572 - stable/8/sys/net80211

2010-06-28 Thread Rui Paulo
Author: rpaulo
Date: Mon Jun 28 12:20:36 2010
New Revision: 209572
URL: http://svn.freebsd.org/changeset/base/209572

Log:
  MFC r209013:
Add missing braces.

Modified:
  stable/8/sys/net80211/ieee80211_hwmp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/net80211/ieee80211_hwmp.c
==
--- stable/8/sys/net80211/ieee80211_hwmp.c  Mon Jun 28 12:04:55 2010
(r209571)
+++ stable/8/sys/net80211/ieee80211_hwmp.c  Mon Jun 28 12:20:36 2010
(r209572)
@@ -707,9 +707,10 @@ hwmp_recv_preq(struct ieee80211vap *vap,
rtorig = ieee80211_mesh_rt_find(vap, preq-preq_origaddr);
if (rtorig == NULL)
rtorig = ieee80211_mesh_rt_add(vap, preq-preq_origaddr);
-   if (rtorig == NULL)
+   if (rtorig == NULL) {
/* XXX stat */
return;
+   }
hrorig = IEEE80211_MESH_ROUTE_PRIV(rtorig, struct ieee80211_hwmp_route);
/*
 * Sequence number validation.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r209567 - head/usr.bin/lock

2010-06-28 Thread Bruce Evans

On Mon, 28 Jun 2010, Gavin Atkinson wrote:


Log:
 Make WARNS=6 safe.


This mainly breaks the warning.


Modified: head/usr.bin/lock/lock.c
==
--- head/usr.bin/lock/lock.cMon Jun 28 08:10:55 2010(r209566)
+++ head/usr.bin/lock/lock.cMon Jun 28 08:30:10 2010(r209567)
@@ -65,6 +65,7 @@ __FBSDID($FreeBSD$);
#include ctype.h
#include errno.h
#include pwd.h
+#include stdint.h


Include to support bogusness below.


#include stdio.h
#include stdlib.h
#include string.h
@@ -257,9 +258,9 @@ hi(int signo __unused)
if (no_timeout) {
(void)putchar('\n');
} else {
-   (void)printf(timeout in %ld:%ld minutes\n,
-   (nexttime - timval.tv_sec) / 60,
-   (nexttime - timval.tv_sec) % 60);
+   (void)printf(timeout in %jd:%jd minutes\n,
+   (intmax_t)(nexttime - timval.tv_sec) / 60,
+   (intmax_t)(nexttime - timval.tv_sec) % 60);


Printing time differences using intmax_t is silly.  They don't need to
work for more than a few days here, but even casting to 16-bit ints
lets them work for 32767 minutes = 546 hours here, while the natural
casts here (of timeval.tv_sec to long) lets them work for 65536 times
longer than that = 4082 years even with 32-bit longs.

Any casts here risk breaking the warnings about type mismatches and
resulting overflows, and in fact there are many in this program.  Here
there is just the promotion of timval.tv_sec to time_t causing the
printf args to normally not match the printf format.  Elsewhere there
are overflow bugs caused by incomplete conversion to time_t, and worse.
Mainly here:

%   nexttime = timval.tv_sec + (sectimeout * 60);

This has about 10 style, type mismatch and overflow bugs, counting other
bugs involving sectimeout, starting with sectimeout not actually being the
seconds timeout (it is the minutes timeout, and scaling it to a seconds
timeout gives overflow bugs).  If the program gets this far without
triggering the bugs, then it has few risks of more, since the residual
timeout is = the original timeout which must be small to work.

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


svn commit: r209573 - stable/7/sys/dev/e1000

2010-06-28 Thread John Baldwin
Author: jhb
Date: Mon Jun 28 14:04:19 2010
New Revision: 209573
URL: http://svn.freebsd.org/changeset/base/209573

Log:
  Remove some gratuitous local diffs.

Modified:
  stable/7/sys/dev/e1000/e1000_regs.h
  stable/7/sys/dev/e1000/if_em.c

Modified: stable/7/sys/dev/e1000/e1000_regs.h
==
--- stable/7/sys/dev/e1000/e1000_regs.h Mon Jun 28 12:20:36 2010
(r209572)
+++ stable/7/sys/dev/e1000/e1000_regs.h Mon Jun 28 14:04:19 2010
(r209573)
@@ -236,7 +236,7 @@
 #define E1000_PRC640x0405C  /* Packets Rx (64 bytes) - R/clr */
 #define E1000_PRC127   0x04060  /* Packets Rx (65-127 bytes) - R/clr */
 #define E1000_PRC255   0x04064  /* Packets Rx (128-255 bytes) - R/clr */
-#define E1000_PRC511   0x04068  /* Packets Rx (255-511 bytes) - R/clr */
+#define E1000_PRC511   0x04068  /* Packets Rx (256-511 bytes) - R/clr */
 #define E1000_PRC1023  0x0406C  /* Packets Rx (512-1023 bytes) - R/clr */
 #define E1000_PRC1522  0x04070  /* Packets Rx (1024-1522 bytes) - R/clr */
 #define E1000_GPRC 0x04074  /* Good Packets Rx Count - R/clr */

Modified: stable/7/sys/dev/e1000/if_em.c
==
--- stable/7/sys/dev/e1000/if_em.c  Mon Jun 28 12:20:36 2010
(r209572)
+++ stable/7/sys/dev/e1000/if_em.c  Mon Jun 28 14:04:19 2010
(r209573)
@@ -2057,8 +2057,8 @@ static void
 em_local_timer(void *arg)
 {
struct adapter  *adapter = arg;
-   struct ifnet*ifp = adapter-ifp;
struct tx_ring  *txr = adapter-tx_rings;
+   struct ifnet *ifp = adapter-ifp;
 
EM_CORE_LOCK_ASSERT(adapter);
 
@@ -3817,7 +3817,6 @@ em_setup_receive_ring(struct rx_ring *rx
bus_dma_segment_t   seg[1];
int rsize, nsegs, error;
 
-
/* Clear the ring contents */
EM_RX_LOCK(rxr);
rsize = roundup2(adapter-num_rx_desc *
@@ -3861,7 +3860,6 @@ em_setup_receive_ring(struct rx_ring *rx
rxr-rx_base[j].buffer_addr = htole64(seg[0].ds_addr);
}
 
-
/* Setup our descriptor indices */
rxr-next_to_check = 0;
rxr-next_to_refresh = 0;
@@ -3984,6 +3982,7 @@ em_free_receive_buffers(struct rx_ring *
  *  Enable receive unit.
  *
  **/
+
 #define MAX_INTS_PER_SEC   8000
 #define DEFAULT_ITR 10/(MAX_INTS_PER_SEC * 256)
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209574 - stable/7/sys/dev/e1000

2010-06-28 Thread John Baldwin
Author: jhb
Date: Mon Jun 28 14:06:44 2010
New Revision: 209574
URL: http://svn.freebsd.org/changeset/base/209574

Log:
  Remove gratuitous whitespace changes accidentally added in the previous
  commit.

Modified:
  stable/7/sys/dev/e1000/e1000_regs.h
  stable/7/sys/dev/e1000/if_em.c

Modified: stable/7/sys/dev/e1000/e1000_regs.h
==
--- stable/7/sys/dev/e1000/e1000_regs.h Mon Jun 28 14:04:19 2010
(r209573)
+++ stable/7/sys/dev/e1000/e1000_regs.h Mon Jun 28 14:06:44 2010
(r209574)
@@ -236,7 +236,7 @@
 #define E1000_PRC640x0405C  /* Packets Rx (64 bytes) - R/clr */
 #define E1000_PRC127   0x04060  /* Packets Rx (65-127 bytes) - R/clr */
 #define E1000_PRC255   0x04064  /* Packets Rx (128-255 bytes) - R/clr */
-#define E1000_PRC511   0x04068  /* Packets Rx (256-511 bytes) - R/clr */
+#define E1000_PRC511   0x04068  /* Packets Rx (255-511 bytes) - R/clr */
 #define E1000_PRC1023  0x0406C  /* Packets Rx (512-1023 bytes) - R/clr */
 #define E1000_PRC1522  0x04070  /* Packets Rx (1024-1522 bytes) - R/clr */
 #define E1000_GPRC 0x04074  /* Good Packets Rx Count - R/clr */

Modified: stable/7/sys/dev/e1000/if_em.c
==
--- stable/7/sys/dev/e1000/if_em.c  Mon Jun 28 14:04:19 2010
(r209573)
+++ stable/7/sys/dev/e1000/if_em.c  Mon Jun 28 14:06:44 2010
(r209574)
@@ -2057,8 +2057,8 @@ static void
 em_local_timer(void *arg)
 {
struct adapter  *adapter = arg;
+   struct ifnet*ifp = adapter-ifp;
struct tx_ring  *txr = adapter-tx_rings;
-   struct ifnet *ifp = adapter-ifp;
 
EM_CORE_LOCK_ASSERT(adapter);
 
@@ -3817,6 +3817,7 @@ em_setup_receive_ring(struct rx_ring *rx
bus_dma_segment_t   seg[1];
int rsize, nsegs, error;
 
+
/* Clear the ring contents */
EM_RX_LOCK(rxr);
rsize = roundup2(adapter-num_rx_desc *
@@ -3860,6 +3861,7 @@ em_setup_receive_ring(struct rx_ring *rx
rxr-rx_base[j].buffer_addr = htole64(seg[0].ds_addr);
}
 
+
/* Setup our descriptor indices */
rxr-next_to_check = 0;
rxr-next_to_refresh = 0;
@@ -3982,7 +3984,6 @@ em_free_receive_buffers(struct rx_ring *
  *  Enable receive unit.
  *
  **/
-
 #define MAX_INTS_PER_SEC   8000
 #define DEFAULT_ITR 10/(MAX_INTS_PER_SEC * 256)
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r209574 - stable/7/sys/dev/e1000

2010-06-28 Thread John Baldwin
On Monday 28 June 2010 10:06:45 am John Baldwin wrote:
 Author: jhb
 Date: Mon Jun 28 14:06:44 2010
 New Revision: 209574
 URL: http://svn.freebsd.org/changeset/base/209574
 
 Log:
   Remove gratuitous whitespace changes accidentally added in the previous
   commit.

*sigh*  In case it wasn't obvious, my previous commit was a misfire where I 
was attempting to remove local diffs to this driver but ended up applying the 
reverse patch and committing it to the wrong tree instead.  :(

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


svn commit: r209575 - releng/8.1/sys/dev/ath/ath_hal/ar5416

2010-06-28 Thread Rui Paulo
Author: rpaulo
Date: Mon Jun 28 14:15:54 2010
New Revision: 209575
URL: http://svn.freebsd.org/changeset/base/209575

Log:
  MFC r209541, r209548:
Fix the AR_SREV_MERLIN_20_OR_LATER() check.
  
  Approved by:  re (kensmith)

Modified:
  releng/8.1/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
Directory Properties:
  releng/8.1/sys/   (props changed)
  releng/8.1/sys/amd64/include/xen/   (props changed)
  releng/8.1/sys/cddl/contrib/opensolaris/   (props changed)
  releng/8.1/sys/contrib/dev/acpica/   (props changed)
  releng/8.1/sys/contrib/pf/   (props changed)
  releng/8.1/sys/dev/ixgbe/   (props changed)
  releng/8.1/sys/dev/xen/xenpci/   (props changed)
  releng/8.1/sys/geom/sched/   (props changed)

Modified: releng/8.1/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
==
--- releng/8.1/sys/dev/ath/ath_hal/ar5416/ar5416reg.h   Mon Jun 28 14:06:44 
2010(r209574)
+++ releng/8.1/sys/dev/ath/ath_hal/ar5416/ar5416reg.h   Mon Jun 28 14:15:54 
2010(r209575)
@@ -612,7 +612,7 @@
 AH_PRIVATE((_ah))-ah_macRev == AR_XSREV_REVISION_MERLIN_20)
 #defineAR_SREV_MERLIN_20_OR_LATER(_ah) \
(AR_SREV_MERLIN_20(_ah) || \
-AH_PRIVATE((_ah))-ah_macVersion  AR_XSREV_VERSION_MERLIN)
+AH_PRIVATE((_ah))-ah_macVersion = AR_XSREV_VERSION_MERLIN)
 
 #defineAR_SREV_KITE(_ah) \
(AH_PRIVATE((_ah))-ah_macVersion == AR_XSREV_VERSION_KITE)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209576 - stable/8/bin/pax

2010-06-28 Thread Xin LI
Author: delphij
Date: Mon Jun 28 17:06:19 2010
New Revision: 209576
URL: http://svn.freebsd.org/changeset/base/209576

Log:
  MFC r205942:
  
  Merge OpenBSD revisions 1.4 through 1.9, mostly style cleanups.
  
  Obtained from:OpenBSD

Modified:
  stable/8/bin/pax/getoldopt.c
Directory Properties:
  stable/8/bin/pax/   (props changed)

Modified: stable/8/bin/pax/getoldopt.c
==
--- stable/8/bin/pax/getoldopt.cMon Jun 28 14:15:54 2010
(r209575)
+++ stable/8/bin/pax/getoldopt.cMon Jun 28 17:06:19 2010
(r209576)
@@ -1,4 +1,4 @@
-/* $OpenBSD: getoldopt.c,v 1.4 2000/01/22 20:24:51 deraadt Exp $   */
+/* $OpenBSD: getoldopt.c,v 1.9 2009/10/27 23:59:22 deraadt Exp $   */
 /* $NetBSD: getoldopt.c,v 1.3 1995/03/21 09:07:28 cgd Exp $*/
 
 /*-
@@ -7,7 +7,7 @@
  * otherwise, it uses the old rules used by tar, dump, and ps.
  *
  * Written 25 August 1985 by John Gilmore (ihnp4!hoptoad!gnu) and placed
- * in the Pubic Domain for your edification and enjoyment.
+ * in the Public Domain for your edification and enjoyment.
  */
 
 #include sys/cdefs.h
@@ -33,7 +33,8 @@ getoldopt(int argc, char **argv, const c
optarg = NULL;
 
if (key == NULL) {  /* First time */
-   if (argc  2) return EOF;
+   if (argc  2)
+   return (-1);
key = argv[1];
if (*key == '-')
use_getopt++;
@@ -42,18 +43,18 @@ getoldopt(int argc, char **argv, const c
}
 
if (use_getopt)
-   return getopt(argc, argv, optstring);
+   return (getopt(argc, argv, optstring));
 
c = *key++;
if (c == '\0') {
key--;
-   return EOF;
+   return (-1);
}
place = strchr(optstring, c);
 
if (place == NULL || c == ':') {
fprintf(stderr, %s: unknown option %c\n, argv[0], c);
-   return('?');
+   return ('?');
}
 
place++;
@@ -64,9 +65,9 @@ getoldopt(int argc, char **argv, const c
} else {
fprintf(stderr, %s: %c argument missing\n,
argv[0], c);
-   return('?');
+   return ('?');
}
}
 
-   return(c);
+   return (c);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209577 - head/sys/kern

2010-06-28 Thread Attilio Rao
Author: attilio
Date: Mon Jun 28 17:45:00 2010
New Revision: 209577
URL: http://svn.freebsd.org/changeset/base/209577

Log:
  Fix a lock leak in the deadlock resolver in case the ticks counter
  wrapped up.
  
  Sponsored by: Sandvine Incorporated
  Submitted by: pluknet pluknet at gmail dot com
  Reported by:  Anton Yuzhaninov citrin at citrin dot ru
  Reviewed by:  jhb
  MFC after:3 days

Modified:
  head/sys/kern/kern_clock.c

Modified: head/sys/kern/kern_clock.c
==
--- head/sys/kern/kern_clock.c  Mon Jun 28 17:06:19 2010(r209576)
+++ head/sys/kern/kern_clock.c  Mon Jun 28 17:45:00 2010(r209577)
@@ -213,8 +213,10 @@ deadlkres(void)
MPASS(td-td_blocked != NULL);
 
/* Handle ticks wrap-up. */
-   if (ticks  td-td_blktick)
+   if (ticks  td-td_blktick) {
+   thread_unlock(td);
continue;
+   }
tticks = ticks - td-td_blktick;
thread_unlock(td);
if (tticks  blkticks) {
@@ -233,8 +235,10 @@ deadlkres(void)
} else if (TD_IS_SLEEPING(td)) {
 
/* Handle ticks wrap-up. */
-   if (ticks  td-td_blktick)
+   if (ticks  td-td_blktick) {
+   thread_unlock(td);
continue;
+   }
 
/*
 * Check if the thread is sleeping on a
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209578 - head/sys/sys

2010-06-28 Thread Konstantin Belousov
Author: kib
Date: Mon Jun 28 17:59:45 2010
New Revision: 209578
URL: http://svn.freebsd.org/changeset/base/209578

Log:
  Use C99 initializers for the struct sysent generated by MAKE_SYSENT().
  
  MFC after:1 week

Modified:
  head/sys/sys/sysent.h

Modified: head/sys/sys/sysent.h
==
--- head/sys/sys/sysent.h   Mon Jun 28 17:45:00 2010(r209577)
+++ head/sys/sys/sysent.h   Mon Jun 28 17:59:45 2010(r209578)
@@ -144,10 +144,10 @@ struct syscall_module_data {
 
 #defineMAKE_SYSENT(syscallname)\
 static struct sysent syscallname##_sysent = {  \
-   (sizeof(struct syscallname ## _args )   \
+   .sy_narg = (sizeof(struct syscallname ## _args )\
/ sizeof(register_t)),  \
-   (sy_call_t *) syscallname, \
-   SYS_AUE_##syscallname   \
+   .sy_call = (sy_call_t *) syscallname,  \
+   .sy_auevent = SYS_AUE_##syscallname,\
 }
 
 #define SYSCALL_MODULE(name, offset, new_sysent, evh, arg) \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209579 - in head/sys: compat/freebsd32 kern sys

2010-06-28 Thread Konstantin Belousov
Author: kib
Date: Mon Jun 28 18:06:46 2010
New Revision: 209579
URL: http://svn.freebsd.org/changeset/base/209579

Log:
  Count number of threads that enter and leave dynamically registered
  syscalls. On the dynamic syscall deregistration, wait until all
  threads leave the syscall code. This somewhat increases the safety
  of the loadable modules unloading.
  
  Reviewed by:  jhb
  Tested by:pho
  MFC after:1 month

Modified:
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/kern_syscalls.c
  head/sys/kern/makesyscalls.sh
  head/sys/kern/subr_trap.c
  head/sys/kern/syscalls.master
  head/sys/sys/sysent.h

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Mon Jun 28 17:59:45 2010
(r209578)
+++ head/sys/compat/freebsd32/syscalls.master   Mon Jun 28 18:06:46 2010
(r209579)
@@ -386,16 +386,16 @@
 ;
 ; The following are reserved for loadable syscalls
 ;
-210AUE_NULLNODEF   lkmnosys lkmnosys nosys_args int
-211AUE_NULLNODEF   lkmnosys lkmnosys nosys_args int
-212AUE_NULLNODEF   lkmnosys lkmnosys nosys_args int
-213AUE_NULLNODEF   lkmnosys lkmnosys nosys_args int
-214AUE_NULLNODEF   lkmnosys lkmnosys nosys_args int
-215AUE_NULLNODEF   lkmnosys lkmnosys nosys_args int
-216AUE_NULLNODEF   lkmnosys lkmnosys nosys_args int
-217AUE_NULLNODEF   lkmnosys lkmnosys nosys_args int
-218AUE_NULLNODEF   lkmnosys lkmnosys nosys_args int
-219AUE_NULLNODEF   lkmnosys lkmnosys nosys_args int
+210AUE_NULLNODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int
+211AUE_NULLNODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int
+212AUE_NULLNODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int
+213AUE_NULLNODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int
+214AUE_NULLNODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int
+215AUE_NULLNODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int
+216AUE_NULLNODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int
+217AUE_NULLNODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int
+218AUE_NULLNODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int
+219AUE_NULLNODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int
 
 ;
 ; The following were introduced with NetBSD/4.4Lite-2

Modified: head/sys/kern/kern_syscalls.c
==
--- head/sys/kern/kern_syscalls.c   Mon Jun 28 17:59:45 2010
(r209578)
+++ head/sys/kern/kern_syscalls.c   Mon Jun 28 18:06:46 2010
(r209579)
@@ -28,12 +28,15 @@
 __FBSDID($FreeBSD$);
 
 #include sys/param.h
+#include sys/kernel.h
 #include sys/lock.h
 #include sys/module.h
 #include sys/sx.h
 #include sys/syscall.h
 #include sys/sysent.h
 #include sys/sysproto.h
+#include sys/systm.h
+#include machine/atomic.h
 
 /*
  * Acts like nosys but can be identified in sysent for dynamic call
@@ -55,6 +58,51 @@ lkmressys(struct thread *td, struct nosy
return (nosys(td, args));
 }
 
+static void
+syscall_thread_drain(struct sysent *se)
+{
+   u_int32_t cnt, oldcnt;
+
+   do {
+   oldcnt = se-sy_thrcnt;
+   KASSERT((oldcnt  SY_THR_STATIC) == 0,
+   (drain on static syscall));
+   cnt = oldcnt | SY_THR_DRAINING;
+   } while (atomic_cmpset_acq_32(se-sy_thrcnt, oldcnt, cnt) == 0);
+   while (atomic_cmpset_32(se-sy_thrcnt, SY_THR_DRAINING,
+   SY_THR_ABSENT) == 0)
+   pause(scdrn, hz/2);
+}
+
+int
+syscall_thread_enter(struct thread *td, struct sysent *se)
+{
+   u_int32_t cnt, oldcnt;
+
+   do {
+   oldcnt = se-sy_thrcnt;
+   if ((oldcnt  SY_THR_STATIC) != 0)
+   return (0);
+   if ((oldcnt  (SY_THR_DRAINING | SY_THR_ABSENT)) != 0)
+   return (ENOSYS);
+   cnt = oldcnt + SY_THR_INCR;
+   } while (atomic_cmpset_acq_32(se-sy_thrcnt, oldcnt, cnt) == 0);
+   return (0);
+}
+
+void
+syscall_thread_exit(struct thread *td, struct sysent *se)
+{
+   u_int32_t cnt, oldcnt;
+
+   do {
+   oldcnt = se-sy_thrcnt;
+   if ((oldcnt  SY_THR_STATIC) != 0)
+   return;
+   cnt = oldcnt - SY_THR_INCR;
+   } while (atomic_cmpset_rel_32(se-sy_thrcnt, oldcnt, cnt) == 0);
+}
+
 int
 syscall_register(int *offset, struct sysent *new_sysent,
 struct sysent *old_sysent)
@@ -74,8 +122,12 @@ syscall_register(int *offset, struct sys
sysent[*offset].sy_call != (sy_call_t *)lkmressys)
return (EEXIST);
 
+   KASSERT(sysent[*offset].sy_thrcnt == SY_THR_ABSENT,
+   (dynamic syscall is not protected));
*old_sysent = sysent[*offset];
+   new_sysent-sy_thrcnt = SY_THR_ABSENT;

svn commit: r209580 - head/sys/kern

2010-06-28 Thread Konstantin Belousov
Author: kib
Date: Mon Jun 28 18:12:42 2010
New Revision: 209580
URL: http://svn.freebsd.org/changeset/base/209580

Log:
  Despite system call deregistration drains the threads executing System V
  shm syscalls, and initial check for the number of allocated segments
  in the module deinitialization code, the following might happen:
 after the check for active segment, while waiting for threads to
 leave some other syscall, shmget(2) is called. Then, we can end
 up with the shared segment that cannot be detached since sysvshm
 module is unloaded.
  
  Prevent the leak by rechecking and disclaiming a reference to the vm
  object owned by sysvshm module, that might have grown during the drain.
  
  Tested by:pho
  Reviewed by:  jhb
  MFC after:1 month

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==
--- head/sys/kern/sysv_shm.cMon Jun 28 18:06:46 2010(r209579)
+++ head/sys/kern/sysv_shm.cMon Jun 28 18:12:42 2010(r209580)
@@ -919,10 +919,18 @@ shmunload()
 #endif
syscall_helper_unregister(shm_syscalls);
 
+   for (i = 0; i  shmalloced; i++) {
 #ifdef MAC
-   for (i = 0; i  shmalloced; i++)
mac_sysvshm_destroy(shmsegs[i]);
 #endif
+   /*
+* Objects might be still mapped into the processes
+* address spaces.  Actual free would happen on the
+* last mapping destruction.
+*/
+   if (shmsegs[i].u.shm_perm.mode != SHMSEG_FREE)
+   vm_object_deallocate(shmsegs[i].object);
+   }
free(shmsegs, M_SHM);
shmexit_hook = NULL;
shmfork_hook = NULL;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209582 - head/sys/kern

2010-06-28 Thread Doug Barton
Author: dougb
Date: Tue Jun 29 01:04:24 2010
New Revision: 209582
URL: http://svn.freebsd.org/changeset/base/209582

Log:
  If i is going to be used in the loop unconditionally the declaration
  has to be unconditional as well.
  
  Conical head covering to: kib

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==
--- head/sys/kern/sysv_shm.cMon Jun 28 18:17:21 2010(r209581)
+++ head/sys/kern/sysv_shm.cTue Jun 29 01:04:24 2010(r209582)
@@ -907,9 +907,7 @@ shminit()
 static int
 shmunload()
 {
-#ifdef MAC
int i;  
-#endif
 
if (shm_nused  0)
return (EBUSY);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r209582 - head/sys/kern

2010-06-28 Thread Doug Barton
On 06/28/10 18:04, Doug Barton wrote:
 Author: dougb
 Date: Tue Jun 29 01:04:24 2010
 New Revision: 209582
 URL: http://svn.freebsd.org/changeset/base/209582
 
 Log:
   If i is going to be used in the loop unconditionally the declaration
   has to be unconditional as well.
   
   Conical head covering to:   kib

Hopefully it's clear to everyone that this is gentle ribbing, as opposed
to criticism. If the fix is so easy even *I* can figure it out, it truly
deserves a pointy hat. :)


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/

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


Re: svn commit: r209582 - head/sys/kern

2010-06-28 Thread Garrett Cooper
On Mon, Jun 28, 2010 at 6:42 PM, Doug Barton do...@freebsd.org wrote:
 On 06/28/10 18:04, Doug Barton wrote:
 Author: dougb
 Date: Tue Jun 29 01:04:24 2010
 New Revision: 209582
 URL: http://svn.freebsd.org/changeset/base/209582

 Log:
   If i is going to be used in the loop unconditionally the declaration
   has to be unconditional as well.

   Conical head covering to:   kib

 Hopefully it's clear to everyone that this is gentle ribbing, as opposed
 to criticism. If the fix is so easy even *I* can figure it out, it truly
 deserves a pointy hat. :)

Ah, but Doug likes hats...! He just hates cones:
http://faiththemutt.files.wordpress.com/2010/02/tumblr_kt24jwbmrb1qzyz6ko1_500.jpg
:(...
-Garrett
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r208752 - head/sys/cam

2010-06-28 Thread Matthew Jacob

On 6/28/2010 2:23 PM, Chagin Dmitry wrote:

On Wed, Jun 02, 2010 at 06:06:32PM +, Matt Jacob wrote:
   

Author: mjacob
Date: Wed Jun  2 18:06:32 2010
New Revision: 208752
URL: http://svn.freebsd.org/changeset/base/208752

Log:
   Protect periph drivers list and rearrange things to minimize the chance of
   stepping oneself during probing.

   Don't blindly decrement a periph probe count.

 


This commit causes a kernel panic on cdrecord -scanbus:


   


A 'camcontrol devlist -v' on this system would be helpful.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org