Re: svn commit: r267812 - head/etc

2014-06-24 Thread John Hay
Hi Hiroki,

Thanks for committing it. Will you also be merging it to 10? That is where
I picked up the problem first.

I see there was a bug filed over the weekend that looks like it might be
the same problem:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191252

Regards

John
--
John Hay -- j...@meraka.csir.co.za / j...@meraka.org.za / j...@freebsd.org

On Tue, Jun 24, 2014 at 04:37:36AM +, Hiroki Sato wrote:
> Author: hrs
> Date: Tue Jun 24 04:37:36 2014
> New Revision: 267812
> URL: http://svnweb.freebsd.org/changeset/base/267812
> 
> Log:
>   Fix ifname normalization.  ifconfig_IF_alias{es,N} did not work if ifname 
> has
>   any of [.-/+].
>   
>   Spotted by: jhay
> 
> Modified:
>   head/etc/network.subr
> 
> Modified: head/etc/network.subr
> ==
> --- head/etc/network.subr Tue Jun 24 02:02:51 2014(r267811)
> +++ head/etc/network.subr Tue Jun 24 04:37:36 2014(r267812)
> @@ -1077,7 +1077,7 @@ ifalias_af_common_handler()
>  ifalias_af_common()
>  {
>   local _ret _if _af _action alias ifconfig_args _aliasn _c _tmpargs _iaf
> - local _punct=".-/+"
> + local _vif _punct=".-/+"
>  
>   _ret=1
>   _aliasn=
> @@ -1086,11 +1086,11 @@ ifalias_af_common()
>   _action=$3
>  
>   # Normalize $_if before using it in a pattern to list_vars()
> - ltr "$_if" "$_punct" "_" _if
> + ltr "$_if" "$_punct" "_" _vif
>  
>   # ifconfig_IF_aliasN which starts with $_af
> - for alias in `list_vars ifconfig_${_if}_alias[0-9]\* |
> - sort_lite -nk1.$((9+${#_if}+7))`
> + for alias in `list_vars ifconfig_${_vif}_alias[0-9]\* |
> + sort_lite -nk1.$((9+${#_vif}+7))`
>   do
>   eval ifconfig_args=\"\$$alias\"
>   _iaf=
> @@ -1118,8 +1118,8 @@ ifalias_af_common()
>   # backward compatibility: ipv6_ifconfig_IF_aliasN.
>   case $_af in
>   inet6)
> - for alias in `list_vars ipv6_ifconfig_${_if}_alias[0-9]\* |
> - sort_lite -nk1.$((14+${#_if}+7))`
> + for alias in `list_vars ipv6_ifconfig_${_vif}_alias[0-9]\* |
> + sort_lite -nk1.$((14+${#_vif}+7))`
>   do
>   eval ifconfig_args=\"\$$alias\"
>   case ${_action}:"${ifconfig_args}" in
> @@ -1129,7 +1129,7 @@ ifalias_af_common()
>   alias:*)
>   _aliasn="${_aliasn} inet6 ${ifconfig_args}"
>   warn "\$${alias} is obsolete. " \
> - "Use ifconfig_$1_aliasN instead."
> + "Use ifconfig_${_vif}_aliasN instead."
>   ;;
>   esac
>   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"


Re: svn commit: r267812 - head/etc

2014-06-24 Thread Hiroki Sato
John Hay  wrote
  in <20140624075045.ga53...@zibbi.meraka.csir.co.za>:

jh> Hi Hiroki,
jh>
jh> Thanks for committing it. Will you also be merging it to 10? That is where
jh> I picked up the problem first.
jh>
jh> I see there was a bug filed over the weekend that looks like it might be
jh> the same problem:
jh>
jh> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191252

 Thank you for the reminder.  Yes, I will merge the change into 10,
 too.

-- Hiroki


pgpPp8rLzr6Rc.pgp
Description: PGP signature


svn commit: r267818 - head/share/misc

2014-06-24 Thread Gavin Atkinson
Author: gavin
Date: Tue Jun 24 12:57:48 2014
New Revision: 267818
URL: http://svnweb.freebsd.org/changeset/base/267818

Log:
  Add missing linefeed.

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotTue Jun 24 12:45:06 2014
(r267817)
+++ head/share/misc/committers-ports.dotTue Jun 24 12:57:48 2014
(r267818)
@@ -183,7 +183,7 @@ rene [label="Rene Ladan\nr...@freebsd.or
 riggs [label="Thomas Zander\nri...@freebsd.org\n2014/01/09"]
 rm [label="Ruslan Makhmatkhanov\n...@freebsd.org\n2011/11/06"]
 rnoland [label="Robert Noland\nrnol...@freebsd.org\n2008/07/21"]
-robak [label="Bartek Rutkowski\ro...@freebsd.org\n2014/06/10"]
+robak [label="Bartek Rutkowski\nro...@freebsd.org\n2014/06/10"]
 rodrigo [label="Rodrigo Osorio\nrodr...@freebsd.org\n2014/01/15"]
 romain [label="Romain Tartiere\nrom...@freebsd.org\n2010/01/24"]
 sahil [label="Sahil Tandon\nsa...@freebsd.org\n2010/04/11"]
___
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: r267820 - head/sys/kern

2014-06-24 Thread Attilio Rao
Author: attilio
Date: Tue Jun 24 15:16:55 2014
New Revision: 267820
URL: http://svnweb.freebsd.org/changeset/base/267820

Log:
  sysctl subsystem uses sxlocks so avoid to setup dynamic sysctl nodes
  before sleepinit() has been fully executed in the SLEEPQUEUE_PROFILING
  case.
  
  Sponsored by: EMC / Isilon storage division

Modified:
  head/sys/kern/subr_sleepqueue.c

Modified: head/sys/kern/subr_sleepqueue.c
==
--- head/sys/kern/subr_sleepqueue.c Tue Jun 24 15:03:00 2014
(r267819)
+++ head/sys/kern/subr_sleepqueue.c Tue Jun 24 15:16:55 2014
(r267820)
@@ -166,24 +166,20 @@ SDT_PROBE_DECLARE(sched, , , sleep);
 SDT_PROBE_DECLARE(sched, , , wakeup);
 
 /*
- * Early initialization of sleep queues that is called from the sleepinit()
- * SYSINIT.
+ * Initialize SLEEPQUEUE_PROFILING specific sysctl nodes.
+ * Note that it must happen after sleepinit() has been fully executed, so
+ * it must happen after SI_SUB_KMEM SYSINIT() subsystem setup.
  */
-void
-init_sleepqueues(void)
-{
 #ifdef SLEEPQUEUE_PROFILING
-   struct sysctl_oid *chain_oid;
+static void
+init_sleepqueue_profiling(void)
+{
char chain_name[10];
-#endif
-   int i;
+   struct sysctl_oid *chain_oid;
+   u_int i;
 
for (i = 0; i < SC_TABLESIZE; i++) {
-   LIST_INIT(&sleepq_chains[i].sc_queues);
-   mtx_init(&sleepq_chains[i].sc_lock, "sleepq chain", NULL,
-   MTX_SPIN | MTX_RECURSE);
-#ifdef SLEEPQUEUE_PROFILING
-   snprintf(chain_name, sizeof(chain_name), "%d", i);
+   snprintf(chain_name, sizeof(chain_name), "%u", i);
chain_oid = SYSCTL_ADD_NODE(NULL, 
SYSCTL_STATIC_CHILDREN(_debug_sleepq_chains), OID_AUTO,
chain_name, CTLFLAG_RD, NULL, "sleepq chain stats");
@@ -192,7 +188,26 @@ init_sleepqueues(void)
SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(chain_oid), OID_AUTO,
"max_depth", CTLFLAG_RD, &sleepq_chains[i].sc_max_depth, 0,
NULL);
+   }
+}
+
+SYSINIT(sleepqueue_profiling, SI_SUB_LOCK, SI_ORDER_ANY,
+init_sleepqueue_profiling, NULL);
 #endif
+
+/*
+ * Early initialization of sleep queues that is called from the sleepinit()
+ * SYSINIT.
+ */
+void
+init_sleepqueues(void)
+{
+   int i;
+
+   for (i = 0; i < SC_TABLESIZE; i++) {
+   LIST_INIT(&sleepq_chains[i].sc_queues);
+   mtx_init(&sleepq_chains[i].sc_lock, "sleepq chain", NULL,
+   MTX_SPIN | MTX_RECURSE);
}
sleepq_zone = uma_zcreate("SLEEPQUEUE", sizeof(struct sleepqueue),
 #ifdef INVARIANTS
___
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: r267758 - head

2014-06-24 Thread Warner Losh

On Jun 22, 2014, at 6:54 PM, Andrey A. Chernov  wrote:

> Author: ache
> Date: Mon Jun 23 00:54:56 2014
> New Revision: 267758
> URL: http://svnweb.freebsd.org/changeset/base/267758
> 
> Log:
>  Change suggestion how to set MAKESYSPATH as broken incremental build
>  workaround. Magic ".../share/mk" (search directories up to /)
>  does not work for f.e. /usr/src/gnu/lib/libgcc because the path
>  inside is starting from /usr/obj hierarchy and ends up in
>  /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
>  IMHO proper fixing of incremental build is needed urgently.

I don’t understand how this is even possible. This change is wrong because it 
has a bogus path the doesn’t exist on all systems. I’m going to fix that.

Agreed on incremental builds, but that is turning out to be harder than 
expected. It is broken, but adding broken advise is even worse.

Warner


> Modified:
>  head/UPDATING
> 
> Modified: head/UPDATING
> ==
> --- head/UPDATING Sun Jun 22 23:40:20 2014(r267757)
> +++ head/UPDATING Mon Jun 23 00:54:56 2014(r267758)
> @@ -67,7 +67,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
>   behavior back, you can .include /etc/src.conf from /etc/make.conf
>   (which is still global and isn't changed). This also changes the
>   behavior of incremental builds inside the tree of individual
> - directories. Set MAKESYSPATH to ".../share/mk" to do that.
> + directories. Set MAKESYSPATH to "/usr/src/share/mk" to do that.
>   Although this has survived make universe and some upgrade scenarios,
>   other upgrade scenarios may have broken. At least one form of
>   temporary breakage was fixed with MAKESYSPATH settings for buildworld
> 

___
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: r267824 - head

2014-06-24 Thread Warner Losh
Author: imp
Date: Tue Jun 24 16:10:48 2014
New Revision: 267824
URL: http://svnweb.freebsd.org/changeset/base/267824

Log:
  Remove fixed path as part of suggestion. Three dots are fine for most
  uses. Add a note about a correct workaround.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Jun 24 15:57:48 2014(r267823)
+++ head/UPDATING   Tue Jun 24 16:10:48 2014(r267824)
@@ -67,11 +67,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
behavior back, you can .include /etc/src.conf from /etc/make.conf
(which is still global and isn't changed). This also changes the
behavior of incremental builds inside the tree of individual
-   directories. Set MAKESYSPATH to "/usr/src/share/mk" to do that.
+   directories. Set MAKESYSPATH to ".../share/mk" to do that.
Although this has survived make universe and some upgrade scenarios,
other upgrade scenarios may have broken. At least one form of
temporary breakage was fixed with MAKESYSPATH settings for buildworld
-   as well...
+   as well... In cases where MAKESYSPATH isn't working with this
+   setting, you'll need to set it to the full path to your tree.
 
One side effect of all this cleaning up is that bsd.compiler.mk
is no longer implicitly included by bsd.own.mk. If you wish to
___
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: r267758 - head

2014-06-24 Thread Andrey Chernov
On 24.06.2014 20:07, Warner Losh wrote:
>> Log:
>>  Change suggestion how to set MAKESYSPATH as broken incremental build
>>  workaround. Magic ".../share/mk" (search directories up to /)
>>  does not work for f.e. /usr/src/gnu/lib/libgcc because the path
>>  inside is starting from /usr/obj hierarchy and ends up in
>>  /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
>>  IMHO proper fixing of incremental build is needed urgently.
> 
> I don’t understand how this is even possible. This change is wrong because it 
> has a bogus path the doesn’t exist on all systems. I’m going to fix that.

How it is possible:
cd /usr/src/gnu/lib/libgcc
make

-- 
http://ache.vniz.net/
___
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: r267758 - head

2014-06-24 Thread Andrey Chernov
On 24.06.2014 21:25, Andrey Chernov wrote:
> On 24.06.2014 20:07, Warner Losh wrote:
>>> Log:
>>>  Change suggestion how to set MAKESYSPATH as broken incremental build
>>>  workaround. Magic ".../share/mk" (search directories up to /)
>>>  does not work for f.e. /usr/src/gnu/lib/libgcc because the path
>>>  inside is starting from /usr/obj hierarchy and ends up in
>>>  /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
>>>  IMHO proper fixing of incremental build is needed urgently.
>>
>> I don’t understand how this is even possible. This change is wrong because 
>> it has a bogus path the doesn’t exist on all systems. I’m going to fix that.
> 
> How it is possible:
> cd /usr/src/gnu/lib/libgcc
> make
> 

P.S. I have to insert debugging printfs into bmake .../ traverse code to
discover that hierarchy down here starts with /usr/obj

-- 
http://ache.vniz.net/
___
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: r267825 - head/sys/fs/cuse

2014-06-24 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Jun 24 18:25:43 2014
New Revision: 267825
URL: http://svnweb.freebsd.org/changeset/base/267825

Log:
  Use existing PHOLD() and PRELE() macros.
  
  Submitted by: kib @

Modified:
  head/sys/fs/cuse/cuse.c

Modified: head/sys/fs/cuse/cuse.c
==
--- head/sys/fs/cuse/cuse.c Tue Jun 24 16:10:48 2014(r267824)
+++ head/sys/fs/cuse/cuse.c Tue Jun 24 18:25:43 2014(r267825)
@@ -813,15 +813,9 @@ cuse_proc2proc_copy(struct proc *proc_s,
.uio_td = td,
};
 
-   PROC_LOCK(proc_s);
-   _PHOLD(proc_s);
-   PROC_UNLOCK(proc_s);
-
+   PHOLD(proc_s);
error = proc_rwmem(proc_s, &uio);
-
-   PROC_LOCK(proc_s);
-   _PRELE(proc_s);
-   PROC_UNLOCK(proc_s);
+   PRELE(proc_s);
 
} else if (proc_cur == proc_s) {
struct iovec iov = {
@@ -838,15 +832,9 @@ cuse_proc2proc_copy(struct proc *proc_s,
.uio_td = td,
};
 
-   PROC_LOCK(proc_d);
-   _PHOLD(proc_d);
-   PROC_UNLOCK(proc_d);
-
+   PHOLD(proc_d);
error = proc_rwmem(proc_d, &uio);
-
-   PROC_LOCK(proc_d);
-   _PRELE(proc_d);
-   PROC_UNLOCK(proc_d);
+   PRELE(proc_d);
} else {
error = EINVAL;
}
___
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: r267826 - head

2014-06-24 Thread Alexander Motin
Author: mav
Date: Tue Jun 24 18:56:45 2014
New Revision: 267826
URL: http://svnweb.freebsd.org/changeset/base/267826

Log:
  Document r267639 CTL ABI breakage.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Jun 24 18:25:43 2014(r267825)
+++ head/UPDATING   Tue Jun 24 18:56:45 2014(r267826)
@@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20140619:
+   Maximal length of the serial number in CTL was increased from 16 to
+   64 chars, that breaks ABI.  All CTL-related tools, such as ctladm
+   and ctld, need to be rebuilt to work with a new kernel.
+
 20140606:
The libatf-c and libatf-c++ major versions were downgraded to 0 and
1 respectively to match the upstream numbers.  They were out of
___
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: r267827 - in head/contrib/file: . Magdir

2014-06-24 Thread Xin LI
Author: delphij
Date: Tue Jun 24 19:04:32 2014
New Revision: 267827
URL: http://svnweb.freebsd.org/changeset/base/267827

Log:
  Fix multiple vulnerabilities in file(1) and libmagic(3).
  
  Security: FreeBSD-SA-14:16.file
  Approved by:  so

Modified:
  head/contrib/file/Magdir/commands
  head/contrib/file/ascmagic.c
  head/contrib/file/file.h
  head/contrib/file/funcs.c
  head/contrib/file/softmagic.c

Modified: head/contrib/file/Magdir/commands
==
--- head/contrib/file/Magdir/commands   Tue Jun 24 18:56:45 2014
(r267826)
+++ head/contrib/file/Magdir/commands   Tue Jun 24 19:04:32 2014
(r267827)
@@ -49,7 +49,8 @@
 !:mime text/x-awk
 0  string/wt   #!\ /usr/bin/awkawk script text executable
 !:mime text/x-awk
-0  regex   =^\\s*BEGIN\\s*[{]  awk script text
+0  regex   =^\\s{0,100}BEGIN\\s{0,100}[{]  awk script text
+!:strength - 12
 
 # AT&T Bell Labs' Plan 9 shell
 0  string/wt   #!\ /bin/rc Plan 9 rc shell script text executable

Modified: head/contrib/file/ascmagic.c
==
--- head/contrib/file/ascmagic.cTue Jun 24 18:56:45 2014
(r267826)
+++ head/contrib/file/ascmagic.cTue Jun 24 19:04:32 2014
(r267827)
@@ -147,7 +147,7 @@ file_ascmagic_with_encoding(struct magic
== NULL)
goto done;
if ((rv = file_softmagic(ms, utf8_buf,
-   (size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0)
+   (size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0)
rv = -1;
}
 

Modified: head/contrib/file/file.h
==
--- head/contrib/file/file.hTue Jun 24 18:56:45 2014(r267826)
+++ head/contrib/file/file.hTue Jun 24 19:04:32 2014(r267827)
@@ -414,7 +414,7 @@ protected int file_encoding(struct magic
 unichar **, size_t *, const char **, const char **, const char **);
 protected int file_is_tar(struct magic_set *, const unsigned char *, size_t);
 protected int file_softmagic(struct magic_set *, const unsigned char *, size_t,
-int, int);
+size_t, int, int);
 protected struct mlist *file_apprentice(struct magic_set *, const char *, int);
 protected uint64_t file_signextend(struct magic_set *, struct magic *,
 uint64_t);

Modified: head/contrib/file/funcs.c
==
--- head/contrib/file/funcs.c   Tue Jun 24 18:56:45 2014(r267826)
+++ head/contrib/file/funcs.c   Tue Jun 24 19:04:32 2014(r267827)
@@ -228,7 +228,7 @@ file_buffer(struct magic_set *ms, int fd
 
/* try soft magic tests */
if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0)
-   if ((m = file_softmagic(ms, ubuf, nb, BINTEST,
+   if ((m = file_softmagic(ms, ubuf, nb, 0, BINTEST,
looks_text)) != 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "softmagic %d\n", m);

Modified: head/contrib/file/softmagic.c
==
--- head/contrib/file/softmagic.c   Tue Jun 24 18:56:45 2014
(r267826)
+++ head/contrib/file/softmagic.c   Tue Jun 24 19:04:32 2014
(r267827)
@@ -43,9 +43,9 @@ FILE_RCSID("@(#)$File: softmagic.c,v 1.1
 
 
 private int match(struct magic_set *, struct magic *, uint32_t,
-const unsigned char *, size_t, int, int);
+const unsigned char *, size_t, int, int, int);
 private int mget(struct magic_set *, const unsigned char *,
-struct magic *, size_t, unsigned int, int);
+struct magic *, size_t, unsigned int, int, int);
 private int magiccheck(struct magic_set *, struct magic *);
 private int32_t mprint(struct magic_set *, struct magic *);
 private int32_t moffset(struct magic_set *, struct magic *);
@@ -60,6 +60,7 @@ private void cvt_16(union VALUETYPE *, c
 private void cvt_32(union VALUETYPE *, const struct magic *);
 private void cvt_64(union VALUETYPE *, const struct magic *);
 
+#define OFFSET_OOB(n, o, i)((n) < (o) || (i) > ((n) - (o)))
 /*
  * softmagic - lookup one file in parsed, in-memory copy of database
  * Passed the name and FILE * of one file to be typed.
@@ -67,13 +68,13 @@ private void cvt_64(union VALUETYPE *, c
 /*ARGSUSED1*/  /* nbytes passed for regularity, maybe need later */
 protected int
 file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
-int mode, int text)
+size_t level, int mode, int text)
 {
struct mlist *ml;
int rv;
for (ml = ms->mlist->next; ml != ms->mlist; ml = ml->next)
if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, mode,
-   text)

svn commit: r267833 - head/usr.sbin/ctld

2014-06-24 Thread Josh Paetzel
Author: jpaetzel
Date: Tue Jun 24 19:12:55 2014
New Revision: 267833
URL: http://svnweb.freebsd.org/changeset/base/267833

Log:
  Fix issues in config parser relating to lun serial numbers.
  
  Without this fix some serial numbers needed to be quoted
  to avoid the config parser bailing out.
  
  Submitted by: delphij
  Sponsored by: iXsystems

Modified:
  head/usr.sbin/ctld/parse.y
  head/usr.sbin/ctld/token.l

Modified: head/usr.sbin/ctld/parse.y
==
--- head/usr.sbin/ctld/parse.y  Tue Jun 24 19:05:47 2014(r267832)
+++ head/usr.sbin/ctld/parse.y  Tue Jun 24 19:12:55 2014(r267833)
@@ -659,6 +659,19 @@ lun_serial:SERIAL STR
}
lun_set_serial(lun, $2);
free($2);
+   } | SERIAL NUM
+   {
+   char *str = NULL;
+
+   if (lun->l_serial != NULL) {
+   log_warnx("serial for lun %d, target \"%s\" "
+   "specified more than once",
+   lun->l_lun, target->t_name);
+   return (1);
+   }
+   asprintf(&str, "%ju", $2);
+   lun_set_serial(lun, str);
+   free(str);
}
;
 

Modified: head/usr.sbin/ctld/token.l
==
--- head/usr.sbin/ctld/token.l  Tue Jun 24 19:05:47 2014(r267832)
+++ head/usr.sbin/ctld/token.l  Tue Jun 24 19:12:55 2014(r267833)
@@ -74,8 +74,9 @@ target{ return TARGET; }
 timeout{ return TIMEOUT; }
 [0-9]+[kKmMgGtTpPeE]?  { if (expand_number(yytext, &yylval.num) == 0)
return NUM;
- else
-   return STR;
+ else {
+   yylval.str = strdup(yytext); return STR;
+ }
}
 \"[^"]+\"  { yylval.str = strndup(yytext + 1,
strlen(yytext) - 2); return STR; }
___
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: r267834 - head/share/man/man4

2014-06-24 Thread Luiz Otavio O Souza
Author: loos
Date: Tue Jun 24 19:42:37 2014
New Revision: 267834
URL: http://svnweb.freebsd.org/changeset/base/267834

Log:
  Clarify the expected usage of I2C 7-bit slave addresses on ioctl(2)
  interface.
  
  While here add the cross reference to iic(4) on iicbus(4).
  
  CR:   D210
  Suggested by: jmg
  MFC after:1 week

Modified:
  head/share/man/man4/iic.4
  head/share/man/man4/iicbus.4

Modified: head/share/man/man4/iic.4
==
--- head/share/man/man4/iic.4   Tue Jun 24 19:12:55 2014(r267833)
+++ head/share/man/man4/iic.4   Tue Jun 24 19:42:37 2014(r267834)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 6, 2006
+.Dd June 24, 2014
 .Dt IIC 4
 .Os
 .Sh NAME
@@ -51,12 +51,20 @@ following ioctls:
 Sends the start condition to the slave specified by the
 .Va slave
 element to the bus.
+The
+.Va slave
+element consists of a 7-bit address and a read/write bit
+(i.e., 7-bit address << 1 | r/w).
+If the read/write bit is set a read operation is initiated, if the read/write
+bit is cleared a write operation is initiated.
 All other elements are ignored.
 .It Dv I2CRPTSTART
 .Pq Vt "struct iiccmd"
 Sends the repeated start condition to the slave specified by the
 .Va slave
 element to the bus.
+The slave address should be specified as in
+.Dv I2CSTART .
 All other elements are ignored.
 .It Dv I2CSTOP
 No argument is passed.
@@ -115,10 +123,15 @@ is set in
 Otherwise the transfer is a write transfer.
 The
 .Va slave
-element specifies the 7-bit address for the transfer.
+element specifies the 7-bit address with the read/write bit for the transfer.
+The read/write bit will be handled by the iicbus stack based on the specified
+transfer operation.
 The
 .Va len
-element is the length of the data.
+element is the number of
+.Pq Vt "struct iic_msg"
+messages encoded on
+.Pq Vt "struct iic_rdwr_data" .
 The
 .Va buf
 element is a buffer for that data.

Modified: head/share/man/man4/iicbus.4
==
--- head/share/man/man4/iicbus.4Tue Jun 24 19:12:55 2014
(r267833)
+++ head/share/man/man4/iicbus.4Tue Jun 24 19:42:37 2014
(r267834)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 6, 1998
+.Dd June 24, 2014
 .Dt IICBUS 4
 .Os
 .Sh NAME
@@ -105,6 +105,7 @@ Some I2C interfaces are available:
 .El
 .Sh SEE ALSO
 .Xr bktr 4 ,
+.Xr iic 4 ,
 .Xr iicbb 4 ,
 .Xr lpbb 4 ,
 .Xr pcf 4
___
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: r267838 - head/sys/dev/mrsas

2014-06-24 Thread Xin LI
Author: delphij
Date: Tue Jun 24 20:09:02 2014
New Revision: 267838
URL: http://svnweb.freebsd.org/changeset/base/267838

Log:
  Correct memset size.
  
  Submitted by: Sascha Wildner (swildner at dragonflybsd dot org)
  Reviewed by:  Kashyap Desai 
  MFC after:2 weeks

Modified:
  head/sys/dev/mrsas/mrsas_fp.c

Modified: head/sys/dev/mrsas/mrsas_fp.c
==
--- head/sys/dev/mrsas/mrsas_fp.c   Tue Jun 24 19:59:13 2014
(r267837)
+++ head/sys/dev/mrsas/mrsas_fp.c   Tue Jun 24 20:09:02 2014
(r267838)
@@ -1219,7 +1219,7 @@ void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO
opcode = cdb[0] == READ_6 ? READ_10 : WRITE_10;
control = cdb[5];

-   memset(cdb, 0, sizeof(cdb));
+   memset(cdb, 0, sizeof(io_request->CDB.CDB32));
cdb[0] = opcode;
cdb[9] = control;
 
___
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: r267839 - head/sys/dev/oce

2014-06-24 Thread Xin LI
Author: delphij
Date: Tue Jun 24 20:11:22 2014
New Revision: 267839
URL: http://svnweb.freebsd.org/changeset/base/267839

Log:
  Apply vendor fixes for big endian support and 20GBps/25GBps link speeds.
  
  Many thanks to Emulex for their continued support of FreeBSD!
  
  Submitted by: Venkata Duvvuru 
  MFC after:3 days

Modified:
  head/sys/dev/oce/oce_hw.c
  head/sys/dev/oce/oce_hw.h
  head/sys/dev/oce/oce_if.c
  head/sys/dev/oce/oce_if.h
  head/sys/dev/oce/oce_mbox.c

Modified: head/sys/dev/oce/oce_hw.c
==
--- head/sys/dev/oce/oce_hw.c   Tue Jun 24 20:09:02 2014(r267838)
+++ head/sys/dev/oce/oce_hw.c   Tue Jun 24 20:11:22 2014(r267839)
@@ -487,11 +487,7 @@ oce_hw_start(POCE_SOFTC sc)
if_link_state_change(sc->ifp, LINK_STATE_DOWN);
}
 
-   if (link.mac_speed > 0 && link.mac_speed < 5)
-   sc->link_speed = link.mac_speed;
-   else
-   sc->link_speed = 0;
-
+   sc->link_speed = link.phys_port_speed;
sc->qos_link_speed = (uint32_t )link.qos_link_speed * 10;
 
rc = oce_start_mq(sc->mq);

Modified: head/sys/dev/oce/oce_hw.h
==
--- head/sys/dev/oce/oce_hw.h   Tue Jun 24 20:09:02 2014(r267838)
+++ head/sys/dev/oce/oce_hw.h   Tue Jun 24 20:11:22 2014(r267839)
@@ -1023,7 +1023,7 @@ struct mbx_hdr {
 #defineOCE_MBX_ADDL_STATUS(_MHDR) ((_MHDR)->u0.rsp.additional_status)
 #defineOCE_MBX_STATUS(_MHDR) ((_MHDR)->u0.rsp.status)
 
-/* [05] OPCODE_COMMON_QUERY_LINK_CONFIG */
+/* [05] OPCODE_COMMON_QUERY_LINK_CONFIG_V1 */
 struct mbx_query_common_link_config {
struct mbx_hdr hdr;
union {
@@ -1032,16 +1032,37 @@ struct mbx_query_common_link_config {
} req;
 
struct {
-   /* dw 0 */
-   uint8_t physical_port;
-   uint8_t mac_duplex;
-   uint8_t mac_speed;
-   uint8_t mac_fault;
-   /* dw 1 */
-   uint8_t mgmt_mac_duplex;
-   uint8_t mgmt_mac_speed;
+   #ifdef _BIG_ENDIAN
+   uint32_t physical_port_fault:8;
+   uint32_t physical_port_speed:8;
+   uint32_t link_duplex:8;
+   uint32_t pt:2;
+   uint32_t port_number:6;
+
uint16_t qos_link_speed;
-   uint32_t logical_link_status;
+   uint16_t rsvd0;
+
+   uint32_t rsvd1:21;
+   uint32_t phys_fcv:1;
+   uint32_t phys_rxf:1;
+   uint32_t phys_txf:1;
+   uint32_t logical_link_status:8;
+   #else
+   uint32_t port_number:6;
+   uint32_t pt:2;
+   uint32_t link_duplex:8;
+   uint32_t physical_port_speed:8;
+   uint32_t physical_port_fault:8;
+
+   uint16_t rsvd0;
+   uint16_t qos_link_speed;
+
+   uint32_t logical_link_status:8;
+   uint32_t phys_txf:1;
+   uint32_t phys_rxf:1;
+   uint32_t phys_fcv:1;
+   uint32_t rsvd1:21;
+   #endif
} rsp;
} params;
 };

Modified: head/sys/dev/oce/oce_if.c
==
--- head/sys/dev/oce/oce_if.c   Tue Jun 24 20:09:02 2014(r267838)
+++ head/sys/dev/oce/oce_if.c   Tue Jun 24 20:11:22 2014(r267839)
@@ -829,10 +829,21 @@ oce_media_status(struct ifnet *ifp, stru
req->ifm_active |= IFM_10G_SR | IFM_FDX;
sc->speed = 1;
break;
+   case 5: /* 20 Gbps */
+   req->ifm_active |= IFM_10G_SR | IFM_FDX;
+   sc->speed = 2;
+   break;
+   case 6: /* 25 Gbps */
+   req->ifm_active |= IFM_10G_SR | IFM_FDX;
+   sc->speed = 25000;
+   break;
case 7: /* 40 Gbps */
req->ifm_active |= IFM_40G_SR4 | IFM_FDX;
sc->speed = 4;
break;
+   default:
+   sc->speed = 0;
+   break;
}

return;
@@ -2217,13 +2228,16 @@ setup_max_queues_want(POCE_SOFTC sc)
(sc->function_mode & FNM_UMC_MODE)||
(sc->function_mode & FNM_VNIC_MODE)   ||
(!is_rss_enabled(sc)) ||
-   (sc->flags & OCE_FLAGS_BE2)) {
+   IS_BE2(sc)) {
sc->nrqs = 1;
sc->nwqs = 1;
} else {
sc->nrqs = MIN(OCE_NCPUS, sc->nrssqs) + 1;

svn commit: r267840 - head/lib/libc/sys

2014-06-24 Thread Garrett Wollman
Author: wollman
Date: Tue Jun 24 20:23:18 2014
New Revision: 267840
URL: http://svnweb.freebsd.org/changeset/base/267840

Log:
  Catch up with many years of changes:
  
  o Document PF_LOCAL as being an alias for PF_UNIX
  o Document POSIX standardization of this interface using AF_*
constants rather than PF_* constants, and note the three particular
families which POSIX standardizes.
  o Note anticipated POSIX standardization of SOCK_CLOEXEC.
  o Delete from listing protocol families that FreeBSD doesn't support
(in some cases, like PF_PUP, has never supported).
  o Add to listing some current protocol families that have been
introduced in the last decade or so.
  o Document the correspondence of PF_* and AF_* constants.
  
  We should probably change the documentation to make the AF_* constants
  primary, but this commit does not do so.
  
  Reviewed by:  kevlo@
  MFC after:1 month

Modified:
  head/lib/libc/sys/socket.2

Modified: head/lib/libc/sys/socket.2
==
--- head/lib/libc/sys/socket.2  Tue Jun 24 20:11:22 2014(r267839)
+++ head/lib/libc/sys/socket.2  Tue Jun 24 20:23:18 2014(r267840)
@@ -57,24 +57,30 @@ These families are defined in the includ
 The currently understood formats are:
 .Pp
 .Bd -literal -offset indent -compact
-PF_LOCAL   Host-internal protocols, formerly called PF_UNIX,
-PF_UNIXHost-internal protocols, deprecated, use PF_LOCAL,
+PF_LOCAL   Host-internal protocols (alias for PF_UNIX),
+PF_UNIXHost-internal protocols,
 PF_INETInternet version 4 protocols,
-PF_PUP PUP protocols, like BSP,
-PF_APPLETALK   AppleTalk protocols,
-PF_ROUTE   Internal Routing protocol,
+PF_INET6   Internet version 6 protocols,
+PF_ROUTE   Internal routing protocol,
 PF_LINKLink layer interface,
-PF_IPX Novell Internet Packet eXchange protocol,
-PF_RTIPHelp Identify RTIP packets,
-PF_PIP Help Identify PIP packets,
-PF_ISDNIntegrated Services Digital Network,
 PF_KEY Internal key-management function,
-PF_INET6   Internet version 6 protocols,
-PF_NATMNative ATM access,
-PF_ATM ATM,
-PF_NETGRAPHNetgraph sockets
+PF_NATMAsynchronous transfer mode protocols,
+PF_NETGRAPHNetgraph sockets,
+PF_IEEE80211   IEEE 802.11 wireless link-layer protocols (WiFi),
+PF_BLUETOOTH   Bluetooth protocols,
+PF_INET_SDPOFED socket direct protocol (IPv4),
+PF_INET6_SDP   OFED socket direct protocol (IPv6)
 .Ed
 .Pp
+Each protocol family is connected to an address family, which has the
+same name except that the prefix is
+.Dq Dv AF_
+in place of
+.Dq Dv PF_ .
+Other protocol families may be also defined, beginning with
+.Dq Dv PF_ ,
+with corresponding address families.
+.Pp
 The socket has the indicated
 .Fa type ,
 which specifies the semantics of communication.
@@ -307,6 +313,37 @@ The socket type is not supported by the 
 .%B PS1
 .%N 8
 .Re
+.Sh STANDARDS
+The
+.Fn socket
+function conforms to
+.St -p1003.1-2008 .
+The
+.Tn POSIX
+standard specifies only the
+.Dv AF_INET ,
+.Dv AF_INET6 ,
+and
+.Dv AF_UNIX
+constants for address families, and requires the use of
+.Dv AF_*
+constants for the
+.Fa domain
+argument of
+.Fn socket .
+The
+.Dv SOCK_CLOEXEC
+flag is expected to conform to the next revision of the
+.Tn POSIX
+standard.
+The
+.Dv SOCK_RDM
+.Fa type ,
+the
+.Dv PF_*
+constants, and other address families are
+.Fx
+extensions.
 .Sh HISTORY
 The
 .Fn socket
___
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: r267842 - head/etc/mtree

2014-06-24 Thread Mark Johnston
Author: markj
Date: Tue Jun 24 21:12:08 2014
New Revision: 267842
URL: http://svnweb.freebsd.org/changeset/base/267842

Log:
  Unbreak installation of the rtld tests.
  
  X-MFC-With:   r267679

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

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Tue Jun 24 20:35:20 2014
(r267841)
+++ head/etc/mtree/BSD.tests.dist   Tue Jun 24 21:12:08 2014
(r267842)
@@ -90,6 +90,7 @@
 ..
 atf-sh
 ..
+..
 rtld-elf
 ..
 ..
___
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: r267758 - head

2014-06-24 Thread Warner Losh

On Jun 24, 2014, at 10:25 AM, Andrey Chernov  wrote:

> On 24.06.2014 20:07, Warner Losh wrote:
>>> Log:
>>> Change suggestion how to set MAKESYSPATH as broken incremental build
>>> workaround. Magic ".../share/mk" (search directories up to /)
>>> does not work for f.e. /usr/src/gnu/lib/libgcc because the path
>>> inside is starting from /usr/obj hierarchy and ends up in
>>> /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
>>> IMHO proper fixing of incremental build is needed urgently.
>> 
>> I don’t understand how this is even possible. This change is wrong because 
>> it has a bogus path the doesn’t exist on all systems. I’m going to fix that.
> 
> How it is possible:
> cd /usr/src/gnu/lib/libgcc
> make

This does a recursive make, with pwd in /usr/obj….  That’s going to be utterly 
evil to fix...

Warner



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r267758 - head

2014-06-24 Thread Warner Losh

On Jun 24, 2014, at 2:26 PM, Warner Losh  wrote:

> 
> On Jun 24, 2014, at 10:25 AM, Andrey Chernov  wrote:
> 
>> On 24.06.2014 20:07, Warner Losh wrote:
 Log:
 Change suggestion how to set MAKESYSPATH as broken incremental build
 workaround. Magic ".../share/mk" (search directories up to /)
 does not work for f.e. /usr/src/gnu/lib/libgcc because the path
 inside is starting from /usr/obj hierarchy and ends up in
 /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
 IMHO proper fixing of incremental build is needed urgently.
>>> 
>>> I don’t understand how this is even possible. This change is wrong because 
>>> it has a bogus path the doesn’t exist on all systems. I’m going to fix that.
>> 
>> How it is possible:
>> cd /usr/src/gnu/lib/libgcc
>> make
> 
> This does a recursive make, with pwd in /usr/obj….  That’s going to be 
> utterly evil to fix…

Actually, adding a simple cd ${.CURDIR} before the make fixes this… We need to 
do it in 3 places.

# one could argue that we should just .include something to make unwind.h 
instead of this rube-goldberg reach over make…
# and I’d agree with them...

Warner



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r267845 - in head/gnu/lib: csu libgcc libgcov

2014-06-24 Thread Warner Losh
Author: imp
Date: Tue Jun 24 22:15:27 2014
New Revision: 267845
URL: http://svnweb.freebsd.org/changeset/base/267845

Log:
  Make sure that the sub-makes for unwind.h start from the CURDIR
  (/usr/src) tree rather than the OBJDIR (/usr/obj) tree. This fixes
  broken incremental builds with the canonical MAKESYSPATH workaround
  of .../share/mk. This is a gross kludge.

Modified:
  head/gnu/lib/csu/Makefile
  head/gnu/lib/libgcc/Makefile
  head/gnu/lib/libgcov/Makefile

Modified: head/gnu/lib/csu/Makefile
==
--- head/gnu/lib/csu/Makefile   Tue Jun 24 21:35:34 2014(r267844)
+++ head/gnu/lib/csu/Makefile   Tue Jun 24 22:15:27 2014(r267845)
@@ -73,7 +73,7 @@ crtendS.o:${ENDSRC}
 
 CLEANFILES+=   tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h
 tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile
-   ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
+   (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} 
${.TARGET})
 
 realinstall:
 .for file in ${OBJS} ${SOBJS} ${TGTOBJS}

Modified: head/gnu/lib/libgcc/Makefile
==
--- head/gnu/lib/libgcc/MakefileTue Jun 24 21:35:34 2014
(r267844)
+++ head/gnu/lib/libgcc/MakefileTue Jun 24 22:15:27 2014
(r267845)
@@ -317,7 +317,7 @@ ${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS
 # Generated headers
 #
 ${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile
-   ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
+   (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} 
${.TARGET})
 
 CLEANFILES += ${COMMONHDRS}
 CLEANFILES += cs-*.h option*

Modified: head/gnu/lib/libgcov/Makefile
==
--- head/gnu/lib/libgcov/Makefile   Tue Jun 24 21:35:34 2014
(r267844)
+++ head/gnu/lib/libgcov/Makefile   Tue Jun 24 22:15:27 2014
(r267845)
@@ -46,7 +46,7 @@ COMMONHDRS=   tm.h tconfig.h gcov-iov.h op
 CLEANFILES+=   ${COMMONHDRS} cs-tm.h cs-tconfig.h options.h optionlist
 
 ${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile
-   ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
+   (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} 
${.TARGET})
 
 ${OBJS} beforedepend: ${COMMONHDRS}
 
___
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: r267758 - head

2014-06-24 Thread Warner Losh

On Jun 24, 2014, at 2:38 PM, Warner Losh  wrote:

> 
> On Jun 24, 2014, at 2:26 PM, Warner Losh  wrote:
> 
>> 
>> On Jun 24, 2014, at 10:25 AM, Andrey Chernov  wrote:
>> 
>>> On 24.06.2014 20:07, Warner Losh wrote:
> Log:
> Change suggestion how to set MAKESYSPATH as broken incremental build
> workaround. Magic ".../share/mk" (search directories up to /)
> does not work for f.e. /usr/src/gnu/lib/libgcc because the path
> inside is starting from /usr/obj hierarchy and ends up in
> /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
> IMHO proper fixing of incremental build is needed urgently.
 
 I don’t understand how this is even possible. This change is wrong because 
 it has a bogus path the doesn’t exist on all systems. I’m going to fix 
 that.
>>> 
>>> How it is possible:
>>> cd /usr/src/gnu/lib/libgcc
>>> make
>> 
>> This does a recursive make, with pwd in /usr/obj….  That’s going to be 
>> utterly evil to fix…
> 
> Actually, adding a simple cd ${.CURDIR} before the make fixes this… We need 
> to do it in 3 places.
> 
> # one could argue that we should just .include something to make unwind.h 
> instead of this rube-goldberg reach over make…
> # and I’d agree with them…

This has been “fixed”…

that was a fun example…  I have to go from “fixed” to actually fixed now…

Warner


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r267758 - head

2014-06-24 Thread Simon J. Gerraty

On Tue, 24 Jun 2014 15:25:45 -0700, Warner Losh writes:
>> Change suggestion how to set MAKESYSPATH as broken incremental =
>build
>> workaround. Magic ".../share/mk" (search directories up to /)

If syspath is going to include .../ it isn't a bad idea for
sys.mk to resolve it.
Something like:

.if ${.MAKE.LEVEL} == 0
# just in case -m, MAKESYSPATH or our default has .../ 
# export a sanitised version...
# first any -m* from command line,
# then any MAKESYSPATH and finally ${.PARSEDIR}
_makesyspath:= ${.MAKEFLAGS:tW:S/ -m / -m/g:tw:M-m*:S,^-m,,} \
${MAKESYSPATH:U} \
${.PARSEDIR}
# replace .../.* with ${.PARSEDIR}, not perfect but pretty close
MAKESYSPATH:= ${_makesyspath:S,:, ,g:C,^\.\.\./.*,${.PARSEDIR},:u:ts:}
.export MAKESYSPATH
.endif

then if a sub-make is launched in a objdir outside of the tree, it will
still find the correct sys.mk etc.

___
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"


you a

2014-06-24 Thread M Kit

___
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: r267850 - head/sys/vm

2014-06-24 Thread Alan Cox
Author: alc
Date: Wed Jun 25 03:30:03 2014
New Revision: 267850
URL: http://svnweb.freebsd.org/changeset/base/267850

Log:
  Now that vm_map_insert() sets MAP_ENTRY_GROWS_{DOWN,UP} on the stack entries
  that it creates (r267645), we can place the check that blocks map entry
  coalescing on stack entries in vm_map_simplify_entry() where it properly
  belongs.
  
  Reviewed by:  kib

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==
--- head/sys/vm/vm_map.cWed Jun 25 02:14:55 2014(r267849)
+++ head/sys/vm/vm_map.cWed Jun 25 03:30:03 2014(r267850)
@@ -1292,12 +1292,12 @@ charged:
map->size += new_entry->end - new_entry->start;
 
/*
-* It may be possible to merge the new entry with the next and/or
-* previous entries.  However, due to MAP_STACK_* being a hack, a
-* panic can result from merging such entries.
+* Try to coalesce the new entry with both the previous and next
+* entries in the list.  Previously, we only attempted to coalesce
+* with the previous entry when object is NULL.  Here, we handle the
+* other cases, which are less common.
 */
-   if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0)
-   vm_map_simplify_entry(map, new_entry);
+   vm_map_simplify_entry(map, new_entry);
 
if (cow & (MAP_PREFAULT|MAP_PREFAULT_PARTIAL)) {
vm_map_pmap_enter(map, start, prot,
@@ -1512,7 +1512,8 @@ vm_map_simplify_entry(vm_map_t map, vm_m
vm_map_entry_t next, prev;
vm_size_t prevsize, esize;
 
-   if (entry->eflags & (MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP))
+   if ((entry->eflags & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP |
+   MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP)) != 0)
return;
 
prev = entry->prev;
___
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: r267851 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace

2014-06-24 Thread Davide Italiano
Author: davide
Date: Wed Jun 25 03:54:02 2014
New Revision: 267851
URL: http://svnweb.freebsd.org/changeset/base/267851

Log:
  Continue the crusade towards a dev_clone()-free kernel, removing its
  usage from dtrace. The dtrace code already uses cdevpriv(9) since FreeBSD
  8, so this change should be quite harmless.
  
  Reviewed by:  markj
  Approved by:  markj
  MFC after:never

Deleted:
  head/sys/cddl/dev/dtrace/dtrace_clone.c
Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/dev/dtrace/dtrace_ioctl.c
  head/sys/cddl/dev/dtrace/dtrace_load.c
  head/sys/cddl/dev/dtrace/dtrace_unload.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Jun 
25 03:30:03 2014(r267850)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Jun 
25 03:54:02 2014(r267851)
@@ -15716,10 +15716,8 @@ dtrace_attach(dev_info_t *devi, ddi_atta
 #endif
 
 #if !defined(sun)
-#if __FreeBSD_version >= 800039
 static void dtrace_dtr(void *);
 #endif
-#endif
 
 /*ARGSUSED*/
 static int
@@ -15745,27 +15743,7 @@ dtrace_open(struct cdev *dev, int oflags
ASSERT(getminor(*devp) == DTRACEMNRN_DTRACE);
 #else
cred_t *cred_p = NULL;
-
-#if __FreeBSD_version < 800039
-   /*
-* The first minor device is the one that is cloned so there is
-* nothing more to do here.
-*/
-   if (dev2unit(dev) == 0)
-   return 0;
-
-   /*
-* Devices are cloned, so if the DTrace state has already
-* been allocated, that means this device belongs to a
-* different client. Each client should open '/dev/dtrace'
-* to get a cloned device.
-*/
-   if (dev->si_drv1 != NULL)
-   return (EBUSY);
-#endif
-
cred_p = dev->si_cred;
-#endif
 
/*
 * If no DTRACE_PRIV_* bits are set in the credential, then the
@@ -15773,11 +15751,6 @@ dtrace_open(struct cdev *dev, int oflags
 */
dtrace_cred2priv(cred_p, &priv, &uid, &zoneid);
if (priv == DTRACE_PRIV_NONE) {
-#if !defined(sun)
-#if __FreeBSD_version < 800039
-   /* Destroy the cloned device. */
-destroy_dev(dev);
-#endif
 #endif
 
return (EACCES);
@@ -15810,12 +15783,8 @@ dtrace_open(struct cdev *dev, int oflags
state = dtrace_state_create(devp, cred_p);
 #else
state = dtrace_state_create(dev);
-#if __FreeBSD_version < 800039
-   dev->si_drv1 = state;
-#else
devfs_set_cdevpriv(state, dtrace_dtr);
 #endif
-#endif
 
mutex_exit(&cpu_lock);
 
@@ -15827,12 +15796,6 @@ dtrace_open(struct cdev *dev, int oflags
--dtrace_opens;
 #endif
mutex_exit(&dtrace_lock);
-#if !defined(sun)
-#if __FreeBSD_version < 800039
-   /* Destroy the cloned device. */
-destroy_dev(dev);
-#endif
-#endif
return (EAGAIN);
}
 
@@ -15845,9 +15808,6 @@ dtrace_open(struct cdev *dev, int oflags
 #if defined(sun)
 static int
 dtrace_close(dev_t dev, int flag, int otyp, cred_t *cred_p)
-#elif __FreeBSD_version < 800039
-static int
-dtrace_close(struct cdev *dev, int flags, int fmt __unused, struct thread *td)
 #else
 static void
 dtrace_dtr(void *data)
@@ -15862,18 +15822,9 @@ dtrace_dtr(void *data)
 
state = ddi_get_soft_state(dtrace_softstate, minor);
 #else
-#if __FreeBSD_version < 800039
-   dtrace_state_t *state = dev->si_drv1;
-
-   /* Check if this is not a cloned device. */
-   if (dev2unit(dev) == 0)
-   return (0);
-#else
dtrace_state_t *state = data;
 #endif
 
-#endif
-
mutex_enter(&cpu_lock);
mutex_enter(&dtrace_lock);
 
@@ -15890,9 +15841,6 @@ dtrace_dtr(void *data)
 
 #if !defined(sun)
kmem_free(state, 0);
-#if __FreeBSD_version < 800039
-   dev->si_drv1 = NULL;
-#endif
 #endif
}
 
@@ -15907,12 +15855,7 @@ dtrace_dtr(void *data)
mutex_exit(&dtrace_lock);
mutex_exit(&cpu_lock);
 
-#if __FreeBSD_version < 800039
-   /* Schedule this cloned device to be destroyed. */
-   destroy_dev_sched(dev);
-#endif
-
-#if defined(sun) || __FreeBSD_version < 800039
+#if defined(sun)
return (0);
 #endif
 }
@@ -16949,24 +16892,14 @@ static d_ioctl_t  dtrace_ioctl;
 static d_ioctl_t   dtrace_ioctl_helper;
 static voiddtrace_load(void *);
 static int dtrace_unload(void);
-#if __FreeBSD_version < 800039
-static voiddtrace_clone(void *, struct ucred *, char *, int , 
struct cdev **);
-static struct clonedevs*dtrace_clones; /* Ptr to the array of 
cloned devices. */
-static eventhandler_tageh_tag; /* Event handler tag. */
-#else
 static struct cdev *dtrace_dev;
 static struct cdev *helper_dev;

svn commit: r267852 - head/sys/dev/glxiic

2014-06-24 Thread Daichi GOTO
Author: daichi (ports committer)
Date: Wed Jun 25 05:39:30 2014
New Revision: 267852
URL: http://svnweb.freebsd.org/changeset/base/267852

Log:
  Fixed an IIC timing issue between the glxiic master and a slave of
  peripheral devices.  When transmitting (rx) from slave to master,
  sometimes nAKC delays. As a result, some slaves fails their
  transmission.
  
  Submitted by: Masanori OZAWA 
  Reviewed by:  brix
  MFC after:1 week

Modified:
  head/sys/dev/glxiic/glxiic.c

Modified: head/sys/dev/glxiic/glxiic.c
==
--- head/sys/dev/glxiic/glxiic.cWed Jun 25 03:54:02 2014
(r267851)
+++ head/sys/dev/glxiic/glxiic.cWed Jun 25 05:39:30 2014
(r267852)
@@ -711,6 +711,7 @@ static int
 glxiic_state_master_addr_callback(struct glxiic_softc *sc, uint8_t status)
 {
uint8_t slave;
+   uint8_t ctrl1;
 
GLXIIC_ASSERT_LOCKED(sc);
 
@@ -746,6 +747,13 @@ glxiic_state_master_addr_callback(struct
 
bus_write_1(sc->smb_res, GLXIIC_SMB_SDA, slave);
 
+   if ((sc->msg->flags & IIC_M_RD) != 0 && sc->ndata == 1) {
+   /* Last byte from slave, set NACK. */
+   ctrl1 = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL1);
+   bus_write_1(sc->smb_res, GLXIIC_SMB_CTRL1,
+   ctrl1 | GLXIIC_SMB_CTRL1_ACK_BIT);
+   }
+
return (IIC_NOERR);
 }
 
@@ -811,13 +819,6 @@ glxiic_state_master_rx_callback(struct g
return (IIC_ENOACK);
}
 
-   if (sc->ndata == 1) {
-   /* Last byte from slave, set NACK. */
-   ctrl1 = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL1);
-   bus_write_1(sc->smb_res, GLXIIC_SMB_CTRL1,
-   ctrl1 | GLXIIC_SMB_CTRL1_ACK_BIT);
-   }
-
if ((status & GLXIIC_SMB_STS_STASTR_BIT) != 0) {
/* Bus is stalled, clear and wait for data. */
bus_write_1(sc->smb_res, GLXIIC_SMB_STS,
@@ -837,6 +838,13 @@ glxiic_state_master_rx_callback(struct g
return (glxiic_state_table[sc->state].callback(sc, status));
}
 
+   if (sc->ndata == 1) {
+   /* Last byte from slave, set NACK. */
+   ctrl1 = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL1);
+   bus_write_1(sc->smb_res, GLXIIC_SMB_CTRL1,
+   ctrl1 | GLXIIC_SMB_CTRL1_ACK_BIT);
+   }
+
glxiic_start_timeout_locked(sc);
 
return (IIC_NOERR);
___
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"