svn commit: r272978 - in head: sys/cam/ctl usr.sbin/ctladm

2014-10-12 Thread Alexander Motin
Author: mav
Date: Sun Oct 12 06:55:34 2014
New Revision: 272978
URL: https://svnweb.freebsd.org/changeset/base/272978

Log:
  Improve and document `ctladm portlist` subcommand.
  
  Make this subcommand less FC-specific, reporting target and port addresses
  in more generic way.  Also make it report list of connected initiators in
  unified way, working for both FC and iSCSI, and potentially others.
  
  MFC after:1 week

Modified:
  head/sys/cam/ctl/ctl.c
  head/usr.sbin/ctladm/ctladm.8
  head/usr.sbin/ctladm/ctladm.c

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Sun Oct 12 06:14:50 2014(r272977)
+++ head/sys/cam/ctl/ctl.c  Sun Oct 12 06:55:34 2014(r272978)
@@ -2237,6 +2237,43 @@ ctl_sbuf_printf_esc(struct sbuf *sb, cha
return (retval);
 }
 
+static void
+ctl_id_sbuf(struct ctl_devid *id, struct sbuf *sb)
+{
+   struct scsi_vpd_id_descriptor *desc;
+   int i;
+
+   if (id == NULL || id-len  4)
+   return;
+   desc = (struct scsi_vpd_id_descriptor *)id-data;
+   switch (desc-id_type  SVPD_ID_TYPE_MASK) {
+   case SVPD_ID_TYPE_T10:
+   sbuf_printf(sb, t10.);
+   break;
+   case SVPD_ID_TYPE_EUI64:
+   sbuf_printf(sb, eui.);
+   break;
+   case SVPD_ID_TYPE_NAA:
+   sbuf_printf(sb, naa.);
+   break;
+   case SVPD_ID_TYPE_SCSI_NAME:
+   break;
+   }
+   switch (desc-proto_codeset  SVPD_ID_CODESET_MASK) {
+   case SVPD_ID_CODESET_BINARY:
+   for (i = 0; i  desc-length; i++)
+   sbuf_printf(sb, %02x, desc-identifier[i]);
+   break;
+   case SVPD_ID_CODESET_ASCII:
+   sbuf_printf(sb, %.*s, (int)desc-length,
+   (char *)desc-identifier);
+   break;
+   case SVPD_ID_CODESET_UTF8:
+   sbuf_printf(sb, %s, (char *)desc-identifier);
+   break;
+   }
+}
+
 static int
 ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
  struct thread *td)
@@ -3288,6 +3325,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
struct ctl_port *port;
struct ctl_lun_list *list;
struct ctl_option *opt;
+   int j;
 
list = (struct ctl_lun_list *)addr;
 
@@ -3344,15 +3382,17 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
if (retval != 0)
break;
 
-   retval = sbuf_printf(sb, \twwnn%#jx/wwnn\n,
-   (uintmax_t)port-wwnn);
-   if (retval != 0)
-   break;
+   if (port-target_devid != NULL) {
+   sbuf_printf(sb, \ttarget);
+   ctl_id_sbuf(port-target_devid, sb);
+   sbuf_printf(sb, /target\n);
+   }
 
-   retval = sbuf_printf(sb, \twwpn%#jx/wwpn\n,
-   (uintmax_t)port-wwpn);
-   if (retval != 0)
-   break;
+   if (port-port_devid != NULL) {
+   sbuf_printf(sb, \tport);
+   ctl_id_sbuf(port-port_devid, sb);
+   sbuf_printf(sb, /port\n);
+   }
 
if (port-port_info != NULL) {
retval = port-port_info(port-onoff_arg, sb);
@@ -3366,6 +3406,26 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
break;
}
 
+   for (j = 0; j  CTL_MAX_INIT_PER_PORT; j++) {
+   if (port-wwpn_iid[j].in_use == 0 ||
+   (port-wwpn_iid[j].wwpn == 0 
+port-wwpn_iid[j].name == NULL))
+   continue;
+
+   if (port-wwpn_iid[j].name != NULL)
+   retval = sbuf_printf(sb,
+   \tinitiator%u %s/initiator\n,
+   j, port-wwpn_iid[j].name);
+   else
+   retval = sbuf_printf(sb,
+   \tinitiator%u 
naa.%08jx/initiator\n,
+   j, port-wwpn_iid[j].wwpn);
+   if (retval != 0)
+   break;
+   }
+   if (retval != 0)
+   break;
+
retval = sbuf_printf(sb, /targ_port\n);
if (retval != 0)
break;


svn commit: r272979 - in head/contrib/netbsd-tests/lib/libc: tls tls/dso tls_dso

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Sun Oct 12 10:04:59 2014
New Revision: 272979
URL: https://svnweb.freebsd.org/changeset/base/272979

Log:
  Only #include sys/tls.h on NetBSD
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c
  head/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c
  head/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c
  head/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c
  head/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c
  head/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c

Modified: head/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c
==
--- head/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c   Sun Oct 12 
06:55:34 2014(r272978)
+++ head/contrib/netbsd-tests/lib/libc/tls/dso/h_tls_dlopen.c   Sun Oct 12 
10:04:59 2014(r272979)
@@ -36,7 +36,9 @@ __RCSID($NetBSD: h_tls_dlopen.c,v 1.5 2
 
 #include atf-c.h
 #include unistd.h
+#if defined(__NetBSD__)
 #include sys/tls.h
+#endif
 
 #ifdef __HAVE_NO___THREAD
 #define__thread

Modified: head/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c
==
--- head/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c   Sun Oct 12 
06:55:34 2014(r272978)
+++ head/contrib/netbsd-tests/lib/libc/tls/t_tls_dlopen.c   Sun Oct 12 
10:04:59 2014(r272979)
@@ -39,7 +39,9 @@ __RCSID($NetBSD: t_tls_dlopen.c,v 1.3 2
 #include pthread.h
 #include unistd.h
 
+#if defined(__NetBSD__)
 #include sys/tls.h
+#endif
 
 #ifdef __HAVE_NO___THREAD
 #define__thread

Modified: head/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c
==
--- head/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c  Sun Oct 12 
06:55:34 2014(r272978)
+++ head/contrib/netbsd-tests/lib/libc/tls/t_tls_dynamic.c  Sun Oct 12 
10:04:59 2014(r272979)
@@ -38,7 +38,9 @@ __RCSID($NetBSD: t_tls_dynamic.c,v 1.3 
 #include pthread.h
 #include unistd.h
 
+#if defined(__NetBSD__)
 #include sys/tls.h
+#endif
 
 #ifdef __HAVE_NO___THREAD
 #define__thread

Modified: head/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c
==
--- head/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c   Sun Oct 12 
06:55:34 2014(r272978)
+++ head/contrib/netbsd-tests/lib/libc/tls/t_tls_static.c   Sun Oct 12 
10:04:59 2014(r272979)
@@ -37,7 +37,9 @@ __RCSID($NetBSD: t_tls_static.c,v 1.2 2
 #include atf-c.h
 #include pthread.h
 
+#if defined(__NetBSD__)
 #include sys/tls.h
+#endif
 
 #ifdef __HAVE_NO___THREAD
 #define__thread

Modified: head/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.c
==
--- head/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.cSun Oct 
12 06:55:34 2014(r272978)
+++ head/contrib/netbsd-tests/lib/libc/tls/t_tls_static_helper.cSun Oct 
12 10:04:59 2014(r272979)
@@ -34,7 +34,9 @@
 #include sys/cdefs.h
 __RCSID($NetBSD: t_tls_static_helper.c,v 1.2 2012/01/17 20:34:57 joerg Exp 
$);
 
+#if defined(__NetBSD__)
 #include sys/tls.h
+#endif
 
 #ifdef __HAVE_NO___THREAD
 #define__thread

Modified: head/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c
==
--- head/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c  Sun Oct 12 
06:55:34 2014(r272978)
+++ head/contrib/netbsd-tests/lib/libc/tls_dso/h_tls_dynamic.c  Sun Oct 12 
10:04:59 2014(r272979)
@@ -35,7 +35,9 @@
 __RCSID($NetBSD: h_tls_dynamic.c,v 1.5 2013/10/21 19:11:17 joerg Exp $);
 
 #include unistd.h
+#if defined(__NetBSD__)
 #include sys/tls.h
+#endif
 
 #ifdef __HAVE_NO___THREAD
 #define__thread
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272980 - head/contrib/netbsd-tests/lib/libc/stdlib

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Sun Oct 12 10:07:26 2014
New Revision: 272980
URL: https://svnweb.freebsd.org/changeset/base/272980

Log:
  #include libutil.h for fparseln on FreeBSD
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c

Modified: head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c
==
--- head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c   Sun Oct 12 
10:04:59 2014(r272979)
+++ head/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c   Sun Oct 12 
10:07:26 2014(r272980)
@@ -36,6 +36,9 @@
 #include string.h
 #include stdlib.h
 #include unistd.h
+#if defined(__FreeBSD__)
+#include libutil.h
+#endif
 
 #define SKIPWS(p)  while (isspace((int)(*p))) p++
 #defineWS  \t\n 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272983 - in head/bin/sh: . tests/builtins

2014-10-12 Thread Jilles Tjoelker
Author: jilles
Date: Sun Oct 12 13:12:06 2014
New Revision: 272983
URL: https://svnweb.freebsd.org/changeset/base/272983

Log:
  sh: Fix break/continue/return in multiline eval.
  
  Example:
eval $'return\necho bad'

Added:
  head/bin/sh/tests/builtins/eval7.0   (contents, props changed)
  head/bin/sh/tests/builtins/eval8.7   (contents, props changed)
Modified:
  head/bin/sh/eval.c
  head/bin/sh/tests/builtins/Makefile

Modified: head/bin/sh/eval.c
==
--- head/bin/sh/eval.c  Sun Oct 12 11:22:25 2014(r272982)
+++ head/bin/sh/eval.c  Sun Oct 12 13:12:06 2014(r272983)
@@ -168,6 +168,8 @@ evalstring(char *s, int flags)
else
evaltree(n, flags);
any = 1;
+   if (evalskip)
+   break;
}
popstackmark(smark);
setstackmark(smark);

Modified: head/bin/sh/tests/builtins/Makefile
==
--- head/bin/sh/tests/builtins/Makefile Sun Oct 12 11:22:25 2014
(r272982)
+++ head/bin/sh/tests/builtins/Makefile Sun Oct 12 13:12:06 2014
(r272983)
@@ -72,6 +72,8 @@ FILES+=   eval3.0
 FILES+=eval4.0
 FILES+=eval5.0
 FILES+=eval6.0
+FILES+=eval7.0
+FILES+=eval8.7
 FILES+=exec1.0
 FILES+=exec2.0
 FILES+=exit1.0

Added: head/bin/sh/tests/builtins/eval7.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/builtins/eval7.0  Sun Oct 12 13:12:06 2014
(r272983)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+# Assumes that break can break out of a loop outside eval.
+
+while :; do
+   eval break
+echo bad1
+   echo bad2
+   exit 3
+done

Added: head/bin/sh/tests/builtins/eval8.7
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/builtins/eval8.7  Sun Oct 12 13:12:06 2014
(r272983)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+f() {
+   eval return 7
+echo bad2
+}
+f
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r272952 - in head/sys: fs/ext2fs fs/msdosfs ufs/ffs

2014-10-12 Thread Bruce Evans

On Sat, 11 Oct 2014, Konstantin Belousov wrote:


Log:
 Do not set IN_ACCESS flag for read-only mounts.  The IN_ACCESS
 survives remount in rw, also it is set for vnodes on rootfs before
 noatime can be set or clock is adjusted.  All conditions result in
 wrong atime for accessed vnodes.

 Submitted by:  bde
 MFC after: 1 week


Thanks.


...
Modified: head/sys/ufs/ffs/ffs_vnops.c
==
--- head/sys/ufs/ffs/ffs_vnops.cSat Oct 11 18:58:58 2014
(r272951)
+++ head/sys/ufs/ffs/ffs_vnops.cSat Oct 11 19:09:56 2014
(r272952)
@@ -627,7 +627,7 @@ ffs_read(ap)
}

if ((error == 0 || uio-uio_resid != orig_resid) 
-   (vp-v_mount-mnt_flag  MNT_NOATIME) == 0 
+   (vp-v_mount-mnt_flag  (MNT_NOATIME | MNT_RDONLY)) == 0 
(ip-i_flag  IN_ACCESS) == 0) {
VI_LOCK(vp);
ip-i_flag |= IN_ACCESS;



Is it correct for only ffs to acquire the vnode interlock?  I think it
is, but don't remember which ffs-only feature requires it.

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


Re: svn commit: r272952 - in head/sys: fs/ext2fs fs/msdosfs ufs/ffs

2014-10-12 Thread Konstantin Belousov
On Mon, Oct 13, 2014 at 12:39:54AM +1100, Bruce Evans wrote:
  @@ -627,7 +627,7 @@ ffs_read(ap)
  }
 
  if ((error == 0 || uio-uio_resid != orig_resid) 
  -   (vp-v_mount-mnt_flag  MNT_NOATIME) == 0 
  +   (vp-v_mount-mnt_flag  (MNT_NOATIME | MNT_RDONLY)) == 0 
  (ip-i_flag  IN_ACCESS) == 0) {
  VI_LOCK(vp);
  ip-i_flag |= IN_ACCESS;
 
 
 Is it correct for only ffs to acquire the vnode interlock?  I think it
 is, but don't remember which ffs-only feature requires it.

We either hold the vnode lock exclusive, or shared + own the vnode interlock,
for i_flag modifications.  Since this is ffs_read(), which is entered with
the vnode shared locked, the interlock must be acquired.

Both msdosfs and ext2fs do not enable the shared locking mode for
the lockmgr locks serving as the vnodes locks, so msdosfs_read() and
ext2_read() are executed with vnode locked exclusively.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272984 - in head/sys: netinet netinet6

2014-10-12 Thread Robert Watson
Author: rwatson
Date: Sun Oct 12 15:49:52 2014
New Revision: 272984
URL: https://svnweb.freebsd.org/changeset/base/272984

Log:
  When deciding whether to call m_pullup() even though there is adequate
  data in an mbuf, use M_WRITABLE() instead of a direct test of M_EXT;
  the latter both unnecessarily exposes mbuf-allocator internals in the
  protocol stack and is also insufficient to catch all cases of
  non-writability.
  
  (NB: m_pullup() does not actually guarantee that a writable mbuf is
  returned, so further refinement of all of these code paths continues to
  be required.)
  
  Reviewed by:  bz
  MFC after:3 days
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision: https://reviews.freebsd.org/D900

Modified:
  head/sys/netinet/igmp.c
  head/sys/netinet/ip_mroute.c
  head/sys/netinet/ip_output.c
  head/sys/netinet6/icmp6.c
  head/sys/netinet6/ip6_mroute.c
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet/igmp.c
==
--- head/sys/netinet/igmp.c Sun Oct 12 13:12:06 2014(r272983)
+++ head/sys/netinet/igmp.c Sun Oct 12 15:49:52 2014(r272984)
@@ -1466,7 +1466,7 @@ igmp_input(struct mbuf **mp, int *offp, 
minlen += IGMP_V3_QUERY_MINLEN;
else
minlen += IGMP_MINLEN;
-   if ((m-m_flags  M_EXT || m-m_len  minlen) 
+   if ((!M_WRITABLE(m) || m-m_len  minlen) 
(m = m_pullup(m, minlen)) == 0) {
IGMPSTAT_INC(igps_rcv_tooshort);
return (IPPROTO_DONE);
@@ -1557,7 +1557,7 @@ igmp_input(struct mbuf **mp, int *offp, 
 */
igmpv3len = iphlen + IGMP_V3_QUERY_MINLEN +
srclen;
-   if ((m-m_flags  M_EXT ||
+   if ((!M_WRITABLE(m) ||
 m-m_len  igmpv3len) 
(m = m_pullup(m, igmpv3len)) == NULL) {
IGMPSTAT_INC(igps_rcv_tooshort);

Modified: head/sys/netinet/ip_mroute.c
==
--- head/sys/netinet/ip_mroute.cSun Oct 12 13:12:06 2014
(r272983)
+++ head/sys/netinet/ip_mroute.cSun Oct 12 15:49:52 2014
(r272984)
@@ -121,7 +121,6 @@ __FBSDID($FreeBSD$);
 #endif
 
 #defineVIFI_INVALID((vifi_t) -1)
-#defineM_HASCL(m)  ((m)-m_flags  M_EXT)
 
 static VNET_DEFINE(uint32_t, last_tv_sec); /* last time we processed this */
 #defineV_last_tv_sec   VNET(last_tv_sec)
@@ -1304,7 +1303,7 @@ X_ip_mforward(struct ip *ip, struct ifne
}
 
mb0 = m_copypacket(m, M_NOWAIT);
-   if (mb0  (M_HASCL(mb0) || mb0-m_len  hlen))
+   if (mb0  (!M_WRITABLE(mb0) || mb0-m_len  hlen))
mb0 = m_pullup(mb0, hlen);
if (mb0 == NULL) {
free(rte, M_MRTABLE);
@@ -1544,7 +1543,7 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp
int hlen = ip-ip_hl  2;
struct mbuf *mm = m_copy(m, 0, hlen);
 
-   if (mm  (M_HASCL(mm) || mm-m_len  hlen))
+   if (mm  (!M_WRITABLE(mm) || mm-m_len  hlen))
mm = m_pullup(mm, hlen);
if (mm == NULL)
return ENOBUFS;
@@ -1665,7 +1664,7 @@ phyint_send(struct ip *ip, struct vif *v
  * so that ip_output() only scribbles on the copy.
  */
 mb_copy = m_copypacket(m, M_NOWAIT);
-if (mb_copy  (M_HASCL(mb_copy) || mb_copy-m_len  hlen))
+if (mb_copy  (!M_WRITABLE(mb_copy) || mb_copy-m_len  hlen))
mb_copy = m_pullup(mb_copy, hlen);
 if (mb_copy == NULL)
return;

Modified: head/sys/netinet/ip_output.c
==
--- head/sys/netinet/ip_output.cSun Oct 12 13:12:06 2014
(r272983)
+++ head/sys/netinet/ip_output.cSun Oct 12 15:49:52 2014
(r272984)
@@ -1365,7 +1365,7 @@ ip_mloopback(struct ifnet *ifp, struct m
 * modify the pack in order to generate checksums.
 */
copym = m_dup(m, M_NOWAIT);
-   if (copym != NULL  (copym-m_flags  M_EXT || copym-m_len  hlen))
+   if (copym != NULL  (!M_WRITABLE(copym) || copym-m_len  hlen))
copym = m_pullup(copym, hlen);
if (copym != NULL) {
/* If needed, compute the checksum and mark it as valid. */

Modified: head/sys/netinet6/icmp6.c
==
--- head/sys/netinet6/icmp6.c   Sun Oct 12 13:12:06 2014(r272983)
+++ head/sys/netinet6/icmp6.c   Sun Oct 12 15:49:52 2014(r272984)
@@ -63,6 +63,8 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
+#defineMBUF_PRIVATE/* XXXRW: Optimisation tries to avoid M_EXT 
mbufs */
+
 #include opt_inet.h
 

svn commit: r273003 - head/usr.sbin/bsdinstall/partedit

2014-10-12 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Oct 12 17:50:25 2014
New Revision: 273003
URL: https://svnweb.freebsd.org/changeset/base/273003

Log:
  Centralize determination of boot firmware (UEFI vs. BIOS/CSM) into a
  function x86_bootmethod() and fix deviations from style(9).

Modified:
  head/usr.sbin/bsdinstall/partedit/partedit_x86.c

Modified: head/usr.sbin/bsdinstall/partedit/partedit_x86.c
==
--- head/usr.sbin/bsdinstall/partedit/partedit_x86.cSun Oct 12 17:45:22 
2014(r273002)
+++ head/usr.sbin/bsdinstall/partedit/partedit_x86.cSun Oct 12 17:50:25 
2014(r273003)
@@ -32,8 +32,21 @@
 
 #include partedit.h
 
-static char platform[255] = ;
-static const char *platform_sysctl = machdep.bootmethod;
+static const char *
+x86_bootmethod(void)
+{
+   static char fw[255] = ;
+   size_t len = sizeof(fw);
+   int error;
+   
+   if (strlen(fw) == 0) {
+   error = sysctlbyname(machdep.bootmethod, fw, len, NULL, -1);
+   if (error != 0)
+   return (BIOS);
+   }
+
+   return (fw);
+}
 
 const char *
 default_scheme(void) {
@@ -41,14 +54,12 @@ default_scheme(void) {
 }
 
 int
-is_scheme_bootable(const char *part_type) {
-   size_t platlen = sizeof(platform);
-   if (strlen(platform) == 0)
-   sysctlbyname(platform_sysctl, platform, platlen, NULL, -1);
+is_scheme_bootable(const char *part_type)
+{
 
if (strcmp(part_type, GPT) == 0)
return (1);
-   if (strcmp(platform, BIOS) == 0) {
+   if (strcmp(x86_bootmethod(), BIOS) == 0) {
if (strcmp(part_type, BSD) == 0)
return (1);
if (strcmp(part_type, MBR) == 0)
@@ -59,31 +70,28 @@ is_scheme_bootable(const char *part_type
 }
 
 int
-is_fs_bootable(const char *part_type, const char *fs) {
-   size_t platlen = sizeof(platform);
-   if (strlen(platform) == 0)
-   sysctlbyname(platform_sysctl, platform, platlen, NULL, -1);
+is_fs_bootable(const char *part_type, const char *fs)
+{
 
if (strcmp(fs, freebsd-ufs) == 0)
return (1);
 
-   if (strcmp(fs, freebsd-zfs) == 0  strcmp(platform, BIOS) == 0)
+   if (strcmp(fs, freebsd-zfs) == 0 
+   strcmp(x86_bootmethod(), BIOS) == 0)
return (1);
 
return (0);
 }
 
 size_t
-bootpart_size(const char *scheme) {
-   size_t platlen = sizeof(platform);
-   if (strlen(platform) == 0)
-   sysctlbyname(platform_sysctl, platform, platlen, NULL, -1);
+bootpart_size(const char *scheme)
+{
 
/* No partcode except for GPT */
if (strcmp(scheme, GPT) != 0)
return (0);
 
-   if (strcmp(platform, BIOS) == 0)
+   if (strcmp(x86_bootmethod(), BIOS) == 0)
return (512*1024);
else 
return (800*1024);
@@ -92,23 +100,20 @@ bootpart_size(const char *scheme) {
 }
 
 const char *
-bootpart_type(const char *scheme) {
-   size_t platlen = sizeof(platform);
-   if (strlen(platform) == 0)
-   sysctlbyname(platform_sysctl, platform, platlen, NULL, -1);
+bootpart_type(const char *scheme)
+{
 
-   if (strcmp(platform, UEFI) == 0)
+   if (strcmp(x86_bootmethod(), UEFI) == 0)
return (efi);
 
return (freebsd-boot);
 }
 
 const char *
-bootcode_path(const char *part_type) {
-   size_t platlen = sizeof(platform);
-   if (strlen(platform) == 0)
-   sysctlbyname(platform_sysctl, platform, platlen, NULL, -1);
-   if (strcmp(platform, UEFI) == 0)
+bootcode_path(const char *part_type)
+{
+
+   if (strcmp(x86_bootmethod(), UEFI) == 0)
return (NULL);
 
if (strcmp(part_type, GPT) == 0)
@@ -122,13 +127,11 @@ bootcode_path(const char *part_type) {
 }

 const char *
-partcode_path(const char *part_type, const char *fs_type) {
-   size_t platlen = sizeof(platform);
-   if (strlen(platform) == 0)
-   sysctlbyname(platform_sysctl, platform, platlen, NULL, -1);
+partcode_path(const char *part_type, const char *fs_type)
+{
 
if (strcmp(part_type, GPT) == 0) {
-   if (strcmp(platform, UEFI) == 0)
+   if (strcmp(x86_bootmethod(), UEFI) == 0)
return (/boot/boot1.efifat);
else if (strcmp(fs_type, zfs) == 0)
return (/boot/gptzfsboot);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273004 - head/sys/dev/uart

2014-10-12 Thread Ian Lepore
Author: ian
Date: Sun Oct 12 17:56:02 2014
New Revision: 273004
URL: https://svnweb.freebsd.org/changeset/base/273004

Log:
  Use the FIFOs in the imx5/imx6 uart hardware instead of interrupting on
  each byte sent or received.

Modified:
  head/sys/dev/uart/uart_dev_imx.c

Modified: head/sys/dev/uart/uart_dev_imx.c
==
--- head/sys/dev/uart/uart_dev_imx.cSun Oct 12 17:50:25 2014
(r273003)
+++ head/sys/dev/uart/uart_dev_imx.cSun Oct 12 17:56:02 2014
(r273004)
@@ -49,6 +49,17 @@ __FBSDID($FreeBSD$);
 #include arm/freescale/imx/imx_ccmvar.h
 
 /*
+ * The hardare FIFOs are 32 bytes.  We want an interrupt when there are 24 
bytes
+ * available to read or space for 24 more bytes to write.  While 8 bytes of
+ * slack before over/underrun might seem excessive, the hardware can run at
+ * 5mbps, which means 2uS per char, so at full speed 8 bytes provides only 16uS
+ * to get into the interrupt handler and service the fifo.
+ */
+#defineIMX_FIFOSZ  32
+#defineIMX_RXFIFO_LEVEL24
+#defineIMX_TXFIFO_LEVEL24
+
+/*
  * Low-level UART interface.
  */
 static int imx_uart_probe(struct uart_bas *bas);
@@ -187,6 +198,17 @@ imx_uart_init(struct uart_bas *bas, int 
SETREG(bas, REG(UBIR), 15);
SETREG(bas, REG(UBMR), (baseclk / baudrate) - 1);
}
+
+   /*
+* Program the tx lowater and rx hiwater levels at which fifo-service
+* interrupts are signaled.  The tx value is interpetted as when there
+* are only this many bytes remaining (not this many free).
+*/
+   reg = GETREG(bas, REG(UFCR));
+   reg = ~(IMXUART_UFCR_TXTL_MASK | IMXUART_UFCR_RXTL_MASK);
+   reg |= (IMX_FIFOSZ - IMX_TXFIFO_LEVEL)  IMXUART_UFCR_TXTL_SHIFT;
+   reg |= IMX_RXFIFO_LEVEL  IMXUART_UFCR_RXTL_SHIFT;
+   SETREG(bas, REG(UFCR), reg);
 }
 
 static void
@@ -199,7 +221,7 @@ static void
 imx_uart_putc(struct uart_bas *bas, int c)
 {
 
-   while (!(IS(bas, USR2, TXFE)))
+   while (!(IS(bas, USR1, TRDY)))
;
SETREG(bas, REG(UTXD), c);
 }
@@ -302,11 +324,15 @@ imx_uart_bus_attach(struct uart_softc *s
 
(void)imx_uart_bus_getsig(sc);
 
-   ENA(bas, UCR4, DREN);
-   DIS(bas, UCR1, RRDYEN);
+   /* Clear all pending interrupts. */
+   SETREG(bas, REG(USR1), 0x);
+   SETREG(bas, REG(USR2), 0x);
+
+   DIS(bas, UCR4, DREN);
+   ENA(bas, UCR1, RRDYEN);
DIS(bas, UCR1, IDEN);
DIS(bas, UCR3, RXDSEN);
-   DIS(bas, UCR2, ATEN);
+   ENA(bas, UCR2, ATEN);
DIS(bas, UCR1, TXMPTYEN);
DIS(bas, UCR1, TRDYEN);
DIS(bas, UCR4, TCEN);
@@ -330,9 +356,6 @@ imx_uart_bus_attach(struct uart_softc *s
ENA(bas, UCR2, IRTS);
ENA(bas, UCR3, RXDMUXSEL);
 
-   /* ACK all interrupts */
-   SETREG(bas, REG(USR1), 0x);
-   SETREG(bas, REG(USR2), 0x);
return (0);
 }
 
@@ -404,7 +427,7 @@ imx_uart_bus_ipend(struct uart_softc *sc
struct uart_bas *bas;
int ipend;
uint32_t usr1, usr2;
-   uint32_t ucr1, ucr4;
+   uint32_t ucr1, ucr2, ucr4;
 
bas = sc-sc_bas;
ipend = 0;
@@ -419,18 +442,28 @@ imx_uart_bus_ipend(struct uart_softc *sc
SETREG(bas, REG(USR2), usr2);
 
ucr1 = GETREG(bas, REG(UCR1));
+   ucr2 = GETREG(bas, REG(UCR2));
ucr4 = GETREG(bas, REG(UCR4));
 
-   if ((usr2  FLD(USR2, TXFE))  (ucr1  FLD(UCR1, TXMPTYEN))) {
-   DIS(bas, UCR1, TXMPTYEN);
-   /* Continue TXing */
+   /* If we have reached tx low-water, we can tx some more now. */
+   if ((usr1  FLD(USR1, TRDY))  (ucr1  FLD(UCR1, TRDYEN))) {
+   DIS(bas, UCR1, TRDYEN);
ipend |= SER_INT_TXIDLE;
}
-   if ((usr2  FLD(USR2, RDR))  (ucr4  FLD(UCR4, DREN))) {
-   DIS(bas, UCR4, DREN);
-   /* Wow, new char on input */
+
+   /*
+* If we have reached the rx high-water, or if there are bytes in the rx
+* fifo and no new data has arrived for 8 character periods (aging
+* timer), we have input data to process.
+*/
+   if (((usr1  FLD(USR1, RRDY))  (ucr1  FLD(UCR1, RRDYEN))) || 
+   ((usr1  FLD(USR1, AGTIM))  (ucr2  FLD(UCR2, ATEN {
+   DIS(bas, UCR1, RRDYEN);
+   DIS(bas, UCR2, ATEN);
ipend |= SER_INT_RXREADY;
}
+
+   /* A break can come in at any time, it never gets disabled. */
if ((usr2  FLD(USR2, BRCD))  (ucr4  FLD(UCR4, BKEN)))
ipend |= SER_INT_BREAK;
 
@@ -459,8 +492,14 @@ imx_uart_bus_probe(struct uart_softc *sc
if (error)
return (error);
 
-   sc-sc_rxfifosz = 1;
-   sc-sc_txfifosz = 1;
+   /*
+* On input we can read up to the full fifo size at once.  On output, we
+* want to write only as much 

svn commit: r273005 - head/usr.sbin/bsdinstall/partedit

2014-10-12 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Oct 12 17:59:31 2014
New Revision: 273005
URL: https://svnweb.freebsd.org/changeset/base/273005

Log:
  Only allow ZFS boot on GPT; the MBR ZFS bootblocks cannot be installed using
  gpart bootcode as /boot/zfsboot needs to be split into multiple pieces by
  hand and copied to different areas of the partition.

Modified:
  head/usr.sbin/bsdinstall/partedit/partedit_x86.c

Modified: head/usr.sbin/bsdinstall/partedit/partedit_x86.c
==
--- head/usr.sbin/bsdinstall/partedit/partedit_x86.cSun Oct 12 17:56:02 
2014(r273004)
+++ head/usr.sbin/bsdinstall/partedit/partedit_x86.cSun Oct 12 17:59:31 
2014(r273005)
@@ -49,7 +49,8 @@ x86_bootmethod(void)
 }
 
 const char *
-default_scheme(void) {
+default_scheme(void)
+{
return (GPT);
 }
 
@@ -77,6 +78,7 @@ is_fs_bootable(const char *part_type, co
return (1);
 
if (strcmp(fs, freebsd-zfs) == 0 
+   strcmp(part_type, GPT) == 0 
strcmp(x86_bootmethod(), BIOS) == 0)
return (1);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273006 - head/sys/ddb

2014-10-12 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Oct 12 18:01:52 2014
New Revision: 273006
URL: https://svnweb.freebsd.org/changeset/base/273006

Log:
  ddb: ANSI-fy function declarations.
  
  MFC after:5 days

Modified:
  head/sys/ddb/db_access.c
  head/sys/ddb/db_break.c
  head/sys/ddb/db_command.c
  head/sys/ddb/db_examine.c
  head/sys/ddb/db_input.c
  head/sys/ddb/db_lex.c
  head/sys/ddb/db_output.c
  head/sys/ddb/db_run.c
  head/sys/ddb/db_sym.c
  head/sys/ddb/db_watch.c
  head/sys/ddb/db_write_cmd.c

Modified: head/sys/ddb/db_access.c
==
--- head/sys/ddb/db_access.cSun Oct 12 17:59:31 2014(r273005)
+++ head/sys/ddb/db_access.cSun Oct 12 18:01:52 2014(r273006)
@@ -54,10 +54,7 @@ static unsigned db_extend[] = {  /* table
 #endif
 
 db_expr_t
-db_get_value(addr, size, is_signed)
-   db_addr_t   addr;
-   register intsize;
-   boolean_t   is_signed;
+db_get_value(db_addr_t addr, int size, boolean_t is_signed)
 {
chardata[sizeof(u_int64_t)];
register db_expr_t value;
@@ -87,10 +84,7 @@ db_get_value(addr, size, is_signed)
 }
 
 void
-db_put_value(addr, size, value)
-   db_addr_t   addr;
-   register intsize;
-   register db_expr_t value;
+db_put_value(db_addr_t addr, int size, db_expr_t value)
 {
chardata[sizeof(int)];
register inti;

Modified: head/sys/ddb/db_break.c
==
--- head/sys/ddb/db_break.c Sun Oct 12 17:59:31 2014(r273005)
+++ head/sys/ddb/db_break.c Sun Oct 12 18:01:52 2014(r273006)
@@ -59,7 +59,7 @@ static void   db_list_breakpoints(void);
 static voiddb_set_breakpoint(vm_map_t map, db_addr_t addr, int count);
 
 static db_breakpoint_t
-db_breakpoint_alloc()
+db_breakpoint_alloc(void)
 {
register db_breakpoint_tbkpt;
 
@@ -78,18 +78,14 @@ db_breakpoint_alloc()
 }
 
 static void
-db_breakpoint_free(bkpt)
-   register db_breakpoint_tbkpt;
+db_breakpoint_free(db_breakpoint_t bkpt)
 {
bkpt-link = db_free_breakpoints;
db_free_breakpoints = bkpt;
 }
 
 static void
-db_set_breakpoint(map, addr, count)
-   vm_map_tmap;
-   db_addr_t   addr;
-   int count;
+db_set_breakpoint(vm_map_t map, db_addr_t addr, int count)
 {
register db_breakpoint_tbkpt;
 
@@ -115,9 +111,7 @@ db_set_breakpoint(map, addr, count)
 }
 
 static void
-db_delete_breakpoint(map, addr)
-   vm_map_tmap;
-   db_addr_t   addr;
+db_delete_breakpoint(vm_map_t map, db_addr_t addr)
 {
register db_breakpoint_tbkpt;
register db_breakpoint_t*prev;
@@ -140,9 +134,7 @@ db_delete_breakpoint(map, addr)
 }
 
 static db_breakpoint_t
-db_find_breakpoint(map, addr)
-   vm_map_tmap;
-   db_addr_t   addr;
+db_find_breakpoint(vm_map_t map, db_addr_t addr)
 {
register db_breakpoint_tbkpt;
 
@@ -158,8 +150,7 @@ db_find_breakpoint(map, addr)
 }
 
 db_breakpoint_t
-db_find_breakpoint_here(addr)
-   db_addr_t   addr;
+db_find_breakpoint_here(db_addr_t addr)
 {
return db_find_breakpoint(db_map_addr(addr), addr);
 }
@@ -180,7 +171,7 @@ do {
\
 #endif
 
 void
-db_set_breakpoints()
+db_set_breakpoints(void)
 {
register db_breakpoint_tbkpt;
 
@@ -197,7 +188,7 @@ db_set_breakpoints()
 }
 
 void
-db_clear_breakpoints()
+db_clear_breakpoints(void)
 {
register db_breakpoint_tbkpt;
 
@@ -220,8 +211,7 @@ db_clear_breakpoints()
  * so the breakpoint does not have to be on the breakpoint list.
  */
 db_breakpoint_t
-db_set_temp_breakpoint(addr)
-   db_addr_t   addr;
+db_set_temp_breakpoint(db_addr_t addr)
 {
register db_breakpoint_tbkpt;
 
@@ -242,8 +232,7 @@ db_set_temp_breakpoint(addr)
 }
 
 void
-db_delete_temp_breakpoint(bkpt)
-   db_breakpoint_t bkpt;
+db_delete_temp_breakpoint(db_breakpoint_t bkpt)
 {
BKPT_CLEAR(bkpt-address, bkpt-bkpt_inst);
db_breakpoint_free(bkpt);
@@ -254,7 +243,7 @@ db_delete_temp_breakpoint(bkpt)
  * List breakpoints.
  */
 static void
-db_list_breakpoints()
+db_list_breakpoints(void)
 {
register db_breakpoint_tbkpt;
 
@@ -278,11 +267,7 @@ db_list_breakpoints()
 /* Delete breakpoint */
 /*ARGSUSED*/
 void
-db_delete_cmd(addr, have_addr, count, modif)
-   db_expr_t   addr;
-   boolean_t   have_addr;
-   db_expr_t   count;
-   char *  modif;
+db_delete_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, char 
*modif)
 {
db_delete_breakpoint(db_map_addr(addr), (db_addr_t)addr);
 }
@@ -290,11 +275,8 @@ db_delete_cmd(addr, have_addr, count, mo
 /* Set breakpoint with skip count */
 /*ARGSUSED*/
 void
-db_breakpoint_cmd(addr, have_addr, count, modif)
-   db_expr_t 

svn commit: r273008 - head/sys/cam/ctl

2014-10-12 Thread Alexander Motin
Author: mav
Date: Sun Oct 12 18:57:22 2014
New Revision: 273008
URL: https://svnweb.freebsd.org/changeset/base/273008

Log:
  Remove stale comments.

Modified:
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Sun Oct 12 18:53:45 2014(r273007)
+++ head/sys/cam/ctl/scsi_ctl.c Sun Oct 12 18:57:22 2014(r273008)
@@ -1513,11 +1513,6 @@ ctlfedone(struct cam_periph *periph, uni
case CAM_MESSAGE_RECV:
switch (inot-arg) {
case MSG_ABORT_TASK_SET:
-   /*
-* XXX KDM this isn't currently
-* supported by CTL.  It ends up
-* being a no-op.
-*/
io-taskio.task_action =
CTL_TASK_ABORT_TASK_SET;
break;
@@ -1534,11 +1529,6 @@ ctlfedone(struct cam_periph *periph, uni
CTL_TASK_LUN_RESET;
break;
case MSG_CLEAR_TASK_SET:
-   /*
-* XXX KDM this isn't currently
-* supported by CTL.  It ends up
-* being a no-op.
-*/
io-taskio.task_action =
CTL_TASK_CLEAR_TASK_SET;
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273009 - in head: etc/devd sys/powerpc/powermac

2014-10-12 Thread Justin Hibbits
Author: jhibbits
Date: Sun Oct 12 19:12:48 2014
New Revision: 273009
URL: https://svnweb.freebsd.org/changeset/base/273009

Log:
  Add an AC line monitor so power_profile can work
  
  Summary:
  Add a polling loop (1Hz) to monitor the battery and AC status, to notify devd
  like ACPI does for power monitoring.  This allows /etc/rc.d/power_profile to
  work on PowerPC laptops
  
  Test Plan:
  Tested on a Titanium PowerBook, configuring economy_cpu_freq and
  performance_cpu_freq, disabling powerd.
  
  Reviewers: #powerpc, nwhitehorn
  
  Reviewed By: nwhitehorn
  
  Subscribers: rpaulo
  
  Differential Revision: https://reviews.freebsd.org/D937

Modified:
  head/etc/devd/apple.conf
  head/sys/powerpc/powermac/pmu.c

Modified: head/etc/devd/apple.conf
==
--- head/etc/devd/apple.confSun Oct 12 18:57:22 2014(r273008)
+++ head/etc/devd/apple.confSun Oct 12 19:12:48 2014(r273009)
@@ -71,4 +71,10 @@ notify 0 {
action  camcontrol eject cd0;
 };
 
-
+# Equivalent to the ACPI/ACAD notify
+notify 10 {
+   match system  PMU;
+   match subsystem   POWER;
+   match typeACLINE;
+   action /etc/rc.d/power_profile $notify;
+}

Modified: head/sys/powerpc/powermac/pmu.c
==
--- head/sys/powerpc/powermac/pmu.c Sun Oct 12 18:57:22 2014
(r273008)
+++ head/sys/powerpc/powermac/pmu.c Sun Oct 12 19:12:48 2014
(r273009)
@@ -35,6 +35,7 @@ __FBSDID($FreeBSD$);
 #include sys/bus.h
 #include sys/conf.h
 #include sys/kernel.h
+#include sys/kthread.h
 #include sys/clock.h
 #include sys/proc.h
 #include sys/reboot.h
@@ -183,6 +184,9 @@ static int pmu_send(void *cookie, int cm
 static uint8_t pmu_read_reg(struct pmu_softc *sc, u_int offset);
 static void pmu_write_reg(struct pmu_softc *sc, u_int offset, uint8_t value);
 static int pmu_intr_state(struct pmu_softc *);
+static void pmu_battquery_proc(void);
+static void pmu_battery_notify(struct pmu_battstate *batt,
+   struct pmu_battstate *old);
 
 /* these values shows that number of data returned after 'send' cmd is sent */
 static signed char pm_send_cmd_type[] = {
@@ -256,6 +260,13 @@ static signed char pm_receive_cmd_type[]
  -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
 };
 
+static struct proc *pmubattproc;
+static struct kproc_desc pmu_batt_kp = {
+   pmu_batt,
+   pmu_battquery_proc,
+   pmubattproc
+};
+
 /* We only have one of each device, so globals are safe */
 static device_t pmu = NULL;
 static device_t pmu_extint = NULL;
@@ -420,6 +431,8 @@ pmu_attach(device_t dev)
struct sysctl_oid *oid, *battroot;
char battnum[2];
 
+   /* Only start the battery monitor if we have a battery. */
+   kproc_start(pmu_batt_kp);
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
acline, CTLTYPE_INT | CTLFLAG_RD, sc, 0,
pmu_acline_state, I, AC Line Status);
@@ -914,6 +927,39 @@ pmu_query_battery(struct pmu_softc *sc, 
return (0);
 }
 
+static void
+pmu_battery_notify(struct pmu_battstate *batt, struct pmu_battstate *old)
+{
+   char notify_buf[16];
+   int acline;
+
+   acline = (batt-state  PMU_PWR_AC_PRESENT) ? 1 : 0;
+   if (acline != (old-state  PMU_PWR_AC_PRESENT)) {
+   snprintf(notify_buf, sizeof(notify_buf),
+   notify=0x%02x, acline);
+   devctl_notify(PMU, POWER, ACLINE, notify_buf);
+   }
+}
+
+static void
+pmu_battquery_proc()
+{
+   struct pmu_softc *sc;
+   struct pmu_battstate batt;
+   struct pmu_battstate cur_batt;
+   int error;
+
+   sc = device_get_softc(pmu);
+
+   error = pmu_query_battery(sc, 0, cur_batt);
+   while (1) {
+   error = pmu_query_battery(sc, 0, batt);
+   pmu_battery_notify(batt, cur_batt);
+   cur_batt = batt;
+   pause(pmu_batt, hz);
+   }
+}
+
 static int
 pmu_acline_state(SYSCTL_HANDLER_ARGS)
 {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r273009 - in head: etc/devd sys/powerpc/powermac

2014-10-12 Thread Justin Hibbits
On Sun, 12 Oct 2014 19:12:49 + (UTC)
Justin Hibbits jhibb...@freebsd.org wrote:

 Author: jhibbits
 Date: Sun Oct 12 19:12:48 2014
 New Revision: 273009
 URL: https://svnweb.freebsd.org/changeset/base/273009
 
 Log:
   Add an AC line monitor so power_profile can work
   
   Summary:
   Add a polling loop (1Hz) to monitor the battery and AC status, to
 notify devd like ACPI does for power monitoring.  This
 allows /etc/rc.d/power_profile to work on PowerPC laptops
   
   Test Plan:
   Tested on a Titanium PowerBook, configuring economy_cpu_freq and
   performance_cpu_freq, disabling powerd.
   
   Reviewers: #powerpc, nwhitehorn
   
   Reviewed By: nwhitehorn
   
   Subscribers: rpaulo
   
   Differential Revision: https://reviews.freebsd.org/D937
 

MFC After: 3 weeks
Relnotes: Yes

(Can we add a template to arc to include those fields in arc messages?)

- Justin


signature.asc
Description: PGP signature


svn commit: r273010 - head/contrib/netbsd-tests/lib/libc/regex

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Sun Oct 12 21:53:13 2014
New Revision: 273010
URL: https://svnweb.freebsd.org/changeset/base/273010

Log:
  Implement 64MB memory limit for test to ensure that it fails reliably in
  600 seconds; it would previously fail inconsistently when run in some virtual
  machine configurations
  
  This patch might need to be reverted or revisited later (see the attached PR
  for more details)
  
  PR: 169302
  
  Submitted by: pho
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c

Modified: head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c
==
--- head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.cSun Oct 12 
19:12:48 2014(r273009)
+++ head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.cSun Oct 12 
21:53:13 2014(r273010)
@@ -45,6 +45,9 @@ __RCSID($NetBSD: t_exhaust.c,v 1.7 2011
 #include stdlib.h
 #include err.h
 #include atf-c.h
+#if defined(__FreeBSD__)
+#include sys/resource.h
+#endif
 
 #ifndef REGEX_MAXSIZE
 #define REGEX_MAXSIZE  
@@ -176,14 +179,25 @@ ATF_TC_HEAD(regcomp_too_big, tc)
 crash, but return a proper error code);
// libtre needs it.
atf_tc_set_md_var(tc, timeout, 600);
+#if defined(__FreeBSD__)
+   atf_tc_set_md_var(tc, require.memory, 64M);
+#else
atf_tc_set_md_var(tc, require.memory, 120M);
+#endif
 }
 
 ATF_TC_BODY(regcomp_too_big, tc)
 {
regex_t re;
+#if defined(__FreeBSD__)
+   struct rlimit limit;
+#endif
int e;
 
+#if defined(__FreeBSD__)
+   limit.rlim_cur = limit.rlim_max = 64 * 1024 * 1024;
+   ATF_REQUIRE(setrlimit(RLIMIT_VMEM, limit) != -1);
+#endif
for (size_t i = 0; i  __arraycount(tests); i++) {
char *d = (*tests[i].pattern)(REGEX_MAXSIZE);
e = regcomp(re, d, tests[i].type);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273011 - head/contrib/netbsd-tests/lib/libc/regex

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Sun Oct 12 21:54:55 2014
New Revision: 273011
URL: https://svnweb.freebsd.org/changeset/base/273011

Log:
  Fix compilation errors with missing wide-type headers and fix compilation
  warnings with -Wformat
  
  In collaboration with: pho
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/regex/debug.c

Modified: head/contrib/netbsd-tests/lib/libc/regex/debug.c
==
--- head/contrib/netbsd-tests/lib/libc/regex/debug.cSun Oct 12 21:53:13 
2014(r273010)
+++ head/contrib/netbsd-tests/lib/libc/regex/debug.cSun Oct 12 21:54:55 
2014(r273011)
@@ -34,6 +34,10 @@
 #include string.h
 
 #include sys/types.h
+#if defined(__FreeBSD__)
+#include wchar.h
+#include wctype.h
+#endif
 
 /* Don't sort these! */
 #include utils.h
@@ -50,6 +54,7 @@ static char *regchar(int);
 void
 regprint(regex_t *r, FILE *d)
 {
+#if defined(__NetBSD__)
struct re_guts *g = r-re_g;
int c;
int last;
@@ -111,6 +116,7 @@ regprint(regex_t *r, FILE *d)
}
fprintf(d, \n);
}
+#endif
 }
 
 /*
@@ -171,6 +177,7 @@ s_print(struct re_guts *g, FILE *d)
break;
case OANYOF:
fprintf(d, [(%ld), (long)opnd);
+#if defined(__NetBSD__)
cs = g-sets[opnd];
last = -1;
for (size_t i = 0; i  g-csetsize+1; i++)  /* +1 
flushes */
@@ -187,6 +194,7 @@ s_print(struct re_guts *g, FILE *d)
last = -1;
}
}
+#endif
fprintf(d, ]);
break;
case OBACK_:
@@ -242,7 +250,11 @@ s_print(struct re_guts *g, FILE *d)
fprintf(d, );
break;
default:
+#if defined(__FreeBSD__)
+   fprintf(d, !%ld(%ld)!, OP(*s), opnd);
+#else
fprintf(d, !%d(%d)!, OP(*s), opnd);
+#endif
break;
}
if (!done)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273012 - head/contrib/netbsd-tests/lib/libc/regex

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Sun Oct 12 21:59:23 2014
New Revision: 273012
URL: https://svnweb.freebsd.org/changeset/base/273012

Log:
  - Add libutil #include for fparseln
  - Change ATF_REQUIRE_EQ_MSG to ATF_CHECK_EQ_MSG to gather all failing results
possible (currently 12 with leftassoc)
  - Mark leftassoc atf_tc_expect_fail on FreeBSD (PR coming soon after further
analysis is done on the code)
  
  In collaboration with: pho
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c

Modified: head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c
==
--- head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c  Sun Oct 12 
21:54:55 2014(r273011)
+++ head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c  Sun Oct 12 
21:59:23 2014(r273012)
@@ -48,6 +48,9 @@ __RCSID($NetBSD: t_regex_att.c,v 1.1 20
 #include vis.h
 #include ctype.h
 #include atf-c.h
+#if defined(__FreeBSD__)
+#include libutil.h
+#endif
 
 static const char sep[] = \r\n\t;
 static const char delim[3] = \0;
@@ -374,7 +377,11 @@ checkmatches(const char *matches, size_t
 cur=%d, max=%zu, res, l, len - off);
off += l;
}
+#if defined(__FreeBSD__)
+   ATF_CHECK_STREQ_MSG(res, matches,  at line %zu, lineno);
+#else
ATF_REQUIRE_STREQ_MSG(res, matches,  at line %zu, lineno);
+#endif
free(res);
 }
 
@@ -573,6 +580,9 @@ ATF_TC_BODY(leftassoc, tc)
 * any explation.  Mark as broken here, but I don't know why. */
atf_tc_expect_fail(Reason for breakage unknown);
 #endif
+#if defined(__FreeBSD__)
+   atf_tc_expect_fail(The expected and matched groups are mismatched on 
FreeBSD);
+#endif
att_test(tc, leftassoc);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273013 - head/etc/rc.d

2014-10-12 Thread Hiroki Sato
Author: hrs
Date: Sun Oct 12 22:11:28 2014
New Revision: 273013
URL: https://svnweb.freebsd.org/changeset/base/273013

Log:
  s/-/_/ in name.

Modified:
  head/etc/rc.d/bgfsck

Modified: head/etc/rc.d/bgfsck
==
--- head/etc/rc.d/bgfsckSun Oct 12 21:59:23 2014(r273012)
+++ head/etc/rc.d/bgfsckSun Oct 12 22:11:28 2014(r273013)
@@ -9,7 +9,7 @@
 
 . /etc/rc.subr
 
-name=background-fsck
+name=background_fsck
 rcvar=background_fsck
 start_cmd=bgfsck_start
 stop_cmd=:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273014 - head/sys/netinet

2014-10-12 Thread Julien Charbon
Author: jch
Date: Sun Oct 12 23:01:25 2014
New Revision: 273014
URL: https://svnweb.freebsd.org/changeset/base/273014

Log:
  A connection in TIME_WAIT state before calling close() actually did not
  received any RST packet.  Do not set error to ECONNRESET in this case.
  
  Differential Revision:https://reviews.freebsd.org/D879
  Reviewed by:  rpaulo, adrian
  Approved by:  jhb (mentor)
  Sponsored by: Verisign, Inc.

Modified:
  head/sys/netinet/tcp_usrreq.c

Modified: head/sys/netinet/tcp_usrreq.c
==
--- head/sys/netinet/tcp_usrreq.c   Sun Oct 12 22:11:28 2014
(r273013)
+++ head/sys/netinet/tcp_usrreq.c   Sun Oct 12 23:01:25 2014
(r273014)
@@ -592,7 +592,9 @@ tcp_usr_disconnect(struct socket *so)
inp = sotoinpcb(so);
KASSERT(inp != NULL, (tcp_usr_disconnect: inp == NULL));
INP_WLOCK(inp);
-   if (inp-inp_flags  (INP_TIMEWAIT | INP_DROPPED)) {
+   if (inp-inp_flags  INP_TIMEWAIT)
+   goto out;
+   if (inp-inp_flags  INP_DROPPED) {
error = ECONNRESET;
goto out;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273015 - head/contrib/netbsd-tests/lib/libc/gen

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Sun Oct 12 23:46:24 2014
New Revision: 273015
URL: https://svnweb.freebsd.org/changeset/base/273015

Log:
  Expect nice_err to fail on FreeBSD with unprivileged users
  
  PR: 189821
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/gen/t_nice.c

Modified: head/contrib/netbsd-tests/lib/libc/gen/t_nice.c
==
--- head/contrib/netbsd-tests/lib/libc/gen/t_nice.c Sun Oct 12 23:01:25 
2014(r273014)
+++ head/contrib/netbsd-tests/lib/libc/gen/t_nice.c Sun Oct 12 23:46:24 
2014(r273015)
@@ -72,6 +72,11 @@ ATF_TC_BODY(nice_err, tc)
 {
int i;
 
+#if defined(__FreeBSD__)
+   atf_tc_expect_fail(nice(incr) with incr  0 fails with unprivileged 
+  users and sets errno == EPERM; see PR # 189821 for more details);
+#endif
+
/*
 * The call should fail with EPERM if the
 * supplied parameter is negative and the
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273016 - head/sys/dev/iicbus

2014-10-12 Thread Justin Hibbits
Author: jhibbits
Date: Sun Oct 12 23:48:55 2014
New Revision: 273016
URL: https://svnweb.freebsd.org/changeset/base/273016

Log:
  Check error return from reading integer part of temperature.
  
  There's a very remote, but possible, chance that the integer part read will
  fail, but the fraction read succeeds, at which point the reported temperature 
is
  invalid.
  
  Reported by: Matthew Rezny
  MFC after:3 weeks

Modified:
  head/sys/dev/iicbus/max6690.c

Modified: head/sys/dev/iicbus/max6690.c
==
--- head/sys/dev/iicbus/max6690.c   Sun Oct 12 23:46:24 2014
(r273015)
+++ head/sys/dev/iicbus/max6690.c   Sun Oct 12 23:48:55 2014
(r273016)
@@ -340,6 +340,10 @@ max6690_sensor_read(struct max6690_senso
}
 
err = max6690_read(sc-sc_dev, sc-sc_addr, reg_int, integer);
+
+   if (err  0)
+   return (-1);
+
err = max6690_read(sc-sc_dev, sc-sc_addr, reg_ext, fraction);
 
if (err  0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273018 - head/sys/dev/alc

2014-10-12 Thread Pyun YongHyeon
Author: yongari
Date: Mon Oct 13 01:06:40 2014
New Revision: 273018
URL: https://svnweb.freebsd.org/changeset/base/273018

Log:
  Remove ALC_LOCK_ASSERT in alc_stop_queue().  This function is now
  called in device attach without holding a driver lock so it
  resulted in panic.
  
  Reported by:  markj

Modified:
  head/sys/dev/alc/if_alc.c

Modified: head/sys/dev/alc/if_alc.c
==
--- head/sys/dev/alc/if_alc.c   Mon Oct 13 00:33:59 2014(r273017)
+++ head/sys/dev/alc/if_alc.c   Mon Oct 13 01:06:40 2014(r273018)
@@ -4394,8 +4394,6 @@ alc_stop_queue(struct alc_softc *sc)
uint32_t reg;
int i;
 
-   ALC_LOCK_ASSERT(sc);
-
/* Disable RxQ. */
reg = CSR_READ_4(sc, ALC_RXQ_CFG);
if ((sc-alc_flags  ALC_FLAG_AR816X_FAMILY) == 0) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273019 - head/contrib/netbsd-tests/lib/libc/locale

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Mon Oct 13 01:14:01 2014
New Revision: 273019
URL: https://svnweb.freebsd.org/changeset/base/273019

Log:
  Do initial port of contrib/netbsd-tests/lib/libc/locale
  
  t_io:
  - Expect failures potentially related to implementation-specific knowledge of
  the zh_TW.Big5 locale [*]
  
  t_mbrtowc:
  - Handle unknown locales more gracefully (do not test if the locale doesn't
  exist)
  - Expect failure with mbrtowc_internal dealing with Japanese locales
  (potentially related to implementation detail knowledge of the ja_* locales) 
[*].
  
  t_mbstowcs, t_mbtowc, t_wctomb:
  - Handle unknown locales more gracefully (do not test if the locale doesn't
  exist)
  
  t_wcstod:
  - Treat FreeBSD like NetBSD and Linux in the XXX: FIXME section
  
  [*] More investigation is required to determine the root cause of the failures
  
  Submitted by: pho
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/locale/t_io.c
  head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c
  head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c
  head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c
  head/contrib/netbsd-tests/lib/libc/locale/t_wcstod.c
  head/contrib/netbsd-tests/lib/libc/locale/t_wctomb.c

Modified: head/contrib/netbsd-tests/lib/libc/locale/t_io.c
==
--- head/contrib/netbsd-tests/lib/libc/locale/t_io.cMon Oct 13 01:06:40 
2014(r273018)
+++ head/contrib/netbsd-tests/lib/libc/locale/t_io.cMon Oct 13 01:14:01 
2014(r273019)
@@ -56,6 +56,11 @@ ATF_TC_BODY(bad_big5_wprintf, tc)
/* XXX implementation detail knowledge (wchar_t encoding) */
wchar_t ibuf[] = { 0xcf10, 0 };
setlocale(LC_CTYPE, zh_TW.Big5);
+
+#if defined(__FreeBSD__)
+   atf_tc_expect_fail(does not fail as expected (may be implementation 
+   specific issue with the test));
+#endif
ATF_REQUIRE_ERRNO(EILSEQ, wprintf(L%ls\n, ibuf)  0);
ATF_REQUIRE(ferror(stdout));
 }
@@ -72,6 +77,11 @@ ATF_TC_BODY(bad_big5_swprintf, tc)
wchar_t ibuf[] = { 0xcf10, 0 };
wchar_t obuf[20];
setlocale(LC_CTYPE, zh_TW.Big5);
+
+#if defined(__FreeBSD__)
+   atf_tc_expect_fail(does not fail as expected (may be implementation 
+   specific issue with the test));
+#endif
ATF_REQUIRE_ERRNO(EILSEQ,
  swprintf(obuf, sizeof(obuf), L%ls\n, ibuf)  0);
 }
@@ -161,6 +171,9 @@ ATF_TC_BODY(bad_big5_getwc, tc)
 
ATF_REQUIRE(fp != NULL);
setlocale(LC_CTYPE, zh_TW.Big5);
+#if defined(__FreeBSD__)
+   atf_tc_expect_fail(does not return WEOF as expected);
+#endif
ATF_REQUIRE_EQ(getwc(fp), WEOF);
fclose(fp);
 }

Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c
==
--- head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c   Mon Oct 13 
01:06:40 2014(r273018)
+++ head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c   Mon Oct 13 
01:14:01 2014(r273019)
@@ -132,7 +132,14 @@ h_ctype2(const struct test *t, bool use_
size_t n;
 
ATF_REQUIRE_STREQ(setlocale(LC_ALL, C), C);
+#if defined(__NetBSD__)
ATF_REQUIRE(setlocale(LC_CTYPE, t-locale) != NULL);
+#else
+   if (setlocale(LC_CTYPE, t-locale) == NULL) {
+   fprintf(stderr, Locale %s not found.\n, t-locale);
+   return;
+   }
+#endif
 
(void)strvis(buf, t-data, VIS_WHITE | VIS_OCTAL);
(void)printf(Checking string: \%s\\n, buf);
@@ -238,6 +245,9 @@ ATF_TC_BODY(mbrtowc_internal, tc)
 {
struct test *t;
 
+#if defined(__FreeBSD__)
+   atf_tc_expect_fail(ja_* locale fails);
+#endif
for (t = tests[0]; t-data != NULL; ++t)
h_ctype2(t, false);
 }

Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c
==
--- head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c  Mon Oct 13 
01:06:40 2014(r273018)
+++ head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c  Mon Oct 13 
01:14:01 2014(r273019)
@@ -150,7 +150,14 @@ ATF_TC_BODY(mbstowcs_basic, tc)
int i;
 
ATF_REQUIRE_STREQ(setlocale(LC_ALL, C), C);
+#if defined(__NetBSD__)
ATF_REQUIRE(setlocale(LC_CTYPE, t-locale) != NULL);
+#else
+   if (setlocale(LC_CTYPE, t-locale) == NULL) {
+   fprintf(stderr, Locale %s not found.\n, t-locale);
+   continue;
+   }
+#endif
 
(void)strvis(visbuf, t-data, VIS_WHITE | VIS_OCTAL);
(void)printf(Checking string: \%s\\n, visbuf);

Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c
==
--- 

svn commit: r273020 - head/contrib/netbsd-tests/lib/libc/string

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Mon Oct 13 02:23:24 2014
New Revision: 273020
URL: https://svnweb.freebsd.org/changeset/base/273020

Log:
  memmem with NUL length needle (aka small) strings on FreeBSD/OSX returns
  NULL instead of the haystack value (aka big)
  
  Submitted by: pho
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/string/t_memmem.c

Modified: head/contrib/netbsd-tests/lib/libc/string/t_memmem.c
==
--- head/contrib/netbsd-tests/lib/libc/string/t_memmem.cMon Oct 13 
01:14:01 2014(r273019)
+++ head/contrib/netbsd-tests/lib/libc/string/t_memmem.cMon Oct 13 
02:23:24 2014(r273020)
@@ -75,8 +75,13 @@ ATF_TC_HEAD(memmem_basic, tc)
 ATF_TC_BODY(memmem_basic, tc)
 {
 
+#if defined(__darwin__) || defined(__FreeBSD__)
+   expect(memmem(b2, lb2, p0, lp0) == NULL);
+   expect(memmem(b0, lb0, p0, lp0) == NULL);
+#else
expect(memmem(b2, lb2, p0, lp0) == b2);
expect(memmem(b0, lb0, p0, lp0) == b0);
+#endif
expect(memmem(b0, lb0, p1, lp1) == NULL);
expect(memmem(b1, lb1, p1, lp1) == NULL);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273021 - head/contrib/netbsd-tests/lib/libc/string

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Mon Oct 13 02:27:59 2014
New Revision: 273021
URL: https://svnweb.freebsd.org/changeset/base/273021

Log:
  Use 1 as a random seed, as recommended in srandom(3). Adjust the random values
  accordingly
  
  Submitted by: pho
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c

Modified: head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c
==
--- head/contrib/netbsd-tests/lib/libc/string/t_memcpy.cMon Oct 13 
02:23:24 2014(r273020)
+++ head/contrib/netbsd-tests/lib/libc/string/t_memcpy.cMon Oct 13 
02:27:59 2014(r273021)
@@ -51,7 +51,11 @@ unsigned char *start[BLOCKTYPES] = {
 };
 
 char result[100];
+#if defined(__NetBSD__)
 const char goodResult[] = 7b405d24bc03195474c70ddae9e1f8fb;
+#else
+const char goodResult[] = 217b4fbe456916bf62a2f85df752e4ab;
+#endif
 
 static void
 runTest(unsigned char *b1, unsigned char *b2)
@@ -89,7 +93,15 @@ ATF_TC_BODY(memcpy_basic, tc)
start[2] = auto1;
start[3] = auto2;
 
+#if defined(__NetBSD__)
srandom(0L);
+#else
+   /*
+* random() shall produce by default a sequence of numbers that can be
+* duplicated by calling srandom() with 1 as the seed.
+*/
+   srandom(1);
+#endif
MD5Init(mc);
for (i = 0; i  BLOCKTYPES; ++i)
for (j = 0; j  BLOCKTYPES; ++j)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273023 - head/contrib/netbsd-tests/lib/libc/stdlib

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Mon Oct 13 02:32:37 2014
New Revision: 273023
URL: https://svnweb.freebsd.org/changeset/base/273023

Log:
  __isnanl is automatically picked according to data type in math.h. There
  isn't a need for the explicit __isnanl test
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c

Modified: head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
==
--- head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.cMon Oct 13 
02:29:58 2014(r273022)
+++ head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.cMon Oct 13 
02:32:37 2014(r273023)
@@ -221,7 +221,9 @@ ATF_TC_BODY(strtold_nan, tc)
 
volatile long double ld = strtold(nan_string, end);
ATF_REQUIRE(isnan(ld) != 0);
+#if !defined(__FreeBSD__)
ATF_REQUIRE(__isnanl(ld) != 0);
+#endif
ATF_REQUIRE(strcmp(end, y) == 0);
 #   else
atf_tc_skip(Requires long double support);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273024 - head/contrib/netbsd-tests/lib/libc/time

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Mon Oct 13 02:44:35 2014
New Revision: 273024
URL: https://svnweb.freebsd.org/changeset/base/273024

Log:
  Only test the return value in mktime_negyear
  
  Testing for the errno is an optional requirement according to POSIX, and
  FreeBSD doesn't document that errno would be set on failure with mktime
  
  Submitted by: pho
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/time/t_mktime.c

Modified: head/contrib/netbsd-tests/lib/libc/time/t_mktime.c
==
--- head/contrib/netbsd-tests/lib/libc/time/t_mktime.c  Mon Oct 13 02:32:37 
2014(r273023)
+++ head/contrib/netbsd-tests/lib/libc/time/t_mktime.c  Mon Oct 13 02:44:35 
2014(r273024)
@@ -72,7 +72,12 @@ ATF_TC_BODY(mktime_negyear, tc)
 
errno = 0;
t = mktime(tms);
+#if defined(__FreeBSD__)
+   /* Open Group says and may set errno to indicate the error */
+   ATF_REQUIRE(t == (time_t)-1);
+#else
ATF_REQUIRE_ERRNO(0, t != (time_t)-1);
+#endif
 }
 
 ATF_TC(timegm_epoch);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273025 - head/contrib/netbsd-tests/lib/libc/time

2014-10-12 Thread Garrett Cooper
Author: ngie
Date: Mon Oct 13 03:55:47 2014
New Revision: 273025
URL: https://svnweb.freebsd.org/changeset/base/273025

Log:
  Change ATF_REQUIRE_MSG calls to ATF_CHECK_MSG to get as many errors as 
possible
  
  t_strptime:common..
  - Expect the testcase body as a whole to fail. Multiple PRs will be filed to
  track the issues (there are 18 check failures)
  
  t_strptime:day..
  - %EA and %OA seem to be case insensitive on FreeBSD

Modified:
  head/contrib/netbsd-tests/lib/libc/time/t_strptime.c

Modified: head/contrib/netbsd-tests/lib/libc/time/t_strptime.c
==
--- head/contrib/netbsd-tests/lib/libc/time/t_strptime.cMon Oct 13 
02:44:35 2014(r273024)
+++ head/contrib/netbsd-tests/lib/libc/time/t_strptime.cMon Oct 13 
03:55:47 2014(r273025)
@@ -49,6 +49,17 @@ h_pass(const char *buf, const char *fmt,
exp = buf + len;
ret = strptime(buf, fmt, tm);
 
+#if defined(__FreeBSD__)
+   ATF_CHECK_MSG(ret == exp,
+   strptime(\%s\, \%s\, tm): incorrect return code: 
+   expected: %p, got: %p, buf, fmt, exp, ret);
+
+#define H_REQUIRE_FIELD(field) \
+   ATF_CHECK_MSG(tm.field == field,\
+   strptime(\%s\, \%s\, tm): incorrect %s:   \
+   expected: %d, but got: %d, buf, fmt,  \
+   ___STRING(field), field, tm.field)
+#else
ATF_REQUIRE_MSG(ret == exp,
strptime(\%s\, \%s\, tm): incorrect return code: 
expected: %p, got: %p, buf, fmt, exp, ret);
@@ -58,6 +69,7 @@ h_pass(const char *buf, const char *fmt,
strptime(\%s\, \%s\, tm): incorrect %s:   \
expected: %d, but got: %d, buf, fmt,  \
___STRING(field), field, tm.field)
+#endif
 
H_REQUIRE_FIELD(tm_sec);
H_REQUIRE_FIELD(tm_min);
@@ -76,8 +88,13 @@ h_fail(const char *buf, const char *fmt)
 {
struct tm tm = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, NULL };
 
+#if defined(__FreeBSD__)
+   ATF_CHECK_MSG(strptime(buf, fmt, tm) == NULL, strptime(\%s\, 
+   \%s\, tm) should fail, but it didn't, buf, fmt);
+#else
ATF_REQUIRE_MSG(strptime(buf, fmt, tm) == NULL, strptime(\%s\, 
\%s\, tm) should fail, but it didn't, buf, fmt);
+#endif
 }
 
 ATF_TC(common);
@@ -91,6 +108,10 @@ ATF_TC_HEAD(common, tc)
 ATF_TC_BODY(common, tc)
 {
 
+#if defined(__FreeBSD__)
+   atf_tc_expect_fail(There are various issues with strptime on FreeBSD);
+#endif
+
h_pass(Tue Jan 20 23:27:46 1998, %a %b %d %T %Y,
24, 46, 27, 23, 20, 0, 98, 2, -1);
h_pass(Tue Jan 20 23:27:46 1998, %a %b %d %H:%M:%S %Y,
@@ -168,9 +189,17 @@ ATF_TC_BODY(day, tc)
h_pass(mon, %a, 3, -1, -1, -1, -1, -1, -1, 1, -1);
h_pass(tueSDay, %A, 7, -1, -1, -1, -1, -1, -1, 2, -1);
h_pass(sunday, %A, 6, -1, -1, -1, -1, -1, -1, 0, -1);
+#if defined(__NetBSD__)
h_fail(sunday, %EA);
+#else
+   h_pass(Sunday, %EA, 6, -1, -1, -1, -1, -1, -1, 0, -1);
+#endif
h_pass(SaturDay, %A, 8, -1, -1, -1, -1, -1, -1, 6, -1);
+#if defined(__NetBSD__)
h_fail(SaturDay, %OA);
+#else
+   h_pass(SaturDay, %OA, 8, -1, -1, -1, -1, -1, -1, 6, -1);
+#endif
 }
 
 ATF_TC(month);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r273026 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-10-12 Thread Xin LI
Author: delphij
Date: Mon Oct 13 05:34:10 2014
New Revision: 273026
URL: https://svnweb.freebsd.org/changeset/base/273026

Log:
  Add a tunable for arc_shrink_shift (vfs.zfs.arc_shrink_shift) that
  controls how much fraction, 1/2^arc_shrink_shift, should be reclaimed
  when there is memory pressure.
  
  Submitted by: Richard Kojedzinszky krichy at tvnetwork.hu
  MFC after:2 weeks

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Mon Oct 13 
03:55:47 2014(r273025)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Mon Oct 13 
05:34:10 2014(r273026)
@@ -217,6 +217,7 @@ SYSINIT(arc_free_target_init, SI_SUB_KTH
 arc_free_target_init, NULL);
 
 TUNABLE_QUAD(vfs.zfs.arc_meta_limit, zfs_arc_meta_limit);
+TUNABLE_INT(vfs.zfs.arc_shrink_shift, zfs_arc_shrink_shift);
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, zfs_arc_max, 0,
 Maximum ARC size);
@@ -225,6 +226,10 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_min
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_average_blocksize, CTLFLAG_RDTUN,
 zfs_arc_average_blocksize, 0,
 ARC average blocksize);
+SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_shrink_shift, CTLFLAG_RW,
+arc_shrink_shift, 0,
+log2(fraction of arc to reclaim));
+
 /*
  * We don't have a tunable for arc_free_target due to the dependency on
  * pagedaemon initialisation.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org