svn commit: r230204 - head/sys/dev/usb/serial

2012-01-16 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan 16 08:13:25 2012
New Revision: 230204
URL: http://svn.freebsd.org/changeset/base/230204

Log:
  Export information about USB serial port unit and port numbers
  directly via the sysctl interface.
  
  Submitted by: Mykhaylo Yehorov
  PR:   usb/164090
  MFC after:1 week

Modified:
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/serial/usb_serial.h

Modified: head/sys/dev/usb/serial/usb_serial.c
==
--- head/sys/dev/usb/serial/usb_serial.cMon Jan 16 07:02:59 2012
(r230203)
+++ head/sys/dev/usb/serial/usb_serial.cMon Jan 16 08:13:25 2012
(r230204)
@@ -292,6 +292,16 @@ ucom_detach(struct ucom_super_softc *ssc
if (ssc-sc_subunits == 0)
return; /* not initialized */
 
+   if (ssc-sc_sysctl_ttyunit != NULL) {
+   sysctl_remove_oid(ssc-sc_sysctl_ttyunit, 1, 0);
+   ssc-sc_sysctl_ttyunit = NULL;
+   }
+
+   if (ssc-sc_sysctl_ttyports != NULL) {
+   sysctl_remove_oid(ssc-sc_sysctl_ttyports, 1, 0);
+   ssc-sc_sysctl_ttyports = NULL;
+   }
+
usb_proc_drain(ssc-sc_tq);
 
for (subunit = 0; subunit  ssc-sc_subunits; subunit++) {
@@ -420,19 +430,36 @@ ucom_detach_tty(struct ucom_softc *sc)
 void
 ucom_set_pnpinfo_usb(struct ucom_super_softc *ssc, device_t dev)
 {
-char buf[64];
-uint8_t iface_index;
-struct usb_attach_arg *uaa;
-
-snprintf(buf, sizeof(buf), ttyname=%s%d ttyports=%d,
-UCOM_TTY_PREFIX, ssc-sc_unit, ssc-sc_subunits);
-
-/* Store the PNP info in the first interface for the dev */
-uaa = device_get_ivars(dev);
-iface_index = uaa-info.bIfaceIndex;
+   char buf[64];
+   uint8_t iface_index;
+   struct usb_attach_arg *uaa;
+
+   snprintf(buf, sizeof(buf), ttyname=%s%d ttyports=%d,
+   UCOM_TTY_PREFIX, ssc-sc_unit, ssc-sc_subunits);
+
+   /* Store the PNP info in the first interface for the device */
+   uaa = device_get_ivars(dev);
+   iface_index = uaa-info.bIfaceIndex;
 
-if (usbd_set_pnpinfo(uaa-device, iface_index, buf) != 0)
-   device_printf(dev, Could not set PNP info\n);
+   if (usbd_set_pnpinfo(uaa-device, iface_index, buf) != 0)
+   device_printf(dev, Could not set PNP info\n);
+
+   /*
+* The following information is also replicated in the pnp-info
+* string which is registered above:
+*/
+   if (ssc-sc_sysctl_ttyunit == NULL) {
+   ssc-sc_sysctl_ttyunit = SYSCTL_ADD_INT(NULL,
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+   OID_AUTO, ttyunit, CTLFLAG_RD,
+   NULL, ssc-sc_unit, TTY unit number);
+   }
+   if (ssc-sc_sysctl_ttyports == NULL) {
+   ssc-sc_sysctl_ttyports = SYSCTL_ADD_INT(NULL,
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+   OID_AUTO, ttyports, CTLFLAG_RD,
+   NULL, ssc-sc_subunits, Number of ports);
+   }
 }
 
 static void

Modified: head/sys/dev/usb/serial/usb_serial.h
==
--- head/sys/dev/usb/serial/usb_serial.hMon Jan 16 07:02:59 2012
(r230203)
+++ head/sys/dev/usb/serial/usb_serial.hMon Jan 16 08:13:25 2012
(r230204)
@@ -70,6 +70,7 @@
 #include sys/tty.h
 #include sys/serial.h
 #include sys/fcntl.h
+#include sys/sysctl.h
 
 /* Module interface related macros */
 #defineUCOM_MODVER 1
@@ -132,8 +133,10 @@ struct ucom_param_task {
 
 struct ucom_super_softc {
struct usb_process sc_tq;
-   uint32_t sc_unit;
-   uint32_t sc_subunits;
+   int sc_unit;
+   int sc_subunits;
+   struct sysctl_oid *sc_sysctl_ttyunit;
+   struct sysctl_oid *sc_sysctl_ttyports;
 };
 
 struct ucom_softc {
___
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: r230205 - in stable/8: lib/libkiconv sys/conf sys/fs/msdosfs sys/fs/smbfs sys/libkern sys/modules/libiconv sys/modules/libmchain sys/netsmb sys/sys

2012-01-16 Thread Kevin Lo
Author: kevlo
Date: Mon Jan 16 08:29:52 2012
New Revision: 230205
URL: http://svn.freebsd.org/changeset/base/230205

Log:
  MFC r228796:
  Discarding local array based on return values.
  
  MFC r227650:
  Add unicode support to msdosfs and smbfs; original pathes from imura,
  bug fixes by Kuan-Chung Chiu buganini at gmail dot com.

Added:
  stable/8/sys/libkern/iconv_ucs.c   (contents, props changed)
Modified:
  stable/8/lib/libkiconv/xlat16_iconv.c
  stable/8/sys/conf/files
  stable/8/sys/fs/msdosfs/msdosfs_conv.c
  stable/8/sys/fs/smbfs/smbfs_smb.c
  stable/8/sys/fs/smbfs/smbfs_subr.c
  stable/8/sys/libkern/iconv.c
  stable/8/sys/modules/libiconv/Makefile
  stable/8/sys/modules/libmchain/Makefile
  stable/8/sys/netsmb/smb_conn.c
  stable/8/sys/netsmb/smb_conn.h
  stable/8/sys/netsmb/smb_smb.c
  stable/8/sys/netsmb/smb_subr.c
  stable/8/sys/sys/iconv.h
  stable/8/sys/sys/mchain.h

Modified: stable/8/lib/libkiconv/xlat16_iconv.c
==
--- stable/8/lib/libkiconv/xlat16_iconv.c   Mon Jan 16 08:13:25 2012
(r230204)
+++ stable/8/lib/libkiconv/xlat16_iconv.c   Mon Jan 16 08:29:52 2012
(r230205)
@@ -74,6 +74,18 @@ kiconv_add_xlat16_cspair(const char *toc
struct xlat16_table xt;
void *data;
char *p;
+   const char unicode[] = ENCODING_UNICODE;
+
+   if ((flag  KICONV_WCTYPE) == 0 
+   strcmp(unicode, tocode) != 0 
+   strcmp(unicode, fromcode) != 0 
+   kiconv_lookupconv(unicode) == 0) {
+   error = kiconv_add_xlat16_cspair(unicode, fromcode, flag);
+   if (error)
+   return (-1);
+   error = kiconv_add_xlat16_cspair(tocode, unicode, flag);
+   return (error);
+   }
 
if (kiconv_lookupcs(tocode, fromcode) == 0)
return (0);

Modified: stable/8/sys/conf/files
==
--- stable/8/sys/conf/files Mon Jan 16 08:13:25 2012(r230204)
+++ stable/8/sys/conf/files Mon Jan 16 08:29:52 2012(r230205)
@@ -2366,6 +2366,7 @@ libkern/fnmatch.c standard
 libkern/gets.c standard
 libkern/iconv.coptional libiconv
 libkern/iconv_converter_if.m   optional libiconv
+libkern/iconv_ucs.coptional libiconv
 libkern/iconv_xlat.c   optional libiconv
 libkern/iconv_xlat16.c optional libiconv
 libkern/index.cstandard

Modified: stable/8/sys/fs/msdosfs/msdosfs_conv.c
==
--- stable/8/sys/fs/msdosfs/msdosfs_conv.c  Mon Jan 16 08:13:25 2012
(r230204)
+++ stable/8/sys/fs/msdosfs/msdosfs_conv.c  Mon Jan 16 08:29:52 2012
(r230205)
@@ -61,9 +61,9 @@
 extern struct iconv_functions *msdosfs_iconv;
 
 static int mbsadjpos(const char **, size_t, size_t, int, int, void *handle);
-static u_int16_t dos2unixchr(const u_char **, size_t *, int, struct 
msdosfsmount *);
+static u_char * dos2unixchr(u_char *, const u_char **, size_t *, int, struct 
msdosfsmount *);
 static u_int16_t unix2doschr(const u_char **, size_t *, struct msdosfsmount *);
-static u_int16_t win2unixchr(u_int16_t, struct msdosfsmount *);
+static u_char * win2unixchr(u_char *, u_int16_t, struct msdosfsmount *);
 static u_int16_t unix2winchr(const u_char **, size_t *, int, struct 
msdosfsmount *);
 
 /*
@@ -242,7 +242,7 @@ dos2unixfn(dn, un, lower, pmp)
 {
size_t i;
int thislong = 0;
-   u_int16_t c;
+   u_char *c, tmpbuf[5];
 
/*
 * If first char of the filename is SLOT_E5 (0x05), then the real
@@ -257,14 +257,12 @@ dos2unixfn(dn, un, lower, pmp)
 * Copy the name portion into the unix filename string.
 */
for (i = 8; i  0  *dn != ' ';) {
-   c = dos2unixchr((const u_char **)dn, i, lower  LCASE_BASE,
-   pmp);
-   if (c  0xff00) {
-   *un++ = c  8;
+   c = dos2unixchr(tmpbuf, (const u_char **)dn, i,
+   lower  LCASE_BASE, pmp);
+   while (*c != '\0') {
+   *un++ = *c++;
thislong++;
}
-   *un++ = c;
-   thislong++;
}
dn += i;
 
@@ -276,14 +274,12 @@ dos2unixfn(dn, un, lower, pmp)
*un++ = '.';
thislong++;
for (i = 3; i  0  *dn != ' ';) {
-   c = dos2unixchr((const u_char **)dn, i,
+   c = dos2unixchr(tmpbuf, (const u_char **)dn, i,
lower  LCASE_EXT, pmp);
-   if (c  0xff00) {
-   *un++ = c  8;
+   while (*c != '\0') {
+   *un++ = *c++;
thislong++;
 

svn commit: r230206 - stable/8/sys/fs/ntfs

2012-01-16 Thread Kevin Lo
Author: kevlo
Date: Mon Jan 16 08:31:32 2012
New Revision: 230206
URL: http://svn.freebsd.org/changeset/base/230206

Log:
  MFC r228864:
  Discard local array based on return values.
  
  Pointed out by:   uqs
  Found with:   Coverity Prevent(tm)
  CID:  10089
  
  MFC 228023:
  Add unicode support to ntfs
  
  Obtained from:imura

Modified:
  stable/8/sys/fs/ntfs/ntfs_subr.c
  stable/8/sys/fs/ntfs/ntfs_subr.h
  stable/8/sys/fs/ntfs/ntfs_vnops.c

Modified: stable/8/sys/fs/ntfs/ntfs_subr.c
==
--- stable/8/sys/fs/ntfs/ntfs_subr.cMon Jan 16 08:29:52 2012
(r230205)
+++ stable/8/sys/fs/ntfs/ntfs_subr.cMon Jan 16 08:31:32 2012
(r230206)
@@ -666,23 +666,18 @@ ntfs_uastricmp(ntmp, ustr, ustrlen, astr
const char *astr;
size_t astrlen;
 {
-   int len;
+   const char *astrp = astr;
+   char tmpbuf[5];
+   int len, res;
size_t i, j, mbstrlen = astrlen;
-   int res;
-   wchar wc;
 
if (ntmp-ntm_ic_l2u) {
-   for (i = 0, j = 0; i  ustrlen  j  astrlen; i++, j++) {
-   if (j  astrlen -1) {
-   wc = (wchar)astr[j]8 | (astr[j+1]0xFF);
-   len = 2;
-   } else {
-   wc = (wchar)astr[j]8  0xFF00;
-   len = 1;
-   }
+   for (i = 0, j = 0; i  ustrlen  j  astrlen; i++) {
+   len = 4;
res = ((int) NTFS_TOUPPER(ustr[i])) -
-   ((int)NTFS_TOUPPER(NTFS_82U(wc, len)));
-   j += len - 1;
+   ((int)NTFS_TOUPPER(NTFS_82U(astrp, len)));
+   astrp += len;
+   j += len;
mbstrlen -= len - 1;
 
if (res)
@@ -695,7 +690,8 @@ ntfs_uastricmp(ntmp, ustr, ustrlen, astr
 */
for (i = 0; i  ustrlen  i  astrlen; i++) {
res = ((int) NTFS_TOUPPER(NTFS_82U(NTFS_U28(ustr[i]), 
len))) -
-   ((int)NTFS_TOUPPER(NTFS_82U((wchar)astr[i], 
len)));
+   ((int)NTFS_TOUPPER(NTFS_82U(astrp, len)));
+   astrp++;
if (res)
return res;
}
@@ -714,23 +710,18 @@ ntfs_uastrcmp(ntmp, ustr, ustrlen, astr,
const char *astr;
size_t astrlen;
 {
-   char u, l;
+   char *c, tmpbuf[5];
size_t i, j, mbstrlen = astrlen;
int res;
-   wchar wc;
 
-   for (i = 0, j = 0; (i  ustrlen)  (j  astrlen); i++, j++) {
-   res = 0;
-   wc = NTFS_U28(ustr[i]);
-   u = (char)(wc8);
-   l = (char)wc;
-   if (u != '\0'  j  astrlen -1) {
-   res = (int) (u - astr[j++]);
+   for (i = 0, j = 0; (i  ustrlen)  (j  astrlen); i++, mbstrlen++) {
+   c = NTFS_U28(ustr[i]);
+   while (*c != '\0') {
+   res = (int) (*c++ - astr[j++]);
+   if (res)
+   return res;
mbstrlen--;
}
-   res = (res8) + (int) (l - astr[j]);
-   if (res)
-   return res;
}
return (ustrlen - mbstrlen);
 }
@@ -2131,50 +2122,48 @@ ntfs_82u_uninit(struct ntfsmount *ntmp)
 }
 
 /*
- * maps the Unicode char to 8bit equivalent
- * XXX currently only gets lower 8bit from the Unicode char
- * and substitutes a '_' for it if the result would be '\0';
- * something better has to be definitely though out
+ * maps the Unicode char to local character
  */
-wchar
+char *
 ntfs_u28(
+   char *outbuf,
struct ntfsmount *ntmp, 
wchar wc)
 {
-   char *p, *outp, inbuf[3], outbuf[3];
+   char *p, *outp, inbuf[3];
size_t ilen, olen;
 
+   outp = outbuf;
if (ntfs_iconv  ntmp-ntm_ic_u2l) {
-   ilen = olen = 2;
+   ilen = 2;
+   olen = 4;
 
inbuf[0] = (char)(wc8);
inbuf[1] = (char)wc;
inbuf[2] = '\0';
p = inbuf;
-   outp = outbuf;
ntfs_iconv-convchr(ntmp-ntm_ic_u2l, (const char **)p, ilen,
outp, olen);
-   if (olen == 1) {
-   return ((wchar)(outbuf[0]0xFF));
-   } else if (olen == 0) {
-   return ((wchar)((outbuf[0]8) | (outbuf[1]0xFF)));
-   }
-   return ('?');
+   if (olen == 4)
+   *outp++ = '?';
+   *outp = '\0';
+   outp = outbuf;
+   return (outp);
}
 
p = ntmp-ntm_u28[(wc8)0xFF];
-   if (p == NULL)
- 

Re: svn commit: r230191 - in head: lib/libc/arm/gen sys/arm/include

2012-01-16 Thread Kostik Belousov
On Sun, Jan 15, 2012 at 11:11:43PM -0500, David Schultz wrote:
 On Mon, Jan 16, 2012, David Schultz wrote:
  Author: das
  Date: Mon Jan 16 04:08:29 2012
  New Revision: 230191
  URL: http://svn.freebsd.org/changeset/base/230191
  
  Log:
Implement FLT_ROUNDS for arm.  Some (all?) arm FPUs lack support  for
dynamic rounding modes, but FPUless chips that use softfloat can support 
  it
because everything is emulated anyway.  (We presently have incomplete
support for hardware FPUs.)

Submitted by: Ian Lepore
 
 Incidentally, all of gcc's hooks into softfloat should probably be in
 the public symbol namespace instead of FBSDprivate.  The compiler generates
 references to them, so we cannot claim that they are internal, unsupported
 interfaces.  I assume that moving them will not break the ABI because
 FreeBSDprivate includes FBSD_X, but I haven't tested this.  Any objections
 to moving them?  Affects arm and mips.

Move will break the ABI. Namespace inheritance is ignored when searching
the symbol match.

On the other hand. FBSDprivate_1.0 is explicitely created to be changed,
so removal of the symbols from this namespace if fine from the POV of
the project policy.

Another argument is that both MIPS and ARM are the second-tier architectures,
and again, project policy allows ABI breakage.


pgpZTnEVlhKjv.pgp
Description: PGP signature


svn commit: r230207 - in head/sys: netinet sys

2012-01-16 Thread Gleb Smirnoff
Author: glebius
Date: Mon Jan 16 09:53:24 2012
New Revision: 230207
URL: http://svn.freebsd.org/changeset/base/230207

Log:
  Drop support for SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFDSTADDR
  ioctl commands.
  
  PR:   163524
  Reviewed by:  net

Modified:
  head/sys/netinet/in.c
  head/sys/sys/param.h

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Mon Jan 16 08:31:32 2012(r230206)
+++ head/sys/netinet/in.c   Mon Jan 16 09:53:24 2012(r230207)
@@ -73,7 +73,7 @@ static int in_lifaddr_ioctl(struct socke
 
 static voidin_socktrim(struct sockaddr_in *);
 static int in_ifinit(struct ifnet *, struct in_ifaddr *,
-   struct sockaddr_in *, int, int, int);
+   struct sockaddr_in *, int, int);
 static voidin_purgemaddrs(struct ifnet *);
 
 static VNET_DEFINE(int, nosameprefix);
@@ -220,7 +220,6 @@ in_control(struct socket *so, u_long cmd
struct in_addr dst;
struct in_ifinfo *ii;
struct in_aliasreq *ifra = (struct in_aliasreq *)data;
-   struct sockaddr_in oldaddr;
int error, hostIsNew, iaIsNew, maskIsNew;
int iaIsFirst;
u_long ocmd = cmd;
@@ -278,10 +277,8 @@ in_control(struct socket *so, u_long cmd
case SIOCSIFBRDADDR:
case SIOCSIFDSTADDR:
case SIOCSIFNETMASK:
-   if (ifr-ifr_addr.sa_family != AF_INET ||
-   ifr-ifr_addr.sa_len != sizeof(struct sockaddr_in))
-   return (EINVAL);
-   break;
+   /* We no longer support that old commands. */
+   return (EINVAL);
 
case SIOCALIFADDR:
if (td != NULL) {
@@ -322,10 +319,6 @@ in_control(struct socket *so, u_long cmd
 */
switch (cmd) {
case SIOCAIFADDR:
-   case SIOCSIFADDR:
-   case SIOCSIFBRDADDR:
-   case SIOCSIFNETMASK:
-   case SIOCSIFDSTADDR:
if (td != NULL) {
error = priv_check(td, PRIV_NET_ADDIFADDR);
if (error)
@@ -413,10 +406,6 @@ in_control(struct socket *so, u_long cmd
error = EADDRNOTAVAIL;
goto out;
}
-   /* FALLTHROUGH */
-   case SIOCSIFADDR:
-   case SIOCSIFNETMASK:
-   case SIOCSIFDSTADDR:
if (ia == NULL) {
ia = (struct in_ifaddr *)
malloc(sizeof *ia, M_IFADDR, M_NOWAIT |
@@ -452,7 +441,6 @@ in_control(struct socket *so, u_long cmd
}
break;
 
-   case SIOCSIFBRDADDR:
case SIOCGIFADDR:
case SIOCGIFNETMASK:
case SIOCGIFDSTADDR:
@@ -493,61 +481,6 @@ in_control(struct socket *so, u_long cmd
*((struct sockaddr_in *)ifr-ifr_addr) = ia-ia_sockmask;
goto out;
 
-   case SIOCSIFDSTADDR:
-   if ((ifp-if_flags  IFF_POINTOPOINT) == 0) {
-   error = EINVAL;
-   goto out;
-   }
-   oldaddr = ia-ia_dstaddr;
-   ia-ia_dstaddr = *(struct sockaddr_in *)ifr-ifr_dstaddr;
-   if (ifp-if_ioctl != NULL) {
-   error = (*ifp-if_ioctl)(ifp, SIOCSIFDSTADDR,
-   (caddr_t)ia);
-   if (error) {
-   ia-ia_dstaddr = oldaddr;
-   goto out;
-   }
-   }
-   if (ia-ia_flags  IFA_ROUTE) {
-   ia-ia_ifa.ifa_dstaddr = (struct sockaddr *)oldaddr;
-   rtinit((ia-ia_ifa), (int)RTM_DELETE, RTF_HOST);
-   ia-ia_ifa.ifa_dstaddr =
-   (struct sockaddr *)ia-ia_dstaddr;
-   rtinit((ia-ia_ifa), (int)RTM_ADD, RTF_HOST|RTF_UP);
-   }
-   goto out;
-
-   case SIOCSIFBRDADDR:
-   if ((ifp-if_flags  IFF_BROADCAST) == 0) {
-   error = EINVAL;
-   goto out;
-   }
-   ia-ia_broadaddr = *(struct sockaddr_in *)ifr-ifr_broadaddr;
-   goto out;
-
-   case SIOCSIFADDR:
-   error = in_ifinit(ifp, ia,
-   (struct sockaddr_in *) ifr-ifr_addr, 1, 0, 0);
-   if (error != 0  iaIsNew)
-   break;
-   if (error == 0) {
-   ii = ((struct in_ifinfo *)ifp-if_afdata[AF_INET]);
-   if (iaIsFirst 
-   (ifp-if_flags  IFF_MULTICAST) != 0) {
-   error = in_joingroup(ifp, allhosts_addr,
-   NULL, ii-ii_allhosts);
-   }
-   EVENTHANDLER_INVOKE(ifaddr_event, ifp);
-   }
-   error 

svn commit: r230208 - head/sys/fs/tmpfs

2012-01-16 Thread Kevin Lo
Author: kevlo
Date: Mon Jan 16 10:25:22 2012
New Revision: 230208
URL: http://svn.freebsd.org/changeset/base/230208

Log:
  Add nfs export support to tmpfs(5)
  
  Reviewed by:  kib

Modified:
  head/sys/fs/tmpfs/tmpfs_vfsops.c

Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c
==
--- head/sys/fs/tmpfs/tmpfs_vfsops.cMon Jan 16 09:53:24 2012
(r230207)
+++ head/sys/fs/tmpfs/tmpfs_vfsops.cMon Jan 16 10:25:22 2012
(r230208)
@@ -150,10 +150,8 @@ tmpfs_mount(struct mount *mp)
return (EINVAL);
 
if (mp-mnt_flag  MNT_UPDATE) {
-   /* XXX: There is no support yet to update file system
-* settings.  Should be added. */
-
-   return EOPNOTSUPP;
+   if (vfs_flagopt(mp-mnt_optnew, export, NULL, 0))
+   return (0);
}
 
vn_lock(mp-mnt_vnodecovered, LK_SHARED | LK_RETRY);
___
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: r230209 - head/sys/dev/usb/serial

2012-01-16 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan 16 10:42:43 2012
New Revision: 230209
URL: http://svn.freebsd.org/changeset/base/230209

Log:
  Export ttyname instead of ttyunit via the sysctl interface.
  
  Submitted by: Mykhaylo Yehorov
  PR:   usb/164090
  MFC after:1 week

Modified:
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/serial/usb_serial.h

Modified: head/sys/dev/usb/serial/usb_serial.c
==
--- head/sys/dev/usb/serial/usb_serial.cMon Jan 16 10:25:22 2012
(r230208)
+++ head/sys/dev/usb/serial/usb_serial.cMon Jan 16 10:42:43 2012
(r230209)
@@ -248,10 +248,16 @@ ucom_attach(struct ucom_super_softc *ssc
return (EINVAL);
}
 
+   /* allocate a uniq unit number */
ssc-sc_unit = ucom_unit_alloc();
if (ssc-sc_unit == -1)
return (ENOMEM);
 
+   /* generate TTY name string */
+   snprintf(ssc-sc_ttyname, sizeof(ssc-sc_ttyname),
+   UCOM_TTY_PREFIX %d, ssc-sc_unit);
+
+   /* create USB request handling process */
error = usb_proc_create(ssc-sc_tq, mtx, ucom, USB_PRI_MED);
if (error) {
ucom_unit_free(ssc-sc_unit);
@@ -292,9 +298,9 @@ ucom_detach(struct ucom_super_softc *ssc
if (ssc-sc_subunits == 0)
return; /* not initialized */
 
-   if (ssc-sc_sysctl_ttyunit != NULL) {
-   sysctl_remove_oid(ssc-sc_sysctl_ttyunit, 1, 0);
-   ssc-sc_sysctl_ttyunit = NULL;
+   if (ssc-sc_sysctl_ttyname != NULL) {
+   sysctl_remove_oid(ssc-sc_sysctl_ttyname, 1, 0);
+   ssc-sc_sysctl_ttyname = NULL;
}
 
if (ssc-sc_sysctl_ttyports != NULL) {
@@ -434,8 +440,8 @@ ucom_set_pnpinfo_usb(struct ucom_super_s
uint8_t iface_index;
struct usb_attach_arg *uaa;
 
-   snprintf(buf, sizeof(buf), ttyname=%s%d ttyports=%d,
-   UCOM_TTY_PREFIX, ssc-sc_unit, ssc-sc_subunits);
+   snprintf(buf, sizeof(buf), ttyname= UCOM_TTY_PREFIX
+   %d ttyports=%d, ssc-sc_unit, ssc-sc_subunits);
 
/* Store the PNP info in the first interface for the device */
uaa = device_get_ivars(dev);
@@ -445,14 +451,14 @@ ucom_set_pnpinfo_usb(struct ucom_super_s
device_printf(dev, Could not set PNP info\n);
 
/*
-* The following information is also replicated in the pnp-info
+* The following information is also replicated in the PNP-info
 * string which is registered above:
 */
-   if (ssc-sc_sysctl_ttyunit == NULL) {
-   ssc-sc_sysctl_ttyunit = SYSCTL_ADD_INT(NULL,
+   if (ssc-sc_sysctl_ttyname == NULL) {
+   ssc-sc_sysctl_ttyname = SYSCTL_ADD_STRING(NULL,
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-   OID_AUTO, ttyunit, CTLFLAG_RD,
-   NULL, ssc-sc_unit, TTY unit number);
+   OID_AUTO, ttyname, CTLFLAG_RD, ssc-sc_ttyname, 0,
+   TTY device basename);
}
if (ssc-sc_sysctl_ttyports == NULL) {
ssc-sc_sysctl_ttyports = SYSCTL_ADD_INT(NULL,

Modified: head/sys/dev/usb/serial/usb_serial.h
==
--- head/sys/dev/usb/serial/usb_serial.hMon Jan 16 10:25:22 2012
(r230208)
+++ head/sys/dev/usb/serial/usb_serial.hMon Jan 16 10:42:43 2012
(r230209)
@@ -135,8 +135,9 @@ struct ucom_super_softc {
struct usb_process sc_tq;
int sc_unit;
int sc_subunits;
-   struct sysctl_oid *sc_sysctl_ttyunit;
+   struct sysctl_oid *sc_sysctl_ttyname;
struct sysctl_oid *sc_sysctl_ttyports;
+   char sc_ttyname[16];
 };
 
 struct ucom_softc {
___
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: r230210 - head/sys/sys

2012-01-16 Thread Gleb Smirnoff
Author: glebius
Date: Mon Jan 16 10:58:14 2012
New Revision: 230210
URL: http://svn.freebsd.org/changeset/base/230210

Log:
  m_getzone() should return only cluster zones.

Modified:
  head/sys/sys/mbuf.h

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Mon Jan 16 10:42:43 2012(r230209)
+++ head/sys/sys/mbuf.h Mon Jan 16 10:58:14 2012(r230210)
@@ -448,9 +448,6 @@ m_getzone(int size)
uma_zone_t zone;

switch (size) {
-   case MSIZE:
-   zone = zone_mbuf;
-   break;
case MCLBYTES:
zone = zone_clust;
break;
___
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: r230211 - head/tools/regression/bin/sh/builtins

2012-01-16 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Mon Jan 16 10:59:44 2012
New Revision: 230211
URL: http://svn.freebsd.org/changeset/base/230211

Log:
  sh: Test EXIT trap with multiple statements in it
  
  Reviewed by:  jilles
  MFC after:2 weeks

Added:
  head/tools/regression/bin/sh/builtins/trap9.0   (contents, props changed)

Added: head/tools/regression/bin/sh/builtins/trap9.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/trap9.0   Mon Jan 16 10:59:44 
2012(r230211)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+test $(trap 'printf trap; echo ped' EXIT; f() { :; }; f) = trapped || exit 1
___
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: r230212 - in head: bin/sh tools/regression/bin/sh/builtins

2012-01-16 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Mon Jan 16 11:07:46 2012
New Revision: 230212
URL: http://svn.freebsd.org/changeset/base/230212

Log:
  sh: Fix execution of multiple statements in a trap when evalskip is set
  
  Before this fix, only the first statement of the trap was executed if
  evalskip was set. This is for example the case when:
  o  -e is set for this shell
  o  a trap is set on EXIT
  o  a function returns 1 and causes the script to abort
  
  Reviewed by:  jilles
  MFC after:2 weeks

Added:
  head/tools/regression/bin/sh/builtins/trap10.0   (contents, props changed)
  head/tools/regression/bin/sh/builtins/trap11.0   (contents, props changed)
Modified:
  head/bin/sh/eval.c
  head/bin/sh/eval.h
  head/bin/sh/trap.c

Modified: head/bin/sh/eval.c
==
--- head/bin/sh/eval.c  Mon Jan 16 10:59:44 2012(r230211)
+++ head/bin/sh/eval.c  Mon Jan 16 11:07:46 2012(r230212)
@@ -75,7 +75,7 @@ __FBSDID($FreeBSD$);
 
 
 int evalskip;  /* set if we are skipping commands */
-static int skipcount;  /* number of levels to skip */
+int skipcount; /* number of levels to skip */
 MKINIT int loopnest;   /* current loop nesting level */
 int funcnest;  /* depth of function calls */
 static int builtin_flags;  /* evalcommand flags for builtins */

Modified: head/bin/sh/eval.h
==
--- head/bin/sh/eval.h  Mon Jan 16 10:59:44 2012(r230211)
+++ head/bin/sh/eval.h  Mon Jan 16 11:07:46 2012(r230212)
@@ -60,6 +60,7 @@ void evalbackcmd(union node *, struct ba
 #define in_function()  funcnest
 extern int funcnest;
 extern int evalskip;
+extern int skipcount;
 
 /* reasons for skipping commands (see comment on breakcmd routine) */
 #define SKIPBREAK  1

Modified: head/bin/sh/trap.c
==
--- head/bin/sh/trap.c  Mon Jan 16 10:59:44 2012(r230211)
+++ head/bin/sh/trap.c  Mon Jan 16 11:07:46 2012(r230212)
@@ -412,7 +412,7 @@ void
 dotrap(void)
 {
int i;
-   int savestatus;
+   int savestatus, prev_evalskip, prev_skipcount;
 
in_dotrap++;
for (;;) {
@@ -427,10 +427,36 @@ dotrap(void)
 */
if (i == SIGCHLD)
ignore_sigchld++;
+
+   /*
+* Backup current evalskip
+* state and reset it before
+* executing a trap, so that the
+* trap is not disturbed by an
+* ongoing break/continue/return
+* statement.
+*/
+   prev_evalskip  = evalskip;
+   prev_skipcount = skipcount;
+   evalskip = 0;
+
last_trapsig = i;
savestatus = exitstatus;
evalstring(trap[i], 0);
exitstatus = savestatus;
+
+   /*
+* If such a command was not
+* already in progress, allow a
+* break/continue/return in the
+* trap action to have an effect
+* outside of it.
+*/
+   if (prev_evalskip != 0) {
+   evalskip  = prev_evalskip;
+   skipcount = prev_skipcount;
+   }
+
if (i == SIGCHLD)
ignore_sigchld--;
}
@@ -501,6 +527,11 @@ exitshell_savedstatus(void)
}
handler = loc1;
if ((p = trap[0]) != NULL  *p != '\0') {
+   /*
+* Reset evalskip, or the trap on EXIT could be
+* interrupted if the last command was a return.
+*/
+   evalskip = 0;
trap[0] = NULL;
evalstring(p, 0);
}

Added: head/tools/regression/bin/sh/builtins/trap10.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/trap10.0  Mon 

Re: svn commit: r230212 - in head: bin/sh tools/regression/bin/sh/builtins

2012-01-16 Thread Jean-Sébastien Pédron
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 16.01.2012 12:07, Jean-Sebastien Pedron wrote:
 Author: dumbbell Date: Mon Jan 16 11:07:46 2012 New Revision:
 230212 URL: http://svn.freebsd.org/changeset/base/230212
 
 Log: sh: Fix execution of multiple statements in a trap when
 evalskip is set
 
 Before this fix, only the first statement of the trap was executed
 if evalskip was set. This is for example the case when: o  -e is
 set for this shell o  a trap is set on EXIT o  a function returns 1
 and causes the script to abort
 
 Reviewed by:  jilles MFC after:   2 weeks

Forgot to specify:
Sponsored by:   Yakaz (http://www.yakaz.com)

- -- 
Jean-Sébastien Pédron
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8UBpsACgkQa+xGJsFYOlNsRgCgzG9k2vIFo0Tiq2somDTiypYx
fkUAoLLKTHUMI8v8LUahYN3d93/uVM9c
=62Ik
-END PGP SIGNATURE-
___
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: r230208 - head/sys/fs/tmpfs

2012-01-16 Thread Mikolaj Golub

On Mon, 16 Jan 2012 10:25:23 + (UTC) Kevin Lo wrote:

 KL Author: kevlo
 KL Date: Mon Jan 16 10:25:22 2012
 KL New Revision: 230208
 KL URL: http://svn.freebsd.org/changeset/base/230208

 KL Log:
 KL   Add nfs export support to tmpfs(5)
 KL   
 KL   Reviewed by:kib

 KL Modified:
 KL   head/sys/fs/tmpfs/tmpfs_vfsops.c

 KL Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c
 KL 
==
 KL --- head/sys/fs/tmpfs/tmpfs_vfsops.cMon Jan 16 09:53:24 2012   
 (r230207)
 KL +++ head/sys/fs/tmpfs/tmpfs_vfsops.cMon Jan 16 10:25:22 2012   
 (r230208)
 KL @@ -150,10 +150,8 @@ tmpfs_mount(struct mount *mp)
 KL  return (EINVAL);
 KL  
 KL  if (mp-mnt_flag  MNT_UPDATE) {
 KL -/* XXX: There is no support yet to update file system
 KL - * settings.  Should be added. */
 KL -
 KL -return EOPNOTSUPP;
 KL +if (vfs_flagopt(mp-mnt_optnew, export, NULL, 0))
 KL +return (0);

Shouldn't we still return EOPNOTSUPP here?

 KL  }
 KL  
 KL  vn_lock(mp-mnt_vnodecovered, LK_SHARED | LK_RETRY);

-- 
Mikolaj Golub
___
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: r230152 - head/sys/mips/conf

2012-01-16 Thread Bjoern A. Zeeb

On 15. Jan 2012, at 19:43 , Adrian Chadd wrote:

 Author: adrian
 Date: Sun Jan 15 19:43:56 2012
 New Revision: 230152
 URL: http://svn.freebsd.org/changeset/base/230152
 
 Log:
  Build some more things (random, bridge/gif/gre, gpio, USB) as modules as well
  so some embedded platform builds can use these instead of a fully monolithic
  kernel.

I would assume that it's this one together with r230150 that broke the 
following kernel configs:

AR71XX_BASE
PB47
ROUTERSTATION
ROUTERSTATION_MFS
RSPRO
RSPRO_MFS
RSPRO_STANDALONE

with:

make: don't know how to make gpio_if.h. Stop

Please fix.

 
 Modified:
  head/sys/mips/conf/AR71XX_BASE
 
 Modified: head/sys/mips/conf/AR71XX_BASE
 ==
 --- head/sys/mips/conf/AR71XX_BASESun Jan 15 19:42:55 2012
 (r230151)
 +++ head/sys/mips/conf/AR71XX_BASESun Jan 15 19:43:56 2012
 (r230152)
 @@ -24,8 +24,9 @@ hints   AR71XX_BASE.hints
 
 makeoptions   DEBUG=-g#Build kernel with gdb(1) debug symbols
 
 -# Also build these as modules, just to ensure the build gets tested.
 -makeoptions  MODULES_OVERRIDE=wlan wlan_xauth wlan_acl wlan_wep wlan_tkip 
 wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci
 +# Build these as modules so small platform builds will have the
 +# modules already built.
 +makeoptions  MODULES_OVERRIDE=random gpio ar71xx if_gif if_gre if_bridge 
 bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp 
 wlan_rssadapt wlan_amrr ath ath_pci
 
 options   DDB
 options   KDB

-- 
Bjoern A. Zeeb You have to have visions!
   It does not matter how good you are. It matters what good you do!

___
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: r230213 - head/sys/netgraph

2012-01-16 Thread Gleb Smirnoff
Author: glebius
Date: Mon Jan 16 12:31:33 2012
New Revision: 230213
URL: http://svn.freebsd.org/changeset/base/230213

Log:
  Remove some disabled NOTYET code. Probability of enabling it is low,
  if anyone wants, he/she can take it from svn.

Modified:
  head/sys/netgraph/ng_socket.c

Modified: head/sys/netgraph/ng_socket.c
==
--- head/sys/netgraph/ng_socket.c   Mon Jan 16 11:07:46 2012
(r230212)
+++ head/sys/netgraph/ng_socket.c   Mon Jan 16 12:31:33 2012
(r230213)
@@ -64,9 +64,6 @@
 #include sys/socketvar.h
 #include sys/syscallsubr.h
 #include sys/sysctl.h
-#ifdef NOTYET
-#include sys/vnode.h
-#endif
 
 #include net/vnet.h
 
@@ -124,9 +121,6 @@ static int  ng_attach_cntl(struct socket 
 static int ng_attach_common(struct socket *so, int type);
 static voidng_detach_common(struct ngpcb *pcbp, int type);
 static voidng_socket_free_priv(struct ngsock *priv);
-#ifdef NOTYET
-static int ng_internalize(struct mbuf *m, struct thread *p);
-#endif
 static int ng_connect_data(struct sockaddr *nam, struct ngpcb *pcbp);
 static int ng_bind(struct sockaddr *nam, struct ngpcb *pcbp);
 
@@ -209,19 +203,10 @@ ngc_send(struct socket *so, int flags, s
int len, error = 0;
struct ng_apply_info apply;
 
-#ifdef NOTYET
-   if (control  (error = ng_internalize(control, td))) {
-   if (pcbp-sockdata == NULL) {
-   error = ENOTCONN;
-   goto release;
-   }
-   }
-#else  /* NOTYET */
if (control) {
error = EINVAL;
goto release;
}
-#endif /* NOTYET */
 
/* Require destination as there may be = 1 hooks on this node. */
if (addr == NULL) {
@@ -661,69 +646,6 @@ ng_socket_free_priv(struct ngsock *priv)
mtx_unlock(priv-mtx);
 }
 
-#ifdef NOTYET
-/*
- * File descriptors can be passed into an AF_NETGRAPH socket.
- * Note, that file descriptors cannot be passed OUT.
- * Only character device descriptors are accepted.
- * Character devices are useful to connect a graph to a device,
- * which after all is the purpose of this whole system.
- */
-static int
-ng_internalize(struct mbuf *control, struct thread *td)
-{
-   const struct cmsghdr *cm = mtod(control, const struct cmsghdr *);
-   struct file *fp;
-   struct vnode *vn;
-   int oldfds;
-   int fd;
-
-   if (cm-cmsg_type != SCM_RIGHTS || cm-cmsg_level != SOL_SOCKET ||
-   cm-cmsg_len != control-m_len) {
-   TRAP_ERROR;
-   return (EINVAL);
-   }
-
-   /* Check there is only one FD. XXX what would more than one signify? */
-   oldfds = ((caddr_t)cm + cm-cmsg_len - (caddr_t)data) / sizeof (int);
-   if (oldfds != 1) {
-   TRAP_ERROR;
-   return (EINVAL);
-   }
-
-   /* Check that the FD given is legit. and change it to a pointer to a
-* struct file. */
-   fd = CMSG_DATA(cm);
-   if ((error = fget(td, fd, 0, fp)) != 0)
-   return (error);
-
-   /* Depending on what kind of resource it is, act differently. For
-* devices, we treat it as a file. For an AF_NETGRAPH socket,
-* shortcut straight to the node. */
-   switch (fp-f_type) {
-   case DTYPE_VNODE:
-   vn = fp-f_data;
-   if (vn  (vn-v_type == VCHR)) {
-   /* for a VCHR, actually reference the FILE */
-   fhold(fp);
-   /* XXX then what :) */
-   /* how to pass on to other modules? */
-   } else {
-   fdrop(fp, td);
-   TRAP_ERROR;
-   return (EINVAL);
-   }
-   break;
-   default:
-   fdrop(fp, td);
-   TRAP_ERROR;
-   return (EINVAL);
-   }
-   fdrop(fp, td);
-   return (0);
-}
-#endif /* NOTYET */
-
 /*
  * Connect the data socket to a named control socket node.
  */
___
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: r230214 - head/sys/netgraph

2012-01-16 Thread Gleb Smirnoff
Author: glebius
Date: Mon Jan 16 12:33:55 2012
New Revision: 230214
URL: http://svn.freebsd.org/changeset/base/230214

Log:
  Add missing static.

Modified:
  head/sys/netgraph/ng_ipfw.c

Modified: head/sys/netgraph/ng_ipfw.c
==
--- head/sys/netgraph/ng_ipfw.c Mon Jan 16 12:31:33 2012(r230213)
+++ head/sys/netgraph/ng_ipfw.c Mon Jan 16 12:33:55 2012(r230214)
@@ -194,7 +194,7 @@ ng_ipfw_connect(hook_p hook)
 }
 
 /* Look up hook by name */
-hook_p
+static hook_p
 ng_ipfw_findhook(node_p node, const char *name)
 {
u_int16_t n;/* numeric representation of hook */
___
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: r230206 - stable/8/sys/fs/ntfs

2012-01-16 Thread Sergey Kandaurov
On 16 January 2012 12:31, Kevin Lo ke...@freebsd.org wrote:
 Author: kevlo
 Date: Mon Jan 16 08:31:32 2012
 New Revision: 230206
 URL: http://svn.freebsd.org/changeset/base/230206

 Log:
  MFC r228864:
  Discard local array based on return values.

  Pointed out by:       uqs
  Found with:   Coverity Prevent(tm)
  CID:  10089

  MFC 228023:
  Add unicode support to ntfs

  Obtained from:        imura

 Modified:
  stable/8/sys/fs/ntfs/ntfs_subr.c
  stable/8/sys/fs/ntfs/ntfs_subr.h
  stable/8/sys/fs/ntfs/ntfs_vnops.c


Hi,
this looks like a direct commit without svn mergeinfo.

-- 
wbr,
pluknet
___
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: r230215 - head/sys/sys

2012-01-16 Thread Gleb Smirnoff
Author: glebius
Date: Mon Jan 16 13:23:19 2012
New Revision: 230215
URL: http://svn.freebsd.org/changeset/base/230215

Log:
  Make panic strings in m_gettype(), m_getzone(), m_cljset()
  consistent.

Modified:
  head/sys/sys/mbuf.h

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Mon Jan 16 12:33:55 2012(r230214)
+++ head/sys/sys/mbuf.h Mon Jan 16 13:23:19 2012(r230215)
@@ -436,7 +436,7 @@ m_gettype(int size)
type = EXT_JUMBO16;
break;
default:
-   panic(%s: m_getjcl: invalid cluster size, __func__);
+   panic(%s: invalid cluster size, __func__);
}
 
return (type);
@@ -463,7 +463,7 @@ m_getzone(int size)
zone = zone_jumbo16;
break;
default:
-   panic(%s: m_getjcl: invalid cluster type, __func__);
+   panic(%s: invalid cluster size, __func__);
}
 
return (zone);
@@ -663,7 +663,7 @@ m_cljset(struct mbuf *m, void *cl, int t
zone = zone_jumbo16;
break;
default:
-   panic(unknown cluster type);
+   panic(%s: unknown cluster type, __func__);
break;
}
 
___
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: r230193 - head/lib/libc/sparc64/fpu

2012-01-16 Thread Bruce Evans

On Mon, 16 Jan 2012, David Schultz wrote:


Log:
 Computations on NaNs are supposed to return one of the input NaNs unchanged.
 Fix a few places in the sparc64 floating-point emulator where this wasn't
 being handled properly.

 Submitted by:  bde


Thanks.  The only remaining large bug that I noticed near this is that
without -mhard-quad-float, signaling NaNs are not quieted and (IIRC)
FE_INVALID is not raised.

BTW, NetBSD in 2005 uses Hauser soft-float for long doubles on sparc64,
and at least the MI parts of it are almost identical with the Hauser
soft-float in FreeBSD.  But FreeBSD uses a completely different version
of soft-float for sparc64.  It was apparently what NetBSD was using
in 2002 when it was imported into FreeBSD.  Perhaps the Hauser version
is better (more correct or faster).  However, the other version is
much simpler and looks much nicer -- it was originally from Berkeley
and has almost perfect KNF formatting (over 95% of lines are perfectly
formatted accoring to knfom; that is much better than 4.4BSD-Lite2
sys/kern/*.c (88%) and FreeBSD-current sys/kern/*.c (89%, not counting
kern_intr.c which is about 0% after a single C++ comment in it confuses
indent(1)) and contrib/nvi/*/*.c (94%).  Hauser soft-float has a Gnuish
style with 4-char indents amd is 26% KNF (probably mainly for the the
empty lines and some comments).

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: r230216 - stable/9/sys/kern

2012-01-16 Thread Kevin Lo
Author: kevlo
Date: Mon Jan 16 14:31:01 2012
New Revision: 230216
URL: http://svn.freebsd.org/changeset/base/230216

Log:
  Fix build breakage

Modified:
  stable/9/sys/kern/subr_mchain.c

Modified: stable/9/sys/kern/subr_mchain.c
==
--- stable/9/sys/kern/subr_mchain.c Mon Jan 16 13:23:19 2012
(r230215)
+++ stable/9/sys/kern/subr_mchain.c Mon Jan 16 14:31:01 2012
(r230216)
@@ -133,21 +133,6 @@ mb_put_padbyte(struct mbchain *mbp)
caddr_t dst;
char x = 0;
 
-   dst = mtod(mbp-gt;mb_cur, caddr_t) + mbp-gt;mb_cur-gt;m_len;
-
-   /* only add padding if address is odd */
-   if ((unsigned long)dst amp; 1)
-   return mb_put_mem(mbp, (caddr_t)amp;x, 1, MB_MSYSTEM);
-   else
-   return 0;
-}
-
-int
-mb_put_padbyte(struct mbchain *mbp)
-{
-   caddr_t dst;
-   char x = 0;
-
dst = mtod(mbp-mb_cur, caddr_t) + mbp-mb_cur-m_len;
 
/* only add padding if address is odd */
___
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: r230217 - stable/8/sys/kern

2012-01-16 Thread Kevin Lo
Author: kevlo
Date: Mon Jan 16 14:40:22 2012
New Revision: 230217
URL: http://svn.freebsd.org/changeset/base/230217

Log:
  Fix build breakage by adding missing mb_put_padbyte()

Modified:
  stable/8/sys/kern/subr_mchain.c

Modified: stable/8/sys/kern/subr_mchain.c
==
--- stable/8/sys/kern/subr_mchain.c Mon Jan 16 14:31:01 2012
(r230216)
+++ stable/8/sys/kern/subr_mchain.c Mon Jan 16 14:40:22 2012
(r230217)
@@ -125,6 +125,21 @@ mb_reserve(struct mbchain *mbp, int size
 }
 
 int
+mb_put_padbyte(struct mbchain *mbp)
+{
+   caddr_t dst;
+   char x = 0;
+
+   dst = mtod(mbp-mb_cur, caddr_t) + mbp-mb_cur-m_len;
+
+   /* only add padding if address is odd */
+   if ((unsigned long)dst  1)
+   return mb_put_mem(mbp, (caddr_t)x, 1, MB_MSYSTEM);
+   else
+   return 0;
+}
+
+int
 mb_put_uint8(struct mbchain *mbp, u_int8_t x)
 {
return mb_put_mem(mbp, (caddr_t)x, sizeof(x), MB_MSYSTEM);
___
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: r230217 - stable/8/sys/kern

2012-01-16 Thread Andriy Gapon
on 16/01/2012 16:40 Kevin Lo said the following:
 Author: kevlo
 Date: Mon Jan 16 14:40:22 2012
 New Revision: 230217
 URL: http://svn.freebsd.org/changeset/base/230217
 
 Log:
   Fix build breakage by adding missing mb_put_padbyte()
 
 Modified:
   stable/8/sys/kern/subr_mchain.c
 
 Modified: stable/8/sys/kern/subr_mchain.c
 ==
 --- stable/8/sys/kern/subr_mchain.c   Mon Jan 16 14:31:01 2012
 (r230216)
 +++ stable/8/sys/kern/subr_mchain.c   Mon Jan 16 14:40:22 2012
 (r230217)
 @@ -125,6 +125,21 @@ mb_reserve(struct mbchain *mbp, int size
  }
  
  int
 +mb_put_padbyte(struct mbchain *mbp)
 +{
 + caddr_t dst;
 + char x = 0;
 +
 + dst = mtod(mbp-mb_cur, caddr_t) + mbp-mb_cur-m_len;
 +
 + /* only add padding if address is odd */
 + if ((unsigned long)dst  1)
 + return mb_put_mem(mbp, (caddr_t)x, 1, MB_MSYSTEM);
 + else
 + return 0;

Broken style above?

 +}
 +
 +int
  mb_put_uint8(struct mbchain *mbp, u_int8_t x)
  {
   return mb_put_mem(mbp, (caddr_t)x, sizeof(x), MB_MSYSTEM);


-- 
Andriy Gapon
___
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: r230218 - head/sys/kern

2012-01-16 Thread Kevin Lo
Author: kevlo
Date: Mon Jan 16 14:54:48 2012
New Revision: 230218
URL: http://svn.freebsd.org/changeset/base/230218

Log:
  Fix a style bug
  
  Spotted by:   avg

Modified:
  head/sys/kern/subr_mchain.c

Modified: head/sys/kern/subr_mchain.c
==
--- head/sys/kern/subr_mchain.c Mon Jan 16 14:40:22 2012(r230217)
+++ head/sys/kern/subr_mchain.c Mon Jan 16 14:54:48 2012(r230218)
@@ -139,7 +139,7 @@ mb_put_padbyte(struct mbchain *mbp)
if ((unsigned long)dst  1)
return mb_put_mem(mbp, (caddr_t)x, 1, MB_MSYSTEM);
else
-   return 0;
+   return 0;
 }
 
 int
___
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: r230206 - stable/8/sys/fs/ntfs

2012-01-16 Thread Kevin Lo
On Mon, Jan 16, 2012 at 04:22:46PM +0300, Sergey Kandaurov wrote:
 On 16 January 2012 12:31, Kevin Lo ke...@freebsd.org wrote:
  Author: kevlo
  Date: Mon Jan 16 08:31:32 2012
  New Revision: 230206
  URL: http://svn.freebsd.org/changeset/base/230206
 
  Log:
  MFC r228864:
  Discard local array based on return values.
 
  Pointed out by: uqs
  Found with: Coverity Prevent(tm)
  CID:10089
 
  MFC 228023:
  Add unicode support to ntfs
 
  Obtained from:  imura
 
  Modified:
  stable/8/sys/fs/ntfs/ntfs_subr.c
  stable/8/sys/fs/ntfs/ntfs_subr.h
  stable/8/sys/fs/ntfs/ntfs_vnops.c
 
 
 Hi,
 this looks like a direct commit without svn mergeinfo.

There was something wrong with my svn tree. 
I'm sorry for any inconvenience caused to you.

 
 -- 
 wbr,
 pluknet

Kevin
___
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: r230206 - stable/8/sys/fs/ntfs

2012-01-16 Thread Andriy Gapon
on 16/01/2012 17:15 Kevin Lo said the following:
 On Mon, Jan 16, 2012 at 04:22:46PM +0300, Sergey Kandaurov wrote:
 On 16 January 2012 12:31, Kevin Lo ke...@freebsd.org wrote:
 Author: kevlo
 Date: Mon Jan 16 08:31:32 2012
 New Revision: 230206
 URL: http://svn.freebsd.org/changeset/base/230206

 Log:
 MFC r228864:
 Discard local array based on return values.

 Pointed out by: uqs
 Found with: Coverity Prevent(tm)
 CID:10089

 MFC 228023:
 Add unicode support to ntfs

 Obtained from:  imura

 Modified:
 stable/8/sys/fs/ntfs/ntfs_subr.c
 stable/8/sys/fs/ntfs/ntfs_subr.h
 stable/8/sys/fs/ntfs/ntfs_vnops.c


 Hi,
 this looks like a direct commit without svn mergeinfo.
 
 There was something wrong with my svn tree. 
 I'm sorry for any inconvenience caused to you.

You need to use svn merge with --record-only option to update svn mergeinfo 
data.

-- 
Andriy Gapon
___
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: r230037 - head/lib/libutil

2012-01-16 Thread Guy Helmer
On Jan 14, 2012, at 3:02 PM, Bruce Evans wrote:

 On Sat, 14 Jan 2012, Pawel Jakub Dawidek wrote:
 
 On Sat, Jan 14, 2012 at 09:59:27PM +1100, Bruce Evans wrote:
 ...
 It's good to declare mode_t, since pidfile_open() uses it and we want
 to remove the dependency on sys/param.h.  However, this definition
 doesn't follow KNF or the style of all the other typedef declarations
 in the file, since all the others follow KNF and thus have a space
 instead of a tab after #define and also after typedef.
 
 I think you mixed space with tab. All the others have a tab after
 #define and typedef. I fully agree this should be consistent.
 
 Oops.
 
 -#ifdef _SYS_PARAM_H_
 intpidfile_close(struct pidfh *_pfh);
 intpidfile_fileno(const struct pidfh *_pfh);
 struct pidfh *
pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr);
 intpidfile_remove(struct pidfh *_pfh);
 intpidfile_write(struct pidfh *_pfh);
 -#endif
 
 Now these are unsorted, since a separate section to hold them is not
 needed.  It was used just to make the ifdef easier to read (we don't
 want to split up the main list with blank lines around each ifdef, and
 without such blank lines the ifdefs are harder to read).
 
 I'd prefer not to change that. All those functions are part of pidfile(3)
 API and it would be better, IMHO, to keep them together here too.
 
 The functions have a unique prefix, so they are grouped nicely when sorted
 into a long list.
 
 While I'm here, I'll complain about the verboseness of that prefix :-).
 Other APIs in the file mostly use short prefixes:
 - kinfo_.  Should have been ki_ like its struct member names.  pidfile uses
  a good prefix for its struct member names too.
 - properties_/property_.  Bad, like the rest of the API.
 - uu_.  A weird nondescriptive name for serial device locking protocol.
  Is it from uucp?  But its weirdness makes it memorable, unlike a
  generic English word like `property'.  Better yet, I don't have to
  quote it here.
 - f.  Stdio's prefix meaning `file'.  To fit indentifiers in 8 characters,
  it can't even have an underscore.
 - pw_.  Old prefix/abbrieviation for `password'.  It's more readable than
  `password' once you are used to it.
 - gr_.  Newer prefix for `group'.  More verbose than the g in gid.
 - quota_.  At least the English word is short.
 
 Just noticed some more disorder: the groups of the defines at the end
 are in random (mostly historical) order (U*, HO*, F*, PW*, HN* (for
 the last parameter of humanize_number()), HN* (for the second last
 parameter...), HD*.
 
 If the pidfile API had defines and if the API is kept in its own
 section, its defines should be in that section.  Most of the other APIs
 that have a man page are large enough to deserve the same treatment
 if it is done for pidfile.  Some like dehumanize^Wscientificize^W
 humanize_number() are larger although they have fewer functions, since
 they have lots of defines.
 
 Bruce

I've pasted the diff below that I think captures the majority of the issues you 
have brought up. I have not attempted to tackle the property.3/properties.3 
issues, nor the objections to the prefixes that I think would take considerably 
more effort to resolve -- I wanted to concentrate on the issues that can be 
isolated to libutil. I hope the diff was pasted OK, especially WRT tab 
characters.

Guy

Index: lib/libutil/property.3
===
--- lib/libutil/property.3  (revision 230221)
+++ lib/libutil/property.3  (working copy)
@@ -36,7 +36,6 @@
 .Sh LIBRARY
 .Lb libutil
 .Sh SYNOPSIS
-.In sys/types.h
 .In libutil.h
 .Ft properties
 .Fn properties_read int fd
Index: lib/libutil/libutil.h
===
--- lib/libutil/libutil.h   (revision 230221)
+++ lib/libutil/libutil.h   (working copy)
@@ -49,8 +49,8 @@
 #endif
 
 #ifndef _MODE_T_DECLARED
-typedef __mode_t   mode_t;
-#define _MODE_T_DECLARED
+typedef__mode_tmode_t;
+#define_MODE_T_DECLARED
 #endif
 
 #ifndef _PID_T_DECLARED
@@ -68,8 +68,8 @@
 #define_UID_T_DECLARED
 #endif
 
-#define PROPERTY_MAX_NAME  64
-#define PROPERTY_MAX_VALUE 512
+#definePROPERTY_MAX_NAME   64
+#definePROPERTY_MAX_VALUE  512
 
 /* for properties.c */
 typedef struct _property {
@@ -80,9 +80,6 @@
 
 /* Avoid pulling in all the include files for no need */
 struct in_addr;
-struct kinfo_file;
-struct kinfo_proc;
-struct kinfo_vmentry;
 struct pidfh;
 struct sockaddr;
 struct termios;
@@ -114,6 +111,12 @@
 intlogin_tty(int _fd);
 intopenpty(int *_amaster, int *_aslave, char *_name,
struct termios *_termp, struct winsize *_winp);
+intpidfile_close(struct pidfh *_pfh);
+intpidfile_fileno(const struct pidfh *_pfh);
+struct pidfh *
+   pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr);
+intpidfile_remove(struct pidfh *_pfh);
+int

svn commit: r230223 - in stable/9/sys/dev: ahci ata ata/chipsets

2012-01-16 Thread Jim Harris
Author: jimharris
Date: Mon Jan 16 17:30:00 2012
New Revision: 230223
URL: http://svn.freebsd.org/changeset/base/230223

Log:
  MFC r229671:
  
   Add 0x2826 device ID for C600 (Patsburg) SATA controller in RAID mode.
  
  Sponsored by: Intel
  Approved by: sbruno

Modified:
  stable/9/sys/dev/ahci/ahci.c
  stable/9/sys/dev/ata/ata-pci.h
  stable/9/sys/dev/ata/chipsets/ata-intel.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/ahci/ahci.c
==
--- stable/9/sys/dev/ahci/ahci.cMon Jan 16 17:08:08 2012
(r230222)
+++ stable/9/sys/dev/ahci/ahci.cMon Jan 16 17:30:00 2012
(r230223)
@@ -171,6 +171,7 @@ static struct {
{0x1d028086, 0x00, Intel Patsburg,0},
{0x1d048086, 0x00, Intel Patsburg,0},
{0x1d068086, 0x00, Intel Patsburg,0},
+   {0x28268086, 0x00, Intel Patsburg (RAID), 0},
{0x1e028086, 0x00, Intel Panther Point,   0},
{0x1e038086, 0x00, Intel Panther Point,   0},
{0x1e048086, 0x00, Intel Panther Point,   0},

Modified: stable/9/sys/dev/ata/ata-pci.h
==
--- stable/9/sys/dev/ata/ata-pci.h  Mon Jan 16 17:08:08 2012
(r230222)
+++ stable/9/sys/dev/ata/ata-pci.h  Mon Jan 16 17:30:00 2012
(r230223)
@@ -236,6 +236,7 @@ struct ata_pci_controller {
 #define ATA_PBG_AH10x1d028086
 #define ATA_PBG_R1 0x1d048086
 #define ATA_PBG_R2 0x1d068086
+#define ATA_PBG_R3 0x28268086
 #define ATA_PBG_S2 0x1d088086
 
 #define ATA_PPT_S1 0x1e008086

Modified: stable/9/sys/dev/ata/chipsets/ata-intel.c
==
--- stable/9/sys/dev/ata/chipsets/ata-intel.c   Mon Jan 16 17:08:08 2012
(r230222)
+++ stable/9/sys/dev/ata/chipsets/ata-intel.c   Mon Jan 16 17:30:00 2012
(r230223)
@@ -197,6 +197,7 @@ ata_intel_probe(device_t dev)
  { ATA_PBG_AH1,  0, INTEL_AHCI, 0, ATA_SA300, Patsburg },
  { ATA_PBG_R1,   0, INTEL_AHCI, 0, ATA_SA300, Patsburg },
  { ATA_PBG_R2,   0, INTEL_AHCI, 0, ATA_SA300, Patsburg },
+ { ATA_PBG_R3,   0, INTEL_AHCI, 0, ATA_SA300, Patsburg },
  { ATA_PBG_S2,   0, INTEL_6CH2, 0, ATA_SA300, Patsburg },
  { ATA_PPT_S1,   0, INTEL_6CH,  0, ATA_SA300, Panther Point },
  { ATA_PPT_S2,   0, INTEL_6CH,  0, ATA_SA300, Panther Point },
___
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: r230224 - in stable/8/sys/dev: ahci ata ata/chipsets

2012-01-16 Thread Jim Harris
Author: jimharris
Date: Mon Jan 16 17:31:26 2012
New Revision: 230224
URL: http://svn.freebsd.org/changeset/base/230224

Log:
  MFC r229671:
  
   Add 0x2826 device ID for C600 (Patsburg) SATA controller in RAID mode.
  
  Sponsored by: Intel
  Approved by: sbruno

Modified:
  stable/8/sys/dev/ahci/ahci.c
  stable/8/sys/dev/ata/ata-pci.h
  stable/8/sys/dev/ata/chipsets/ata-intel.c
Directory Properties:
  stable/8/   (props changed)
  stable/8/sys/   (props changed)

Modified: stable/8/sys/dev/ahci/ahci.c
==
--- stable/8/sys/dev/ahci/ahci.cMon Jan 16 17:30:00 2012
(r230223)
+++ stable/8/sys/dev/ahci/ahci.cMon Jan 16 17:31:26 2012
(r230224)
@@ -171,6 +171,7 @@ static struct {
{0x1d028086, 0x00, Intel Patsburg,0},
{0x1d048086, 0x00, Intel Patsburg,0},
{0x1d068086, 0x00, Intel Patsburg,0},
+   {0x28268086, 0x00, Intel Patsburg (RAID), 0},
{0x1e028086, 0x00, Intel Panther Point,   0},
{0x1e038086, 0x00, Intel Panther Point,   0},
{0x1e048086, 0x00, Intel Panther Point,   0},

Modified: stable/8/sys/dev/ata/ata-pci.h
==
--- stable/8/sys/dev/ata/ata-pci.h  Mon Jan 16 17:30:00 2012
(r230223)
+++ stable/8/sys/dev/ata/ata-pci.h  Mon Jan 16 17:31:26 2012
(r230224)
@@ -236,6 +236,7 @@ struct ata_pci_controller {
 #define ATA_PBG_AH10x1d028086
 #define ATA_PBG_R1 0x1d048086
 #define ATA_PBG_R2 0x1d068086
+#define ATA_PBG_R3 0x28268086
 #define ATA_PBG_S2 0x1d088086
 
 #define ATA_PPT_S1 0x1e008086

Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c
==
--- stable/8/sys/dev/ata/chipsets/ata-intel.c   Mon Jan 16 17:30:00 2012
(r230223)
+++ stable/8/sys/dev/ata/chipsets/ata-intel.c   Mon Jan 16 17:31:26 2012
(r230224)
@@ -197,6 +197,7 @@ ata_intel_probe(device_t dev)
  { ATA_PBG_AH1,  0, INTEL_AHCI, 0, ATA_SA300, Patsburg },
  { ATA_PBG_R1,   0, INTEL_AHCI, 0, ATA_SA300, Patsburg },
  { ATA_PBG_R2,   0, INTEL_AHCI, 0, ATA_SA300, Patsburg },
+ { ATA_PBG_R3,   0, INTEL_AHCI, 0, ATA_SA300, Patsburg },
  { ATA_PBG_S2,   0, INTEL_6CH2, 0, ATA_SA300, Patsburg },
  { ATA_PPT_S1,   0, INTEL_6CH,  0, ATA_SA300, Panther Point },
  { ATA_PPT_S2,   0, INTEL_6CH,  0, ATA_SA300, Panther Point },
___
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: r230223 - in stable/9/sys/dev: ahci ata ata/chipsets

2012-01-16 Thread Andriy Gapon
on 16/01/2012 19:30 Jim Harris said the following:
[snip]
 Modified:
   stable/9/sys/dev/ahci/ahci.c
   stable/9/sys/dev/ata/ata-pci.h
   stable/9/sys/dev/ata/chipsets/ata-intel.c
 Directory Properties:
   stable/9/   (props changed)
   stable/9/sys/   (props changed)
[snip]

The last two lines look incorrect.
Are you following http://wiki.freebsd.org/SubversionPrimer/Merging ?
Namely, this change should have been svn-merged to the 'sys' sub-directory.

-- 
Andriy Gapon
___
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: r230159 - stable/8/sys/kern

2012-01-16 Thread Andriy Gapon
on 15/01/2012 22:52 Eitan Adler said the following:
 Author: eadler (ports committer)
 Date: Sun Jan 15 20:52:31 2012
 New Revision: 230159
 URL: http://svn.freebsd.org/changeset/base/230159
 
 Log:
   MFC r228343:
- Fix ktrace leakage if error is set
   
   PR: kern/163098
   Approved by:sbruno
 
 Modified:
   stable/8/sys/kern/kern_ktrace.c
 Directory Properties:
   stable/8/sys/   (props changed)

Eitan,

the list of the directory properties changes seems to be too short.
Have you made a common mistake of cleaning up the results of svn merge or do 
you
have a sparse checkout of sys?  Or something else?

 Modified: stable/8/sys/kern/kern_ktrace.c
 ==
 --- stable/8/sys/kern/kern_ktrace.c   Sun Jan 15 20:52:01 2012
 (r230158)
 +++ stable/8/sys/kern/kern_ktrace.c   Sun Jan 15 20:52:31 2012
 (r230159)
 @@ -473,7 +473,7 @@ ktrsysret(code, error, retval)
   ktp = req-ktr_data.ktr_sysret;
   ktp-ktr_code = code;
   ktp-ktr_error = error;
 - ktp-ktr_retval = retval;   /* what about val2 ? */
 + ktp-ktr_retval = ((error == 0) ? retval: 0);   /* what about 
 val2 ? */
   ktr_submitrequest(curthread, req);
  }
  


-- 
Andriy Gapon
___
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: r230037 - head/lib/libutil

2012-01-16 Thread Pawel Jakub Dawidek
On Mon, Jan 16, 2012 at 11:14:32AM -0600, Guy Helmer wrote:
 I've pasted the diff below that I think captures the majority of the issues 
 you have brought up. I have not attempted to tackle the 
 property.3/properties.3 issues, nor the objections to the prefixes that I 
 think would take considerably more effort to resolve -- I wanted to 
 concentrate on the issues that can be isolated to libutil. I hope the diff 
 was pasted OK, especially WRT tab characters.

The patch looks mostly good, one nit mentioned below and also one
question for Bruce.

 +/* Flags for hexdump(3) */
 +/* Flags for humanize_number(3) flags */
 +/* Flags for humanize_number(3) scale */
 +/* return values from realhostname() */
 +/* Flags for pw_scan() */
 +/* Return values from uu_lock() */

All those sentences are missing period and one doesn't start with
capital letter.

I noticed also one more inconsistency:

struct kinfo_file *
kinfo_getfile(pid_t _pid, int *_cntp);
struct passwd
*pw_dup(const struct passwd *_pw);

Sometimes * is on the same line as function type and sometimes it is in
the line below. Former is definiately better.

Guy, feel free to commit what you got now with those sentences fixed and
I'll do one iterration. It is taking way too long and I'm sure you are
bored by now:) We don't want to scare you off:)

 +struct pidfh *
 + pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr);

Bruce, is this your suggestion? This somehow looks weird too me. What I
use and I think it is in general more widely used across FreeBSD is
simply:

struct pidfh *pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr);

when the type exceeds one tab, but the line fits into 80 chars or:

struct pidfh *pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr,
int _some_other_argument);

when line exceeds 80 chars.

Especially this one looks very strange:

properties
properties_read(int _fd);

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl


pgpUcTaVTBw6Z.pgp
Description: PGP signature


svn commit: r230225 - head/include

2012-01-16 Thread David Chisnall
Author: theraven
Date: Mon Jan 16 18:19:53 2012
New Revision: 230225
URL: http://svn.freebsd.org/changeset/base/230225

Log:
  Use the signal fence builtin in stdatomic.h when using the clang atomic
  builtins, rather than the __asm hack.  Somehow I missed the existence of this
  builtin originally and only noticed that it was there when I went to implement
  it...
  
  Note: Trunk clang now has support for (most of) the C[++]11 atomics stuff.
  Please test!
  
  Approved by:  brooks (mentor)

Modified:
  head/include/stdatomic.h

Modified: head/include/stdatomic.h
==
--- head/include/stdatomic.hMon Jan 16 17:31:26 2012(r230224)
+++ head/include/stdatomic.hMon Jan 16 18:19:53 2012(r230225)
@@ -104,10 +104,7 @@ enum memory_order {
  * 7.17.4 Fences.
  */
 
-#if defined(__CLANG_ATOMICS)
-#defineatomic_thread_fence(order)  __atomic_thread_fence(order)
-#defineatomic_signal_fence(order)  __asm volatile ( : : : 
memory)
-#elif defined(__GNUC_ATOMICS)
+#if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS)
 #defineatomic_thread_fence(order)  __atomic_thread_fence(order)
 #defineatomic_signal_fence(order)  __atomic_signal_fence(order)
 #else
___
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: r230191 - in head: lib/libc/arm/gen sys/arm/include

2012-01-16 Thread David Schultz
On Mon, Jan 16, 2012, Kostik Belousov wrote:
 On Sun, Jan 15, 2012 at 11:11:43PM -0500, David Schultz wrote:
  On Mon, Jan 16, 2012, David Schultz wrote:
   Author: das
   Date: Mon Jan 16 04:08:29 2012
   New Revision: 230191
   URL: http://svn.freebsd.org/changeset/base/230191
   
   Log:
 Implement FLT_ROUNDS for arm.  Some (all?) arm FPUs lack support  for
 dynamic rounding modes, but FPUless chips that use softfloat can 
   support it
 because everything is emulated anyway.  (We presently have incomplete
 support for hardware FPUs.)
 
 Submitted by:   Ian Lepore
  
  Incidentally, all of gcc's hooks into softfloat should probably be in
  the public symbol namespace instead of FBSDprivate.  The compiler generates
  references to them, so we cannot claim that they are internal, unsupported
  interfaces.  I assume that moving them will not break the ABI because
  FreeBSDprivate includes FBSD_X, but I haven't tested this.  Any objections
  to moving them?  Affects arm and mips.
 
 Move will break the ABI. Namespace inheritance is ignored when searching
 the symbol match.
 
 On the other hand. FBSDprivate_1.0 is explicitely created to be changed,
 so removal of the symbols from this namespace if fine from the POV of
 the project policy.
 
 Another argument is that both MIPS and ARM are the second-tier architectures,
 and again, project policy allows ABI breakage.

Right; it was more a question of whether it would cause anyone
undue inconvenience.

Actually, before we call them officially supported, another
question is why all of the symbols related to floating-point
emulation are coming from libc and not libgcc.
___
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: r230226 - in head: sbin/mount sbin/mount_cd9660 sbin/mount_ext2fs sbin/mount_msdosfs sbin/mount_nfs sbin/mount_ntfs sbin/mount_nullfs sbin/mount_reiserfs sbin/mount_std sbin/mount_udf s...

2012-01-16 Thread Jaakko Heinonen
Author: jh
Date: Mon Jan 16 19:34:21 2012
New Revision: 230226
URL: http://svn.freebsd.org/changeset/base/230226

Log:
  Change checkpath() to not exit on error. This is a prerequisite for
  fixing the mount(8) failok option.
  
  PR:   163668
  Reviewed by:  Garrett Cooper, delphij (previous version)

Modified:
  head/sbin/mount/getmntopts.c
  head/sbin/mount/mntopts.h
  head/sbin/mount/mount.c
  head/sbin/mount/mount_fs.c
  head/sbin/mount_cd9660/mount_cd9660.c
  head/sbin/mount_ext2fs/mount_ext2fs.c
  head/sbin/mount_msdosfs/mount_msdosfs.c
  head/sbin/mount_nfs/mount_nfs.c
  head/sbin/mount_ntfs/mount_ntfs.c
  head/sbin/mount_nullfs/mount_nullfs.c
  head/sbin/mount_reiserfs/mount_reiserfs.c
  head/sbin/mount_std/mount_std.c
  head/sbin/mount_udf/mount_udf.c
  head/sbin/mount_unionfs/mount_unionfs.c
  head/usr.sbin/mount_portalfs/mount_portalfs.c

Modified: head/sbin/mount/getmntopts.c
==
--- head/sbin/mount/getmntopts.cMon Jan 16 18:19:53 2012
(r230225)
+++ head/sbin/mount/getmntopts.cMon Jan 16 19:34:21 2012
(r230226)
@@ -124,16 +124,20 @@ rmslashes(char *rrpin, char *rrpout)
*rrpout = '\0';
 }
 
-void
+int
 checkpath(const char *path, char *resolved)
 {
struct stat sb;
 
if (realpath(path, resolved) != NULL  stat(resolved, sb) == 0) {
-   if (!S_ISDIR(sb.st_mode))
-   errx(EX_USAGE, %s: not a directory, resolved);
+   if (!S_ISDIR(sb.st_mode)) {
+   errno = ENOTDIR;
+   return (1);
+   }
} else
-   errx(EX_USAGE, %s: %s, resolved, strerror(errno));
+   return (1);
+
+   return (0);
 }
 
 void

Modified: head/sbin/mount/mntopts.h
==
--- head/sbin/mount/mntopts.h   Mon Jan 16 18:19:53 2012(r230225)
+++ head/sbin/mount/mntopts.h   Mon Jan 16 19:34:21 2012(r230226)
@@ -93,7 +93,7 @@ struct mntopt {
 
 void getmntopts(const char *, const struct mntopt *, int *, int *);
 void rmslashes(char *, char *);
-void checkpath(const char *, char resolved_path[]);
+int checkpath(const char *, char resolved_path[]);
 extern int getmnt_silent;
 void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, 
size_t len);
 void build_iovec_argf(struct iovec **iov, int *iovlen, const char *name, const 
char *fmt, ...);

Modified: head/sbin/mount/mount.c
==
--- head/sbin/mount/mount.c Mon Jan 16 18:19:53 2012(r230225)
+++ head/sbin/mount/mount.c Mon Jan 16 19:34:21 2012(r230226)
@@ -539,7 +539,10 @@ mountfs(const char *vfstype, const char 
static struct cpa mnt_argv;
 
/* resolve the mountpoint with realpath(3) */
-   (void)checkpath(name, mntpath);
+   if (checkpath(name, mntpath) != 0) {
+   warn(%s, mntpath);
+   return (1);
+   }
name = mntpath;
 
if (mntopts == NULL)

Modified: head/sbin/mount/mount_fs.c
==
--- head/sbin/mount/mount_fs.c  Mon Jan 16 18:19:53 2012(r230225)
+++ head/sbin/mount/mount_fs.c  Mon Jan 16 19:34:21 2012(r230226)
@@ -118,7 +118,10 @@ mount_fs(const char *vfstype, int argc, 
dev = argv[0];
dir = argv[1];
 
-   (void)checkpath(dir, mntpath);
+   if (checkpath(dir, mntpath) != 0) {
+   warn(%s, mntpath);
+   return (1);
+   }
(void)rmslashes(dev, dev);
 
build_iovec(iov, iovlen, fstype, fstype, (size_t)-1);

Modified: head/sbin/mount_cd9660/mount_cd9660.c
==
--- head/sbin/mount_cd9660/mount_cd9660.c   Mon Jan 16 18:19:53 2012
(r230225)
+++ head/sbin/mount_cd9660/mount_cd9660.c   Mon Jan 16 19:34:21 2012
(r230226)
@@ -149,7 +149,8 @@ main(int argc, char **argv)
 * Resolve the mountpoint with realpath(3) and remove unnecessary
 * slashes from the devicename if there are any.
 */
-   (void)checkpath(dir, mntpath);
+   if (checkpath(dir, mntpath) != 0)
+   err(1, %s, mntpath);
(void)rmslashes(dev, dev);
 
if (ssector == -1) {

Modified: head/sbin/mount_ext2fs/mount_ext2fs.c
==
--- head/sbin/mount_ext2fs/mount_ext2fs.c   Mon Jan 16 18:19:53 2012
(r230225)
+++ head/sbin/mount_ext2fs/mount_ext2fs.c   Mon Jan 16 19:34:21 2012
(r230226)
@@ -103,7 +103,8 @@ main(int argc, char *argv[])
 * Resolve the mountpoint with realpath(3) and remove unnecessary
 * slashes from the devicename if there are any.
 */
-   

Re: svn commit: r229794 - head/usr.bin/hexdump

2012-01-16 Thread Tijl Coosemans
On Sunday 08 January 2012 00:15:22 Eitan Adler wrote:
 Author: eadler (ports committer)
 Date: Sat Jan  7 23:15:21 2012
 New Revision: 229794
 URL: http://svn.freebsd.org/changeset/base/229794
 
 Log:
   - Fix how hexdump parses escape strings
   From the NetBSD bug:
   The way how hexdump(1) parses escape sequences has some bugs.
   It shows up when an escape sequence is used as the non-last character
   of a format string.
   
   PR: bin/144722
   Submitted by:   gcooper
   Approved by:rpaulo
   Obtained from:  NetBSD
   MFC after:  1 week
 
 Modified:
   head/usr.bin/hexdump/parse.c
 
 Modified: head/usr.bin/hexdump/parse.c
 ==
 --- head/usr.bin/hexdump/parse.c  Sat Jan  7 22:29:46 2012
 (r229793)
 +++ head/usr.bin/hexdump/parse.c  Sat Jan  7 23:15:21 2012
 (r229794)
 @@ -255,7 +255,9 @@ rewrite(FS *fs)
   sokay = NOTOKAY;
   }
  
 - p2 = p1 + 1;/* Set end pointer. */
 + p2 = *p1 ? p1 + 1 : p1; /* Set end pointer -- make sure
 +  * that it's non-NUL/-NULL first
 +  * though. */
   cs[0] = *p1;/* Set conversion string. */
   cs[1] = '\0';
  
 @@ -449,13 +451,21 @@ escape(char *p1)
   char *p2;
  
   /* alphabetic escape sequences have to be done in place */
 - for (p2 = p1;; ++p1, ++p2) {
 - if (!*p1) {
 - *p2 = *p1;
 - break;
 - }
 - if (*p1 == '\\')
 - switch(*++p1) {
 + for (p2 = p1; *p1; p1++, p2++) {
 + /* 
 +  * Let's take a peak at the next item and see whether or not
 +  * we need to escape the value...
 +  */
 + if (*p1 == '\\') {
 +
 + p1++;
 +
 + switch(*p1) {
 + /* A standalone `\' */
 + case '\0':
 + *p2 = '\\';
 + *++p2 = '\0';
 + break;

This chunk needs to be reworked. This case causes a buffer overflow
because p1 points to the end of the string here and is then incremented
and dereferenced by the for loop.

Also, after the for loop p2 needs to be zero-terminated. Currently, the
output has an extra n at the beginning of every line:

  2f 2a 2d 0a 20 2a 20 43  6f 70 79 72 69 67 68 74  |/*-. * Copyright|
n0010  20 28 63 29 20 31 39 39  30 2c 20 31 39 39 33 0a  | (c) 1990, 1993.|
n0020  20 2a 09 54 68 65 20 52  65 67 65 6e 74 73 20 6f  | *.The Regents o|

   case 'a':
/* *p2 = '\a'; */
   *p2 = '\007';
 @@ -482,7 +492,12 @@ escape(char *p1)
   *p2 = *p1;
   break;
   }
 +
 + } else
 + *p2 = *p1;
 +
   }
 +
  }
  
  void
 


signature.asc
Description: This is a digitally signed message part.


Re: svn commit: r230193 - head/lib/libc/sparc64/fpu

2012-01-16 Thread David Schultz
On Tue, Jan 17, 2012, Bruce Evans wrote:
 On Mon, 16 Jan 2012, David Schultz wrote:
 
 Log:
  Computations on NaNs are supposed to return one of the input NaNs 
  unchanged.
  Fix a few places in the sparc64 floating-point emulator where this wasn't
  being handled properly.
 
  Submitted by:   bde
 
 Thanks.  The only remaining large bug that I noticed near this is that
 without -mhard-quad-float, signaling NaNs are not quieted and (IIRC)
 FE_INVALID is not raised.
 
 BTW, NetBSD in 2005 uses Hauser soft-float for long doubles on sparc64,
 and at least the MI parts of it are almost identical with the Hauser
 soft-float in FreeBSD.  But FreeBSD uses a completely different version
 of soft-float for sparc64.  It was apparently what NetBSD was using
 in 2002 when it was imported into FreeBSD.  Perhaps the Hauser version
 is better (more correct or faster).  However, the other version is
 much simpler and looks much nicer -- it was originally from Berkeley
 and has almost perfect KNF formatting (over 95% of lines are perfectly
 formatted accoring to knfom; that is much better than 4.4BSD-Lite2
 sys/kern/*.c (88%) and FreeBSD-current sys/kern/*.c (89%, not counting
 kern_intr.c which is about 0% after a single C++ comment in it confuses
 indent(1)) and contrib/nvi/*/*.c (94%).  Hauser soft-float has a Gnuish
 style with 4-char indents amd is 26% KNF (probably mainly for the the
 empty lines and some comments).

softfloat is probably better.  The style of contrib sources is
what it is, and we have worse in the tree.

That said, I don't have the cycles right now to fix what ain't
broken.  Moving all of the libc/quad/ floating-point routines to
softfloat is more important, because that stuff *is* broken.
___
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: r230228 - head/sys/powerpc/include

2012-01-16 Thread David Schultz
Author: das
Date: Mon Jan 16 20:17:29 2012
New Revision: 230228
URL: http://svn.freebsd.org/changeset/base/230228

Log:
  Change the definition of FLT_EVAL_METHOD from 1 to 0.  A value of 1 implies
  that the compiler promotes floats to double precision in computations, but
  inspection of the output of a cross-compiler indicates that this isn't the
  case on powerpc.

Modified:
  head/sys/powerpc/include/float.h

Modified: head/sys/powerpc/include/float.h
==
--- head/sys/powerpc/include/float.hMon Jan 16 19:41:24 2012
(r230227)
+++ head/sys/powerpc/include/float.hMon Jan 16 20:17:29 2012
(r230228)
@@ -47,7 +47,7 @@ __END_DECLS
 
 #define FLT_RADIX  2   /* b */
 #if __ISO_C_VISIBLE = 1999
-#defineFLT_EVAL_METHOD 1   /* operands promoted to double 
*/
+#defineFLT_EVAL_METHOD 0
 #defineDECIMAL_DIG 17  /* max precision in decimal 
digits */
 #endif
 
___
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: r230229 - in head/sys: arm/include mips/include powerpc/include

2012-01-16 Thread David Schultz
Author: das
Date: Mon Jan 16 20:17:51 2012
New Revision: 230229
URL: http://svn.freebsd.org/changeset/base/230229

Log:
  Fix the value of float_t to match what is implied by FLT_EVAL_METHOD.

Modified:
  head/sys/arm/include/_types.h
  head/sys/mips/include/_types.h
  head/sys/powerpc/include/_types.h

Modified: head/sys/arm/include/_types.h
==
--- head/sys/arm/include/_types.h   Mon Jan 16 20:17:29 2012
(r230228)
+++ head/sys/arm/include/_types.h   Mon Jan 16 20:17:51 2012
(r230229)
@@ -69,7 +69,7 @@ typedef   unsigned long long  __uint64_t;
 typedef__uint32_t  __clock_t;  /* clock()... */
 typedef__int32_t   __critical_t;
 typedefdouble  __double_t;
-typedefdouble  __float_t;
+typedeffloat   __float_t;
 typedef__int32_t   __intfptr_t;
 typedef__int64_t   __intmax_t;
 typedef__int32_t   __intptr_t;

Modified: head/sys/mips/include/_types.h
==
--- head/sys/mips/include/_types.h  Mon Jan 16 20:17:29 2012
(r230228)
+++ head/sys/mips/include/_types.h  Mon Jan 16 20:17:51 2012
(r230229)
@@ -74,7 +74,7 @@ typedef   unsigned long long  __uint64_t;
  */
 typedef__int32_t   __clock_t;  /* clock()... */
 typedefdouble  __double_t;
-typedefdouble  __float_t;
+typedeffloat   __float_t;
 #ifdef __mips_n64
 typedef__int64_t   __critical_t;
 typedef__int64_t   __intfptr_t;

Modified: head/sys/powerpc/include/_types.h
==
--- head/sys/powerpc/include/_types.h   Mon Jan 16 20:17:29 2012
(r230228)
+++ head/sys/powerpc/include/_types.h   Mon Jan 16 20:17:51 2012
(r230229)
@@ -73,7 +73,7 @@ typedef   unsigned long long  __uint64_t;
  */
 typedef__uint32_t  __clock_t;  /* clock()... */
 typedefdouble  __double_t;
-typedefdouble  __float_t;
+typedeffloat   __float_t;
 #ifdef __LP64__
 typedef__int64_t   __critical_t;
 typedef__int64_t   __intfptr_t;
___
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: r230230 - head/sys/dev/random

2012-01-16 Thread David Schultz
Author: das
Date: Mon Jan 16 20:18:10 2012
New Revision: 230230
URL: http://svn.freebsd.org/changeset/base/230230

Log:
  Generate a warning if the kernel's arc4random() is seeded with bogus entropy.

Modified:
  head/sys/dev/random/harvest.c

Modified: head/sys/dev/random/harvest.c
==
--- head/sys/dev/random/harvest.c   Mon Jan 16 20:17:51 2012
(r230229)
+++ head/sys/dev/random/harvest.c   Mon Jan 16 20:18:10 2012
(r230230)
@@ -37,6 +37,7 @@ __FBSDID($FreeBSD$);
 #include sys/queue.h
 #include sys/random.h
 #include sys/selinfo.h
+#include sys/syslog.h
 #include sys/systm.h
 #include sys/sysctl.h
 
@@ -48,6 +49,7 @@ static int read_random_phony(void *, int
 
 /* Structure holding the desired entropy sources */
 struct harvest_select harvest = { 1, 1, 1, 0 };
+static int warned = 0;
 
 /* hold the address of the routine which is actually called if
  * the randomdev is loaded
@@ -71,6 +73,7 @@ random_yarrow_deinit_harvester(void)
 {
reap_func = NULL;
read_func = read_random_phony;
+   warned = 0;
 }
 
 /* Entropy harvesting routine. This is supposed to be fast; do
@@ -108,6 +111,11 @@ read_random_phony(void *buf, int count)
u_long randval;
int size, i;
 
+   if (!warned) {
+   log(LOG_WARNING, random device not loaded; using insecure 
entropy\n);
+   warned = 1;
+   }
+
/* srandom() is called in kern/init_main.c:proc0_post() */
 
/* Fill buf[] with random(9) output */
___
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: r230231 - head/sys/kern

2012-01-16 Thread Sergey Kandaurov
Author: pluknet
Date: Mon Jan 16 20:42:56 2012
New Revision: 230231
URL: http://svn.freebsd.org/changeset/base/230231

Log:
  Be pedantic and change // comment to C-style one.
  
  Noticed by:   Bruce Evans

Modified:
  head/sys/kern/kern_intr.c

Modified: head/sys/kern/kern_intr.c
==
--- head/sys/kern/kern_intr.c   Mon Jan 16 20:18:10 2012(r230230)
+++ head/sys/kern/kern_intr.c   Mon Jan 16 20:42:56 2012(r230231)
@@ -633,7 +633,7 @@ intr_event_add_handler(struct intr_event
mtx_lock(ie-ie_lock);
it-it_event = ie; 
ih-ih_thread = it;
-   ithread_update(it); // XXX - do we really need this?!?!?
+   ithread_update(it); /* XXX - do we really need this?!?!? */
} else { /* Create the global per-event thread if we need one. */
while (ie-ie_thread == NULL  handler != NULL) {
if (ie-ie_flags  IE_ADDING_THREAD)
___
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: r230233 - head/lib/libutil

2012-01-16 Thread Guy Helmer
Author: ghelmer
Date: Mon Jan 16 21:19:23 2012
New Revision: 230233
URL: http://svn.freebsd.org/changeset/base/230233

Log:
  Fix more disorder in prototypes and constants.
  Fix header comments for each section of constants.
  Fix whitespace in #define lines.
  Fix unnecessary parenthesis in constants.

Modified:
  head/lib/libutil/libutil.h

Modified: head/lib/libutil/libutil.h
==
--- head/lib/libutil/libutil.h  Mon Jan 16 20:45:29 2012(r230232)
+++ head/lib/libutil/libutil.h  Mon Jan 16 21:19:23 2012(r230233)
@@ -49,8 +49,8 @@ typedef   __gid_t gid_t;
 #endif
 
 #ifndef _MODE_T_DECLARED
-typedef __mode_t   mode_t;
-#define _MODE_T_DECLARED
+typedef__mode_tmode_t;
+#define_MODE_T_DECLARED
 #endif
 
 #ifndef _PID_T_DECLARED
@@ -68,8 +68,8 @@ typedef   __uid_t uid_t;
 #define_UID_T_DECLARED
 #endif
 
-#define PROPERTY_MAX_NAME  64
-#define PROPERTY_MAX_VALUE 512
+#definePROPERTY_MAX_NAME   64
+#definePROPERTY_MAX_VALUE  512
 
 /* for properties.c */
 typedef struct _property {
@@ -80,9 +80,6 @@ typedef struct _property {
 
 /* Avoid pulling in all the include files for no need */
 struct in_addr;
-struct kinfo_file;
-struct kinfo_proc;
-struct kinfo_vmentry;
 struct pidfh;
 struct sockaddr;
 struct termios;
@@ -114,6 +111,12 @@ intkld_load(const char *_name);
 intlogin_tty(int _fd);
 intopenpty(int *_amaster, int *_aslave, char *_name,
struct termios *_termp, struct winsize *_winp);
+intpidfile_close(struct pidfh *_pfh);
+intpidfile_fileno(const struct pidfh *_pfh);
+struct pidfh *
+   pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr);
+intpidfile_remove(struct pidfh *_pfh);
+intpidfile_write(struct pidfh *_pfh);
 void   properties_free(properties _list);
 char   *property_find(properties _list, const char *_name);
 properties
@@ -170,13 +173,6 @@ struct group
 intgr_tmp(int _mdf);
 #endif
 
-intpidfile_close(struct pidfh *_pfh);
-intpidfile_fileno(const struct pidfh *_pfh);
-struct pidfh *
-   pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr);
-intpidfile_remove(struct pidfh *_pfh);
-intpidfile_write(struct pidfh *_pfh);
-
 #ifdef _UFS_UFS_QUOTA_H_
 struct fstab;
 struct quotafile;
@@ -199,22 +195,6 @@ intquota_write_usage(struct quotafile *
 
 __END_DECLS
 
-#define UU_LOCK_INUSE (1)
-#define UU_LOCK_OK (0)
-#define UU_LOCK_OPEN_ERR (-1)
-#define UU_LOCK_READ_ERR (-2)
-#define UU_LOCK_CREAT_ERR (-3)
-#define UU_LOCK_WRITE_ERR (-4)
-#define UU_LOCK_LINK_ERR (-5)
-#define UU_LOCK_TRY_ERR (-6)
-#define UU_LOCK_OWNER_ERR (-7)
-
-/* return values from realhostname() */
-#define HOSTNAME_FOUND (0)
-#define HOSTNAME_INCORRECTNAME (1)
-#define HOSTNAME_INVALIDADDR   (2)
-#define HOSTNAME_INVALIDNAME   (3)
-
 /* fparseln(3) */
 #defineFPARSELN_UNESCESC   0x01
 #defineFPARSELN_UNESCCONT  0x02
@@ -222,26 +202,43 @@ __END_DECLS
 #defineFPARSELN_UNESCREST  0x08
 #defineFPARSELN_UNESCALL   0x0f
 
-/* pw_scan() */
-#define PWSCAN_MASTER  0x01
-#define PWSCAN_WARN0x02
-
-/* humanize_number(3) */
-#define HN_DECIMAL 0x01
-#define HN_NOSPACE 0x02
-#define HN_B   0x04
-#define HN_DIVISOR_10000x08
-#define HN_IEC_PREFIXES0x10
-
-/* maxscale = 0x07 */
-#define HN_GETSCALE0x10
-#define HN_AUTOSCALE   0x20
-
-/* hexdump(3) */
+/* Flags for hexdump(3). */
 #defineHD_COLUMN_MASK  0xff
 #defineHD_DELIM_MASK   0xff00
 #defineHD_OMIT_COUNT   (1  16)
 #defineHD_OMIT_HEX (1  17)
 #defineHD_OMIT_CHARS   (1  18)
 
+/* Flags for humanize_number(3) flags. */
+#defineHN_DECIMAL  0x01
+#defineHN_NOSPACE  0x02
+#defineHN_B0x04
+#defineHN_DIVISOR_1000 0x08
+#defineHN_IEC_PREFIXES 0x10
+
+/* Flags for humanize_number(3) scale. */
+#defineHN_GETSCALE 0x10
+#defineHN_AUTOSCALE0x20
+
+/* return values from realhostname(). */
+#defineHOSTNAME_FOUND  0
+#defineHOSTNAME_INCORRECTNAME  1
+#defineHOSTNAME_INVALIDADDR2
+#defineHOSTNAME_INVALIDNAME3
+
+/* Flags for pw_scan(). */
+#definePWSCAN_MASTER   0x01
+#definePWSCAN_WARN 0x02
+
+/* Return values from uu_lock(). */
+#defineUU_LOCK_INUSE   1
+#defineUU_LOCK_OK  0
+#defineUU_LOCK_OPEN_ERR-1
+#defineUU_LOCK_READ_ERR-2
+#defineUU_LOCK_CREAT_ERR   -3
+#defineUU_LOCK_WRITE_ERR   -4
+#defineUU_LOCK_LINK_ERR-5
+#defineUU_LOCK_TRY_ERR 

svn commit: r230234 - head/lib/libutil

2012-01-16 Thread Guy Helmer
Author: ghelmer
Date: Mon Jan 16 21:25:41 2012
New Revision: 230234
URL: http://svn.freebsd.org/changeset/base/230234

Log:
  Remove unnecessary includes from these libutil man pages.
  
  Requested by bde (as was the previous commit).

Modified:
  head/lib/libutil/pidfile.3
  head/lib/libutil/property.3
  head/lib/libutil/realhostname.3

Modified: head/lib/libutil/pidfile.3
==
--- head/lib/libutil/pidfile.3  Mon Jan 16 21:19:23 2012(r230233)
+++ head/lib/libutil/pidfile.3  Mon Jan 16 21:25:41 2012(r230234)
@@ -36,7 +36,6 @@
 .Sh LIBRARY
 .Lb libutil
 .Sh SYNOPSIS
-.In sys/param.h
 .In libutil.h
 .Ft struct pidfh *
 .Fn pidfile_open const char *path mode_t mode pid_t *pidptr

Modified: head/lib/libutil/property.3
==
--- head/lib/libutil/property.3 Mon Jan 16 21:19:23 2012(r230233)
+++ head/lib/libutil/property.3 Mon Jan 16 21:25:41 2012(r230234)
@@ -36,7 +36,6 @@
 .Sh LIBRARY
 .Lb libutil
 .Sh SYNOPSIS
-.In sys/types.h
 .In libutil.h
 .Ft properties
 .Fn properties_read int fd

Modified: head/lib/libutil/realhostname.3
==
--- head/lib/libutil/realhostname.3 Mon Jan 16 21:19:23 2012
(r230233)
+++ head/lib/libutil/realhostname.3 Mon Jan 16 21:25:41 2012
(r230234)
@@ -33,8 +33,6 @@
 .Sh LIBRARY
 .Lb libutil
 .Sh SYNOPSIS
-.In sys/types.h
-.In netinet/in.h
 .In libutil.h
 .Ft int
 .Fn realhostname char *host size_t hsize const struct in_addr *ip
___
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: r230159 - stable/8/sys/kern

2012-01-16 Thread Bjoern A. Zeeb

On 16. Jan 2012, at 17:41 , Andriy Gapon wrote:

 on 15/01/2012 22:52 Eitan Adler said the following:
 Author: eadler (ports committer)
 Date: Sun Jan 15 20:52:31 2012
 New Revision: 230159
 URL: http://svn.freebsd.org/changeset/base/230159
 
 Log:
  MFC r228343:
   - Fix ktrace leakage if error is set
 
  PR: kern/163098
  Approved by:sbruno
 
 Modified:
  stable/8/sys/kern/kern_ktrace.c
 Directory Properties:
  stable/8/sys/   (props changed)
 
 Eitan,
 
 the list of the directory properties changes seems to be too short.
 Have you made a common mistake of cleaning up the results of svn merge or 
 do you
 have a sparse checkout of sys?  Or something else?

I think he just uses svn 1.7.x

/bz

 
 Modified: stable/8/sys/kern/kern_ktrace.c
 ==
 --- stable/8/sys/kern/kern_ktrace.c  Sun Jan 15 20:52:01 2012
 (r230158)
 +++ stable/8/sys/kern/kern_ktrace.c  Sun Jan 15 20:52:31 2012
 (r230159)
 @@ -473,7 +473,7 @@ ktrsysret(code, error, retval)
  ktp = req-ktr_data.ktr_sysret;
  ktp-ktr_code = code;
  ktp-ktr_error = error;
 -ktp-ktr_retval = retval;   /* what about val2 ? */
 +ktp-ktr_retval = ((error == 0) ? retval: 0);   /* what about 
 val2 ? */
  ktr_submitrequest(curthread, req);
 }
 
 
 
 -- 
 Andriy Gapon

-- 
Bjoern A. Zeeb You have to have visions!
   It does not matter how good you are. It matters what good you do!

___
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: r230231 - head/sys/kern

2012-01-16 Thread Joerg Sonnenberger
On Mon, Jan 16, 2012 at 08:42:56PM +, Sergey Kandaurov wrote:
 Log:
   Be pedantic and change // comment to C-style one.

If you want to be pedantic, at least be correct. // is perfectly valid
C99.

Joerg
___
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: r230237 - in stable/9: contrib/gperf contrib/gperf/doc contrib/gperf/lib contrib/gperf/src contrib/gperf/tests gnu/usr.bin/gperf sys/sys

2012-01-16 Thread Baptiste Daroussin
Author: bapt
Date: Mon Jan 16 22:17:12 2012
New Revision: 230237
URL: http://svn.freebsd.org/changeset/base/230237

Log:
  MFC r228060, r228068, r228060
  
  Upgrade gperf to 3.0.3 latest GPLv2 version
  
  Approved by:des (mentor)

Added:
  stable/9/contrib/gperf/configure.ac
 - copied unchanged from r228060, head/contrib/gperf/configure.ac
  stable/9/contrib/gperf/doc/configure.ac
 - copied unchanged from r228060, head/contrib/gperf/doc/configure.ac
  stable/9/contrib/gperf/lib/configure.ac
 - copied unchanged from r228060, head/contrib/gperf/lib/configure.ac
  stable/9/contrib/gperf/lib/getline.cc
 - copied unchanged from r228060, head/contrib/gperf/lib/getline.cc
  stable/9/contrib/gperf/lib/getline.h
 - copied unchanged from r228060, head/contrib/gperf/lib/getline.h
  stable/9/contrib/gperf/src/config.h_vms
 - copied unchanged from r228060, head/contrib/gperf/src/config.h_vms
  stable/9/contrib/gperf/src/configure.ac
 - copied unchanged from r228060, head/contrib/gperf/src/configure.ac
  stable/9/contrib/gperf/src/input.cc
 - copied unchanged from r228060, head/contrib/gperf/src/input.cc
  stable/9/contrib/gperf/src/input.h
 - copied unchanged from r228060, head/contrib/gperf/src/input.h
  stable/9/contrib/gperf/src/keyword-list.cc
 - copied unchanged from r228060, head/contrib/gperf/src/keyword-list.cc
  stable/9/contrib/gperf/src/keyword-list.h
 - copied unchanged from r228060, head/contrib/gperf/src/keyword-list.h
  stable/9/contrib/gperf/src/keyword-list.icc
 - copied unchanged from r228060, head/contrib/gperf/src/keyword-list.icc
  stable/9/contrib/gperf/src/keyword.cc
 - copied unchanged from r228060, head/contrib/gperf/src/keyword.cc
  stable/9/contrib/gperf/src/keyword.h
 - copied unchanged from r228060, head/contrib/gperf/src/keyword.h
  stable/9/contrib/gperf/src/keyword.icc
 - copied unchanged from r228060, head/contrib/gperf/src/keyword.icc
  stable/9/contrib/gperf/src/output.cc
 - copied, changed from r228060, head/contrib/gperf/src/output.cc
  stable/9/contrib/gperf/src/output.h
 - copied unchanged from r228060, head/contrib/gperf/src/output.h
  stable/9/contrib/gperf/src/positions.cc
 - copied unchanged from r228060, head/contrib/gperf/src/positions.cc
  stable/9/contrib/gperf/src/positions.h
 - copied unchanged from r228060, head/contrib/gperf/src/positions.h
  stable/9/contrib/gperf/src/positions.icc
 - copied unchanged from r228060, head/contrib/gperf/src/positions.icc
  stable/9/contrib/gperf/src/search.cc
 - copied unchanged from r228060, head/contrib/gperf/src/search.cc
  stable/9/contrib/gperf/src/search.h
 - copied unchanged from r228060, head/contrib/gperf/src/search.h
Replaced:
  stable/9/contrib/gperf/doc/gperf.texi
 - copied unchanged from r228068, head/contrib/gperf/doc/gperf.texi
  stable/9/contrib/gperf/doc/gpl.texinfo
 - copied unchanged from r228068, head/contrib/gperf/doc/gpl.texinfo
Deleted:
  stable/9/contrib/gperf/acconfig.h
  stable/9/contrib/gperf/configure.in
  stable/9/contrib/gperf/doc/configure.in
  stable/9/contrib/gperf/doc/texinfo.tex
  stable/9/contrib/gperf/lib/configure.in
  stable/9/contrib/gperf/src/configure.in
  stable/9/contrib/gperf/src/gen-perf.cc
  stable/9/contrib/gperf/src/gen-perf.h
  stable/9/contrib/gperf/src/iterator.cc
  stable/9/contrib/gperf/src/iterator.h
  stable/9/contrib/gperf/src/key-list.cc
  stable/9/contrib/gperf/src/key-list.h
  stable/9/contrib/gperf/src/list-node.cc
  stable/9/contrib/gperf/src/list-node.h
  stable/9/contrib/gperf/src/new.cc
  stable/9/contrib/gperf/src/read-line.cc
  stable/9/contrib/gperf/src/read-line.h
  stable/9/contrib/gperf/src/read-line.icc
  stable/9/contrib/gperf/src/trace.cc
  stable/9/contrib/gperf/src/trace.h
  stable/9/contrib/gperf/src/vectors.cc
  stable/9/contrib/gperf/src/vectors.h
  stable/9/contrib/gperf/tests/
Modified:
  stable/9/contrib/gperf/AUTHORS
  stable/9/contrib/gperf/COPYING
  stable/9/contrib/gperf/ChangeLog
  stable/9/contrib/gperf/FREEBSD-Xlist
  stable/9/contrib/gperf/INSTALL
  stable/9/contrib/gperf/Makefile.devel
  stable/9/contrib/gperf/Makefile.in
  stable/9/contrib/gperf/NEWS
  stable/9/contrib/gperf/README
  stable/9/contrib/gperf/aclocal.m4
  stable/9/contrib/gperf/configure
  stable/9/contrib/gperf/doc/Makefile.in
  stable/9/contrib/gperf/doc/configure
  stable/9/contrib/gperf/doc/gperf.1
  stable/9/contrib/gperf/doc/help2man
  stable/9/contrib/gperf/lib/Makefile.in
  stable/9/contrib/gperf/lib/configure
  stable/9/contrib/gperf/lib/hash.cc
  stable/9/contrib/gperf/lib/hash.h
  stable/9/contrib/gperf/src/Makefile.in
  stable/9/contrib/gperf/src/bool-array.cc
  stable/9/contrib/gperf/src/bool-array.h
  stable/9/contrib/gperf/src/bool-array.icc
  stable/9/contrib/gperf/src/config.h.in
  stable/9/contrib/gperf/src/configure
  stable/9/contrib/gperf/src/hash-table.cc
  stable/9/contrib/gperf/src/hash-table.h
  stable/9/contrib/gperf/src/main.cc
  

svn commit: r230238 - in head/sys/dev/usb: . quirk serial

2012-01-16 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan 16 22:26:25 2012
New Revision: 230238
URL: http://svn.freebsd.org/changeset/base/230238

Log:
  Add support for more USB devices.
  
  Submitted by: pav @
  MFC after:1 week

Modified:
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==
--- head/sys/dev/usb/quirk/usb_quirk.c  Mon Jan 16 22:17:12 2012
(r230237)
+++ head/sys/dev/usb/quirk/usb_quirk.c  Mon Jan 16 22:26:25 2012
(r230238)
@@ -134,6 +134,7 @@ static struct usb_quirk_entry usb_quirks
USB_QUIRK(QUALCOMM2, CDMA_MSM, 0x, 0x, UQ_ASSUME_CM_OVER_DATA),
USB_QUIRK(CURITEL, UM150, 0x, 0x, UQ_ASSUME_CM_OVER_DATA),
USB_QUIRK(CURITEL, UM175, 0x, 0x, UQ_ASSUME_CM_OVER_DATA),
+   USB_QUIRK(VERTEX, VW110L, 0x, 0x, UQ_ASSUME_CM_OVER_DATA),
 
/* USB Mass Storage Class Quirks */
USB_QUIRK_VP(USB_VENDOR_ASAHIOPTICAL, 0, UQ_MSC_NO_RS_CLEAR_UA,

Modified: head/sys/dev/usb/serial/u3g.c
==
--- head/sys/dev/usb/serial/u3g.c   Mon Jan 16 22:17:12 2012
(r230237)
+++ head/sys/dev/usb/serial/u3g.c   Mon Jan 16 22:26:25 2012
(r230238)
@@ -354,6 +354,7 @@ static const STRUCT_USB_HOST_ID u3g_devs
U3G_DEV(QISDA, H21_2, 0),
U3G_DEV(QUALCOMM2, AC8700, 0),
U3G_DEV(QUALCOMM2, MF330, 0),
+   U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT),
U3G_DEV(QUALCOMMINC, AC2726, 0),
U3G_DEV(QUALCOMMINC, AC8700, 0),
U3G_DEV(QUALCOMMINC, AC8710, 0),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsMon Jan 16 22:17:12 2012(r230237)
+++ head/sys/dev/usb/usbdevsMon Jan 16 22:26:25 2012(r230238)
@@ -679,6 +679,7 @@ vendor QISDA0x1da5  Qisda
 vendor METAGEEK2   0x1dd5  MetaGeek
 vendor ALINK   0x1e0e  Alink
 vendor AIRTIES 0x1eda  AirTies
+vendor VERTEX  0x1fe7  Vertex Wireless Co., Ltd.
 vendor DLINK   0x2001  D-Link
 vendor PLANEX2 0x2019  Planex Communications
 vendor HAUPPAUGE2  0x2040  Hauppauge Computer Works
@@ -2679,6 +2680,7 @@ product QUALCOMM2 MF330   0x6613  MF330
 product QUALCOMM2 RWT_FCT  0x3100  RWT FCT-CDMA 2000 1xRTT modem
 product QUALCOMM2 CDMA_MSM 0x3196  CDMA Technologies MSM modem
 product QUALCOMM2 AC8700   0x6000  AC8700
+product QUALCOMM2 VW110L   0x1000  Vertex Wireless 110L modem
 product QUALCOMMINC CDMA_MSM   0x0001  CDMA Technologies MSM modem
 product QUALCOMMINC E0002  0x0002  3G modem
 product QUALCOMMINC E0003  0x0003  3G modem
@@ -3374,6 +3376,9 @@ product VIA USB2IDEBRIDGE 0x6204  USB 2.0
 /* Vaisala products */
 product VAISALA CABLE  0x0200  USB Interface cable
 
+/* Vertex products */
+product VERTEX VW110L  0x0100  Vertex VW110L modem
+
 /* VidzMedia products */
 product VIDZMEDIA MONSTERTV0x4fb1  MonsterTV P2H
 
___
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: r230239 - in stable/8: contrib/gperf contrib/gperf/doc contrib/gperf/lib contrib/gperf/src contrib/gperf/tests gnu/usr.bin/gperf sys/sys

2012-01-16 Thread Baptiste Daroussin
Author: bapt
Date: Mon Jan 16 22:26:45 2012
New Revision: 230239
URL: http://svn.freebsd.org/changeset/base/230239

Log:
  MFC r228060, r228068, r228060
  
  Upgrade gperf to 3.0.3 latest GPLv2 version
  
  Approved by:des (mentor)

Added:
  stable/8/contrib/gperf/configure.ac
 - copied unchanged from r228060, head/contrib/gperf/configure.ac
  stable/8/contrib/gperf/doc/configure.ac
 - copied unchanged from r228060, head/contrib/gperf/doc/configure.ac
  stable/8/contrib/gperf/lib/configure.ac
 - copied unchanged from r228060, head/contrib/gperf/lib/configure.ac
  stable/8/contrib/gperf/lib/getline.cc
 - copied unchanged from r228060, head/contrib/gperf/lib/getline.cc
  stable/8/contrib/gperf/lib/getline.h
 - copied unchanged from r228060, head/contrib/gperf/lib/getline.h
  stable/8/contrib/gperf/src/config.h_vms
 - copied unchanged from r228060, head/contrib/gperf/src/config.h_vms
  stable/8/contrib/gperf/src/configure.ac
 - copied unchanged from r228060, head/contrib/gperf/src/configure.ac
  stable/8/contrib/gperf/src/input.cc
 - copied unchanged from r228060, head/contrib/gperf/src/input.cc
  stable/8/contrib/gperf/src/input.h
 - copied unchanged from r228060, head/contrib/gperf/src/input.h
  stable/8/contrib/gperf/src/keyword-list.cc
 - copied unchanged from r228060, head/contrib/gperf/src/keyword-list.cc
  stable/8/contrib/gperf/src/keyword-list.h
 - copied unchanged from r228060, head/contrib/gperf/src/keyword-list.h
  stable/8/contrib/gperf/src/keyword-list.icc
 - copied unchanged from r228060, head/contrib/gperf/src/keyword-list.icc
  stable/8/contrib/gperf/src/keyword.cc
 - copied unchanged from r228060, head/contrib/gperf/src/keyword.cc
  stable/8/contrib/gperf/src/keyword.h
 - copied unchanged from r228060, head/contrib/gperf/src/keyword.h
  stable/8/contrib/gperf/src/keyword.icc
 - copied unchanged from r228060, head/contrib/gperf/src/keyword.icc
  stable/8/contrib/gperf/src/output.cc
 - copied, changed from r228060, head/contrib/gperf/src/output.cc
  stable/8/contrib/gperf/src/output.h
 - copied unchanged from r228060, head/contrib/gperf/src/output.h
  stable/8/contrib/gperf/src/positions.cc
 - copied unchanged from r228060, head/contrib/gperf/src/positions.cc
  stable/8/contrib/gperf/src/positions.h
 - copied unchanged from r228060, head/contrib/gperf/src/positions.h
  stable/8/contrib/gperf/src/positions.icc
 - copied unchanged from r228060, head/contrib/gperf/src/positions.icc
  stable/8/contrib/gperf/src/search.cc
 - copied unchanged from r228060, head/contrib/gperf/src/search.cc
  stable/8/contrib/gperf/src/search.h
 - copied unchanged from r228060, head/contrib/gperf/src/search.h
Replaced:
  stable/8/contrib/gperf/doc/gperf.texi
 - copied unchanged from r228068, head/contrib/gperf/doc/gperf.texi
  stable/8/contrib/gperf/doc/gpl.texinfo
 - copied unchanged from r228068, head/contrib/gperf/doc/gpl.texinfo
Deleted:
  stable/8/contrib/gperf/acconfig.h
  stable/8/contrib/gperf/configure.in
  stable/8/contrib/gperf/doc/configure.in
  stable/8/contrib/gperf/doc/texinfo.tex
  stable/8/contrib/gperf/lib/configure.in
  stable/8/contrib/gperf/src/configure.in
  stable/8/contrib/gperf/src/gen-perf.h
  stable/8/contrib/gperf/src/iterator.cc
  stable/8/contrib/gperf/src/iterator.h
  stable/8/contrib/gperf/src/key-list.h
  stable/8/contrib/gperf/src/list-node.cc
  stable/8/contrib/gperf/src/list-node.h
  stable/8/contrib/gperf/src/new.cc
  stable/8/contrib/gperf/src/read-line.cc
  stable/8/contrib/gperf/src/read-line.h
  stable/8/contrib/gperf/src/read-line.icc
  stable/8/contrib/gperf/src/trace.cc
  stable/8/contrib/gperf/src/trace.h
  stable/8/contrib/gperf/src/vectors.cc
  stable/8/contrib/gperf/src/vectors.h
  stable/8/contrib/gperf/tests/
Modified:
  stable/8/contrib/gperf/AUTHORS
  stable/8/contrib/gperf/COPYING
  stable/8/contrib/gperf/ChangeLog
  stable/8/contrib/gperf/FREEBSD-Xlist
  stable/8/contrib/gperf/INSTALL
  stable/8/contrib/gperf/Makefile.devel
  stable/8/contrib/gperf/Makefile.in
  stable/8/contrib/gperf/NEWS
  stable/8/contrib/gperf/README
  stable/8/contrib/gperf/aclocal.m4
  stable/8/contrib/gperf/configure
  stable/8/contrib/gperf/doc/Makefile.in
  stable/8/contrib/gperf/doc/configure
  stable/8/contrib/gperf/doc/gperf.1
  stable/8/contrib/gperf/doc/help2man
  stable/8/contrib/gperf/lib/Makefile.in
  stable/8/contrib/gperf/lib/configure
  stable/8/contrib/gperf/lib/hash.cc
  stable/8/contrib/gperf/lib/hash.h
  stable/8/contrib/gperf/src/Makefile.in
  stable/8/contrib/gperf/src/bool-array.cc
  stable/8/contrib/gperf/src/bool-array.h
  stable/8/contrib/gperf/src/bool-array.icc
  stable/8/contrib/gperf/src/config.h.in
  stable/8/contrib/gperf/src/configure
  stable/8/contrib/gperf/src/hash-table.cc
  stable/8/contrib/gperf/src/hash-table.h
  stable/8/contrib/gperf/src/main.cc
  stable/8/contrib/gperf/src/options.cc
  stable/8/contrib/gperf/src/options.h
  

Re: svn commit: r230159 - stable/8/sys/kern

2012-01-16 Thread Andriy Gapon
on 16/01/2012 23:40 Bjoern A. Zeeb said the following:
 
 On 16. Jan 2012, at 17:41 , Andriy Gapon wrote:
 
 on 15/01/2012 22:52 Eitan Adler said the following:
 Author: eadler (ports committer)
 Date: Sun Jan 15 20:52:31 2012
 New Revision: 230159
 URL: http://svn.freebsd.org/changeset/base/230159

 Log:
  MFC r228343:
  - Fix ktrace leakage if error is set

  PR:kern/163098
  Approved by:   sbruno

 Modified:
  stable/8/sys/kern/kern_ktrace.c
 Directory Properties:
  stable/8/sys/   (props changed)

 Eitan,

 the list of the directory properties changes seems to be too short.
 Have you made a common mistake of cleaning up the results of svn merge or 
 do you
 have a sparse checkout of sys?  Or something else?
 
 I think he just uses svn 1.7.x

I haven't realized that the newer svn records the mergeinfo properties
differently from 1.6.
Sorry for the noise, Eitan and all.
And thank you for the information, Bjoern.


 Modified: stable/8/sys/kern/kern_ktrace.c
 ==
 --- stable/8/sys/kern/kern_ktrace.c Sun Jan 15 20:52:01 2012
 (r230158)
 +++ stable/8/sys/kern/kern_ktrace.c Sun Jan 15 20:52:31 2012
 (r230159)
 @@ -473,7 +473,7 @@ ktrsysret(code, error, retval)
 ktp = req-ktr_data.ktr_sysret;
 ktp-ktr_code = code;
 ktp-ktr_error = error;
 -   ktp-ktr_retval = retval;   /* what about val2 ? */
 +   ktp-ktr_retval = ((error == 0) ? retval: 0);   /* what about 
 val2 ? */
 ktr_submitrequest(curthread, req);
 }



 -- 
 Andriy Gapon
 


-- 
Andriy Gapon
___
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: r230240 - stable/9

2012-01-16 Thread Jim Harris
Author: jimharris
Date: Mon Jan 16 22:59:23 2012
New Revision: 230240
URL: http://svn.freebsd.org/changeset/base/230240

Log:
  Revert r229671 mergeinfo property from root directory.  This was mistakenly
  added as part of r230223 MFC commit.
  
  Reviewed by: avg
  Approved by: sbruno

Modified:
Directory Properties:
  stable/9/   (props changed)
___
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: r230241 - stable/8

2012-01-16 Thread Jim Harris
Author: jimharris
Date: Mon Jan 16 23:02:37 2012
New Revision: 230241
URL: http://svn.freebsd.org/changeset/base/230241

Log:
  Revert r229671 mergeinfo property from root directory.  This was mistakenly
  added as part of r230224 MFC commit.
  
  Reviewed by: avg
  Approved by: sbruno

Modified:
Directory Properties:
  stable/8/   (props changed)
___
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: r230242 - in head/sys/dev/usb: . serial

2012-01-16 Thread Stanislav Sedov
Author: stas
Date: Mon Jan 16 23:14:23 2012
New Revision: 230242
URL: http://svn.freebsd.org/changeset/base/230242

Log:
  - Add ID for the BeagleBone FTDI serial over usb port.
  
  MFC after:3 days

Modified:
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/uftdi.c
==
--- head/sys/dev/usb/serial/uftdi.c Mon Jan 16 23:02:37 2012
(r230241)
+++ head/sys/dev/usb/serial/uftdi.c Mon Jan 16 23:14:23 2012
(r230242)
@@ -221,6 +221,7 @@ static STRUCT_USB_HOST_ID uftdi_devs[] =
UFTDI_DEV(FTDI, SERIAL_4232H, 8U232AM),
UFTDI_DEV(FTDI, SERIAL_8U232AM, 8U232AM),
UFTDI_DEV(FTDI, SERIAL_8U232AM4, 8U232AM),
+   UFTDI_DEV(FTDI, SERIAL_BEAGLEBONE, 8U232AM),
UFTDI_DEV(FTDI, SEMC_DSS20, 8U232AM),
UFTDI_DEV(FTDI, CFA_631, 8U232AM),
UFTDI_DEV(FTDI, CFA_632, 8U232AM),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsMon Jan 16 23:02:37 2012(r230241)
+++ head/sys/dev/usb/usbdevsMon Jan 16 23:14:23 2012(r230242)
@@ -1606,6 +1606,7 @@ product FTDI SERIAL_2232C 0x6010  FT2232C
 product FTDI SERIAL_2232D  0x9e90  FT2232D Dual port Serial
 product FTDI BEAGLEBONE0xA6D0  BeagleBone
 product FTDI SERIAL_4232H  0x6011  FT4232H Quad port Serial
+product FTDI SERIAL_BEAGLEBONE 0xa6d0  BeagleBone FTDI Serial
 /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */
 product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi
 product FTDI TACTRIX_OPENPORT_13S 0xcc49 OpenPort 1.3 Subaru
___
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: r230244 - in stable/9: sbin/geom/class/raid sys/geom/raid

2012-01-16 Thread Jim Harris
Author: jimharris
Date: Mon Jan 16 23:22:56 2012
New Revision: 230244
URL: http://svn.freebsd.org/changeset/base/230244

Log:
  MFC r229886:
  
   Add support for 2TB disks in GEOM RAID for Intel metadata format.
  
  Sponsored by: Intel
  Approved by: sbruno

Modified:
  stable/9/sbin/geom/class/raid/graid.8
  stable/9/sys/geom/raid/md_intel.c
Directory Properties:
  stable/9/sbin/geom/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/sbin/geom/class/raid/graid.8
==
--- stable/9/sbin/geom/class/raid/graid.8   Mon Jan 16 23:22:42 2012
(r230243)
+++ stable/9/sbin/geom/class/raid/graid.8   Mon Jan 16 23:22:56 2012
(r230244)
@@ -251,7 +251,7 @@ complete it there.
 Do not run GEOM RAID class on migrating volumes under pain of possible data
 corruption!
 .Sh 2TiB BARRIERS
-Intel and Promise metadata formats do not support disks above 2TiB.
+Promise metadata format does not support disks above 2TiB.
 NVIDIA metadata format does not support volumes above 2TiB.
 .Sh EXIT STATUS
 Exit status is 0 on success, and non-zero if the command fails.

Modified: stable/9/sys/geom/raid/md_intel.c
==
--- stable/9/sys/geom/raid/md_intel.c   Mon Jan 16 23:22:42 2012
(r230243)
+++ stable/9/sys/geom/raid/md_intel.c   Mon Jan 16 23:22:56 2012
(r230244)
@@ -64,7 +64,10 @@ struct intel_raid_map {
uint8_t total_domains;
uint8_t failed_disk_num;
uint8_t ddf;
-   uint32_tfiller_2[7];
+   uint32_toffset_hi;
+   uint32_tdisk_sectors_hi;
+   uint32_tstripe_count_hi;
+   uint32_tfiller_2[4];
uint32_tdisk_idx[1];/* total_disks entries. */
 #define INTEL_DI_IDX   0x00ff
 #define INTEL_DI_RBLD  0x0100
@@ -111,7 +114,8 @@ struct intel_raid_vol {
uint8_t fs_state;
uint16_tverify_errors;
uint16_tbad_blocks;
-   uint32_tfiller_1[4];
+   uint32_tcurr_migr_unit_hi;
+   uint32_tfiller_1[3];
struct intel_raid_map map[1];   /* 2 entries if migr_state != 0. */
 } __packed;
 
@@ -125,8 +129,9 @@ struct intel_raid_disk {
 #define INTEL_F_ASSIGNED   0x02
 #define INTEL_F_FAILED 0x04
 #define INTEL_F_ONLINE 0x08
-
-   uint32_tfiller[5];
+   uint32_towner_cfg_num;
+   uint32_tsectors_hi;
+   uint32_tfiller[3];
 } __packed;
 
 struct intel_raid_conf {
@@ -254,6 +259,82 @@ intel_get_volume(struct intel_raid_conf 
return (mvol);
 }
 
+static off_t
+intel_get_map_offset(struct intel_raid_map *mmap)
+{
+   off_t offset = (off_t)mmap-offset_hi  32;
+
+   offset += mmap-offset;
+   return (offset);
+}
+
+static void
+intel_set_map_offset(struct intel_raid_map *mmap, off_t offset)
+{
+
+   mmap-offset = offset  0x;
+   mmap-offset_hi = offset  32;
+}
+
+static off_t
+intel_get_map_disk_sectors(struct intel_raid_map *mmap)
+{
+   off_t disk_sectors = (off_t)mmap-disk_sectors_hi  32;
+
+   disk_sectors += mmap-disk_sectors;
+   return (disk_sectors);
+}
+
+static void
+intel_set_map_disk_sectors(struct intel_raid_map *mmap, off_t disk_sectors)
+{
+
+   mmap-disk_sectors = disk_sectors  0x;
+   mmap-disk_sectors_hi = disk_sectors  32;
+}
+
+static void
+intel_set_map_stripe_count(struct intel_raid_map *mmap, off_t stripe_count)
+{
+
+   mmap-stripe_count = stripe_count  0x;
+   mmap-stripe_count_hi = stripe_count  32;
+}
+
+static off_t
+intel_get_disk_sectors(struct intel_raid_disk *disk)
+{
+   off_t sectors = (off_t)disk-sectors_hi  32;
+
+   sectors += disk-sectors;
+   return (sectors);
+}
+
+static void
+intel_set_disk_sectors(struct intel_raid_disk *disk, off_t sectors)
+{
+
+   disk-sectors = sectors  0x;
+   disk-sectors_hi = sectors  32;
+}
+
+static off_t
+intel_get_vol_curr_migr_unit(struct intel_raid_vol *vol)
+{
+   off_t curr_migr_unit = (off_t)vol-curr_migr_unit_hi  32;
+
+   curr_migr_unit += vol-curr_migr_unit;
+   return (curr_migr_unit);
+}
+
+static void
+intel_set_vol_curr_migr_unit(struct intel_raid_vol *vol, off_t curr_migr_unit)
+{
+
+   vol-curr_migr_unit = curr_migr_unit  0x;
+   vol-curr_migr_unit_hi = curr_migr_unit  32;
+}
+
 static void
 g_raid_md_intel_print(struct intel_raid_conf *meta)
 {
@@ -274,10 +355,11 @@ g_raid_md_intel_print(struct intel_raid_
printf(attributes  0x%08x\n, meta-attributes);
printf(total_disks %u\n, meta-total_disks);
printf(total_volumes   %u\n, meta-total_volumes);
-   printf(DISK#   serial disk_sectors disk_id flags\n);
+   printf(DISK#   serial disk_sectors disk_sectors_hi disk_id flags\n);
for (i = 0; i  

svn commit: r230245 - in stable/8: sbin/geom/class/raid sys/geom/raid

2012-01-16 Thread Jim Harris
Author: jimharris
Date: Tue Jan 17 00:02:45 2012
New Revision: 230245
URL: http://svn.freebsd.org/changeset/base/230245

Log:
  MFC r229886:
  
   Add support for 2TB disks in GEOM RAID for Intel metadata format.
  
  Sponsored by: Intel
  Approved by: sbruno

Modified:
  stable/8/sbin/geom/class/raid/graid.8
  stable/8/sys/geom/raid/md_intel.c
Directory Properties:
  stable/8/sbin/geom/   (props changed)
  stable/8/sys/   (props changed)

Modified: stable/8/sbin/geom/class/raid/graid.8
==
--- stable/8/sbin/geom/class/raid/graid.8   Mon Jan 16 23:22:56 2012
(r230244)
+++ stable/8/sbin/geom/class/raid/graid.8   Tue Jan 17 00:02:45 2012
(r230245)
@@ -251,7 +251,7 @@ complete it there.
 Do not run GEOM RAID class on migrating volumes under pain of possible data
 corruption!
 .Sh 2TiB BARRIERS
-Intel and Promise metadata formats do not support disks above 2TiB.
+Promise metadata format does not support disks above 2TiB.
 NVIDIA metadata format does not support volumes above 2TiB.
 .Sh EXIT STATUS
 Exit status is 0 on success, and non-zero if the command fails.

Modified: stable/8/sys/geom/raid/md_intel.c
==
--- stable/8/sys/geom/raid/md_intel.c   Mon Jan 16 23:22:56 2012
(r230244)
+++ stable/8/sys/geom/raid/md_intel.c   Tue Jan 17 00:02:45 2012
(r230245)
@@ -64,7 +64,10 @@ struct intel_raid_map {
uint8_t total_domains;
uint8_t failed_disk_num;
uint8_t ddf;
-   uint32_tfiller_2[7];
+   uint32_toffset_hi;
+   uint32_tdisk_sectors_hi;
+   uint32_tstripe_count_hi;
+   uint32_tfiller_2[4];
uint32_tdisk_idx[1];/* total_disks entries. */
 #define INTEL_DI_IDX   0x00ff
 #define INTEL_DI_RBLD  0x0100
@@ -111,7 +114,8 @@ struct intel_raid_vol {
uint8_t fs_state;
uint16_tverify_errors;
uint16_tbad_blocks;
-   uint32_tfiller_1[4];
+   uint32_tcurr_migr_unit_hi;
+   uint32_tfiller_1[3];
struct intel_raid_map map[1];   /* 2 entries if migr_state != 0. */
 } __packed;
 
@@ -125,8 +129,9 @@ struct intel_raid_disk {
 #define INTEL_F_ASSIGNED   0x02
 #define INTEL_F_FAILED 0x04
 #define INTEL_F_ONLINE 0x08
-
-   uint32_tfiller[5];
+   uint32_towner_cfg_num;
+   uint32_tsectors_hi;
+   uint32_tfiller[3];
 } __packed;
 
 struct intel_raid_conf {
@@ -254,6 +259,82 @@ intel_get_volume(struct intel_raid_conf 
return (mvol);
 }
 
+static off_t
+intel_get_map_offset(struct intel_raid_map *mmap)
+{
+   off_t offset = (off_t)mmap-offset_hi  32;
+
+   offset += mmap-offset;
+   return (offset);
+}
+
+static void
+intel_set_map_offset(struct intel_raid_map *mmap, off_t offset)
+{
+
+   mmap-offset = offset  0x;
+   mmap-offset_hi = offset  32;
+}
+
+static off_t
+intel_get_map_disk_sectors(struct intel_raid_map *mmap)
+{
+   off_t disk_sectors = (off_t)mmap-disk_sectors_hi  32;
+
+   disk_sectors += mmap-disk_sectors;
+   return (disk_sectors);
+}
+
+static void
+intel_set_map_disk_sectors(struct intel_raid_map *mmap, off_t disk_sectors)
+{
+
+   mmap-disk_sectors = disk_sectors  0x;
+   mmap-disk_sectors_hi = disk_sectors  32;
+}
+
+static void
+intel_set_map_stripe_count(struct intel_raid_map *mmap, off_t stripe_count)
+{
+
+   mmap-stripe_count = stripe_count  0x;
+   mmap-stripe_count_hi = stripe_count  32;
+}
+
+static off_t
+intel_get_disk_sectors(struct intel_raid_disk *disk)
+{
+   off_t sectors = (off_t)disk-sectors_hi  32;
+
+   sectors += disk-sectors;
+   return (sectors);
+}
+
+static void
+intel_set_disk_sectors(struct intel_raid_disk *disk, off_t sectors)
+{
+
+   disk-sectors = sectors  0x;
+   disk-sectors_hi = sectors  32;
+}
+
+static off_t
+intel_get_vol_curr_migr_unit(struct intel_raid_vol *vol)
+{
+   off_t curr_migr_unit = (off_t)vol-curr_migr_unit_hi  32;
+
+   curr_migr_unit += vol-curr_migr_unit;
+   return (curr_migr_unit);
+}
+
+static void
+intel_set_vol_curr_migr_unit(struct intel_raid_vol *vol, off_t curr_migr_unit)
+{
+
+   vol-curr_migr_unit = curr_migr_unit  0x;
+   vol-curr_migr_unit_hi = curr_migr_unit  32;
+}
+
 static void
 g_raid_md_intel_print(struct intel_raid_conf *meta)
 {
@@ -274,10 +355,11 @@ g_raid_md_intel_print(struct intel_raid_
printf(attributes  0x%08x\n, meta-attributes);
printf(total_disks %u\n, meta-total_disks);
printf(total_volumes   %u\n, meta-total_volumes);
-   printf(DISK#   serial disk_sectors disk_id flags\n);
+   printf(DISK#   serial disk_sectors disk_sectors_hi disk_id flags\n);
for (i = 0; i  

svn commit: r230246 - head/sys/kern

2012-01-16 Thread Alan Cox
Author: alc
Date: Tue Jan 17 00:27:32 2012
New Revision: 230246
URL: http://svn.freebsd.org/changeset/base/230246

Log:
  Improve abstraction.  Eliminate direct access by elf*_load_section()
  to an OBJT_VNODE-specific field of the vm object.  The same
  information can be just as easily obtained from the struct vattr that
  is in struct image_params if the latter is passed to
  elf*_load_section().  Moreover, by replacing the vmspace and vm
  object parameters to elf*_load_section() with a struct image_params
  parameter, we actually reduce the size of the object code.
  
  In collaboration with:kib

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Tue Jan 17 00:02:45 2012(r230245)
+++ head/sys/kern/imgact_elf.c  Tue Jan 17 00:27:32 2012(r230246)
@@ -86,9 +86,9 @@ static Elf_Brandinfo *__elfN(get_brandin
 const char *interp, int32_t *osrel);
 static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr,
 u_long *entry, size_t pagesize);
-static int __elfN(load_section)(struct vmspace *vmspace, vm_object_t object,
-vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz,
-vm_prot_t prot, size_t pagesize);
+static int __elfN(load_section)(struct image_params *imgp, vm_offset_t offset,
+caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot,
+size_t pagesize);
 static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp);
 static boolean_t __elfN(freebsd_trans_osrel)(const Elf_Note *note,
 int32_t *osrel);
@@ -445,13 +445,14 @@ __elfN(map_insert)(vm_map_t map, vm_obje
 }
 
 static int
-__elfN(load_section)(struct vmspace *vmspace,
-   vm_object_t object, vm_offset_t offset,
-   caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot,
-   size_t pagesize)
+__elfN(load_section)(struct image_params *imgp, vm_offset_t offset,
+caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot,
+size_t pagesize)
 {
struct sf_buf *sf;
size_t map_len;
+   vm_map_t map;
+   vm_object_t object;
vm_offset_t map_addr;
int error, rv, cow;
size_t copy_len;
@@ -466,12 +467,13 @@ __elfN(load_section)(struct vmspace *vms
 * While I'm here, might as well check for something else that
 * is invalid: filsz cannot be greater than memsz.
 */
-   if ((off_t)filsz + offset  object-un_pager.vnp.vnp_size ||
-   filsz  memsz) {
+   if ((off_t)filsz + offset  imgp-attr-va_size || filsz  memsz) {
uprintf(elf_load_section: truncated ELF file\n);
return (ENOEXEC);
}
 
+   object = imgp-object;
+   map = imgp-proc-p_vmspace-vm_map;
map_addr = trunc_page_ps((vm_offset_t)vmaddr, pagesize);
file_addr = trunc_page_ps(offset, pagesize);
 
@@ -491,7 +493,7 @@ __elfN(load_section)(struct vmspace *vms
cow = MAP_COPY_ON_WRITE | MAP_PREFAULT |
(prot  VM_PROT_WRITE ? 0 : MAP_DISABLE_COREDUMP);
 
-   rv = __elfN(map_insert)(vmspace-vm_map,
+   rv = __elfN(map_insert)(map,
  object,
  file_addr,/* file offset */
  map_addr, /* virtual start */
@@ -521,8 +523,8 @@ __elfN(load_section)(struct vmspace *vms
 
/* This had damn well better be true! */
if (map_len != 0) {
-   rv = __elfN(map_insert)(vmspace-vm_map, NULL, 0, map_addr,
-   map_addr + map_len, VM_PROT_ALL, 0);
+   rv = __elfN(map_insert)(map, NULL, 0, map_addr, map_addr +
+   map_len, VM_PROT_ALL, 0);
if (rv != KERN_SUCCESS) {
return (EINVAL);
}
@@ -550,8 +552,8 @@ __elfN(load_section)(struct vmspace *vms
 * set it to the specified protection.
 * XXX had better undo the damage from pasting over the cracks here!
 */
-   vm_map_protect(vmspace-vm_map, trunc_page(map_addr),
-   round_page(map_addr + map_len),  prot, FALSE);
+   vm_map_protect(map, trunc_page(map_addr), round_page(map_addr +
+   map_len), prot, FALSE);
 
return (0);
 }
@@ -580,7 +582,6 @@ __elfN(load_file)(struct proc *p, const 
const Elf_Ehdr *hdr = NULL;
const Elf_Phdr *phdr = NULL;
struct nameidata *nd;
-   struct vmspace *vmspace = p-p_vmspace;
struct vattr *attr;
struct image_params *imgp;
vm_prot_t prot;
@@ -672,11 +673,10 @@ __elfN(load_file)(struct proc *p, const 
if (phdr[i].p_type == PT_LOAD  phdr[i].p_memsz != 0) {
/* Loadable segment */
prot = __elfN(trans_prot)(phdr[i].p_flags);
-   if ((error = __elfN(load_section)(vmspace,
- 

svn commit: r230247 - head/sys/vm

2012-01-16 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Jan 17 00:31:09 2012
New Revision: 230247
URL: http://svn.freebsd.org/changeset/base/230247

Log:
  Revert r212360 now that PowerPC can handle large sparse arguments to
  pmap_remove() (changed in r228412).
  
  MFC after:2 weeks

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cTue Jan 17 00:27:32 2012(r230246)
+++ head/sys/vm/vm_pageout.cTue Jan 17 00:31:09 2012(r230247)
@@ -714,11 +714,8 @@ vm_pageout_map_deactivate_pages(map, des
 * table pages.
 */
if (desired == 0  nothingwired) {
-   tmpe = map-header.next;
-   while (tmpe != map-header) {
-   pmap_remove(vm_map_pmap(map), tmpe-start, tmpe-end);
-   tmpe = tmpe-next;
-   }
+   pmap_remove(vm_map_pmap(map), vm_map_min(map),
+   vm_map_max(map));
}
vm_map_unlock(map);
 }
___
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: r230249 - in head/sys: compat/freebsd32 fs/cd9660 fs/fdescfs fs/hpfs fs/msdosfs fs/nfsclient fs/ntfs fs/nwfs fs/portalfs fs/pseudofs fs/smbfs gnu/fs/reiserfs kern nfsclient sys ufs/ffs

2012-01-16 Thread Kirk McKusick
Author: mckusick
Date: Tue Jan 17 01:08:01 2012
New Revision: 230249
URL: http://svn.freebsd.org/changeset/base/230249

Log:
  Make sure all intermediate variables holding mount flags (mnt_flag)
  and that all internal kernel calls passing mount flags are declared
  as uint64_t so that flags in the top 32-bits are not lost.
  
  MFC after: 2 weeks

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/fs/cd9660/cd9660_vfsops.c
  head/sys/fs/fdescfs/fdesc_vfsops.c
  head/sys/fs/hpfs/hpfs_vfsops.c
  head/sys/fs/msdosfs/msdosfs_vfsops.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/fs/ntfs/ntfs_vfsops.c
  head/sys/fs/nwfs/nwfs_vfsops.c
  head/sys/fs/portalfs/portal_vfsops.c
  head/sys/fs/pseudofs/pseudofs.c
  head/sys/fs/pseudofs/pseudofs.h
  head/sys/fs/smbfs/smbfs_vfsops.c
  head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
  head/sys/kern/vfs_mount.c
  head/sys/kern/vfs_subr.c
  head/sys/nfsclient/nfs_vfsops.c
  head/sys/sys/mount.h
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Tue Jan 17 00:34:16 2012
(r230248)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Tue Jan 17 01:08:01 2012
(r230249)
@@ -2485,9 +2485,17 @@ freebsd32_nmount(struct thread *td,
 } */ *uap)
 {
struct uio *auio;
+   uint64_t flags;
int error;
 
-   AUDIT_ARG_FFLAGS(uap-flags);
+   /*
+* Mount flags are now 64-bits. On 32-bit archtectures only
+* 32-bits are passed in, but from here on everything handles
+* 64-bit flags correctly.
+*/
+   flags = uap-flags;
+
+   AUDIT_ARG_FFLAGS(flags);
 
/*
 * Filter out MNT_ROOTFS.  We do not want clients of nmount() in
@@ -2496,7 +2504,7 @@ freebsd32_nmount(struct thread *td,
 * MNT_ROOTFS should only be set by the kernel when mounting its
 * root file system.
 */
-   uap-flags = ~MNT_ROOTFS;
+   flags = ~MNT_ROOTFS;
 
/*
 * check that we have an even number of iovec's
@@ -2508,7 +2516,7 @@ freebsd32_nmount(struct thread *td,
error = freebsd32_copyinuio(uap-iovp, uap-iovcnt, auio);
if (error)
return (error);
-   error = vfs_donmount(td, uap-flags, auio);
+   error = vfs_donmount(td, flags, auio);
 
free(auio, M_IOV);
return error;

Modified: head/sys/fs/cd9660/cd9660_vfsops.c
==
--- head/sys/fs/cd9660/cd9660_vfsops.c  Tue Jan 17 00:34:16 2012
(r230248)
+++ head/sys/fs/cd9660/cd9660_vfsops.c  Tue Jan 17 01:08:01 2012
(r230249)
@@ -95,7 +95,7 @@ static int iso_mountfs(struct vnode *dev
  */
 
 static int
-cd9660_cmount(struct mntarg *ma, void *data, int flags)
+cd9660_cmount(struct mntarg *ma, void *data, uint64_t flags)
 {
struct iso_args args;
struct export_args exp;

Modified: head/sys/fs/fdescfs/fdesc_vfsops.c
==
--- head/sys/fs/fdescfs/fdesc_vfsops.c  Tue Jan 17 00:34:16 2012
(r230248)
+++ head/sys/fs/fdescfs/fdesc_vfsops.c  Tue Jan 17 01:08:01 2012
(r230249)
@@ -65,7 +65,7 @@ static vfs_root_t fdesc_root;
  * Compatibility shim for old mount(2) system call.
  */
 int
-fdesc_cmount(struct mntarg *ma, void *data, int flags)
+fdesc_cmount(struct mntarg *ma, void *data, uint64_t flags)
 {
return kernel_mount(ma, flags);
 }

Modified: head/sys/fs/hpfs/hpfs_vfsops.c
==
--- head/sys/fs/hpfs/hpfs_vfsops.c  Tue Jan 17 00:34:16 2012
(r230248)
+++ head/sys/fs/hpfs/hpfs_vfsops.c  Tue Jan 17 01:08:01 2012
(r230249)
@@ -73,7 +73,7 @@ static int
 hpfs_cmount ( 
struct mntarg *ma,
void *data,
-   int flags)
+   uint64_t flags)
 {
struct hpfs_args args;
struct export_args exp;

Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c
==
--- head/sys/fs/msdosfs/msdosfs_vfsops.cTue Jan 17 00:34:16 2012
(r230248)
+++ head/sys/fs/msdosfs/msdosfs_vfsops.cTue Jan 17 01:08:01 2012
(r230249)
@@ -197,7 +197,7 @@ update_mp(struct mount *mp, struct threa
 }
 
 static int
-msdosfs_cmount(struct mntarg *ma, void *data, int flags)
+msdosfs_cmount(struct mntarg *ma, void *data, uint64_t flags)
 {
struct msdosfs_args args;
struct export_args exp;

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==
--- head/sys/fs/nfsclient/nfs_clvfsops.cTue Jan 17 00:34:16 2012
(r230248)
+++ head/sys/fs/nfsclient/nfs_clvfsops.cTue Jan 17 01:08:01 2012
(r230249)
@@ -1131,7 +1131,7 @@ out:
  */
 /* 

svn commit: r230250 - head/sys/ufs/ffs

2012-01-16 Thread Kirk McKusick
Author: mckusick
Date: Tue Jan 17 01:14:56 2012
New Revision: 230250
URL: http://svn.freebsd.org/changeset/base/230250

Log:
  There are several bugs/hangs when trying to take a snapshot on a UFS/FFS
  filesystem running with journaled soft updates. Until these problems
  have been tracked down, return ENOTSUPP when an attempt is made to
  take a snapshot on a filesystem running with journaled soft updates.
  
  MFC after: 2 weeks

Modified:
  head/sys/ufs/ffs/ffs_snapshot.c

Modified: head/sys/ufs/ffs/ffs_snapshot.c
==
--- head/sys/ufs/ffs/ffs_snapshot.c Tue Jan 17 01:08:01 2012
(r230249)
+++ head/sys/ufs/ffs/ffs_snapshot.c Tue Jan 17 01:14:56 2012
(r230250)
@@ -225,10 +225,18 @@ ffs_snapshot(mp, snapfile)
ump = VFSTOUFS(mp);
fs = ump-um_fs;
sn = NULL;
+   /*
+* At the moment, journaled soft updates cannot support
+* taking snapshots.
+*/
+   if (MOUNTEDSUJ(mp)) {
+   vfs_mount_error(mp, %s: Snapshots are not yet supported when 
+   running with journaled soft updates, fs-fs_fsmnt);
+   return (EOPNOTSUPP);
+   }
MNT_ILOCK(mp);
flag = mp-mnt_flag;
MNT_IUNLOCK(mp);
-
/*
 * Need to serialize access to snapshot code per filesystem.
 */
___
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: r230252 - head/sys/fs/tmpfs

2012-01-16 Thread Kevin Lo
Author: kevlo
Date: Tue Jan 17 01:25:53 2012
New Revision: 230252
URL: http://svn.freebsd.org/changeset/base/230252

Log:
  Return EOPNOTSUPP since we only support update mounts for NFS export.
  
  Spotted by:   trociny

Modified:
  head/sys/fs/tmpfs/tmpfs_vfsops.c

Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c
==
--- head/sys/fs/tmpfs/tmpfs_vfsops.cTue Jan 17 01:18:40 2012
(r230251)
+++ head/sys/fs/tmpfs/tmpfs_vfsops.cTue Jan 17 01:25:53 2012
(r230252)
@@ -150,8 +150,12 @@ tmpfs_mount(struct mount *mp)
return (EINVAL);
 
if (mp-mnt_flag  MNT_UPDATE) {
+   /*
+* Only support update mounts for NFS export.
+*/
if (vfs_flagopt(mp-mnt_optnew, export, NULL, 0))
return (0);
+   return (EOPNOTSUPP);
}
 
vn_lock(mp-mnt_vnodecovered, LK_SHARED | LK_RETRY);
___
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: r230253 - in stable: 8/sys/dev/tws 9/sys/dev/tws

2012-01-16 Thread Xin LI
Author: delphij
Date: Tue Jan 17 01:28:43 2012
New Revision: 230253
URL: http://svn.freebsd.org/changeset/base/230253

Log:
  MFC 229416 + 223200:
  
  Don't forget to release queue lock when allocation of memory failed.
  
  Submitted by: Sascha Wildner saw online de
  Obtained from:DragonFly

Modified:
  stable/9/sys/dev/tws/tws.c
Directory Properties:
  stable/9/sys/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/8/sys/dev/tws/tws.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/9/sys/dev/tws/tws.c
==
--- stable/9/sys/dev/tws/tws.c  Tue Jan 17 01:25:53 2012(r230252)
+++ stable/9/sys/dev/tws/tws.c  Tue Jan 17 01:28:43 2012(r230253)
@@ -685,6 +685,7 @@ tws_init_reqs(struct tws_softc *sc, u_in
 {
 if (bus_dmamap_create(sc-data_tag, 0, sc-reqs[i].dma_map)) {
 /* log a ENOMEM failure msg here */
+mtx_unlock(sc-q_lock);
 return(FAILURE);
 } 
 sc-reqs[i].cmd_pkt =  cmd_buf[i];
___
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: r230253 - in stable: 8/sys/dev/tws 9/sys/dev/tws

2012-01-16 Thread Xin LI
Author: delphij
Date: Tue Jan 17 01:28:43 2012
New Revision: 230253
URL: http://svn.freebsd.org/changeset/base/230253

Log:
  MFC 229416 + 223200:
  
  Don't forget to release queue lock when allocation of memory failed.
  
  Submitted by: Sascha Wildner saw online de
  Obtained from:DragonFly

Modified:
  stable/8/sys/dev/tws/tws.c
Directory Properties:
  stable/8/sys/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/9/sys/dev/tws/tws.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/8/sys/dev/tws/tws.c
==
--- stable/8/sys/dev/tws/tws.c  Tue Jan 17 01:25:53 2012(r230252)
+++ stable/8/sys/dev/tws/tws.c  Tue Jan 17 01:28:43 2012(r230253)
@@ -685,6 +685,7 @@ tws_init_reqs(struct tws_softc *sc, u_in
 {
 if (bus_dmamap_create(sc-data_tag, 0, sc-reqs[i].dma_map)) {
 /* log a ENOMEM failure msg here */
+mtx_unlock(sc-q_lock);
 return(FAILURE);
 } 
 sc-reqs[i].cmd_pkt =  cmd_buf[i];
___
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: r230254 - stable/9/release/doc/en_US.ISO8859-1/errata

2012-01-16 Thread Hiroki Sato
Author: hrs
Date: Tue Jan 17 02:49:23 2012
New Revision: 230254
URL: http://svn.freebsd.org/changeset/base/230254

Log:
  Document the following open issues:
  
   - $ipv6_prefix_IF fails to configure IF when there is no $ifconfig_IF_ipv6.
   - USB 3.0 hubs do not work.

Modified:
  stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml

Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml
==
--- stable/9/release/doc/en_US.ISO8859-1/errata/article.sgmlTue Jan 17 
01:28:43 2012(r230253)
+++ stable/9/release/doc/en_US.ISO8859-1/errata/article.sgmlTue Jan 17 
02:49:23 2012(r230254)
@@ -288,6 +288,34 @@ boot/screen
  literalALLOW_NEW_SOURCES/literal and
  literalBLOCK_OLD_SOURCES/literal)./para
   /listitem
+
+  listitem
+   pararelease.current; fails to configure an interface
+ specified in the man.rc.conf.5; variable
+ varnameipv6_prefix_replaceableIF/replaceable/varname
+ when the interface does not have a corresponding
+ varnameifconfig_replaceableIF/replaceable_ipv6/varname
+ variable.  This problem will be fixed in the future
+ releases.  To work around this problem on release.current;,
+ add an
+ varnameifconfig_replaceableIF/replaceable_ipv6/varname
+ line for each interface specified in
+ varnameipv6_prefix_replaceableIF/replaceable/varname
+ as the following:/para
+
+   programlistingipv6_prefix_em0=2001:db8:1:0 2001:db8:2:0
+ifconfig_em0_ipv6=inet6 auto_linklocal/programlisting
+  /listitem
+
+  listitem
+   paraIn release.current; the os; USB subsystem supports USB
+ 3.0 by the man.xhci.4; driver.  However, a bug that could
+ prevent it from working with a USB 3.0 hub has been found
+ and fixed after the release date.  This means
+ release.current; and prior do not work with a USB 3.0 hub.
+ This problem has been fixed in HEAD and will be merged into
+ the 9-STABLE branch./para
+  /listitem
 /itemizedlist
   /sect1
 
___
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: r230217 - stable/8/sys/kern

2012-01-16 Thread Bruce Evans

On Mon, 16 Jan 2012, Andriy Gapon wrote:


on 16/01/2012 16:40 Kevin Lo said the following:

Log:
  Fix build breakage by adding missing mb_put_padbyte()

Modified:
  stable/8/sys/kern/subr_mchain.c

Modified: stable/8/sys/kern/subr_mchain.c
==
--- stable/8/sys/kern/subr_mchain.c Mon Jan 16 14:31:01 2012
(r230216)
+++ stable/8/sys/kern/subr_mchain.c Mon Jan 16 14:40:22 2012
(r230217)
@@ -125,6 +125,21 @@ mb_reserve(struct mbchain *mbp, int size
 }

 int
+mb_put_padbyte(struct mbchain *mbp)
+{
+   caddr_t dst;
+   char x = 0;
+
+   dst = mtod(mbp-mb_cur, caddr_t) + mbp-mb_cur-m_len;
+
+   /* only add padding if address is odd */
+   if ((unsigned long)dst  1)
+   return mb_put_mem(mbp, (caddr_t)x, 1, MB_MSYSTEM);
+   else
+   return 0;


Broken style above?


No.  Broken style in almost all of the above.  Also a technical bug which
give brokenness on some as yet unsupported arches:

1. Use of caddr_t for dst.  caddr_t was endemic in mbuf code, but has
   been mostly eradicated there, except in a couple of APIs where it
   may be needed for backwards compatibility, and in all of subr_mchain.c.
   So here it is bug for bug compatible with nearby code.

   Here and probably mostly elsewhere, caddr_t is used mainly to do
   pointer arithmetic on it.  It is assumed that caddr_t is precisely
   `char *', so that the pointer arithmetic increases it by 1 per
   increment.  For that use, `char *' should be used directly.

2. Initialization in declaration for x.

3. Meaningless variable name for x.  This bug is endemic in subr_mchain.c.
   This at first confused me into thinking that x was a dummy not-really
   used variable.  It actually holds the padding byte.  Generally in
   subr_mchain.c, for calls to mb_put_mem(), it holds the source data in
   a uintN_t variable.  Here we should also use uint8_t for the variable
   and spell the size of the variable as sizeof(x), so that we look like
   other calls.

   mb_put_mem() has many style bugs too.  It takes a caddr_t source address,
   but should take a `void *' source address.  Its case statement has
   misindented labels...  I had to look at it to see what x does.

4. Non-capitalized comment.

5. Non-terminated comment.

   The last 2 bugs are not endemic in subr_mchain.c, partly because
   subr_mchain.c has very few comments and even fewer comments for
   individual statements (only 8, including 1 for the copyright; no
   others are for individual statements; 1 is banal; all except the
   copyright have style bugs).

6. `unsigned long' is not abbreviated as u_long.

7. `unsigned long' is a logically and possibly physically wrong type
   to use here.  We really want dst to be an integer so that we can
   mask it.  But mtod() starts with a pointer and produces a pointer.
   We should have used it to produce a `char *', but we actually used
   it to produce a caddr_t.  We already assumed that caddr_t is
   precisely `char *'.  Now we only need to assume that it is a
   pointer.  We want to convert it to an integer.  For that, we
   should cast it to uintptr_t.  Instead, we cast it to `unsigned long'.
   This assumes that either uintptr_t is unsigned long (as happens on
   all supported 64-bit arches) or that uintptr_t has the same size as
   unsigned long and the compiler doesn't warn about this type mismatch
   (as happens on all supported 32-bit arches).

   Perhaps we should actually use an alignment macro to do this, but I
   don't know of any suitable one.  _ALIGN() is the main one, and it
   only rounds up.  And its implementation has lots of style bugs (*).

8. Missing parentheses around return value of mb_put_mem().  This bug
   was never common in mbuf code, but it is endemic in subr_mchain.c

9. Missing parentheses around return value of 0.

10. Missing indentation of return of value of 0.

These bugs were all copied from -current.  The last one has been fixed,
at least in -current.  It is the smallest one with the smallest closure.
Another 1000 commits to all branches should be enough to fix them all.

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


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

2012-01-16 Thread Sergey Kandaurov
On 17 January 2012 02:13, Joerg Sonnenberger jo...@britannica.bec.de wrote:
 On Mon, Jan 16, 2012 at 08:42:56PM +, Sergey Kandaurov wrote:
 Log:
   Be pedantic and change // comment to C-style one.

 If you want to be pedantic, at least be correct. // is perfectly valid
 C99.


Yes, you're right. Sorry for being confusing in the commit message.

The intention was to provide comments with pre-C99 syntax for
syntax-checking / static analyzing tools which old enough to not
understand this syntax but otherwise still good. Also, style(9) doesn't
describe or cite //-style comments, which is usually treated there as
avoid it to use. This was only such comment in sys/kern. After this
change there is no // comments in sys/sys, sys/kern, sys/vm in head.

-- 
wbr,
pluknet
___
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: r230256 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2012-01-16 Thread Sergey Kandaurov
Author: pluknet
Date: Tue Jan 17 06:23:25 2012
New Revision: 230256
URL: http://svn.freebsd.org/changeset/base/230256

Log:
  Fix the lock zrl-zr_mtx already initialized assertion by initializing
  the allocated memory before calling mtx_init(9) on mtx pointing to it.
  Otherwize, random contents of uninitialized memory might occasionally
  trigger the assertion.
  
  Reported by:  Pavel Polyakov bsd kobyla org
  Reviewed by:  pjd
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jan 17 
04:45:11 2012(r230255)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jan 17 
06:23:25 2012(r230256)
@@ -1077,7 +1077,7 @@ dnode_hold_impl(objset_t *os, uint64_t o
if (children_dnodes == NULL) {
int i;
dnode_children_t *winner;
-   children_dnodes = kmem_alloc(sizeof (dnode_children_t) +
+   children_dnodes = kmem_zalloc(sizeof (dnode_children_t) +
(epb - 1) * sizeof (dnode_handle_t), KM_SLEEP);
children_dnodes-dnc_count = epb;
dnh = children_dnodes-dnc_children[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: r230257 - stable/9/sys/boot/i386/libi386

2012-01-16 Thread Konstantin Belousov
Author: kib
Date: Tue Jan 17 06:40:41 2012
New Revision: 230257
URL: http://svn.freebsd.org/changeset/base/230257

Log:
  MFC r229435:
  Add special loader environment variables 'comconsole_port' and
  'comconsole_pcidev'.
  
  Change allows to use ISA serial ports other than COM1 for the
  loader/kernel console without loader recompilation, and to configure
  console on the PCI-attached UARTs.

Modified:
  stable/9/sys/boot/i386/libi386/biospci.c
  stable/9/sys/boot/i386/libi386/comconsole.c
  stable/9/sys/boot/i386/libi386/libi386.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/i386/libi386/biospci.c
==
--- stable/9/sys/boot/i386/libi386/biospci.cTue Jan 17 06:23:25 2012
(r230256)
+++ stable/9/sys/boot/i386/libi386/biospci.cTue Jan 17 06:40:41 2012
(r230257)
@@ -342,3 +342,9 @@ biospci_read_config(uint32_t locator, in
return (0);
 }
 
+uint32_t
+biospci_locator(int8_t bus, uint8_t device, uint8_t function)
+{
+
+   return ((bus  8) | ((device  0x1f)  3) | (function  0x7));
+}

Modified: stable/9/sys/boot/i386/libi386/comconsole.c
==
--- stable/9/sys/boot/i386/libi386/comconsole.c Tue Jan 17 06:23:25 2012
(r230256)
+++ stable/9/sys/boot/i386/libi386/comconsole.c Tue Jan 17 06:40:41 2012
(r230257)
@@ -30,6 +30,7 @@ __FBSDID($FreeBSD$);
 #include bootstrap.h
 #include machine/cpufunc.h
 #include dev/ic/ns16550.h
+#include dev/pci/pcireg.h
 #include libi386.h
 
 #define COMC_FMT   0x3 /* 8N1 */
@@ -49,14 +50,23 @@ static int  comc_init(int arg);
 static voidcomc_putchar(int c);
 static int comc_getchar(void);
 static int comc_getspeed(void);
+static voidset_hw_console_hint(void);
 static int comc_ischar(void);
-static int comc_parsespeed(const char *string);
-static voidcomc_setup(int speed);
+static int comc_parseint(const char *string);
+static uint32_t comc_parse_pcidev(const char *string);
+static int comc_pcidev_set(struct env_var *ev, int flags,
+   const void *value);
+static int comc_pcidev_handle(uint32_t locator);
+static int comc_port_set(struct env_var *ev, int flags,
+   const void *value);
+static voidcomc_setup(int speed, int port);
 static int comc_speed_set(struct env_var *ev, int flags,
const void *value);
 
 static int comc_started;
 static int comc_curspeed;
+static int comc_port = COMPORT;
+static uint32_tcomc_locator;
 
 struct console comconsole = {
 comconsole,
@@ -72,9 +82,10 @@ struct console comconsole = {
 static void
 comc_probe(struct console *cp)
 {
-char speedbuf[16];
-char *cons, *speedenv;
-int speed;
+char intbuf[16];
+char *cons, *env;
+int speed, port;
+uint32_t locator;
 
 /* XXX check the BIOS equipment list? */
 cp-c_flags |= (C_PRESENTIN | C_PRESENTOUT);
@@ -90,16 +101,40 @@ comc_probe(struct console *cp)
getenv(boot_multicons) != NULL) {
comc_curspeed = comc_getspeed();
}
-   speedenv = getenv(comconsole_speed);
-   if (speedenv != NULL) {
-   speed = comc_parsespeed(speedenv);
+
+   env = getenv(comconsole_speed);
+   if (env != NULL) {
+   speed = comc_parseint(env);
if (speed  0)
comc_curspeed = speed;
}
 
-   sprintf(speedbuf, %d, comc_curspeed);
+   sprintf(intbuf, %d, comc_curspeed);
unsetenv(comconsole_speed);
-   env_setenv(comconsole_speed, EV_VOLATILE, speedbuf, comc_speed_set,
+   env_setenv(comconsole_speed, EV_VOLATILE, intbuf, comc_speed_set,
+   env_nounset);
+
+   env = getenv(comconsole_port);
+   if (env != NULL) {
+   port = comc_parseint(env);
+   if (port  0)
+   comc_port = port;
+   }
+
+   sprintf(intbuf, %d, comc_port);
+   unsetenv(comconsole_port);
+   env_setenv(comconsole_port, EV_VOLATILE, intbuf, comc_port_set,
+   env_nounset);
+
+   env = getenv(comconsole_pcidev);
+   if (env != NULL) {
+   locator = comc_parse_pcidev(env);
+   if (locator != 0)
+   comc_pcidev_handle(locator);
+   }
+
+   unsetenv(comconsole_pcidev);
+   env_setenv(comconsole_pcidev, EV_VOLATILE, env, comc_pcidev_set,
env_nounset);
 }
 }
@@ -111,7 +146,7 @@ comc_init(int arg)
return 0;
 comc_started = 1;
 
-comc_setup(comc_curspeed);
+comc_setup(comc_curspeed, comc_port);
 
 return(0);
 }
@@ -122,8 +157,8 @@ comc_putchar(int c)
 int wait;
 
 for (wait = COMC_TXWAIT; wait  0; wait--)
-if (inb(COMPORT + com_lsr)  LSR_TXRDY) {
-   outb(COMPORT + com_data, (u_char)c);
+if (inb(comc_port + com_lsr)  

svn commit: r230258 - stable/9/sys/vm

2012-01-16 Thread Konstantin Belousov
Author: kib
Date: Tue Jan 17 06:57:55 2012
New Revision: 230258
URL: http://svn.freebsd.org/changeset/base/230258

Log:
  MFC r229934:
  Change the type of the paging_in_progress refcounter from u_short to
  u_int. With the auto-sized buffer cache on the modern machines, UFS
  metadata can generate more the 65535 pages belonging to the buffers
  undergoing i/o, overflowing the counter.
  
  To keep the layout of other fields of the struct vm_object intact
  on stable/9, put enlarged paging_in_progress at the end of the structure,
  and put a placeholder in the place of old pip counter.

Modified:
  stable/9/sys/vm/vm_object.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/vm/vm_object.h
==
--- stable/9/sys/vm/vm_object.h Tue Jan 17 06:40:41 2012(r230257)
+++ stable/9/sys/vm/vm_object.h Tue Jan 17 06:57:55 2012(r230258)
@@ -96,7 +96,7 @@ struct vm_object {
objtype_t type; /* type of pager */
u_short flags;  /* see below */
u_short pg_color;   /* (c) color of first page in obj */
-   u_short paging_in_progress; /* Paging (in or out) so don't collapse 
or destroy */
+   u_short pad1;   /* Old pip counter */
int resident_page_count;/* number of resident pages */
struct vm_object *backing_object; /* object that I'm a shadow of */
vm_ooffset_t backing_object_offset;/* Offset in backing object */
@@ -146,6 +146,7 @@ struct vm_object {
} un_pager;
struct ucred *cred;
vm_ooffset_t charge;
+   u_int paging_in_progress;   /* Paging (in or out) so don't collapse 
or destroy */
 };
 
 /*
___
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: r230259 - stable/9/sys/boot/common

2012-01-16 Thread Konstantin Belousov
Author: kib
Date: Tue Jan 17 07:01:22 2012
New Revision: 230259
URL: http://svn.freebsd.org/changeset/base/230259

Log:
  MFC r229771:
  Document comconsole_port and comconsole_pcidev loader variables.

Modified:
  stable/9/sys/boot/common/loader.8
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/common/loader.8
==
--- stable/9/sys/boot/common/loader.8   Tue Jan 17 06:57:55 2012
(r230258)
+++ stable/9/sys/boot/common/loader.8   Tue Jan 17 07:01:22 2012
(r230259)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd December 27, 2011
+.Dd January 7, 2012
 .Dt LOADER 8
 .Os
 .Sh NAME
@@ -419,6 +419,43 @@ was compiled.
 Changes to the
 .Va comconsole_speed
 variable take effect immediately.
+.It Va comconsole_port
+Defines the base i/o port used to access console UART
+(i386 and amd64 only).
+If the variable is not set, its assumed value is 0x3F8, which
+corresponds to PC port COM1, unless overriden by
+.Va BOOT_COMCONSOLE_PORT
+variable during the compilation of
+.Nm .
+Setting the
+.Va comconsole_port
+variable automatically set
+.Va hw.uart.console
+environment variable to provide a hint to kernel for location of the console.
+Loader console is changed immediately after variable
+.Va comconsole_port
+is set.
+.It Va comconsole_pcidev
+Defines the location of a PCI device of the 'simple communication'
+class to be used as the serial console UART (i386 and amd64 only).
+The syntax of the variable is
+.Li 'bus:device:function[:bar]' ,
+where all members must be numeric, with possible
+.Li 0x
+prefix to indicate a hexadecimal value.
+The
+.Va bar
+member is optional and assumed to be 0x10 if omitted.
+The bar must decode i/o space.
+Setting the variable
+.Va comconsole_pcidev
+automatically sets the variable
+.Va comconsole_port
+to the base of the selected bar, and hint
+.Va hw.uart.console .
+Loader console is changed immediately after variable
+.Va comconsole_pcidev
+is set.
 .It Va console
 Defines the current console or consoles.
 Multiple consoles may be specified.
___
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: r230260 - head/sys/amd64/include

2012-01-16 Thread Konstantin Belousov
Author: kib
Date: Tue Jan 17 07:21:23 2012
New Revision: 230260
URL: http://svn.freebsd.org/changeset/base/230260

Log:
  Add macro IS_BSP() to check whether the current CPU is BSP.
  
  MFC after:1 week

Modified:
  head/sys/amd64/include/pcpu.h

Modified: head/sys/amd64/include/pcpu.h
==
--- head/sys/amd64/include/pcpu.h   Tue Jan 17 07:01:22 2012
(r230259)
+++ head/sys/amd64/include/pcpu.h   Tue Jan 17 07:21:23 2012
(r230260)
@@ -226,6 +226,8 @@ __curthread(void)
 }
 #definecurthread   (__curthread())
 
+#defineIS_BSP()(PCPU_GET(cpuid) == 0)
+
 #else /* !lint || defined(__GNUCLIKE_ASM)  defined(__GNUCLIKE___TYPEOF) */
 
 #error this file needs to be ported to your compiler
___
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: r230261 - in head/sys: amd64/include i386/include

2012-01-16 Thread Konstantin Belousov
Author: kib
Date: Tue Jan 17 07:23:43 2012
New Revision: 230261
URL: http://svn.freebsd.org/changeset/base/230261

Log:
  Add definitions related to XCR0.
  
  MFC after:1 week

Modified:
  head/sys/amd64/include/specialreg.h
  head/sys/i386/include/specialreg.h

Modified: head/sys/amd64/include/specialreg.h
==
--- head/sys/amd64/include/specialreg.h Tue Jan 17 07:21:23 2012
(r230260)
+++ head/sys/amd64/include/specialreg.h Tue Jan 17 07:23:43 2012
(r230261)
@@ -66,6 +66,7 @@
 #defineCR4_PCE 0x0100  /* Performance monitoring counter 
enable */
 #defineCR4_FXSR 0x0200 /* Fast FPU save/restore used by OS */
 #defineCR4_XMM 0x0400  /* enable SIMD/MMX2 to use except 16 */
+#defineCR4_XSAVE 0x0004/* XSETBV/XGETBV */
 
 /*
  * Bits in AMD64 special registers.  EFER is 64 bits wide.
@@ -76,6 +77,18 @@
 #defineEFER_NXE 0x00800/* PTE No-Execute bit enable (R/W) */
 
 /*
+ * Intel Extended Features registers
+ */
+#defineXCR00   /* XFEATURE_ENABLED_MASK register */
+
+#defineXFEATURE_ENABLED_X870x0001
+#defineXFEATURE_ENABLED_SSE0x0002
+#defineXFEATURE_ENABLED_AVX0x0004
+
+#defineXFEATURE_AVX\
+(XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE | XFEATURE_ENABLED_AVX)
+
+/*
  * CPUID instruction features register
  */
 #defineCPUID_FPU   0x0001

Modified: head/sys/i386/include/specialreg.h
==
--- head/sys/i386/include/specialreg.h  Tue Jan 17 07:21:23 2012
(r230260)
+++ head/sys/i386/include/specialreg.h  Tue Jan 17 07:23:43 2012
(r230261)
@@ -66,6 +66,7 @@
 #defineCR4_PCE 0x0100  /* Performance monitoring counter 
enable */
 #defineCR4_FXSR 0x0200 /* Fast FPU save/restore used by OS */
 #defineCR4_XMM 0x0400  /* enable SIMD/MMX2 to use except 16 */
+#defineCR4_XSAVE 0x0004/* XSETBV/XGETBV */
 
 /*
  * Bits in AMD64 special registers.  EFER is 64 bits wide.
___
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: r230262 - head/sys/amd64/include

2012-01-16 Thread Konstantin Belousov
Author: kib
Date: Tue Jan 17 07:30:36 2012
New Revision: 230262
URL: http://svn.freebsd.org/changeset/base/230262

Log:
  Implement xsetbv(), xsave() and xrstor() providing C access to the
  similarly named CPU instructions.
  
  Since our in-tree binutils gas is not aware of the instructions, and
  I have to use the byte-sequence to encode them, hardcode the r/m operand
  as (%rdi). This way, first argument of the pseudo-function is already
  placed into proper register.
  
  MFC after:1 week

Modified:
  head/sys/amd64/include/cpufunc.h

Modified: head/sys/amd64/include/cpufunc.h
==
--- head/sys/amd64/include/cpufunc.hTue Jan 17 07:23:43 2012
(r230261)
+++ head/sys/amd64/include/cpufunc.hTue Jan 17 07:30:36 2012
(r230262)
@@ -669,6 +669,41 @@ intr_restore(register_t rflags)
write_rflags(rflags);
 }
 
+static __inline void
+xsetbv(uint32_t reg, uint64_t val)
+{
+   uint32_t low, hi;
+
+   low = val;
+   hi = val  32;
+   __asm __volatile(.byte 0x0f,0x01,0xd1 : :
+   c (reg), a (low), d (hi));
+}
+
+static __inline void
+xsave(char *addr, uint64_t mask)
+{
+   uint32_t low, hi;
+
+   low = mask;
+   hi = mask  32;
+   /* xsave (%rdi) */
+   __asm __volatile(.byte 0x0f,0xae,0x27 : :
+   a (low), d (hi), D (addr) : memory);
+}
+
+static __inline void
+xrstor(char *addr, uint64_t mask)
+{
+   uint32_t low, hi;
+
+   low = mask;
+   hi = mask  32;
+   /* xrstor (%rdi) */
+   __asm __volatile(.byte 0x0f,0xae,0x2f : :
+   a (low), d (hi), D (addr));
+}
+
 #else /* !(__GNUCLIKE_ASM  __CC_SUPPORTS___INLINE) */
 
 intbreakpoint(void);
@@ -733,6 +768,9 @@ u_int   rgs(void);
 void   wbinvd(void);
 void   write_rflags(u_int rf);
 void   wrmsr(u_int msr, uint64_t newval);
+void   xsetbv(uint32_t reg, uint64_t val);
+void   xsave(char *addr, uint64_t mask);
+void   xrstor(char *addr, uint64_t mask);
 
 #endif /* __GNUCLIKE_ASM  __CC_SUPPORTS___INLINE */
 
___
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