Re: svn commit: r288431 - in head/sys: kern sys vm

2015-10-08 Thread John-Mark Gurney
Alan Cox wrote this message on Fri, Oct 02, 2015 at 18:50 -0500:
> On Oct 2, 2015, at 10:59 AM, John Baldwin  wrote:
> 
> > I think it is not unreasonble to expect that fadvise() incurs system-wide
> > affects.  A properly implemented WILLNEED that does read-ahead cannot work
> > without incurring system-wide effects.  I had always assumed that fadvise()
> > operated on a file, not a given process' view of a file (unlike, say,
> > madvise which only operates on mappings and only indirectly affects
> > file-backed data).
> 
> 
> Can you elaborate on what you mean by ?I had always assumed that fadvise() 
> operated on a file, ???
> 
> Under the previous implementation, if you did an fadvise(DONTNEED) on a file, 
> in order to cache the file?s pages, those pages first had to be unmapped from 
> any address space.  (You can find this unmapping performed by 
> vm_page_try_to_cache().)  In other words, there was never any code that said, 
> ?Is this a mapped page, and if it is, don?t cache it because we?re actually 
> performing an fadvise().?  So, to pick an extreme example, if you did an 
> fadvise(?libc.so?, DONTNEED), unless some process had libc.so wired, then 
> every single mapping to every single page of libc.so was going to be 
> destroyed and the pages moved to the cache.  However, because we moved the 
> pages to the cache (rather than freeing them), and libc.so is frequently 
> accessed, a subsequent instruction fetch would have faulted and been able to 
> reactivate the cached page, avoiding an I/O operation.  In other words, that 
> we were caching the pages targeted by fadvise() rather than simply freeing 
> them mattered in cases where th
 e pages were in use/accessed by multiple processes.

This would be a very nasty DoS if someone just ran fadvise('libc.so',
DONTNEED) in loop, and forced any future accesses of libc.so to pull
from disk, over and over and over again...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289059 - head/sys/vm

2015-10-08 Thread Alan Cox
Author: alc
Date: Fri Oct  9 03:38:58 2015
New Revision: 289059
URL: https://svnweb.freebsd.org/changeset/base/289059

Log:
  Exploit r288122 to avoid pointlessly enqueueing a page that is about to be
  freed.
  
  Submitted by: kmacy
  Differential Revision:https://reviews.freebsd.org/D1674

Modified:
  head/sys/vm/vm_glue.c

Modified: head/sys/vm/vm_glue.c
==
--- head/sys/vm/vm_glue.c   Thu Oct  8 23:27:45 2015(r289058)
+++ head/sys/vm/vm_glue.c   Fri Oct  9 03:38:58 2015(r289059)
@@ -418,7 +418,7 @@ vm_thread_stack_dispose(vm_object_t ksob
if (m == NULL)
panic("vm_thread_dispose: kstack already missing?");
vm_page_lock(m);
-   vm_page_unwire(m, PQ_INACTIVE);
+   vm_page_unwire(m, PQ_NONE);
vm_page_free(m);
vm_page_unlock(m);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289058 - head/sys/i386/linux

2015-10-08 Thread Mateusz Guzik
On Thu, Oct 08, 2015 at 11:27:45PM +, Conrad E. Meyer wrote:
> Author: cem
> Date: Thu Oct  8 23:27:45 2015
> New Revision: 289058
> URL: https://svnweb.freebsd.org/changeset/base/289058
> 
> Log:
>   Fix missing semi-colon from r289055.
>   
>   Obtained from:  mjg
>   Sponsored by:   EMC / Isilon Storage Division
> 
> Modified:
>   head/sys/i386/linux/linux_sysvec.c
> 
> Modified: head/sys/i386/linux/linux_sysvec.c
> ==
> --- head/sys/i386/linux/linux_sysvec.cThu Oct  8 21:52:20 2015
> (r289057)
> +++ head/sys/i386/linux/linux_sysvec.cThu Oct  8 23:27:45 2015
> (r289058)
> @@ -866,7 +866,7 @@ linux_fetch_syscall_args(struct thread *
>  
>   if (sa->code >= p->p_sysent->sv_size)
>   /* nosys */
> - sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1]
> + sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1];
>   else
>   sa->callp = &p->p_sysent->sv_table[sa->code];
>   sa->narg = sa->callp->sy_narg;

Reported by:NGie Cooper 

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


svn commit: r289058 - head/sys/i386/linux

2015-10-08 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct  8 23:27:45 2015
New Revision: 289058
URL: https://svnweb.freebsd.org/changeset/base/289058

Log:
  Fix missing semi-colon from r289055.
  
  Obtained from:mjg
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/i386/linux/linux_sysvec.c

Modified: head/sys/i386/linux/linux_sysvec.c
==
--- head/sys/i386/linux/linux_sysvec.c  Thu Oct  8 21:52:20 2015
(r289057)
+++ head/sys/i386/linux/linux_sysvec.c  Thu Oct  8 23:27:45 2015
(r289058)
@@ -866,7 +866,7 @@ linux_fetch_syscall_args(struct thread *
 
if (sa->code >= p->p_sysent->sv_size)
/* nosys */
-   sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1]
+   sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1];
else
sa->callp = &p->p_sysent->sv_table[sa->code];
sa->narg = sa->callp->sy_narg;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289055 - in head/sys: amd64/linux i386/linux

2015-10-08 Thread NGie Cooper
On Thu, Oct 8, 2015 at 2:08 PM, Mateusz Guzik  wrote:
> Author: mjg
> Date: Thu Oct  8 21:08:35 2015
> New Revision: 289055
> URL: https://svnweb.freebsd.org/changeset/base/289055

...

> Modified: head/sys/i386/linux/linux_sysvec.c
> ==
> --- head/sys/i386/linux/linux_sysvec.c  Thu Oct  8 20:32:44 2015
> (r289054)
> +++ head/sys/i386/linux/linux_sysvec.c  Thu Oct  8 21:08:35 2015
> (r289055)
> @@ -866,7 +866,7 @@ linux_fetch_syscall_args(struct thread *
>
> if (sa->code >= p->p_sysent->sv_size)
> /* nosys */
> -   sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL];
> +   sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1]
> else
> sa->callp = &p->p_sysent->sv_table[sa->code];
> sa->narg = sa->callp->sy_narg;

Semicolon missing here. This broke the i386 build.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289057 - head/sys/sys

2015-10-08 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Oct  8 21:52:20 2015
New Revision: 289057
URL: https://svnweb.freebsd.org/changeset/base/289057

Log:
  Remove comment obsoleted by r289056.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/sys/kernel.h

Modified: head/sys/sys/kernel.h
==
--- head/sys/sys/kernel.h   Thu Oct  8 21:28:06 2015(r289056)
+++ head/sys/sys/kernel.h   Thu Oct  8 21:52:20 2015(r289057)
@@ -80,10 +80,6 @@ extern volatile int ticks;
  * for binary compatibility with inserted elements.
  *
  * The SI_SUB_LAST value must have the highest lexical value.
- *
- * The SI_SUB_SWAP values represent a value used by
- * the BSD 4.4Lite but not by FreeBSD; it is maintained in dependent
- * order to support porting.
  */
 enum sysinit_sub_id {
SI_SUB_DUMMY= 0x000,/* not executed; for linker*/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289056 - head/sys/sys

2015-10-08 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Oct  8 21:28:06 2015
New Revision: 289056
URL: https://svnweb.freebsd.org/changeset/base/289056

Log:
  Remove unused SI_SUB_* #defines.
  
  Reviewed by:  kib@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D3708

Modified:
  head/sys/sys/kernel.h

Modified: head/sys/sys/kernel.h
==
--- head/sys/sys/kernel.h   Thu Oct  8 21:08:35 2015(r289055)
+++ head/sys/sys/kernel.h   Thu Oct  8 21:28:06 2015(r289056)
@@ -90,8 +90,6 @@ enum sysinit_sub_id {
SI_SUB_DONE = 0x001,/* processed*/
SI_SUB_TUNABLES = 0x070,/* establish tunable values */
SI_SUB_COPYRIGHT= 0x081,/* first use of console*/
-   SI_SUB_SETTINGS = 0x088,/* check and recheck settings */
-   SI_SUB_MTX_POOL_STATIC  = 0x090,/* static mutex pool */
SI_SUB_VM   = 0x100,/* virtual memory system init*/
SI_SUB_KMEM = 0x180,/* kernel memory*/
SI_SUB_HYPERVISOR   = 0x1A4,/*
@@ -119,14 +117,12 @@ enum sysinit_sub_id {
SI_SUB_RUN_QUEUE= 0x240,/* set up run queue*/
SI_SUB_KTRACE   = 0x248,/* ktrace */
SI_SUB_OPENSOLARIS  = 0x249,/* OpenSolaris compatibility */
-   SI_SUB_CYCLIC   = 0x24A,/* Cyclic timers */
SI_SUB_AUDIT= 0x24C,/* audit */
SI_SUB_CREATE_INIT  = 0x250,/* create init process*/
SI_SUB_SCHED_IDLE   = 0x260,/* required idle procs */
SI_SUB_MBUF = 0x270,/* mbuf subsystem */
SI_SUB_INTR = 0x280,/* interrupt threads */
SI_SUB_SOFTINTR = 0x281,/* start soft interrupt thread 
*/
-   SI_SUB_ACL  = 0x290,/* start for filesystem ACLs */
SI_SUB_DEVFS= 0x2F0,/* devfs ready for devices */
SI_SUB_INIT_IF  = 0x300,/* prep for net interfaces */
SI_SUB_NETGRAPH = 0x301,/* Let Netgraph initialize */
@@ -153,9 +149,6 @@ enum sysinit_sub_id {
SI_SUB_KICK_SCHEDULER   = 0xa00,/* start the timeout events*/
SI_SUB_INT_CONFIG_HOOKS = 0xa80,/* Interrupts enabled config */
SI_SUB_ROOT_CONF= 0xb00,/* Find root devices */
-   SI_SUB_DUMP_CONF= 0xb20,/* Find dump devices */
-   SI_SUB_RAID = 0xb38,/* Configure GEOM classes */
-   SI_SUB_SWAP = 0xc00,/* swap */
SI_SUB_INTRINSIC_POST   = 0xd00,/* proc 0 cleanup*/
SI_SUB_SYSCALLS = 0xd80,/* register system calls */
SI_SUB_VNET_DONE= 0xdc0,/* vnet registration complete */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289055 - in head/sys: amd64/linux i386/linux

2015-10-08 Thread Mateusz Guzik
Author: mjg
Date: Thu Oct  8 21:08:35 2015
New Revision: 289055
URL: https://svnweb.freebsd.org/changeset/base/289055

Log:
  linux: fix handling of out-of-bounds syscall attempts
  
  Due to an off by one the code would read an entry past the table, as
  opposed to the last entry which contains the nosys handler.
  
  Reported by:  Pawel Biernacki 

Modified:
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/i386/linux/linux_sysvec.c

Modified: head/sys/amd64/linux/linux_sysvec.c
==
--- head/sys/amd64/linux/linux_sysvec.c Thu Oct  8 20:32:44 2015
(r289054)
+++ head/sys/amd64/linux/linux_sysvec.c Thu Oct  8 21:08:35 2015
(r289055)
@@ -234,7 +234,7 @@ linux_fetch_syscall_args(struct thread *
 
if (sa->code >= p->p_sysent->sv_size)
/* nosys */
-   sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL];
+   sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1];
else
sa->callp = &p->p_sysent->sv_table[sa->code];
sa->narg = sa->callp->sy_narg;

Modified: head/sys/i386/linux/linux_sysvec.c
==
--- head/sys/i386/linux/linux_sysvec.c  Thu Oct  8 20:32:44 2015
(r289054)
+++ head/sys/i386/linux/linux_sysvec.c  Thu Oct  8 21:08:35 2015
(r289055)
@@ -866,7 +866,7 @@ linux_fetch_syscall_args(struct thread *
 
if (sa->code >= p->p_sysent->sv_size)
/* nosys */
-   sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL];
+   sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1]
else
sa->callp = &p->p_sysent->sv_table[sa->code];
sa->narg = sa->callp->sy_narg;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289054 - stable/10/share/mk

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 20:32:44 2015
New Revision: 289054
URL: https://svnweb.freebsd.org/changeset/base/289054

Log:
  Revert r289043.
  
  r284408 was marked for MFC but is not safe for stable/10 yet due to failing
  in bin/sh/tests.

Modified:
  stable/10/share/mk/bsd.test.mk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/bsd.test.mk
==
--- stable/10/share/mk/bsd.test.mk  Thu Oct  8 19:21:14 2015
(r289053)
+++ stable/10/share/mk/bsd.test.mk  Thu Oct  8 20:32:44 2015
(r289054)
@@ -10,10 +10,6 @@
 
 :
 
-.ifndef TESTSDIR
-.error "Please define TESTSDIR when including bsd.test.mk"
-.endif
-
 # List of subdirectories containing tests into which to recurse.  This has the
 # same semantics as SUBDIR at build-time.  However, the directories listed here
 # get registered into the run-time test suite definitions so that the test
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r288911 - head/share/mk

2015-10-08 Thread Bryan Drewery
On 10/8/2015 11:40 AM, Warner Losh wrote:
> > We're including it there because Simon wanted it included there so
> > meta-mode settings were visible in sys.mk 
> . I thought it
> > lame at the
> > time, but had no better solution.
> >
> 
> Ah! So the /etc/src-env.conf thing I referenced does replace it. So we
> can remove src.conf from sys.mk  now. It came in via
> r284598, and I
> documented it and added it to src.conf.5/makeman later on.
> 
> I'll go ahead and do that since there's no impact to meta mode now.
> 
> That at least resolves my issues with nested port builds - ignoring that
> src.*.mk still gets included which I haven't had a problem with and is
> my own fault and intention given I want the MAKESYSPATH from local
> checkout!
> 
> 
> If you haven't made a commit yet, I'd be keen on reviewing the change.

Will do.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r289053 - stable/10/share/mk

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 19:21:14 2015
New Revision: 289053
URL: https://svnweb.freebsd.org/changeset/base/289053

Log:
  MFC r288201:
  
Don't recurse with cleanobj.

Modified:
  stable/10/share/mk/bsd.progs.mk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/bsd.progs.mk
==
--- stable/10/share/mk/bsd.progs.mk Thu Oct  8 19:19:56 2015
(r289052)
+++ stable/10/share/mk/bsd.progs.mk Thu Oct  8 19:21:14 2015
(r289053)
@@ -90,7 +90,7 @@ $v =
 
 .if !empty(PROGS) && !defined(_RECURSING_PROGS)
 # tell progs.mk we might want to install things
-PROGS_TARGETS+= checkdpadd clean cleandepend cleandir cleanobj depend install
+PROGS_TARGETS+= checkdpadd clean cleandepend cleandir depend install
 
 .for p in ${PROGS}
 .if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289052 - stable/10/share/mk

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 19:19:56 2015
New Revision: 289052
URL: https://svnweb.freebsd.org/changeset/base/289052

Log:
  MFC r288160:
  
Document bsd.progs.mk and add more variables overrides.

Modified:
  stable/10/share/mk/bsd.README
  stable/10/share/mk/bsd.progs.mk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/bsd.README
==
--- stable/10/share/mk/bsd.README   Thu Oct  8 19:13:36 2015
(r289051)
+++ stable/10/share/mk/bsd.README   Thu Oct  8 19:19:56 2015
(r289052)
@@ -251,6 +251,20 @@ PROG_CXX   If defined, the name of the pro
standard C++ library.  PROG_CXX overrides the value
of PROG if PROG is also set.
 
+PROGS  When used with , allow building multiple
+PROGS_CXX  PROG and PROGS_CXX in one Makefile.  To define
+   individual variables for each program the VAR.prog
+   syntax should be used.  For example:
+
+   PROGS=  foo bar
+   SRCS.foo=   foo_src.c
+   LDADD.foo=  -lutil
+   SRCS.bar=   bar_src.c
+
+   The supported variables are BINDIR BINGRP BINMODE BINOWN
+   CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS DPSRCS LDADD
+   LDFLAGS MAN MLINKS PROGNAME SRCS.
+
 PROGNAME   The name that the above program will be installed as, if
different from ${PROG}.
 

Modified: stable/10/share/mk/bsd.progs.mk
==
--- stable/10/share/mk/bsd.progs.mk Thu Oct  8 19:13:36 2015
(r289051)
+++ stable/10/share/mk/bsd.progs.mk Thu Oct  8 19:19:56 2015
(r289052)
@@ -42,8 +42,10 @@ PROG ?= $t
 
 .if defined(PROG)
 # just one of many
-PROG_OVERRIDE_VARS += BINDIR DPSRCS MAN SRCS
-PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD LDFLAGS 
${PROG_OVERRIDE_VARS}
+PROG_OVERRIDE_VARS +=  BINDIR BINGRP BINOWN BINMODE DPSRCS MAN PROGNAME \
+   SRCS
+PROG_VARS +=   CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD LINKS \
+   LDFLAGS MLINKS ${PROG_OVERRIDE_VARS}
 .for v in ${PROG_VARS:O:u}
 .if empty(${PROG_OVERRIDE_VARS:M$v})
 .if defined(${v}.${PROG})
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289051 - stable/10/share/mk

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 19:13:36 2015
New Revision: 289051
URL: https://svnweb.freebsd.org/changeset/base/289051

Log:
  MFC r288158:
  
Fix most cases of bsd.progs.mk running duplicate or missing commands.

Modified:
  stable/10/share/mk/bsd.prog.mk
  stable/10/share/mk/bsd.progs.mk
  stable/10/share/mk/bsd.test.mk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/bsd.prog.mk
==
--- stable/10/share/mk/bsd.prog.mk  Thu Oct  8 19:10:51 2015
(r289050)
+++ stable/10/share/mk/bsd.prog.mk  Thu Oct  8 19:13:36 2015
(r289051)
@@ -252,7 +252,7 @@ realinstall: _maninstall
 .ORDER: beforeinstall _maninstall
 .endif
 
-.endif
+.endif # !target(install)
 
 .if !target(lint)
 lint: ${SRCS:M*.c}

Modified: stable/10/share/mk/bsd.progs.mk
==
--- stable/10/share/mk/bsd.progs.mk Thu Oct  8 19:10:51 2015
(r289050)
+++ stable/10/share/mk/bsd.progs.mk Thu Oct  8 19:13:36 2015
(r289051)
@@ -66,25 +66,27 @@ UPDATE_DEPENDFILE ?= NO
 DEPENDFILE?= .depend.${PROG}
 # prog.mk will do the rest
 .else
-all: ${FILES} ${PROGS} ${SCRIPTS}
+all: ${PROGS}
 
 # We cannot capture dependencies for meta mode here
 UPDATE_DEPENDFILE = NO
 # nor can we safely run in parallel.
 .NOTPARALLEL:
 .endif
-.endif
+.endif # PROGS || PROGS_CXX
 
-# The non-recursive call to bsd.progs.mk will handle FILES; NUL out
-# FILESGROUPS so recursive calls don't duplicate the work
+# These are handled by the main make process.
 .ifdef _RECURSING_PROGS
-FILESGROUPS=
+_PROGS_GLOBAL_VARS= CLEANFILES CLEANDIRS FILESGROUPS SCRIPTS
+.for v in ${_PROGS_GLOBAL_VARS}
+$v =
+.endfor
 .endif
 
 # handle being called [bsd.]progs.mk
 .include 
 
-.ifndef _RECURSING_PROGS
+.if !empty(PROGS) && !defined(_RECURSING_PROGS)
 # tell progs.mk we might want to install things
 PROGS_TARGETS+= checkdpadd clean cleandepend cleandir cleanobj depend install
 
@@ -94,12 +96,14 @@ PROGS_TARGETS+= checkdpadd clean cleande
 x.$p= PROG_CXX=$p
 .endif
 
+# Main PROG target
 $p ${p}_p: .PHONY .MAKE
(cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
SUBDIR= PROG=$p \
DEPENDFILE=.depend.$p .MAKE.DEPENDFILE=.depend.$p \
${x.$p})
 
+# Pseudo targets for PROG, such as 'install'.
 .for t in ${PROGS_TARGETS:O:u}
 $p.$t: .PHONY .MAKE
(cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
@@ -109,21 +113,8 @@ $p.$t: .PHONY .MAKE
 .endfor
 .endfor
 
-.if !empty(PROGS)
+# Depend main pseudo targets on all PROG.pseudo targets too.
 .for t in ${PROGS_TARGETS:O:u}
 $t: ${PROGS:%=%.$t}
 .endfor
 .endif
-
-.if empty(PROGS) && !empty(SCRIPTS)
-
-.for t in ${PROGS_TARGETS:O:u}
-scripts.$t: .PHONY .MAKE
-   (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} SUBDIR= _RECURSING_PROGS= \
-   $t)
-$t: scripts.$t
-.endfor
-
-.endif
-
-.endif

Modified: stable/10/share/mk/bsd.test.mk
==
--- stable/10/share/mk/bsd.test.mk  Thu Oct  8 19:10:51 2015
(r289050)
+++ stable/10/share/mk/bsd.test.mk  Thu Oct  8 19:13:36 2015
(r289051)
@@ -99,10 +99,6 @@ test: beforetest realtest
 test: aftertest
 .endif
 
-.if !empty(SUBDIR)
-.include 
-.endif
-
 .if !empty(PROGS) || !empty(PROGS_CXX) || !empty(SCRIPTS)
 .include 
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289050 - stable/10/share/mk

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 19:10:51 2015
New Revision: 289050
URL: https://svnweb.freebsd.org/changeset/base/289050

Log:
  Direct commit to fix usage with fmake.
  
  fmake does not have :tW, so use some clever :Q tricks to achieve the
  same result.  This won't work if PATH actually contains spaces, but
  it's better than not working at all.

Modified:
  stable/10/share/mk/bsd.test.mk
  stable/10/share/mk/suite.test.mk

Modified: stable/10/share/mk/bsd.test.mk
==
--- stable/10/share/mk/bsd.test.mk  Thu Oct  8 18:33:47 2015
(r289049)
+++ stable/10/share/mk/bsd.test.mk  Thu Oct  8 19:10:51 2015
(r289050)
@@ -43,11 +43,19 @@ DISTRIBUTION:=  tests
 # Ordered list of directories to construct the PATH for the tests.
 TESTS_PATH+= ${DESTDIR}/bin ${DESTDIR}/sbin \
  ${DESTDIR}/usr/bin ${DESTDIR}/usr/sbin
+.if defined(.PARSEDIR)
 TESTS_ENV+= PATH=${TESTS_PATH:tW:C/ +/:/g}
+.else
+TESTS_ENV+= PATH=${TESTS_PATH:N :Q:S,\\ ,:,g}
+.endif
 
 # Ordered list of directories to construct the LD_LIBRARY_PATH for the tests.
 TESTS_LD_LIBRARY_PATH+= ${DESTDIR}/lib ${DESTDIR}/usr/lib
+.if defined(.PARSEDIR)
 TESTS_ENV+= LD_LIBRARY_PATH=${TESTS_LD_LIBRARY_PATH:tW:C/ +/:/g}
+.else
+TESTS_ENV+= LD_LIBRARY_PATH=${TESTS_LD_LIBRARY_PATH:N :Q:S,\\ ,:,g}
+.endif
 
 # List of all tests being built.  The various *.test.mk modules extend this
 # variable as needed.

Modified: stable/10/share/mk/suite.test.mk
==
--- stable/10/share/mk/suite.test.mkThu Oct  8 18:33:47 2015
(r289049)
+++ stable/10/share/mk/suite.test.mkThu Oct  8 19:10:51 2015
(r289050)
@@ -72,8 +72,13 @@ Kyuafile.auto: Makefile
 echo; \
} >Kyuafile.auto.tmp
 .for _T in ${_TESTS}
+.if defined(.PARSEDIR)
@echo 
'${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/$/,/:tW:C/^/,
 /W:C/,$//W}}' \
>>Kyuafile.auto.tmp
+.else
+   @echo 
'${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/^/, 
/:Q:S/\\ ,/,/g:S,\\,,g}}' \
+   >>Kyuafile.auto.tmp
+.endif
 .endfor
 .for _T in ${TESTS_SUBDIRS:N.WAIT}
@echo "include(\"${_T}/Kyuafile\")" >>Kyuafile.auto.tmp
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r288911 - head/share/mk

2015-10-08 Thread Warner Losh
On Thu, Oct 8, 2015 at 10:03 AM, Bryan Drewery  wrote:

> On 10/8/15 9:00 AM, Warner Losh wrote:
> >
> > On Wed, Oct 7, 2015 at 7:39 PM, Bryan Drewery  > > wrote:
> >
> > On 10/6/2015 1:24 PM, Warner Losh wrote:
> > >> With the META_MODE changes, sjg introduced this /etc/src-env.conf
> file
> > >> that is included from sys.mk  early, that can be
> used for overriding
> > >> things like MAKEOBJDIRPREFIX, enabling META_MODE (it needs to be
> set
> > >> extremely early for AUTO_OBJ support, among other things).
> > >>
> > >> As far as I can tell, the sys.mk  change to
> include src.conf early was
> > >> done out of convenience.  Meaning, we could remove that and just
> add
> > >> back a .include http://src.init.mk>> or similar at
> the top of all src
> > Makefiles.
> > > All src makefiles? Yea, I’d rather hoped to avoid that, though it
> is easily
> > > scripted. I’d thought of this solution at the time I did the
> MAKESYSPATH
> > > hack, and rejected it as being too unwieldy. And having that at
> the top
> > > of all the files would still require MAKESYSPATH need to be
> …/share/mk
> > > to work out. I was rather hoping we could find some good way around
> > > doing that.
> >
> > r289000 confuses me. Clearly src.opts.mk  is
> > still needed in Makefiles.
> > So why are we including src.conf in sys.mk  and not
> > src.opts.mk ?
> >
> >
> > We're including it there because Simon wanted it included there so
> > meta-mode settings were visible in sys.mk . I thought it
> > lame at the
> > time, but had no better solution.
> >
>
> Ah! So the /etc/src-env.conf thing I referenced does replace it. So we
> can remove src.conf from sys.mk now. It came in via r284598, and I
> documented it and added it to src.conf.5/makeman later on.
>
> I'll go ahead and do that since there's no impact to meta mode now.
>
> That at least resolves my issues with nested port builds - ignoring that
> src.*.mk still gets included which I haven't had a problem with and is
> my own fault and intention given I want the MAKESYSPATH from local
> checkout!
>

If you haven't made a commit yet, I'd be keen on reviewing the change.

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

svn commit: r289049 - stable/10/release

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 18:33:47 2015
New Revision: 289049
URL: https://svnweb.freebsd.org/changeset/base/289049

Log:
  Direct commit to fix warnings with fmake when building from top-level.
  
  The top-level Makefile.inc1 uses 'make -C release -V' to lookup revision
  information, which causes Makefile.vm and Makefile.vagrant to be included.
  
  fmake has 2 issues here:
  
1. It doesn't like the empty result of .if ${VAR:Mfoo}
2. It doesn't like .if ${loop_item} ==

Modified:
  stable/10/release/Makefile.vagrant

Modified: stable/10/release/Makefile.vagrant
==
--- stable/10/release/Makefile.vagrant  Thu Oct  8 18:02:50 2015
(r289048)
+++ stable/10/release/Makefile.vagrant  Thu Oct  8 18:33:47 2015
(r289049)
@@ -24,7 +24,7 @@ VAGRANT_VERSION!= date +%Y.%m.%d
 VAGRANT_TARGET:=   ${OSRELEASE}${SNAPSHOT_DATE}
 .if !empty(CLOUDWARE)
 . for _PROVIDER in ${CLOUDWARE}
-.  if ${_PROVIDER:MVAGRANT*}
+.  if !empty(${_PROVIDER:MVAGRANT*})
 VAGRANT_PROVIDERS+=${_PROVIDER:S/VAGRANT-//:tl}
 .  endif
 . endfor
@@ -61,19 +61,19 @@ ${PROVIDER}:
 ${VAGRANT_TARGET}.${PROVIDER}.box: ${PROVIDER} cw-vagrant-${PROVIDER} 
vagrant-create-${PROVIDER}-metadata
@echo "==> PACKAGING: ${VAGRANT_TARGET}.${PROVIDER}.box in `pwd`"
@cp vagrant-${PROVIDER}.vmdk ${PROVIDER}/vagrant.vmdk
-. if ${PROVIDER} == "virtualbox"
+. if !empty(${PROVIDER:Mvirtualbox})
@(cd ${.OBJDIR}/${PROVIDER} && echo '{"provider":"${PROVIDER}"}' > 
metadata.json)
@(cd ${.OBJDIR}/${PROVIDER} && tar -czf 
../${VAGRANT_TARGET}.${PROVIDER}.box metadata.json box.ovf vagrant.vmdk)
-. elif ${PROVIDER} == "vmware"
+. elif !empty(${PROVIDER:Mvmware})
@(cd ${.OBJDIR}/${PROVIDER} && echo 
'{"provider":"${PROVIDER}_desktop"}' > metadata.json)
@(cd ${.OBJDIR}/${PROVIDER} && tar -czf 
../${VAGRANT_TARGET}.${PROVIDER}.box metadata.json vagrant.vmx vagrant.vmdk)
 . endif
 
 CLEANFILES+=   vagrant-do-upload-${PROVIDER}
 vagrant-do-upload-${PROVIDER}: ${VAGRANT_TARGET}.${PROVIDER}.box
-. if ${PROVIDER} == "virtualbox"
+. if !empty(${PROVIDER:Mvirtualbox})
${.CURDIR}/scripts/atlas-upload.sh -b ${TYPE}-${REVISION}-${BRANCH} -f 
${VAGRANT_TARGET}.${PROVIDER}.box -p ${PROVIDER} -k ${VAGRANT_KEY} -u 
${VAGRANT_USERNAME} -v ${VAGRANT_VERSION}
-. elif ${PROVIDER} == "vmware"
+. elif !empty(${PROVIDER:Mvmware})
${.CURDIR}/scripts/atlas-upload.sh -b ${TYPE}-${REVISION}-${BRANCH} -f 
${VAGRANT_TARGET}.${PROVIDER}.box -p ${PROVIDER}_desktop -k ${VAGRANT_KEY} -u 
${VAGRANT_USERNAME} -v ${VAGRANT_VERSION}
 . endif
touch ${.OBJDIR}/${.TARGET}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289047 - stable/10/contrib/libcxxrt

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 18:02:43 2015
New Revision: 289047
URL: https://svnweb.freebsd.org/changeset/base/289047

Log:
  MFC r288238:
  
MFV c3ccd112: Correct off-by-ones in free_exception of emergency buffer

Modified:
  stable/10/contrib/libcxxrt/exception.cc
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/libcxxrt/exception.cc
==
--- stable/10/contrib/libcxxrt/exception.cc Thu Oct  8 18:01:56 2015
(r289046)
+++ stable/10/contrib/libcxxrt/exception.cc Thu Oct  8 18:02:43 2015
(r289047)
@@ -516,7 +516,7 @@ static void emergency_malloc_free(char *
break;
}
}
-   assert(buffer > 0 &&
+   assert(buffer >= 0 &&
   "Trying to free something that is not an emergency buffer!");
// emergency_malloc() is expected to return 0-initialized data.  We 
don't
// zero the buffer when allocating it, because the static buffers will
@@ -556,7 +556,7 @@ static void free_exception(char *e)
 {
// If this allocation is within the address range of the emergency 
buffer,
// don't call free() because it was not allocated with malloc()
-   if ((e > emergency_buffer) &&
+   if ((e >= emergency_buffer) &&
(e < (emergency_buffer + sizeof(emergency_buffer
{
emergency_malloc_free(e);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289048 - stable/9/contrib/libcxxrt

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 18:02:50 2015
New Revision: 289048
URL: https://svnweb.freebsd.org/changeset/base/289048

Log:
  MFC r288238:
  
MFV c3ccd112: Correct off-by-ones in free_exception of emergency buffer

Modified:
  stable/9/contrib/libcxxrt/exception.cc
Directory Properties:
  stable/9/contrib/libcxxrt/   (props changed)

Modified: stable/9/contrib/libcxxrt/exception.cc
==
--- stable/9/contrib/libcxxrt/exception.cc  Thu Oct  8 18:02:43 2015
(r289047)
+++ stable/9/contrib/libcxxrt/exception.cc  Thu Oct  8 18:02:50 2015
(r289048)
@@ -516,7 +516,7 @@ static void emergency_malloc_free(char *
break;
}
}
-   assert(buffer > 0 &&
+   assert(buffer >= 0 &&
   "Trying to free something that is not an emergency buffer!");
// emergency_malloc() is expected to return 0-initialized data.  We 
don't
// zero the buffer when allocating it, because the static buffers will
@@ -556,7 +556,7 @@ static void free_exception(char *e)
 {
// If this allocation is within the address range of the emergency 
buffer,
// don't call free() because it was not allocated with malloc()
-   if ((e > emergency_buffer) &&
+   if ((e >= emergency_buffer) &&
(e < (emergency_buffer + sizeof(emergency_buffer
{
emergency_malloc_free(e);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289046 - stable/9/share/man/man9

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 18:01:56 2015
New Revision: 289046
URL: https://svnweb.freebsd.org/changeset/base/289046

Log:
  MFC r288271:
  
Document bus_get_resource(9).

Added:
  stable/9/share/man/man9/bus_get_resource.9
 - copied unchanged from r288271, head/share/man/man9/bus_get_resource.9
Modified:
  stable/9/share/man/man9/Makefile
Directory Properties:
  stable/9/share/man/man9/   (props changed)

Modified: stable/9/share/man/man9/Makefile
==
--- stable/9/share/man/man9/MakefileThu Oct  8 18:01:14 2015
(r289045)
+++ stable/9/share/man/man9/MakefileThu Oct  8 18:01:56 2015
(r289046)
@@ -38,6 +38,7 @@ MAN=  accept_filter.9 \
bus_generic_print_child.9 \
bus_generic_read_ivar.9 \
bus_generic_shutdown.9 \
+   bus_get_resource.9 \
BUS_NEW_PASS.9 \
BUS_PRINT_CHILD.9 \
BUS_READ_IVAR.9 \

Copied: stable/9/share/man/man9/bus_get_resource.9 (from r288271, 
head/share/man/man9/bus_get_resource.9)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/share/man/man9/bus_get_resource.9  Thu Oct  8 18:01:56 2015
(r289046, copy of r288271, head/share/man/man9/bus_get_resource.9)
@@ -0,0 +1,94 @@
+.\"
+.\" Copyright (c) 2008
+.\"The DragonFly Project.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in
+.\"the documentation and/or other materials provided with the
+.\"distribution.
+.\" 3. Neither the name of The DragonFly Project nor the names of its
+.\"contributors may be used to endorse or promote products derived
+.\"from this software without specific, prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
+.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $DragonFly: src/share/man/man9/bus_get_resource.9,v 1.1 2008/11/09 
09:48:41 swildner Exp $
+.\" $FreeBSD$
+.\"
+.Dd September 26, 2015
+.Dt BUS_GET_RESOURCE 9
+.Os
+.Sh NAME
+.Nm bus_get_resource
+.Nd "read a resource range/value with a given resource ID"
+.Sh SYNOPSIS
+.In sys/param.h
+.In sys/bus.h
+.In sys/rman.h
+.Ft int
+.Fo bus_get_resource
+.Fa "device_t dev" "int type" "int rid" "u_long *startp" "u_long *countp"
+.Fc
+.Sh DESCRIPTION
+The
+.Fn bus_get_resource
+function reads the range or value of the resource
+.Fa type , rid
+pair and stores it in the
+.Fa startp
+and
+.Fa countp
+arguments.
+.Pp
+The arguments are as follows:
+.Bl -tag -width ".Fa startp"
+.It Fa dev
+The device to read the resource from.
+.It Fa type
+The type of resource you want to read.
+It is one of:
+.Pp
+.Bl -tag -width ".Dv SYS_RES_MEMORY" -compact
+.It Dv SYS_RES_IRQ
+for IRQs
+.It Dv SYS_RES_DRQ
+for ISA DMA lines
+.It Dv SYS_RES_MEMORY
+for I/O memory
+.It Dv SYS_RES_IOPORT
+for I/O ports
+.El
+.It Fa rid
+A bus-specific handle that identifies the resource being read.
+.It Fa startp
+A pointer to the start address of this resource.
+.It Fa countp
+A pointer to the length of the resource.
+For example, the size of the memory in bytes.
+.El
+.Sh RETURN VALUES
+Zero is returned on success, otherwise an error is returned.
+.Sh SEE ALSO
+.Xr bus_set_resource 9 ,
+.Xr device 9 ,
+.Xr driver 9
+.Sh AUTHORS
+This manual page was written by
+.An Sascha Wildner .
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289045 - stable/10/share/man/man9

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 18:01:14 2015
New Revision: 289045
URL: https://svnweb.freebsd.org/changeset/base/289045

Log:
  MFC r288271:
  
Document bus_get_resource(9).

Added:
  stable/10/share/man/man9/bus_get_resource.9
 - copied unchanged from r288271, head/share/man/man9/bus_get_resource.9
Modified:
  stable/10/share/man/man9/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man9/Makefile
==
--- stable/10/share/man/man9/Makefile   Thu Oct  8 17:59:05 2015
(r289044)
+++ stable/10/share/man/man9/Makefile   Thu Oct  8 18:01:14 2015
(r289045)
@@ -39,6 +39,7 @@ MAN=  accept_filter.9 \
bus_generic_print_child.9 \
bus_generic_read_ivar.9 \
bus_generic_shutdown.9 \
+   bus_get_resource.9 \
BUS_NEW_PASS.9 \
BUS_PRINT_CHILD.9 \
BUS_READ_IVAR.9 \

Copied: stable/10/share/man/man9/bus_get_resource.9 (from r288271, 
head/share/man/man9/bus_get_resource.9)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/share/man/man9/bus_get_resource.9 Thu Oct  8 18:01:14 2015
(r289045, copy of r288271, head/share/man/man9/bus_get_resource.9)
@@ -0,0 +1,94 @@
+.\"
+.\" Copyright (c) 2008
+.\"The DragonFly Project.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in
+.\"the documentation and/or other materials provided with the
+.\"distribution.
+.\" 3. Neither the name of The DragonFly Project nor the names of its
+.\"contributors may be used to endorse or promote products derived
+.\"from this software without specific, prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
+.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $DragonFly: src/share/man/man9/bus_get_resource.9,v 1.1 2008/11/09 
09:48:41 swildner Exp $
+.\" $FreeBSD$
+.\"
+.Dd September 26, 2015
+.Dt BUS_GET_RESOURCE 9
+.Os
+.Sh NAME
+.Nm bus_get_resource
+.Nd "read a resource range/value with a given resource ID"
+.Sh SYNOPSIS
+.In sys/param.h
+.In sys/bus.h
+.In sys/rman.h
+.Ft int
+.Fo bus_get_resource
+.Fa "device_t dev" "int type" "int rid" "u_long *startp" "u_long *countp"
+.Fc
+.Sh DESCRIPTION
+The
+.Fn bus_get_resource
+function reads the range or value of the resource
+.Fa type , rid
+pair and stores it in the
+.Fa startp
+and
+.Fa countp
+arguments.
+.Pp
+The arguments are as follows:
+.Bl -tag -width ".Fa startp"
+.It Fa dev
+The device to read the resource from.
+.It Fa type
+The type of resource you want to read.
+It is one of:
+.Pp
+.Bl -tag -width ".Dv SYS_RES_MEMORY" -compact
+.It Dv SYS_RES_IRQ
+for IRQs
+.It Dv SYS_RES_DRQ
+for ISA DMA lines
+.It Dv SYS_RES_MEMORY
+for I/O memory
+.It Dv SYS_RES_IOPORT
+for I/O ports
+.El
+.It Fa rid
+A bus-specific handle that identifies the resource being read.
+.It Fa startp
+A pointer to the start address of this resource.
+.It Fa countp
+A pointer to the length of the resource.
+For example, the size of the memory in bytes.
+.El
+.Sh RETURN VALUES
+Zero is returned on success, otherwise an error is returned.
+.Sh SEE ALSO
+.Xr bus_set_resource 9 ,
+.Xr device 9 ,
+.Xr driver 9
+.Sh AUTHORS
+This manual page was written by
+.An Sascha Wildner .
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289044 - head/lib/libstand

2015-10-08 Thread Marcel Moolenaar
Author: marcel
Date: Thu Oct  8 17:59:05 2015
New Revision: 289044
URL: https://svnweb.freebsd.org/changeset/base/289044

Log:
  If we can't open the file, skip devclose() for the exclusive_file_system
  case. We never called devopen(), so we know there's nothing to close.

Modified:
  head/lib/libstand/open.c

Modified: head/lib/libstand/open.c
==
--- head/lib/libstand/open.cThu Oct  8 17:55:53 2015(r289043)
+++ head/lib/libstand/open.cThu Oct  8 17:59:05 2015(r289044)
@@ -114,7 +114,7 @@ open(const char *fname, int mode)
error = (fs->fo_open)(fname, f);
if (error == 0)
goto ok;
-   goto fail;
+   goto err;
 }
 
 error = devopen(f, fname, &file);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289043 - stable/10/share/mk

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 17:55:53 2015
New Revision: 289043
URL: https://svnweb.freebsd.org/changeset/base/289043

Log:
  MFC r284408:
  
Ensure TESTSDIR is defined before bsd.test.mk is .include'd

Modified:
  stable/10/share/mk/bsd.test.mk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/bsd.test.mk
==
--- stable/10/share/mk/bsd.test.mk  Thu Oct  8 17:49:14 2015
(r289042)
+++ stable/10/share/mk/bsd.test.mk  Thu Oct  8 17:55:53 2015
(r289043)
@@ -10,6 +10,10 @@
 
 :
 
+.ifndef TESTSDIR
+.error "Please define TESTSDIR when including bsd.test.mk"
+.endif
+
 # List of subdirectories containing tests into which to recurse.  This has the
 # same semantics as SUBDIR at build-time.  However, the directories listed here
 # get registered into the run-time test suite definitions so that the test
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289042 - in stable/10/kerberos5: libexec/kdigest usr.bin/hxtool usr.bin/kadmin usr.bin/kcc usr.sbin/iprop-log usr.sbin/ktutil

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 17:49:14 2015
New Revision: 289042
URL: https://svnweb.freebsd.org/changeset/base/289042

Log:
  MFC r288198,r288200:
  
r288198:
  Remove unneeded dependency line.
r288200:
  Remove unneeded dependency of '.o: .h' that bsd.prog.mk already handles.

Modified:
  stable/10/kerberos5/libexec/kdigest/Makefile
  stable/10/kerberos5/usr.bin/hxtool/Makefile
  stable/10/kerberos5/usr.bin/kadmin/Makefile
  stable/10/kerberos5/usr.bin/kcc/Makefile
  stable/10/kerberos5/usr.sbin/iprop-log/Makefile
  stable/10/kerberos5/usr.sbin/ktutil/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/kerberos5/libexec/kdigest/Makefile
==
--- stable/10/kerberos5/libexec/kdigest/MakefileThu Oct  8 17:48:49 
2015(r289041)
+++ stable/10/kerberos5/libexec/kdigest/MakefileThu Oct  8 17:49:14 
2015(r289042)
@@ -18,9 +18,7 @@ CLEANFILES=   kdigest-commands.h kdigest-c
 kdigest-commands.h: kdigest-commands.in
${SLC} ${.ALLSRC:M*.in}
 
-.for ext in c o
-kdigest-commands.${ext}: kdigest-commands.h
-.endfor
+kdigest-commands.c: kdigest-commands.h
 
 .include 
 

Modified: stable/10/kerberos5/usr.bin/hxtool/Makefile
==
--- stable/10/kerberos5/usr.bin/hxtool/Makefile Thu Oct  8 17:48:49 2015
(r289041)
+++ stable/10/kerberos5/usr.bin/hxtool/Makefile Thu Oct  8 17:49:14 2015
(r289042)
@@ -15,9 +15,7 @@ CLEANFILES=   hxtool-commands.h hxtool-com
 hxtool-commands.h: hxtool-commands.in
${SLC} ${.ALLSRC:M*.in}
 
-.for ext in c o
-hxtool-commands.${ext}: hxtool-commands.h
-.endfor
+hxtool-commands.c: hxtool-commands.h
 
 .include 
 

Modified: stable/10/kerberos5/usr.bin/kadmin/Makefile
==
--- stable/10/kerberos5/usr.bin/kadmin/Makefile Thu Oct  8 17:48:49 2015
(r289041)
+++ stable/10/kerberos5/usr.bin/kadmin/Makefile Thu Oct  8 17:49:14 2015
(r289042)
@@ -43,9 +43,7 @@ CLEANFILES=   kadmin-commands.h kadmin-com
 kadmin-commands.h: ${KRB5DIR}/kadmin/kadmin-commands.in
${SLC} ${.ALLSRC:M*.in}
 
-.for ext in o c
-kadmin-commands.${ext}: kadmin-commands.h
-.endfor
+kadmin-commands.c: kadmin-commands.h
 
 .PATH: ${KRB5DIR}/kadmin
 

Modified: stable/10/kerberos5/usr.bin/kcc/Makefile
==
--- stable/10/kerberos5/usr.bin/kcc/MakefileThu Oct  8 17:48:49 2015
(r289041)
+++ stable/10/kerberos5/usr.bin/kcc/MakefileThu Oct  8 17:49:14 2015
(r289042)
@@ -24,9 +24,7 @@ CLEANFILES=   kcc-commands.h kcc-commands.
 kcc-commands.h: kcc-commands.in
${SLC} ${.ALLSRC:M*.in}
 
-.for ext in c o
-kcc-commands.${ext}: kcc-commands.h
-.endfor
+kcc-commands.c: kcc-commands.h
 
 .include 
 

Modified: stable/10/kerberos5/usr.sbin/iprop-log/Makefile
==
--- stable/10/kerberos5/usr.sbin/iprop-log/Makefile Thu Oct  8 17:48:49 
2015(r289041)
+++ stable/10/kerberos5/usr.sbin/iprop-log/Makefile Thu Oct  8 17:49:14 
2015(r289042)
@@ -19,9 +19,7 @@ CLEANFILES=   iprop-commands.h iprop-comma
 iprop-commands.h: iprop-commands.in
${SLC} ${.ALLSRC:M*.in}
 
-.for ext in c o
-iprop-commands.${ext}: iprop-commands.h
-.endfor
+iprop-commands.c: iprop-commands.h
 
 .include 
 

Modified: stable/10/kerberos5/usr.sbin/ktutil/Makefile
==
--- stable/10/kerberos5/usr.sbin/ktutil/MakefileThu Oct  8 17:48:49 
2015(r289041)
+++ stable/10/kerberos5/usr.sbin/ktutil/MakefileThu Oct  8 17:49:14 
2015(r289042)
@@ -29,8 +29,6 @@ CLEANFILES=   ktutil-commands.h ktutil-com
 ktutil-commands.h: ${KRB5DIR}/admin/ktutil-commands.in
${SLC} ${.ALLSRC:M*.in}
 
-.for ext in c o
-ktutil-commands.${ext}: ktutil-commands.h
-.endfor
+ktutil-commands.c: ktutil-commands.h
 
 .PATH: ${KRB5DIR}/admin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289041 - head/share/timedef

2015-10-08 Thread Xin LI
Author: delphij
Date: Thu Oct  8 17:48:49 2015
New Revision: 289041
URL: https://svnweb.freebsd.org/changeset/base/289041

Log:
  Fix short month names and replace %b with %_m in date_fmt for Chinese
  locales.
  
  When using a Chinese locale, such as zh_TW.UTF-8 or zh_CN.UTF-8,
  nl_langinfo(ABMON_*) only returned numbers.  For instance,
  nl_langinfo(ABMON_1) returns 1, nl_langinfo(ABMON_2) returns 2, and
  so on.
  
  This causes problems in applications that put the short month name
  and the day of the month together.  For example, 'Apr 14' in English
  becomes '414日' in Chinese on the top bar of GNOME Shell.
  
  This problem may be resolved by appending '月' to all short month
  names and replacing %b with %_m in date_fmt. ja_JP.UTF-8 already
  does this, and this matches the en_US.ISO8859-1 behavior, which
  returns 'Oct'.  The GNU C Library also returns values with '月'
  appended.
  
  PR:   199441
  Submitted by: Ting-Wei Lan 
  MFC after:2 weeks

Modified:
  head/share/timedef/zh_CN.GB18030.src
  head/share/timedef/zh_CN.GB2312.src
  head/share/timedef/zh_CN.UTF-8.src   (contents, props changed)
  head/share/timedef/zh_CN.eucCN.src
  head/share/timedef/zh_TW.Big5.src
  head/share/timedef/zh_TW.UTF-8.src

Modified: head/share/timedef/zh_CN.GB18030.src
==
--- head/share/timedef/zh_CN.GB18030.srcThu Oct  8 17:45:03 2015
(r289040)
+++ head/share/timedef/zh_CN.GB18030.srcThu Oct  8 17:48:49 2015
(r289041)
@@ -5,18 +5,18 @@
 #
 # Short month names
 #
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1��
+ 2��
+ 3��
+ 4��
+ 5��
+ 6��
+ 7��
+ 8��
+ 9��
+10��
+11��
+12��
 #
 # Long month names (as in a date)
 #
@@ -75,7 +75,7 @@
 #
 # date_fmt
 #
-%Y��%b��%e�� %A %X %Z
+%Y��%_m��%e�� %A %X %Z
 #
 # Long month names (without case ending)
 #

Modified: head/share/timedef/zh_CN.GB2312.src
==
--- head/share/timedef/zh_CN.GB2312.src Thu Oct  8 17:45:03 2015
(r289040)
+++ head/share/timedef/zh_CN.GB2312.src Thu Oct  8 17:48:49 2015
(r289041)
@@ -5,18 +5,18 @@
 #
 # Short month names
 #
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1��
+ 2��
+ 3��
+ 4��
+ 5��
+ 6��
+ 7��
+ 8��
+ 9��
+10��
+11��
+12��
 #
 # Long month names (as in a date)
 #
@@ -75,7 +75,7 @@
 #
 # date_fmt
 #
-%Y��%b��%e�� %A %X %Z
+%Y��%_m��%e�� %A %X %Z
 #
 # Long month names (without case ending)
 #

Modified: head/share/timedef/zh_CN.UTF-8.src
==
--- head/share/timedef/zh_CN.UTF-8.src  Thu Oct  8 17:45:03 2015
(r289040)
+++ head/share/timedef/zh_CN.UTF-8.src  Thu Oct  8 17:48:49 2015
(r289041)
@@ -5,18 +5,18 @@
 #
 # Short month names
 #
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1月
+ 2月
+ 3月
+ 4月
+ 5月
+ 6月
+ 7月
+ 8月
+ 9月
+10月
+11月
+12月
 #
 # Long month names (as in a date)
 #
@@ -75,7 +75,7 @@
 #
 # date_fmt
 #
-%Y年%b月%e日 %A %X %Z
+%Y年%_m月%e日 %A %X %Z
 #
 # Long month names (without case ending)
 #

Modified: head/share/timedef/zh_CN.eucCN.src
==
--- head/share/timedef/zh_CN.eucCN.src  Thu Oct  8 17:45:03 2015
(r289040)
+++ head/share/timedef/zh_CN.eucCN.src  Thu Oct  8 17:48:49 2015
(r289041)
@@ -5,18 +5,18 @@
 #
 # Short month names
 #
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1��
+ 2��
+ 3��
+ 4��
+ 5��
+ 6��
+ 7��
+ 8��
+ 9��
+10��
+11��
+12��
 #
 # Long month names (as in a date)
 #
@@ -75,7 +75,7 @@
 #
 # date_fmt
 #
-%Y��%b��%e�� %A %X %Z
+%Y��%_m��%e�� %A %X %Z
 #
 # Long month names (without case ending)
 #

Modified: head/share/timedef/zh_TW.Big5.src
==
--- head/share/timedef/zh_TW.Big5.src   Thu Oct  8 17:45:03 2015
(r289040)
+++ head/share/timedef/zh_TW.Big5.src   Thu Oct  8 17:48:49 2015
(r289041)
@@ -4,18 +4,18 @@
 # WARNING: empty lines are essential too
 #
 # Short month names
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1��
+ 2��
+ 3��
+ 4��
+ 5��
+ 6��
+ 7��
+ 8��
+ 9��
+10��
+11��
+12��
 #
 # Long month names (as in a date)
 #
@@ -74,7 +74,7 @@
 #
 # date_fmt
 #
-%Y�~%b��%e�� %A %X %Z
+%Y�~%_m��%e�� %A %X %Z
 #
 # Long month names (without case ending)
 #

Modified: head/share/timedef/zh_TW.UTF-8.src
==
--- head/share/timedef/zh_TW.UTF-8.src  Thu Oct  8 17:45:03 2015
(r289040)
+++ head/share/timedef/zh_TW.UTF-8.src  Thu Oct  8 17:48:49 2015
(r289041)
@@ -4,18 +4,18 @@
 # WARNING: empty lines are essential too
 #
 # Short month names
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1月
+ 2月
+ 3月
+ 4月
+ 5月
+ 6月
+ 7月
+ 8月
+ 9月
+10月
+11月
+12月
 #
 # Long month names (as in a date)
 #
@@ -74,7 +74,7 @@
 #
 # date_fmt
 #
-%Y年%b月%e日 %A 

svn commit: r289040 - stable/10/share/mk

2015-10-08 Thread Bryan Drewery
Author: bdrewery
Date: Thu Oct  8 17:45:03 2015
New Revision: 289040
URL: https://svnweb.freebsd.org/changeset/base/289040

Log:
  MFC r288179:
  
Fix running make in src directories without a Makefile giving confusing
errors.

Modified:
  stable/10/share/mk/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/Makefile
==
--- stable/10/share/mk/Makefile Thu Oct  8 17:42:08 2015(r289039)
+++ stable/10/share/mk/Makefile Thu Oct  8 17:45:03 2015(r289040)
@@ -1,6 +1,12 @@
 # $FreeBSD$
 #  @(#)Makefile8.1 (Berkeley) 6/8/93
 
+# Only parse this if executing make in this directory, not in other places
+# in src that lack a Makefile, such as sys/dev/*.  Otherwise the MAKESYSPATH
+# will read this Makefile since it auto includes it into -I.
+# Note that this guard only works for bmake.
+.if !defined(.PARSEDIR) || ${.CURDIR} == ${.PARSEDIR}
+
 .include 
 
 FILES= \
@@ -51,3 +57,4 @@ FILES+=   tap.test.mk
 .endif
 
 .include 
+.endif # CURDIR == PARSEDIR
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289039 - in head/sys: arm64/conf conf

2015-10-08 Thread Konstantin Belousov
Author: kib
Date: Thu Oct  8 17:42:08 2015
New Revision: 289039
URL: https://svnweb.freebsd.org/changeset/base/289039

Log:
  Build changes that allow the modules on arm64.
  - Move the required kernel compiler flags from Makefile.arm64 to kern.mk.
  - Build arm64 modules as PIC; non-PIC relocations in .o for shared object
output cannot be handled.
  - Do not try to install aarch64 symlink.
  - A hack for arm64 to avoid ld -r stage.  See the comment for the explanation.
Some functionality is lost, like ctf handling, but hopefully will be
restored after newer linker is available.
  
  Reviewed by:  andrew, emaste
  Tested by:andrew (on real hardware)
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D3796

Modified:
  head/sys/arm64/conf/GENERIC
  head/sys/conf/Makefile.arm64
  head/sys/conf/kern.mk
  head/sys/conf/kern.post.mk
  head/sys/conf/kmod.mk

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Thu Oct  8 17:41:17 2015(r289038)
+++ head/sys/arm64/conf/GENERIC Thu Oct  8 17:42:08 2015(r289039)
@@ -22,7 +22,6 @@ cpu   ARM64
 ident  GENERIC
 
 makeoptionsDEBUG=-g# Build kernel with gdb(1) debug symbols
-makeoptionsNO_MODULES=1# We don't yet support modules on arm64
 
 optionsSCHED_ULE   # ULE scheduler
 optionsPREEMPTION  # Enable kernel thread preemption

Modified: head/sys/conf/Makefile.arm64
==
--- head/sys/conf/Makefile.arm64Thu Oct  8 17:41:17 2015
(r289038)
+++ head/sys/conf/Makefile.arm64Thu Oct  8 17:42:08 2015
(r289039)
@@ -27,12 +27,6 @@ S=   ../../..
 
 INCLUDES+= -I$S/contrib/libfdt
 
-# We generally don't want fpu instructions in the kernel.
-CFLAGS += -mgeneral-regs-only
-
-# Reserve x18 for pcpu data
-CFLAGS += -ffixed-x18
-
 .if !empty(DDB_ENABLED)
 CFLAGS += -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
 .endif

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Thu Oct  8 17:41:17 2015(r289038)
+++ head/sys/conf/kern.mk   Thu Oct  8 17:42:08 2015(r289039)
@@ -97,6 +97,13 @@ INLINE_LIMIT?=   8000
 INLINE_LIMIT?= 8000
 .endif
 
+.if ${MACHINE_CPUARCH} == "aarch64"
+# We generally don't want fpu instructions in the kernel.
+CFLAGS += -mgeneral-regs-only
+# Reserve x18 for pcpu data
+CFLAGS += -ffixed-x18
+.endif
+
 #
 # For sparc64 we want the medany code model so modules may be located
 # anywhere in the 64-bit address space.  We also tell GCC to use floating

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Thu Oct  8 17:41:17 2015(r289038)
+++ head/sys/conf/kern.post.mk  Thu Oct  8 17:42:08 2015(r289039)
@@ -212,7 +212,7 @@ SRCS=   assym.s vnode_if.h ${BEFORE_DEPEND
mv .newdep .depend
 
 _ILINKS= machine
-.if ${MACHINE} != ${MACHINE_CPUARCH}
+.if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64"
 _ILINKS+= ${MACHINE_CPUARCH}
 .endif
 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Thu Oct  8 17:41:17 2015(r289038)
+++ head/sys/conf/kmod.mk   Thu Oct  8 17:42:08 2015(r289039)
@@ -113,6 +113,10 @@ CFLAGS+=   ${DEBUG_FLAGS}
 CFLAGS+=   -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
 .endif
 
+.if ${MACHINE_CPUARCH} == "aarch64"
+CFLAGS+=   -fPIC
+.endif
+
 # Temporary workaround for PR 196407, which contains the fascinating details.
 # Don't allow clang to use fpu instructions or registers in kernel modules.
 .if ${MACHINE_CPUARCH} == arm
@@ -182,7 +186,17 @@ ${PROG}.debug: ${FULLPROG}
 
 .if ${__KLD_SHARED} == yes
 ${FULLPROG}: ${KMOD}.kld
+.if ${MACHINE_CPUARCH} != "aarch64"
${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${KMOD}.kld
+.else
+#XXXKIB Relocatable linking in aarch64 ld from binutils 2.25.1 does
+#   not work.  The linker corrupts the references to the external
+#   symbols which are defined by other object in the linking set
+#   and should therefore loose the GOT entry.  The problem seems
+#   to be fixed in the binutils-gdb git HEAD as of 2015-10-04.  Hack
+#   below allows to get partially functioning modules for now.
+   ${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${OBJS}
+.endif
 .if !defined(DEBUG_FLAGS)
${OBJCOPY} --strip-debug ${.TARGET}
 .endif
@@ -220,7 +234,7 @@ ${FULLPROG}: ${OBJS}
 .endif
 
 _ILINKS=machine
-.if ${MACHINE} != ${MACHINE_CPUARCH}
+.if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64"

svn commit: r289038 - head/share/timedef

2015-10-08 Thread Xin LI
Author: delphij
Date: Thu Oct  8 17:41:17 2015
New Revision: 289038
URL: https://svnweb.freebsd.org/changeset/base/289038

Log:
  Add encoding for mime-types.
  
  MFC after:2 weeks

Modified:
Directory Properties:
  head/share/timedef/zh_CN.GB18030.src   (props changed)
  head/share/timedef/zh_CN.GB2312.src   (props changed)
  head/share/timedef/zh_CN.UTF-8.src   (props changed)
  head/share/timedef/zh_CN.eucCN.src   (props changed)
  head/share/timedef/zh_TW.Big5.src   (props changed)
  head/share/timedef/zh_TW.UTF-8.src   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289037 - head/sys/modules

2015-10-08 Thread Konstantin Belousov
Author: kib
Date: Thu Oct  8 17:32:45 2015
New Revision: 289037
URL: https://svnweb.freebsd.org/changeset/base/289037

Log:
  Disable syscons and vpo modules for arm64.
  
  Reviewed by:  andrew, emaste
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D3796

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Thu Oct  8 17:32:17 2015(r289036)
+++ head/sys/modules/Makefile   Thu Oct  8 17:32:45 2015(r289037)
@@ -479,8 +479,8 @@ _txp=   txp
 _cxgbe=cxgbe
 .endif
 
-.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" && \
-   ${MACHINE_CPUARCH} != "powerpc"
+.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
+   ${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc"
 _syscons=  syscons
 _vpo=  vpo
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289036 - head/sys/dev/sym

2015-10-08 Thread Konstantin Belousov
Author: kib
Date: Thu Oct  8 17:32:17 2015
New Revision: 289036
URL: https://svnweb.freebsd.org/changeset/base/289036

Log:
  Add the arm64 define.
  
  Reviewed by:  andrew, emaste
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D3796

Modified:
  head/sys/dev/sym/sym_hipd.c

Modified: head/sys/dev/sym/sym_hipd.c
==
--- head/sys/dev/sym/sym_hipd.c Thu Oct  8 16:58:01 2015(r289035)
+++ head/sys/dev/sym/sym_hipd.c Thu Oct  8 17:32:17 2015(r289036)
@@ -136,6 +136,8 @@ typedef u_int32_t u32;
 #define MEMORY_BARRIER()   __asm__ volatile("membar #Sync" : : : "memory")
 #elif  defined __arm__
 #define MEMORY_BARRIER()   dmb()
+#elif  defined __aarch64__
+#define MEMORY_BARRIER()   dmb(sy)
 #else
 #error "Not supported platform"
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289033 - in head/sys: amd64/include/xen conf dev/xen/console i386/include/xen xen

2015-10-08 Thread Roger Pau Monné
Author: royger
Date: Thu Oct  8 16:39:43 2015
New Revision: 289033
URL: https://svnweb.freebsd.org/changeset/base/289033

Log:
  xen/console: Introduce a new console driver for Xen guest
  
  The current Xen console driver is crashing very quickly when using it on
  an ARM guest. This is because the console lock is recursive and it may
  lead to recursion on the tty lock and/or corrupt the ring pointer.
  
  Furthermore, the console lock is not always taken where it should be and has
  to be released too early because of the way the console has been designed.
  
  Over the years, code has been modified to support various new features but
  the driver has not been reworked.
  
  This new driver has been rewritten with the idea of only having a small set
  of specific function to write either via the shared ring or the hypercall
  interface.
  
  Note that HVM support has been left aside for now because it requires
  additional features which are not yet supported. A follow-up patch will be
  sent with HVM guest support.
  
  List of items that may be good to have but not mandatory:
   - Avoid to flush for each character written when using the tty
   - Support multiple consoles
  
  Submitted by: Julien Grall 
  Reviewed by:  royger
  Differential Revision:https://reviews.freebsd.org/D3698
  Sponsored by: Citrix Systems R&D

Added:
  head/sys/dev/xen/console/xen_console.c   (contents, props changed)
Deleted:
  head/sys/dev/xen/console/console.c
  head/sys/dev/xen/console/xencons_ring.c
  head/sys/dev/xen/console/xencons_ring.h
Modified:
  head/sys/amd64/include/xen/hypercall.h
  head/sys/conf/files
  head/sys/i386/include/xen/hypercall.h
  head/sys/xen/hypervisor.h

Modified: head/sys/amd64/include/xen/hypercall.h
==
--- head/sys/amd64/include/xen/hypercall.h  Thu Oct  8 15:48:44 2015
(r289032)
+++ head/sys/amd64/include/xen/hypercall.h  Thu Oct  8 16:39:43 2015
(r289033)
@@ -308,7 +308,7 @@ HYPERVISOR_xen_version(
 
 static inline int __must_check
 HYPERVISOR_console_io(
-   int cmd, unsigned int count, char *str)
+   int cmd, unsigned int count, const char *str)
 {
return _hypercall3(int, console_io, cmd, count, str);
 }

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Oct  8 15:48:44 2015(r289032)
+++ head/sys/conf/files Thu Oct  8 16:39:43 2015(r289033)
@@ -2853,8 +2853,7 @@ dev/xe/if_xe_pccard.c optional xe pccar
 dev/xen/balloon/balloon.c  optional xenhvm
 dev/xen/blkfront/blkfront.coptional xenhvm
 dev/xen/blkback/blkback.c  optional xenhvm
-dev/xen/console/console.c  optional xenhvm
-dev/xen/console/xencons_ring.c optional xenhvm
+dev/xen/console/xen_console.c  optional xenhvm
 dev/xen/control/control.c  optional xenhvm
 dev/xen/grant_table/grant_table.c  optional xenhvm
 dev/xen/netback/netback.c  optional xenhvm

Added: head/sys/dev/xen/console/xen_console.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/xen/console/xen_console.c  Thu Oct  8 16:39:43 2015
(r289033)
@@ -0,0 +1,797 @@
+/*
+ * Copyright (c) 2015 Julien Grall 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#i

svn commit: r289035 - head/sys/arm64/arm64

2015-10-08 Thread Konstantin Belousov
Author: kib
Date: Thu Oct  8 16:58:01 2015
New Revision: 289035
URL: https://svnweb.freebsd.org/changeset/base/289035

Log:
  Implement in-kernel relocator for the arm64 module linker.
  
  It is decided to go with the shared object file format for modules on
  arm64, due to the Aarch64 instruction set details.  Combination of the
  signed 28-bit offset in the branch instructions encoding together with
  the supported memory model of compilers makes the relocatable object
  support impossible or at least too hard.
  
  Reviewed by:  andrew, emaste
  Tested by:andrew (on real hardware)
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D3796

Modified:
  head/sys/arm64/arm64/elf_machdep.c

Modified: head/sys/arm64/arm64/elf_machdep.c
==
--- head/sys/arm64/arm64/elf_machdep.c  Thu Oct  8 16:46:11 2015
(r289034)
+++ head/sys/arm64/arm64/elf_machdep.c  Thu Oct  8 16:58:01 2015
(r289035)
@@ -1,11 +1,14 @@
 /*-
- * Copyright (c) 2014 The FreeBSD Foundation.
+ * Copyright (c) 2014, 2015 The FreeBSD Foundation.
  * Copyright (c) 2014 Andrew Turner.
  * All rights reserved.
  *
  * This software was developed by Andrew Turner under
  * sponsorship from the FreeBSD Foundation.
  *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -124,12 +127,66 @@ elf64_dump_thread(struct thread *td __un
 
 }
 
+static int
+elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data,
+int type, int local, elf_lookup_fn lookup)
+{
+   Elf_Addr *where, addr, addend;
+   Elf_Word rtype, symidx;
+   const Elf_Rel *rel;
+   const Elf_Rela *rela;
+   int error;
+
+   switch (type) {
+   case ELF_RELOC_REL:
+   rel = (const Elf_Rel *)data;
+   where = (Elf_Addr *) (relocbase + rel->r_offset);
+   addend = *where;
+   rtype = ELF_R_TYPE(rel->r_info);
+   symidx = ELF_R_SYM(rel->r_info);
+   break;
+   case ELF_RELOC_RELA:
+   rela = (const Elf_Rela *)data;
+   where = (Elf_Addr *) (relocbase + rela->r_offset);
+   addend = rela->r_addend;
+   rtype = ELF_R_TYPE(rela->r_info);
+   symidx = ELF_R_SYM(rela->r_info);
+   break;
+   default:
+   panic("unknown reloc type %d\n", type);
+   }
+
+   if (local) {
+   if (rtype == R_AARCH64_RELATIVE)
+   *where = elf_relocaddr(lf, relocbase + addend);
+   return (0);
+   }
+
+   switch (rtype) {
+   case R_AARCH64_NONE:
+   case R_AARCH64_RELATIVE:
+   break;
+   case R_AARCH64_ABS64:
+   case R_AARCH64_GLOB_DAT:
+   case R_AARCH64_JUMP_SLOT:
+   error = lookup(lf, symidx, 1, &addr);
+   if (error != 0)
+   return (-1);
+   *where = addr + addend;
+   break;
+   default:
+   printf("kldload: unexpected relocation type %d\n", rtype);
+   return (-1);
+   }
+   return (0);
+}
+
 int
 elf_reloc_local(linker_file_t lf, Elf_Addr relocbase, const void *data,
-int type, elf_lookup_fn lookup __unused)
+int type, elf_lookup_fn lookup)
 {
 
-   panic("ARM64TODO: elf_reloc_local");
+   return (elf_reloc_internal(lf, relocbase, data, type, 1, lookup));
 }
 
 /* Process one elf relocation with addend. */
@@ -138,13 +195,15 @@ elf_reloc(linker_file_t lf, Elf_Addr rel
 elf_lookup_fn lookup)
 {
 
-   panic("ARM64TODO: elf_reloc");
+   return (elf_reloc_internal(lf, relocbase, data, type, 0, lookup));
 }
 
 int
-elf_cpu_load_file(linker_file_t lf __unused)
+elf_cpu_load_file(linker_file_t lf)
 {
 
+   if (lf->id != 1)
+   cpu_icache_sync_range((vm_offset_t)lf->address, lf->size);
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289034 - head/sys/arm64/arm64

2015-10-08 Thread Konstantin Belousov
Author: kib
Date: Thu Oct  8 16:46:11 2015
New Revision: 289034
URL: https://svnweb.freebsd.org/changeset/base/289034

Log:
  Make the copyright notice in the file to match reality.  Use the
  recommended FreeBSD license text.
  
  Approved by:  andrew
  Discussed with:   emaste
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D3846

Modified:
  head/sys/arm64/arm64/elf_machdep.c

Modified: head/sys/arm64/arm64/elf_machdep.c
==
--- head/sys/arm64/arm64/elf_machdep.c  Thu Oct  8 16:39:43 2015
(r289033)
+++ head/sys/arm64/arm64/elf_machdep.c  Thu Oct  8 16:46:11 2015
(r289034)
@@ -1,14 +1,8 @@
 /*-
  * Copyright (c) 2014 The FreeBSD Foundation.
  * Copyright (c) 2014 Andrew Turner.
- * Copyright (c) 2001 Jake Burkholder.
- * Copyright (c) 2000 Eduardo Horvath.
- * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Paul Kranenburg.
- *
  * This software was developed by Andrew Turner under
  * sponsorship from the FreeBSD Foundation.
  *
@@ -21,19 +15,17 @@
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * from: NetBSD: mdreloc.c,v 1.42 2008/04/28 20:23:04 martin Exp
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  */
 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289027 - head/contrib/tzcode/stdtime

2015-10-08 Thread Bryan Drewery
On 10/8/15 5:51 AM, Andriy Gapon wrote:
> On 08/10/2015 14:42, Craig Rodrigues wrote:
>> Author: rodrigc
>> Date: Thu Oct  8 11:42:15 2015
>> New Revision: 289027
>> URL: https://svnweb.freebsd.org/changeset/base/289027
>>
>> Log:
>>   Merge:
>>  commit 400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd
>>  Author: Paul Eggert 
>>  Date:   Fri Oct 12 07:53:12 2012 -0700
>>   
>>  Assume C89.
>>   
>>   
>> https://github.com/eggert/tz/commit/400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd
> 
> What if one day github disappears but FreeBSD is still going?
> The full commit message would be lost.
> 

The same could be said for _every_ "Obtained from" commit.  We reference
NetBSD CVS revisions for example.  We even have FreeBSD CVS revision
references in our SVN logs that are useless now.

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


Re: svn commit: r289027 - head/contrib/tzcode/stdtime

2015-10-08 Thread David Chisnall
On 8 Oct 2015, at 13:51, Andriy Gapon  wrote:
> 
> What if one day github disappears but FreeBSD is still going?
> The full commit message would be lost.

That’s not the only thing that is bad about this commit message.  Why ‘Assume 
C89?’  We compile libc as C99 + GNU extensions and are likely to default to C11 
+ GNU extensions soon.  Reading the actual commit, it looks as if it’s changing 
K&R declarations to ISO C declarations.  

It’s also introducing an ATTRIBUTE_PURE macro in private.h, which does exactly 
the same as __pure declared in sys/cdefs.h (which is included by *every single 
FreeBSD header*.  Why this extra spelling?  No idea.  Is this contrib code (it 
looks like it)?  If so, it should come in via the vendor area (not be directly 
committed to head), if not then it should have been code reviewed and not 
include redundant and confusing macro declarations.

When merging stuff from GitHub, Alfred has written some good documentation 
about how to handle them in such a way that we preserve the prior commit 
history (effectively, checkout the pr branch, rebase it on head, git svn 
dcommit the result).  Please follow this procedure.

David

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

Re: svn commit: r289027 - head/contrib/tzcode/stdtime

2015-10-08 Thread Conrad Meyer
On Thu, Oct 8, 2015 at 9:06 AM, Andriy Gapon  wrote:
> This commit seems to set a precedent of "merging" a github pull request into 
> the
> tree.  That's why I decided to comment.

I did so as well in r288238, for example. :-)

Upstreams (for tz or libcxxrt), hosted at Github or elsewhere, may disappear.

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


Re: svn commit: r289027 - head/contrib/tzcode/stdtime

2015-10-08 Thread Andriy Gapon
On 08/10/2015 18:26, Conrad Meyer wrote:
> On Thu, Oct 8, 2015 at 5:51 AM, Andriy Gapon  wrote:
>> On 08/10/2015 14:42, Craig Rodrigues wrote:
>>>  Assume C89.
>>>
>>>   
>>> https://github.com/eggert/tz/commit/400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd
>>
>> What if one day github disappears but FreeBSD is still going?
>> The full commit message would be lost.
> 
> Looking at the full commit message on Github, nothing of value was lost.

This commit seems to set a precedent of "merging" a github pull request into the
tree.  That's why I decided to comment.


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


Re: svn commit: r288911 - head/share/mk

2015-10-08 Thread Bryan Drewery
On 10/8/15 9:00 AM, Warner Losh wrote:
> 
> On Wed, Oct 7, 2015 at 7:39 PM, Bryan Drewery  > wrote:
> 
> On 10/6/2015 1:24 PM, Warner Losh wrote:
> >> With the META_MODE changes, sjg introduced this /etc/src-env.conf file
> >> that is included from sys.mk  early, that can be used 
> for overriding
> >> things like MAKEOBJDIRPREFIX, enabling META_MODE (it needs to be set
> >> extremely early for AUTO_OBJ support, among other things).
> >>
> >> As far as I can tell, the sys.mk  change to include 
> src.conf early was
> >> done out of convenience.  Meaning, we could remove that and just add
> >> back a .include http://src.init.mk>> or similar at the 
> top of all src
> Makefiles.
> > All src makefiles? Yea, I’d rather hoped to avoid that, though it is 
> easily
> > scripted. I’d thought of this solution at the time I did the MAKESYSPATH
> > hack, and rejected it as being too unwieldy. And having that at the top
> > of all the files would still require MAKESYSPATH need to be …/share/mk
> > to work out. I was rather hoping we could find some good way around
> > doing that.
> 
> r289000 confuses me. Clearly src.opts.mk  is
> still needed in Makefiles.
> So why are we including src.conf in sys.mk  and not
> src.opts.mk ?
> 
> 
> We're including it there because Simon wanted it included there so
> meta-mode settings were visible in sys.mk . I thought it
> lame at the
> time, but had no better solution.
> 

Ah! So the /etc/src-env.conf thing I referenced does replace it. So we
can remove src.conf from sys.mk now. It came in via r284598, and I
documented it and added it to src.conf.5/makeman later on.

I'll go ahead and do that since there's no impact to meta mode now.

That at least resolves my issues with nested port builds - ignoring that
src.*.mk still gets included which I haven't had a problem with and is
my own fault and intention given I want the MAKESYSPATH from local checkout!


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

Re: svn commit: r288911 - head/share/mk

2015-10-08 Thread Warner Losh
On Wed, Oct 7, 2015 at 7:39 PM, Bryan Drewery  wrote:

> On 10/6/2015 1:24 PM, Warner Losh wrote:
> >> With the META_MODE changes, sjg introduced this /etc/src-env.conf file
> >> that is included from sys.mk early, that can be used for overriding
> >> things like MAKEOBJDIRPREFIX, enabling META_MODE (it needs to be set
> >> extremely early for AUTO_OBJ support, among other things).
> >>
> >> As far as I can tell, the sys.mk change to include src.conf early was
> >> done out of convenience.  Meaning, we could remove that and just add
> >> back a .include  or similar at the top of all src
> Makefiles.
> > All src makefiles? Yea, I’d rather hoped to avoid that, though it is
> easily
> > scripted. I’d thought of this solution at the time I did the MAKESYSPATH
> > hack, and rejected it as being too unwieldy. And having that at the top
> > of all the files would still require MAKESYSPATH need to be …/share/mk
> > to work out. I was rather hoping we could find some good way around
> > doing that.
>
> r289000 confuses me. Clearly src.opts.mk is still needed in Makefiles.
> So why are we including src.conf in sys.mk and not src.opts.mk?
>

We're including it there because Simon wanted it included there so
meta-mode settings were visible in sys.mk. I thought it lame at the
time, but had no better solution.

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

svn commit: r289032 - in stable/10: sbin/init sys/dev/acpica sys/kern sys/sys

2015-10-08 Thread Colin Percival
Author: cperciva
Date: Thu Oct  8 15:48:44 2015
New Revision: 289032
URL: https://svnweb.freebsd.org/changeset/base/289032

Log:
  MFC r288446: Disable suspend during shutdown.

Modified:
  stable/10/sbin/init/init.c
  stable/10/sys/dev/acpica/acpi.c
  stable/10/sys/kern/kern_shutdown.c
  stable/10/sys/sys/systm.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/init/init.c
==
--- stable/10/sbin/init/init.c  Thu Oct  8 15:38:34 2015(r289031)
+++ stable/10/sbin/init/init.c  Thu Oct  8 15:48:44 2015(r289032)
@@ -1499,6 +1499,15 @@ static state_func_t
 death(void)
 {
session_t *sp;
+   int block, blocked;
+   size_t len;
+
+   /* Temporarily block suspend. */
+   len = sizeof(blocked);
+   block = 1;
+   if (sysctlbyname("kern.suspend_blocked", &blocked, &len,
+   &block, sizeof(block)) == -1)
+   blocked = 0;
 
/*
 * Also revoke the TTY here.  Because runshutdown() may reopen
@@ -1515,6 +1524,11 @@ death(void)
/* Try to run the rc.shutdown script within a period of time */
runshutdown();
 
+   /* Unblock suspend if we blocked it. */
+   if (!blocked)
+   sysctlbyname("kern.suspend_blocked", NULL, NULL,
+   &blocked, sizeof(blocked));
+
return (state_func_t) death_single;
 }
 

Modified: stable/10/sys/dev/acpica/acpi.c
==
--- stable/10/sys/dev/acpica/acpi.c Thu Oct  8 15:38:34 2015
(r289031)
+++ stable/10/sys/dev/acpica/acpi.c Thu Oct  8 15:48:44 2015
(r289032)
@@ -2546,8 +2546,11 @@ acpi_ReqSleepState(struct acpi_softc *sc
 if (!acpi_sleep_states[state])
return (EOPNOTSUPP);
 
-/* If a suspend request is already in progress, just return. */
-if (sc->acpi_next_sstate != 0) {
+/*
+ * If a reboot/shutdown/suspend request is already in progress or
+ * suspend is blocked due to an upcoming shutdown, just return.
+ */
+if (rebooting || sc->acpi_next_sstate != 0 || suspend_blocked) {
return (0);
 }
 

Modified: stable/10/sys/kern/kern_shutdown.c
==
--- stable/10/sys/kern/kern_shutdown.c  Thu Oct  8 15:38:34 2015
(r289031)
+++ stable/10/sys/kern/kern_shutdown.c  Thu Oct  8 15:48:44 2015
(r289032)
@@ -139,6 +139,10 @@ static int show_busybufs = 1;
 SYSCTL_INT(_kern_shutdown, OID_AUTO, show_busybufs, CTLFLAG_RW,
&show_busybufs, 0, "");
 
+int suspend_blocked = 0;
+SYSCTL_INT(_kern, OID_AUTO, suspend_blocked, CTLFLAG_RW,
+   &suspend_blocked, 0, "Block suspend due to a pending shutdown");
+
 /*
  * Variable panicstr contains argument to first call to panic; used as flag
  * to indicate that the kernel has already called panic.

Modified: stable/10/sys/sys/systm.h
==
--- stable/10/sys/sys/systm.h   Thu Oct  8 15:38:34 2015(r289031)
+++ stable/10/sys/sys/systm.h   Thu Oct  8 15:48:44 2015(r289032)
@@ -46,6 +46,7 @@
 #include /* for people using printf mainly */
 
 extern int cold;   /* nonzero if we are doing a cold boot */
+extern int suspend_blocked;/* block suspend due to pending shutdown */
 extern int rebooting;  /* kern_reboot() has been called. */
 extern const char *panicstr;   /* panic message */
 extern char version[]; /* system version */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289031 - head/sys/boot/i386/gptboot

2015-10-08 Thread Colin Percival
Author: cperciva
Date: Thu Oct  8 15:38:34 2015
New Revision: 289031
URL: https://svnweb.freebsd.org/changeset/base/289031

Log:
  Change gptldr from relocating 0xfff1 bytes of boot2 to relocating 0x2
  bytes of boot2.  Since we're in 16-bit mode, we can't copy all 128kB at
  once; instead we loop four times and copy 32 kB each time.
  
  This change was made necessary by an upcoming increase in the size of the
  boot2 binary; should it increase further, the COPY_BLKS value can be
  adjusted without anyone needing to remember 8086 assembly language again.
  
  Requested by: allanjude
  Tested by:allanjude
  MFC after:1 week

Modified:
  head/sys/boot/i386/gptboot/gptldr.S

Modified: head/sys/boot/i386/gptboot/gptldr.S
==
--- head/sys/boot/i386/gptboot/gptldr.S Thu Oct  8 15:13:57 2015
(r289030)
+++ head/sys/boot/i386/gptboot/gptldr.S Thu Oct  8 15:38:34 2015
(r289031)
@@ -45,6 +45,10 @@
 /* Misc. Constants */
.set SIZ_PAG,0x1000 # Page size
.set SIZ_SEC,0x200  # Sector size
+   .set COPY_BLKS,0x4  # Number of blocks
+   # to copy for boot2
+   .set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be
+   # a multiple of 16 bytes
 
.globl start
.code16
@@ -68,26 +72,39 @@ start:  xor %cx,%cx # Zero
  * its header to find boot2.  We need to copy boot2 to MEM_USR and BTX
  * to MEM_BTX.  Since those might overlap, we have to copy boot2
  * backwards first and then copy BTX.  We aren't sure exactly how long
- * boot2 is, but we assume it can't be longer than 64k, so we just always
- * copy 64k.
+ * boot2 is, but it's currently under 128kB so we'll copy 4 blocks of 32kB
+ * each; this can be adjusted via COPY_BLK and COPY_BLK_SZ above.
  */
mov $end,%bx# BTX
mov 0xa(%bx),%si# Get BTX length and set
add %bx,%si #  %si to start of boot2
-   mov %si,%ax # Align %ds:%si on a
-   shr $4,%ax  #  paragraph boundary
-   and $0xf,%si#  with the smallest
-   mov %ax,%ds #  possible %si
-   add $(64 * 1024 - 16),%si
-   mov $MEM_USR/16,%ax # Point %es:%di at end of
-   mov $(64 * 1024 - 16),%di   #  largest boot2 range
+   dec %si # Set %ds:%si to point at the
+   mov %si,%ax # last byte we want to copy
+   shr $4,%ax  # from boot2, with %si made as
+   add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # small as possible.
+   and $0xf,%si# 
+   mov %ax,%ds #
+   mov $MEM_USR/16,%ax # Set %es:(-1) to point at
+   add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # the last byte we
+   mov %ax,%es # want to copy boot2 into.
+   mov $COPY_BLKS,%bx  # Copy COPY_BLKS 32k blocks
+copyloop:
+   add $COPY_BLK_SZ,%si# Adjust %ds:%si to point at
+   mov %ds,%ax # the end of the next 32k to
+   sub $COPY_BLK_SZ/16,%ax # copy from boot2
+   mov %ax,%ds
+   mov $COPY_BLK_SZ-1,%di  # Adjust %es:%di to point at
+   mov %es,%ax # the end of the next 32k into
+   sub $COPY_BLK_SZ/16,%ax # which we want boot2 copied
mov %ax,%es
+   mov $COPY_BLK_SZ,%cx# Copy 32k
std
-   mov %di,%cx # Copy 64k - paragraph + 1 
-   inc %cx #  bytes
rep movsb
+   dec %bx
+   jnz copyloop
mov %cx,%ds # Reset %ds and %es
mov %cx,%es
+   mov $end,%bx# BTX
mov 0xa(%bx),%cx# Get BTX length and set
mov %bx,%si #  %si to end of BTX
mov $MEM_BTX,%di# %di -> end of BTX at
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289027 - head/contrib/tzcode/stdtime

2015-10-08 Thread Benjamin Kaduk
On Thu, Oct 8, 2015 at 10:26 AM, Conrad Meyer  wrote:

> On Thu, Oct 8, 2015 at 5:51 AM, Andriy Gapon  wrote:
> > On 08/10/2015 14:42, Craig Rodrigues wrote:
> >>  Assume C89.
> >>
> >>
> https://github.com/eggert/tz/commit/400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd
> >
> > What if one day github disappears but FreeBSD is still going?
> > The full commit message would be lost.
>
> Looking at the full commit message on Github, nothing of value was lost.
>

Would have been nice to know if it was "Assume C89, because K&R is dead" or
"Assume C89, because we still have to work on crippled platforms even
though C99 has been out for 15 years", though.  (The code makes it clear
it's the former.)

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


Re: svn commit: r289027 - head/contrib/tzcode/stdtime

2015-10-08 Thread Conrad Meyer
On Thu, Oct 8, 2015 at 5:51 AM, Andriy Gapon  wrote:
> On 08/10/2015 14:42, Craig Rodrigues wrote:
>>  Assume C89.
>>
>>   
>> https://github.com/eggert/tz/commit/400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd
>
> What if one day github disappears but FreeBSD is still going?
> The full commit message would be lost.

Looking at the full commit message on Github, nothing of value was lost.

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


svn commit: r289030 - head/sys/dev/usb/controller

2015-10-08 Thread Kevin Lo
Author: kevlo
Date: Thu Oct  8 15:13:57 2015
New Revision: 289030
URL: https://svnweb.freebsd.org/changeset/base/289030

Log:
  Add support for Fresco Logic USB 3.0 host controller.
  
  Fresco Logic hosts advertise MSI, but fail to actually generate MSI
  interrupts.  We have to disable MSI use.
  
  Reviewed by:  hselasky

Modified:
  head/sys/dev/usb/controller/xhci_pci.c

Modified: head/sys/dev/usb/controller/xhci_pci.c
==
--- head/sys/dev/usb/controller/xhci_pci.c  Thu Oct  8 13:39:27 2015
(r289029)
+++ head/sys/dev/usb/controller/xhci_pci.c  Thu Oct  8 15:13:57 2015
(r289030)
@@ -98,13 +98,16 @@ xhci_pci_match(device_t self)
case 0x01941033:
return ("NEC uPD720200 USB 3.0 controller");
 
+   case 0x10001b73:
+   return ("Fresco Logic FL1000G USB 3.0 controller");
+
case 0x10421b21:
return ("ASMedia ASM1042 USB 3.0 controller");
case 0x11421b21:
return ("ASMedia ASM1042A USB 3.0 controller");
 
case 0x0f358086:
-   return ("Intel Intel BayTrail USB 3.0 controller");
+   return ("Intel BayTrail USB 3.0 controller");
case 0x9c318086:
case 0x1e318086:
return ("Intel Panther Point USB 3.0 controller");
@@ -184,7 +187,8 @@ xhci_pci_attach(device_t self)
 {
struct xhci_softc *sc = device_get_softc(self);
int count, err, rid;
-   uint8_t usedma32;
+   uint8_t usemsi = 1;
+   uint8_t usedma32 = 0;
 
rid = PCI_XHCI_CBMEM;
sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid,
@@ -203,6 +207,10 @@ xhci_pci_attach(device_t self)
/* Don't use 64-bit DMA on these controllers. */
usedma32 = 1;
break;
+   case 0x10001b73:/* FL1000G */
+   /* Fresco Logic host doesn't support MSI. */
+   usemsi = 0;
+   break;
case 0x0f358086:/* BayTrail */
case 0x9c318086:/* Panther Point */
case 0x1e318086:/* Panther Point */
@@ -214,9 +222,6 @@ xhci_pci_attach(device_t self)
 */
sc->sc_port_route = &xhci_pci_port_route;
sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP;
-   /* FALLTHROUGH */
-   default:
-   usedma32 = 0;
break;
}
 
@@ -232,7 +237,7 @@ xhci_pci_attach(device_t self)
usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0);
 
rid = 0;
-   if (xhci_use_msi) {
+   if (xhci_use_msi && usemsi) {
count = 1;
if (pci_alloc_msi(self, &count) == 0) {
if (bootverbose)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289029 - head/sys/dev/usb/controller

2015-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct  8 13:39:27 2015
New Revision: 289029
URL: https://svnweb.freebsd.org/changeset/base/289029

Log:
  Add quirk for USB 3.0 PCI device.
  
  Submitted by: Gary Jennejohn 
  MFC after:1 week

Modified:
  head/sys/dev/usb/controller/xhci_pci.c

Modified: head/sys/dev/usb/controller/xhci_pci.c
==
--- head/sys/dev/usb/controller/xhci_pci.c  Thu Oct  8 12:55:21 2015
(r289028)
+++ head/sys/dev/usb/controller/xhci_pci.c  Thu Oct  8 13:39:27 2015
(r289029)
@@ -199,6 +199,7 @@ xhci_pci_attach(device_t self)
 
switch (pci_get_devid(self)) {
case 0x01941033:/* NEC uPD720200 USB 3.0 controller */
+   case 0x00141912:/* NEC uPD720201 USB 3.0 controller */
/* Don't use 64-bit DMA on these controllers. */
usedma32 = 1;
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r289027 - head/contrib/tzcode/stdtime

2015-10-08 Thread Baptiste Daroussin
On Thu, Oct 08, 2015 at 03:51:26PM +0300, Andriy Gapon wrote:
> On 08/10/2015 14:42, Craig Rodrigues wrote:
> > Author: rodrigc
> > Date: Thu Oct  8 11:42:15 2015
> > New Revision: 289027
> > URL: https://svnweb.freebsd.org/changeset/base/289027
> > 
> > Log:
> >   Merge:
> >  commit 400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd
> >  Author: Paul Eggert 
> >  Date:   Fri Oct 12 07:53:12 2012 -0700
> >   
> >  Assume C89.
> >   
> >   
> > https://github.com/eggert/tz/commit/400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd
> 
> What if one day github disappears but FreeBSD is still going?
> The full commit message would be lost.
> 

Same if someone edit history

Bapt


signature.asc
Description: PGP signature


Re: svn commit: r289027 - head/contrib/tzcode/stdtime

2015-10-08 Thread Andriy Gapon
On 08/10/2015 14:42, Craig Rodrigues wrote:
> Author: rodrigc
> Date: Thu Oct  8 11:42:15 2015
> New Revision: 289027
> URL: https://svnweb.freebsd.org/changeset/base/289027
> 
> Log:
>   Merge:
>  commit 400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd
>  Author: Paul Eggert 
>  Date:   Fri Oct 12 07:53:12 2012 -0700
>   
>  Assume C89.
>   
>   https://github.com/eggert/tz/commit/400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd

What if one day github disappears but FreeBSD is still going?
The full commit message would be lost.

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


svn commit: r289028 - in head/sys/dev/usb: . wlan

2015-10-08 Thread Gavin Atkinson
Author: gavin
Date: Thu Oct  8 12:55:21 2015
New Revision: 289028
URL: https://svnweb.freebsd.org/changeset/base/289028

Log:
  Recognise the Netgear WNDA4100 (N900) 3x3 device in run(4).

Modified:
  head/sys/dev/usb/usbdevs
  head/sys/dev/usb/wlan/if_run.c

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsThu Oct  8 11:42:15 2015(r289027)
+++ head/sys/dev/usb/usbdevsThu Oct  8 12:55:21 2015(r289028)
@@ -3261,6 +3261,7 @@ product NETGEAR WG111U_NF 0x4301  WG111U 
 product NETGEAR WG111V20x6a00  WG111V2
 product NETGEAR WN111V20x9001  WN111V2
 product NETGEAR WNDA3100   0x9010  WNDA3100
+product NETGEAR WNDA4100   0x9012  WNDA4100
 product NETGEAR WNDA3200   0x9018  WNDA3200
 product NETGEAR RTL8192CU  0x9021  RTL8192CU
 product NETGEAR WNA10000x9040  WNA1000

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Thu Oct  8 11:42:15 2015
(r289027)
+++ head/sys/dev/usb/wlan/if_run.c  Thu Oct  8 12:55:21 2015
(r289028)
@@ -246,6 +246,7 @@ static const STRUCT_USB_HOST_ID run_devs
 RUN_DEV(MSI,   RT3070_9),
 RUN_DEV(MSI,   RT3070_10),
 RUN_DEV(MSI,   RT3070_11),
+RUN_DEV(NETGEAR,   WNDA4100),
 RUN_DEV(OVISLINK,  RT3072),
 RUN_DEV(PARA,  RT3070),
 RUN_DEV(PEGATRON,  RT2870),
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289027 - head/contrib/tzcode/stdtime

2015-10-08 Thread Craig Rodrigues
Author: rodrigc
Date: Thu Oct  8 11:42:15 2015
New Revision: 289027
URL: https://svnweb.freebsd.org/changeset/base/289027

Log:
  Merge:
 commit 400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd
 Author: Paul Eggert 
 Date:   Fri Oct 12 07:53:12 2012 -0700
  
 Assume C89.
  
  https://github.com/eggert/tz/commit/400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd

Modified:
  head/contrib/tzcode/stdtime/difftime.c
  head/contrib/tzcode/stdtime/localtime.c
  head/contrib/tzcode/stdtime/private.h

Modified: head/contrib/tzcode/stdtime/difftime.c
==
--- head/contrib/tzcode/stdtime/difftime.c  Thu Oct  8 11:07:09 2015
(r289026)
+++ head/contrib/tzcode/stdtime/difftime.c  Thu Oct  8 11:42:15 2015
(r289027)
@@ -18,9 +18,7 @@ __FBSDID("$FreeBSD$");
 #include "un-namespace.h"
 
 double
-difftime(time1, time0)
-const time_t   time1;
-const time_t   time0;
+difftime(const time_t time1, const time_t time0)
 {
/*
** If (sizeof (double) > sizeof (time_t)) simply convert and subtract

Modified: head/contrib/tzcode/stdtime/localtime.c
==
--- head/contrib/tzcode/stdtime/localtime.c Thu Oct  8 11:07:09 2015
(r289026)
+++ head/contrib/tzcode/stdtime/localtime.c Thu Oct  8 11:42:15 2015
(r289027)
@@ -173,8 +173,9 @@ struct rule {
 static longdetzcode(const char * codep);
 static time_t  detzcode64(const char * codep);
 static int differ_by_repeat(time_t t1, time_t t0);
-static const char *getzname(const char * strp);
-static const char *getqzname(const char * strp, const int delim);
+static const char *getzname(const char * strp) ATTRIBUTE_PURE;
+static const char *getqzname(const char * strp, const int delim)
+  ATTRIBUTE_PURE;
 static const char *getnum(const char * strp, int * nump, int min,
int max);
 static const char *getsecs(const char * strp, long * secsp);
@@ -186,7 +187,7 @@ static struct tm *  gmtsub(const time_t *
 static struct tm * localsub(const time_t * timep, long offset,
struct tm * tmp);
 static int increment_overflow(int * number, int delta);
-static int leaps_thru_end_of(int y);
+static int leaps_thru_end_of(int y) ATTRIBUTE_PURE;
 static int long_increment_overflow(long * number, int delta);
 static int long_normalize_overflow(long * tensptr,
int * unitsptr, int base);
@@ -210,7 +211,8 @@ static struct tm *  timesub(const time_t 
 static int tmcomp(const struct tm * atmp,
const struct tm * btmp);
 static time_t  transtime(time_t janfirst, int year,
-   const struct rule * rulep, long offset);
+ const struct rule * rulep, long offset)
+  ATTRIBUTE_PURE;
 static int typesequiv(const struct state * sp, int a, int b);
 static int tzload(const char * name, struct state * sp,
int doextend);
@@ -269,8 +271,7 @@ time_t  altzone = 0;
 #endif /* defined ALTZONE */
 
 static long
-detzcode(codep)
-const char * const codep;
+detzcode(const char *const codep)
 {
longresult;
int i;
@@ -282,8 +283,7 @@ const char * const  codep;
 }
 
 static time_t
-detzcode64(codep)
-const char * const codep;
+detzcode64(const char *const codep)
 {
register time_t result;
register inti;
@@ -355,9 +355,7 @@ settzname(void)
 }
 
 static int
-differ_by_repeat(t1, t0)
-const time_t   t1;
-const time_t   t0;
+differ_by_repeat(const time_t t1, const time_t t0)
 {
int_fast64_t _t0 = t0;
int_fast64_t _t1 = t1;
@@ -1217,8 +1215,7 @@ const int lastditch;
 }
 
 static void
-gmtload(sp)
-struct state * const   sp;
+gmtload(struct state *const sp)
 {
if (tzload(gmt, sp, TRUE) != 0)
(void) tzparse(gmt, sp, TRUE);
@@ -1241,7 +1238,7 @@ tzsetwall_basic(int rdlocked)
 
 #ifdef ALL_STATE
if (lclptr == NULL) {
-   lclptr = (struct state *) calloc(1, sizeof *lclptr);
+   lclptr = calloc(1, sizeof *lclptr);
if (lclptr == NULL) {
settzname();/* all we can do */
_RWLOCK_UNLOCK(&lcl_rwlock);
@@ -1341,10 +1338,7 @@ tzset(void)
 
 /*ARGSUSED*/
 static struct tm *
-localsub(timep, offset, tmp)
-const time_t * const   timep;
-const long offset;
-struct tm * const  tmp;
+localsub(const time_t *const timep, const long offset, struct tm *const tmp)
 {
struct state *  sp;
const struct ttinfo *   ttisp;
@@ -1440,8 +1434,7 @@ localtime_key_init(void)
 }
 
 struct tm *
-localtime(timep)
-const time_t * const   timep;
+lo

svn commit: r289003 - vendor-sys/illumos/dist/uts/common/dtrace vendor-sys/illumos/dist/uts/common/sys vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt

2015-10-08 Thread Mark Johnston
Author: markj
Date: Thu Oct  8 04:29:39 2015
New Revision: 289003
URL: https://svnweb.freebsd.org/changeset/base/289003

Log:
  6271 dtrace caused excessive fork time
  
  Author: Bryan Cantrill 
  Reviewed by: Adam Leventhal 
  Reviewed by: Dan McDonald 
  Reviewed by: Richard Lowe 
  Approved by: Gordon Ross 
  
  illumos/illumos-gate@7bd3c1d12d0c764e1517c3aca62c634409356764

Added:
  vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh
  vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh.out

Changes in other areas also in this revision:
Modified:
  vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c
  vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c
  vendor-sys/illumos/dist/uts/common/sys/dtrace.h

Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh   
Thu Oct  8 04:29:39 2015(r289003)
@@ -0,0 +1,99 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2015, Joyent, Inc. All rights reserved.
+#
+
+#
+# This test assures that we can have the same provider name across multiple
+# probe definitions, and that the result will be the union of those
+# definitions.  In particular, libusdt depends on this when (for example)
+# node modules that create a provider are loaded multiple times due to
+# being included by different modules.
+#
+
+if [ $# != 1 ]; then
+   echo expected one argument: '<'dtrace-path'>'
+   exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <
+
+void
+main()
+{
+EOF
+
+objs=
+
+for oogle in bagnoogle stalloogle cockoogle; do
+   cat > $oogle.c <
+
+void
+$oogle()
+{
+   DTRACE_PROBE(doogle, $oogle);
+}
+EOF
+
+   cat > $oogle.d <> test.c
+done
+
+echo "}" >> test.c
+
+gcc -m32 -o test test.c $objs
+
+if [ $? -ne 0 ]; then
+   print -u2 "failed to compile test.c"
+   exit 1
+fi
+
+$dtrace -n 'doogle$target:::{@[probename] = count()}' \
+-n 'END{printa("%-10s %@d\n", @)}' -x quiet -x aggsortkey -Zc ./test
+
+if [ $? -ne 0 ]; then
+   print -u2 "failed to execute test"
+   exit 1
+fi
+
+cd /
+/usr/bin/rm -rf $DIR
+exit 0

Added: 
vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh.out
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh.out   
Thu Oct  8 04:29:39 2015(r289003)
@@ -0,0 +1,4 @@
+bagnoogle  1
+cockoogle  1
+stalloogle 1
+
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289026 - head/sys/kern

2015-10-08 Thread Konstantin Belousov
Author: kib
Date: Thu Oct  8 11:07:09 2015
New Revision: 289026
URL: https://svnweb.freebsd.org/changeset/base/289026

Log:
  Enforce the maxproc limitation before allocating struct proc, initial
  struct thread and kernel stack for the thread.  Otherwise, a load
  similar to a fork bomb would exhaust KVA and possibly kmem, mostly due
  to the struct proc being type-stable.
  
  The nprocs counter is changed from being protected by allproc_lock sx
  to be an atomic variable.  Note that ddb/db_ps.c:db_ps() use of nprocs
  was unsafe before, and is still unsafe, but it seems that the only
  possible undesired consequence is the harmless warning printed when
  allproc linked list length does not match nprocs.
  
  Diagnosed by: Svatopluk Kraus 
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/kern_exit.c
  head/sys/kern/kern_fork.c

Modified: head/sys/kern/kern_exit.c
==
--- head/sys/kern/kern_exit.c   Thu Oct  8 10:00:41 2015(r289025)
+++ head/sys/kern/kern_exit.c   Thu Oct  8 11:07:09 2015(r289026)
@@ -963,9 +963,7 @@ proc_reap(struct thread *td, struct proc
KASSERT(FIRST_THREAD_IN_PROC(p),
("proc_reap: no residual thread!"));
uma_zfree(proc_zone, p);
-   sx_xlock(&allproc_lock);
-   nprocs--;
-   sx_xunlock(&allproc_lock);
+   atomic_add_int(&nprocs, -1);
 }
 
 static int

Modified: head/sys/kern/kern_fork.c
==
--- head/sys/kern/kern_fork.c   Thu Oct  8 10:00:41 2015(r289025)
+++ head/sys/kern/kern_fork.c   Thu Oct  8 11:07:09 2015(r289026)
@@ -382,12 +382,6 @@ do_fork(struct thread *td, int flags, st
p2_held = 0;
p1 = td->td_proc;
 
-   /*
-* Increment the nprocs resource before blocking can occur.  There
-* are hard-limits as to the number of processes that can run.
-*/
-   nprocs++;
-
trypid = fork_findpid(flags);
 
sx_sunlock(&proctree_lock);
@@ -771,16 +765,14 @@ int
 fork1(struct thread *td, int flags, int pages, struct proc **procp,
 int *procdescp, int pdflags, struct filecaps *fcaps)
 {
-   struct proc *p1;
-   struct proc *newproc;
-   int ok;
+   struct proc *p1, *newproc;
struct thread *td2;
struct vmspace *vm2;
+   struct file *fp_procdesc;
vm_ooffset_t mem_charged;
-   int error;
+   int error, nprocs_new, ok;
static int curfail;
static struct timeval lastfail;
-   struct file *fp_procdesc = NULL;
 
/* Check for the undefined or unimplemented flags. */
if ((flags & ~(RFFLAGS | RFTSIGFLAGS(RFTSIGMASK))) != 0)
@@ -819,6 +811,35 @@ fork1(struct thread *td, int flags, int 
return (fork_norfproc(td, flags));
}
 
+   fp_procdesc = NULL;
+   newproc = NULL;
+   vm2 = NULL;
+
+   /*
+* Increment the nprocs resource before allocations occur.
+* Although process entries are dynamically created, we still
+* keep a global limit on the maximum number we will
+* create. There are hard-limits as to the number of processes
+* that can run, established by the KVA and memory usage for
+* the process data.
+*
+* Don't allow a nonprivileged user to use the last ten
+* processes; don't let root exceed the limit.
+*/
+   nprocs_new = atomic_fetchadd_int(&nprocs, 1) + 1;
+   if ((nprocs_new >= maxproc - 10 && priv_check_cred(td->td_ucred,
+   PRIV_MAXPROC, 0) != 0) || nprocs_new >= maxproc) {
+   error = EAGAIN;
+   sx_xlock(&allproc_lock);
+   if (ppsratecheck(&lastfail, &curfail, 1)) {
+   printf("maxproc limit exceeded by uid %u (pid %d); "
+   "see tuning(7) and login.conf(5)\n",
+   td->td_ucred->cr_ruid, p1->p_pid);
+   }
+   sx_xunlock(&allproc_lock);
+   goto fail2;
+   }
+
/*
 * If required, create a process descriptor in the parent first; we
 * will abandon it if something goes wrong. We don't finit() until
@@ -831,7 +852,6 @@ fork1(struct thread *td, int flags, int 
}
 
mem_charged = 0;
-   vm2 = NULL;
if (pages == 0)
pages = kstack_pages;
/* Allocate new proc. */
@@ -898,20 +918,7 @@ fork1(struct thread *td, int flags, int 
 
/* We have to lock the process tree while we look for a pid. */
sx_slock(&proctree_lock);
-
-   /*
-* Although process entries are dynamically created, we still keep
-* a global limit on the maximum number we will create.  Don't allow
-* a nonprivileged user to use the last ten processes; don't let root
-* exceed the limit. The variable nprocs is

svn commit: r289025 - head/sys/sys

2015-10-08 Thread Fabien Thomas
Author: fabient
Date: Thu Oct  8 10:00:41 2015
New Revision: 289025
URL: https://svnweb.freebsd.org/changeset/base/289025

Log:
  Fix r283120 which use class size larger than 8bits.
  The new mapping will restore binary compatibility with stable_10
  but file generated since r283120 are broken.
  
  Reviewed by:  jhb
  Sponsored by: Stormshield

Modified:
  head/sys/sys/pmc.h

Modified: head/sys/sys/pmc.h
==
--- head/sys/sys/pmc.h  Thu Oct  8 09:54:33 2015(r289024)
+++ head/sys/sys/pmc.h  Thu Oct  8 10:00:41 2015(r289025)
@@ -128,26 +128,26 @@ enum pmc_cputype {
  */
 
 #define__PMC_CLASSES() 
\
-   __PMC_CLASS(TSC,0x000,  "CPU Timestamp counter")\
-   __PMC_CLASS(K7, 0x100,  "AMD K7 performance counters")  \
-   __PMC_CLASS(K8, 0x101,  "AMD K8 performance counters")  \
-   __PMC_CLASS(P5, 0x102,  "Intel Pentium counters")   \
-   __PMC_CLASS(P6, 0x103,  "Intel Pentium Pro counters")   \
-   __PMC_CLASS(P4, 0x104,  "Intel Pentium-IV counters")\
-   __PMC_CLASS(IAF,0x105,  "Intel Core2/Atom, fixed function") \
-   __PMC_CLASS(IAP,0x106,  "Intel Core...Atom, programmable") \
-   __PMC_CLASS(UCF,0x107,  "Intel Uncore fixed function")  \
-   __PMC_CLASS(UCP,0x108,  "Intel Uncore programmable")\
-   __PMC_CLASS(XSCALE, 0x200,  "Intel XScale counters")\
-   __PMC_CLASS(ARMV7,  0x201,  "ARMv7")\
-   __PMC_CLASS(ARMV8,  0x202,  "ARMv8")\
-   __PMC_CLASS(MIPS24K,0x300,  "MIPS 24K") \
-   __PMC_CLASS(OCTEON, 0x301,  "Cavium Octeon")\
-   __PMC_CLASS(MIPS74K,0x302,  "MIPS 74K") \
-   __PMC_CLASS(PPC7450,0x400,  "Motorola MPC7450 class")   \
-   __PMC_CLASS(PPC970, 0x401,  "IBM PowerPC 970 class")\
-   __PMC_CLASS(E500,   0x402,  "Freescale e500 class") \
-   __PMC_CLASS(SOFT,   0x8000, "Software events")
+   __PMC_CLASS(TSC,0x00,   "CPU Timestamp counter")\
+   __PMC_CLASS(K7, 0x01,   "AMD K7 performance counters")  \
+   __PMC_CLASS(K8, 0x02,   "AMD K8 performance counters")  \
+   __PMC_CLASS(P5, 0x03,   "Intel Pentium counters")   \
+   __PMC_CLASS(P6, 0x04,   "Intel Pentium Pro counters")   \
+   __PMC_CLASS(P4, 0x05,   "Intel Pentium-IV counters")\
+   __PMC_CLASS(IAF,0x06,   "Intel Core2/Atom, fixed function") \
+   __PMC_CLASS(IAP,0x07,   "Intel Core...Atom, programmable") \
+   __PMC_CLASS(UCF,0x08,   "Intel Uncore fixed function")  \
+   __PMC_CLASS(UCP,0x09,   "Intel Uncore programmable")\
+   __PMC_CLASS(XSCALE, 0x0A,   "Intel XScale counters")\
+   __PMC_CLASS(MIPS24K,0x0B,   "MIPS 24K") \
+   __PMC_CLASS(OCTEON, 0x0C,   "Cavium Octeon")\
+   __PMC_CLASS(PPC7450,0x0D,   "Motorola MPC7450 class")   \
+   __PMC_CLASS(PPC970, 0x0E,   "IBM PowerPC 970 class")\
+   __PMC_CLASS(SOFT,   0x0F,   "Software events")  \
+   __PMC_CLASS(ARMV7,  0x10,   "ARMv7")\
+   __PMC_CLASS(ARMV8,  0x11,   "ARMv8")\
+   __PMC_CLASS(MIPS74K,0x12,   "MIPS 74K") \
+   __PMC_CLASS(E500,   0x13,   "Freescale e500 class")
 
 enum pmc_class {
 #undef  __PMC_CLASS
@@ -156,7 +156,7 @@ enum pmc_class {
 };
 
 #definePMC_CLASS_FIRST PMC_CLASS_TSC
-#definePMC_CLASS_LAST  PMC_CLASS_SOFT
+#definePMC_CLASS_LAST  PMC_CLASS_E500
 
 /*
  * A PMC can be in the following states:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289024 - head/sys/kern

2015-10-08 Thread Fabien Thomas
Author: fabient
Date: Thu Oct  8 09:54:33 2015
New Revision: 289024
URL: https://svnweb.freebsd.org/changeset/base/289024

Log:
  Fix r283998 that broke mapin events for hwpmc.
  
  Reviewed by:  jhb
  Sponsored by: Stormshield

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Thu Oct  8 09:46:35 2015(r289023)
+++ head/sys/kern/vfs_vnops.c   Thu Oct  8 09:54:33 2015(r289024)
@@ -43,6 +43,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_hwpmc_hooks.h"
+
 #include 
 #include 
 #include 
@@ -84,6 +86,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef HWPMC_HOOKS
+#include 
+#endif
+
 static fo_rdwr_t   vn_read;
 static fo_rdwr_t   vn_write;
 static fo_rdwr_t   vn_io_fault;
@@ -2461,7 +2467,7 @@ vn_mmap(struct file *fp, vm_map_t map, v
/* Inform hwpmc(4) if an executable is being mapped. */
if (error == 0 && (prot & VM_PROT_EXECUTE) != 0) {
pkm.pm_file = vp;
-   pkm.pm_address = (uintptr_t) addr;
+   pkm.pm_address = (uintptr_t) *addr;
PMC_CALL_HOOK(td, PMC_FN_MMAP, (void *) &pkm);
}
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289023 - head/usr.sbin/pmcstat

2015-10-08 Thread Fabien Thomas
Author: fabient
Date: Thu Oct  8 09:46:35 2015
New Revision: 289023
URL: https://svnweb.freebsd.org/changeset/base/289023

Log:
  Fix for r288176 changes related to debug symbols move.
  
  Reviewed by: emaste
  Sponsored by: Stormshield

Modified:
  head/usr.sbin/pmcstat/pmcstat_log.c

Modified: head/usr.sbin/pmcstat/pmcstat_log.c
==
--- head/usr.sbin/pmcstat/pmcstat_log.c Thu Oct  8 08:55:34 2015
(r289022)
+++ head/usr.sbin/pmcstat/pmcstat_log.c Thu Oct  8 09:46:35 2015
(r289023)
@@ -966,21 +966,32 @@ pmcstat_image_addr2line(struct pmcstat_i
 char *funcname, size_t funcname_len)
 {
static int addr2line_warn = 0;
-   unsigned l;
 
char *sep, cmdline[PATH_MAX], imagepath[PATH_MAX];
+   unsigned l;
int fd;
 
if (image->pi_addr2line == NULL) {
-   snprintf(imagepath, sizeof(imagepath), "%s%s.symbols",
+   /* Try default debug file location. */
+   snprintf(imagepath, sizeof(imagepath),
+   "/usr/lib/debug/%s%s.debug",
args.pa_fsroot,
pmcstat_string_unintern(image->pi_fullpath));
fd = open(imagepath, O_RDONLY);
if (fd < 0) {
-   snprintf(imagepath, sizeof(imagepath), "%s%s",
+   /* Old kernel symbol path. */
+   snprintf(imagepath, sizeof(imagepath), "%s%s.symbols",
args.pa_fsroot,
pmcstat_string_unintern(image->pi_fullpath));
-   } else
+   fd = open(imagepath, O_RDONLY);
+   if (fd < 0) {
+   snprintf(imagepath, sizeof(imagepath), "%s%s",
+   args.pa_fsroot,
+   pmcstat_string_unintern(
+   image->pi_fullpath));
+   }
+   }
+   if (fd >= 0)
close(fd);
/*
 * New addr2line support recursive inline function with -i
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289022 - in stable/9/sys: net netinet

2015-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct  8 08:55:34 2015
New Revision: 289022
URL: https://svnweb.freebsd.org/changeset/base/289022

Log:
  MFC r287775:
  Update TSO limits to include all headers.
  
  To make driver programming easier the TSO limits are changed to
  reflect the values used in the BUSDMA tag a network adapter driver is
  using. The TCP/IP network stack will subtract space for all linklevel
  and protocol level headers and ensure that the full mbuf chain passed
  to the network adapter fits within the given limits. See r287775
  for a more detailed description.
  
  Differential Revision:https://reviews.freebsd.org/D3477
  Reviewed by:  rmacklem

Modified:
  stable/9/sys/net/if_var.h
  stable/9/sys/netinet/tcp_output.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/net/   (props changed)

Modified: stable/9/sys/net/if_var.h
==
--- stable/9/sys/net/if_var.h   Thu Oct  8 08:55:08 2015(r289021)
+++ stable/9/sys/net/if_var.h   Thu Oct  8 08:55:34 2015(r289022)
@@ -222,11 +222,12 @@ struct ifnet {
 * count limit does not apply. If all three fields are zero,
 * there is no TSO limit.
 *
-* NOTE: The TSO limits only apply to the data payload part of
-* a TCP/IP packet. That means there is no need to subtract
-* space for ethernet-, vlan-, IP- or TCP- headers from the
-* TSO limits unless the hardware driver in question requires
-* so.
+* NOTE: The TSO limits should reflect the values used in the
+* BUSDMA tag a network adapter is using to load a mbuf chain
+* for transmission. The TCP/IP network stack will subtract
+* space for all linklevel and protocol level headers and
+* ensure that the full mbuf chain passed to the network
+* adapter fits within the given limits.
 */
u_int   if_hw_tsomax;
int if_ispare[1];

Modified: stable/9/sys/netinet/tcp_output.c
==
--- stable/9/sys/netinet/tcp_output.c   Thu Oct  8 08:55:08 2015
(r289021)
+++ stable/9/sys/netinet/tcp_output.c   Thu Oct  8 08:55:34 2015
(r289022)
@@ -798,7 +798,8 @@ send:
 */
if (if_hw_tsomax != 0) {
/* compute maximum TSO length */
-   max_len = (if_hw_tsomax - hdrlen);
+   max_len = (if_hw_tsomax - hdrlen -
+   max_linkhdr);
if (max_len <= 0) {
len = 0;
} else if (len > max_len) {
@@ -813,6 +814,15 @@ send:
 */
if (if_hw_tsomaxsegcount != 0 &&
if_hw_tsomaxsegsize != 0) {
+   /*
+* Subtract one segment for the LINK
+* and TCP/IP headers mbuf that will
+* be prepended to this mbuf chain
+* after the code in this section
+* limits the number of mbufs in the
+* chain to if_hw_tsomaxsegcount.
+*/
+   if_hw_tsomaxsegcount -= 1;
max_len = 0;
mb = sbsndmbuf(&so->so_snd, off, &moff);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289021 - head/etc/periodic/daily

2015-10-08 Thread Dag-Erling Smørgrav
Author: des
Date: Thu Oct  8 08:55:08 2015
New Revision: 289021
URL: https://svnweb.freebsd.org/changeset/base/289021

Log:
  Add -n to the ntpq command line so it will show IP addresses instead of
  host names, which rarely fit in the available space.
  
  MFC after:1 week

Modified:
  head/etc/periodic/daily/480.status-ntpd

Modified: head/etc/periodic/daily/480.status-ntpd
==
--- head/etc/periodic/daily/480.status-ntpd Thu Oct  8 08:30:40 2015
(r289020)
+++ head/etc/periodic/daily/480.status-ntpd Thu Oct  8 08:55:08 2015
(r289021)
@@ -18,7 +18,7 @@ case "$daily_status_ntpd_enable" in
echo ""
echo "NTP status:"
 
-   synchronized=$(ntpq -p | tee /dev/stderr | grep '^\*')
+   synchronized=$(ntpq -pn | tee /dev/stderr | grep '^\*')
if [ -z "$synchronized" ]; then
rc=1
fi
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289020 - in stable/10/sys: net netinet

2015-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct  8 08:30:40 2015
New Revision: 289020
URL: https://svnweb.freebsd.org/changeset/base/289020

Log:
  MFC r287775:
  Update TSO limits to include all headers.
  
  To make driver programming easier the TSO limits are changed to
  reflect the values used in the BUSDMA tag a network adapter driver is
  using. The TCP/IP network stack will subtract space for all linklevel
  and protocol level headers and ensure that the full mbuf chain passed
  to the network adapter fits within the given limits. See r287775
  for a more detailed description.
  
  Differential Revision:https://reviews.freebsd.org/D3477
  Reviewed by:  rmacklem

Modified:
  stable/10/sys/net/if_var.h
  stable/10/sys/netinet/tcp_output.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/if_var.h
==
--- stable/10/sys/net/if_var.h  Thu Oct  8 08:06:23 2015(r289019)
+++ stable/10/sys/net/if_var.h  Thu Oct  8 08:30:40 2015(r289020)
@@ -236,11 +236,12 @@ struct ifnet {
 * count limit does not apply. If all three fields are zero,
 * there is no TSO limit.
 *
-* NOTE: The TSO limits only apply to the data payload part of
-* a TCP/IP packet. That means there is no need to subtract
-* space for ethernet-, vlan-, IP- or TCP- headers from the
-* TSO limits unless the hardware driver in question requires
-* so.
+* NOTE: The TSO limits should reflect the values used in the
+* BUSDMA tag a network adapter is using to load a mbuf chain
+* for transmission. The TCP/IP network stack will subtract
+* space for all linklevel and protocol level headers and
+* ensure that the full mbuf chain passed to the network
+* adapter fits within the given limits.
 */
u_int   if_hw_tsomax;
 

Modified: stable/10/sys/netinet/tcp_output.c
==
--- stable/10/sys/netinet/tcp_output.c  Thu Oct  8 08:06:23 2015
(r289019)
+++ stable/10/sys/netinet/tcp_output.c  Thu Oct  8 08:30:40 2015
(r289020)
@@ -807,7 +807,8 @@ send:
 */
if (if_hw_tsomax != 0) {
/* compute maximum TSO length */
-   max_len = (if_hw_tsomax - hdrlen);
+   max_len = (if_hw_tsomax - hdrlen -
+   max_linkhdr);
if (max_len <= 0) {
len = 0;
} else if (len > max_len) {
@@ -822,6 +823,15 @@ send:
 */
if (if_hw_tsomaxsegcount != 0 &&
if_hw_tsomaxsegsize != 0) {
+   /*
+* Subtract one segment for the LINK
+* and TCP/IP headers mbuf that will
+* be prepended to this mbuf chain
+* after the code in this section
+* limits the number of mbufs in the
+* chain to if_hw_tsomaxsegcount.
+*/
+   if_hw_tsomaxsegcount -= 1;
max_len = 0;
mb = sbsndmbuf(&so->so_snd, off, &moff);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289019 - in stable/9: share/man/man3 sys/sys

2015-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct  8 08:06:23 2015
New Revision: 289019
URL: https://svnweb.freebsd.org/changeset/base/289019

Log:
  MFC r284915:
  Make the system queue header file fully usable within C++ programs by
  adding macros to define class lists.
  
  This change is backwards compatible for all use within C and C++
  programs. Only C++ programs will have added support to use the queue
  macros within classes. Previously the queue macros could only be used
  within structures.
  
  The queue.3 manual page has been updated to describe the new
  functionality and some alphabetic sorting has been done while
  at it.
  
  Differential Revision:https://reviews.freebsd.org/D2745
  PR:   200827 (exp-run)

Modified:
  stable/9/share/man/man3/Makefile
  stable/9/share/man/man3/queue.3
  stable/9/sys/sys/queue.h
Directory Properties:
  stable/9/share/   (props changed)
  stable/9/share/man/   (props changed)
  stable/9/share/man/man3/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/share/man/man3/Makefile
==
--- stable/9/share/man/man3/MakefileThu Oct  8 07:50:50 2015
(r289018)
+++ stable/9/share/man/man3/MakefileThu Oct  8 08:06:23 2015
(r289019)
@@ -40,10 +40,13 @@ MLINKS+=fpgetround.3 fpgetmask.3 \
 MLINKS+=   makedev.3 major.3 \
makedev.3 minor.3
 MLINKS+=   ${PTHREAD_MLINKS}
-MLINKS+=   queue.3 LIST_EMPTY.3 \
+MLINKS+=   queue.3 LIST_CLASS_ENTRY.3 \
+   queue.3 LIST_CLASS_HEAD.3 \
+   queue.3 LIST_EMPTY.3 \
queue.3 LIST_ENTRY.3 \
queue.3 LIST_FIRST.3 \
queue.3 LIST_FOREACH.3 \
+   queue.3 LIST_FOREACH_FROM_SAFE.3 \
queue.3 LIST_FOREACH_SAFE.3 \
queue.3 LIST_HEAD.3 \
queue.3 LIST_HEAD_INITIALIZER.3 \
@@ -55,10 +58,13 @@ MLINKS+=queue.3 LIST_EMPTY.3 \
queue.3 LIST_PREV.3 \
queue.3 LIST_REMOVE.3 \
queue.3 LIST_SWAP.3 \
+   queue.3 SLIST_CLASS_ENTRY.3 \
+   queue.3 SLIST_CLASS_HEAD.3 \
queue.3 SLIST_EMPTY.3 \
queue.3 SLIST_ENTRY.3 \
queue.3 SLIST_FIRST.3 \
queue.3 SLIST_FOREACH.3 \
+   queue.3 SLIST_FOREACH_FROM_SAFE.3 \
queue.3 SLIST_FOREACH_SAFE.3 \
queue.3 SLIST_HEAD.3 \
queue.3 SLIST_HEAD_INITIALIZER.3 \
@@ -70,11 +76,14 @@ MLINKS+=queue.3 LIST_EMPTY.3 \
queue.3 SLIST_REMOVE_AFTER.3 \
queue.3 SLIST_REMOVE_HEAD.3 \
queue.3 SLIST_SWAP.3 \
+   queue.3 STAILQ_CLASS_ENTRY.3 \
+   queue.3 STAILQ_CLASS_HEAD.3 \
queue.3 STAILQ_CONCAT.3 \
queue.3 STAILQ_EMPTY.3 \
queue.3 STAILQ_ENTRY.3 \
queue.3 STAILQ_FIRST.3 \
queue.3 STAILQ_FOREACH.3 \
+   queue.3 STAILQ_FOREACH_FROM_SAFE.3 \
queue.3 STAILQ_FOREACH_SAFE.3 \
queue.3 STAILQ_HEAD.3 \
queue.3 STAILQ_HEAD_INITIALIZER.3 \
@@ -88,12 +97,16 @@ MLINKS+=queue.3 LIST_EMPTY.3 \
queue.3 STAILQ_REMOVE_AFTER.3 \
queue.3 STAILQ_REMOVE_HEAD.3 \
queue.3 STAILQ_SWAP.3 \
+   queue.3 TAILQ_CLASS_ENTRY.3 \
+   queue.3 TAILQ_CLASS_HEAD.3 \
queue.3 TAILQ_CONCAT.3 \
queue.3 TAILQ_EMPTY.3 \
queue.3 TAILQ_ENTRY.3 \
queue.3 TAILQ_FIRST.3 \
queue.3 TAILQ_FOREACH.3 \
+   queue.3 TAILQ_FOREACH_FROM_SAFE.3 \
queue.3 TAILQ_FOREACH_REVERSE.3 \
+   queue.3 TAILQ_FOREACH_REVERSE_FROM_SAFE.3 \
queue.3 TAILQ_FOREACH_REVERSE_SAFE.3 \
queue.3 TAILQ_FOREACH_SAFE.3 \
queue.3 TAILQ_HEAD.3 \

Modified: stable/9/share/man/man3/queue.3
==
--- stable/9/share/man/man3/queue.3 Thu Oct  8 07:50:50 2015
(r289018)
+++ stable/9/share/man/man3/queue.3 Thu Oct  8 08:06:23 2015
(r289019)
@@ -32,35 +32,39 @@
 .\"@(#)queue.3 8.2 (Berkeley) 1/24/94
 .\" $FreeBSD$
 .\"
-.Dd April 16, 2015
+.Dd June 24, 2015
 .Dt QUEUE 3
 .Os
 .Sh NAME
+.Nm SLIST_CLASS_ENTRY ,
+.Nm SLIST_CLASS_HEAD ,
 .Nm SLIST_EMPTY ,
 .Nm SLIST_ENTRY ,
 .Nm SLIST_FIRST ,
 .Nm SLIST_FOREACH ,
 .Nm SLIST_FOREACH_FROM ,
-.Nm SLIST_FOREACH_SAFE ,
 .Nm SLIST_FOREACH_FROM_SAFE ,
+.Nm SLIST_FOREACH_SAFE ,
 .Nm SLIST_HEAD ,
 .Nm SLIST_HEAD_INITIALIZER ,
 .Nm SLIST_INIT ,
 .Nm SLIST_INSERT_AFTER ,
 .Nm SLIST_INSERT_HEAD ,
 .Nm SLIST_NEXT ,
+.Nm SLIST_REMOVE ,
 .Nm SLIST_REMOVE_AFTER ,
 .Nm SLIST_REMOVE_HEAD ,
-.Nm SLIST_REMOVE ,
 .Nm SLIST_SWAP ,
+.Nm STAILQ_C

svn commit: r289018 - in stable/10: share/man/man3 sys/sys

2015-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct  8 07:50:50 2015
New Revision: 289018
URL: https://svnweb.freebsd.org/changeset/base/289018

Log:
  MFC r284915:
  Make the system queue header file fully usable within C++ programs by
  adding macros to define class lists.
  
  This change is backwards compatible for all use within C and C++
  programs. Only C++ programs will have added support to use the queue
  macros within classes. Previously the queue macros could only be used
  within structures.
  
  The queue.3 manual page has been updated to describe the new
  functionality and some alphabetic sorting has been done while
  at it.
  
  Differential Revision:https://reviews.freebsd.org/D2745
  PR:   200827 (exp-run)

Modified:
  stable/10/share/man/man3/Makefile
  stable/10/share/man/man3/queue.3
  stable/10/sys/sys/queue.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man3/Makefile
==
--- stable/10/share/man/man3/Makefile   Thu Oct  8 07:34:30 2015
(r289017)
+++ stable/10/share/man/man3/Makefile   Thu Oct  8 07:50:50 2015
(r289018)
@@ -64,10 +64,13 @@ MLINKS+=fpgetround.3 fpgetmask.3 \
 MLINKS+=   makedev.3 major.3 \
makedev.3 minor.3
 MLINKS+=   ${PTHREAD_MLINKS}
-MLINKS+=   queue.3 LIST_EMPTY.3 \
+MLINKS+=   queue.3 LIST_CLASS_ENTRY.3 \
+   queue.3 LIST_CLASS_HEAD.3 \
+   queue.3 LIST_EMPTY.3 \
queue.3 LIST_ENTRY.3 \
queue.3 LIST_FIRST.3 \
queue.3 LIST_FOREACH.3 \
+   queue.3 LIST_FOREACH_FROM_SAFE.3 \
queue.3 LIST_FOREACH_SAFE.3 \
queue.3 LIST_HEAD.3 \
queue.3 LIST_HEAD_INITIALIZER.3 \
@@ -79,10 +82,13 @@ MLINKS+=queue.3 LIST_EMPTY.3 \
queue.3 LIST_PREV.3 \
queue.3 LIST_REMOVE.3 \
queue.3 LIST_SWAP.3 \
+   queue.3 SLIST_CLASS_ENTRY.3 \
+   queue.3 SLIST_CLASS_HEAD.3 \
queue.3 SLIST_EMPTY.3 \
queue.3 SLIST_ENTRY.3 \
queue.3 SLIST_FIRST.3 \
queue.3 SLIST_FOREACH.3 \
+   queue.3 SLIST_FOREACH_FROM_SAFE.3 \
queue.3 SLIST_FOREACH_SAFE.3 \
queue.3 SLIST_HEAD.3 \
queue.3 SLIST_HEAD_INITIALIZER.3 \
@@ -94,11 +100,14 @@ MLINKS+=   queue.3 LIST_EMPTY.3 \
queue.3 SLIST_REMOVE_AFTER.3 \
queue.3 SLIST_REMOVE_HEAD.3 \
queue.3 SLIST_SWAP.3 \
+   queue.3 STAILQ_CLASS_ENTRY.3 \
+   queue.3 STAILQ_CLASS_HEAD.3 \
queue.3 STAILQ_CONCAT.3 \
queue.3 STAILQ_EMPTY.3 \
queue.3 STAILQ_ENTRY.3 \
queue.3 STAILQ_FIRST.3 \
queue.3 STAILQ_FOREACH.3 \
+   queue.3 STAILQ_FOREACH_FROM_SAFE.3 \
queue.3 STAILQ_FOREACH_SAFE.3 \
queue.3 STAILQ_HEAD.3 \
queue.3 STAILQ_HEAD_INITIALIZER.3 \
@@ -112,12 +121,16 @@ MLINKS+=  queue.3 LIST_EMPTY.3 \
queue.3 STAILQ_REMOVE_AFTER.3 \
queue.3 STAILQ_REMOVE_HEAD.3 \
queue.3 STAILQ_SWAP.3 \
+   queue.3 TAILQ_CLASS_ENTRY.3 \
+   queue.3 TAILQ_CLASS_HEAD.3 \
queue.3 TAILQ_CONCAT.3 \
queue.3 TAILQ_EMPTY.3 \
queue.3 TAILQ_ENTRY.3 \
queue.3 TAILQ_FIRST.3 \
queue.3 TAILQ_FOREACH.3 \
+   queue.3 TAILQ_FOREACH_FROM_SAFE.3 \
queue.3 TAILQ_FOREACH_REVERSE.3 \
+   queue.3 TAILQ_FOREACH_REVERSE_FROM_SAFE.3 \
queue.3 TAILQ_FOREACH_REVERSE_SAFE.3 \
queue.3 TAILQ_FOREACH_SAFE.3 \
queue.3 TAILQ_HEAD.3 \

Modified: stable/10/share/man/man3/queue.3
==
--- stable/10/share/man/man3/queue.3Thu Oct  8 07:34:30 2015
(r289017)
+++ stable/10/share/man/man3/queue.3Thu Oct  8 07:50:50 2015
(r289018)
@@ -32,35 +32,39 @@
 .\"@(#)queue.3 8.2 (Berkeley) 1/24/94
 .\" $FreeBSD$
 .\"
-.Dd April 16, 2015
+.Dd June 24, 2015
 .Dt QUEUE 3
 .Os
 .Sh NAME
+.Nm SLIST_CLASS_ENTRY ,
+.Nm SLIST_CLASS_HEAD ,
 .Nm SLIST_EMPTY ,
 .Nm SLIST_ENTRY ,
 .Nm SLIST_FIRST ,
 .Nm SLIST_FOREACH ,
 .Nm SLIST_FOREACH_FROM ,
-.Nm SLIST_FOREACH_SAFE ,
 .Nm SLIST_FOREACH_FROM_SAFE ,
+.Nm SLIST_FOREACH_SAFE ,
 .Nm SLIST_HEAD ,
 .Nm SLIST_HEAD_INITIALIZER ,
 .Nm SLIST_INIT ,
 .Nm SLIST_INSERT_AFTER ,
 .Nm SLIST_INSERT_HEAD ,
 .Nm SLIST_NEXT ,
+.Nm SLIST_REMOVE ,
 .Nm SLIST_REMOVE_AFTER ,
 .Nm SLIST_REMOVE_HEAD ,
-.Nm SLIST_REMOVE ,
 .Nm SLIST_SWAP ,
+.Nm STAILQ_CLASS_ENTRY ,
+.Nm STAILQ_CLASS_HEAD ,
 .Nm STAILQ_CONCAT ,
 .Nm STAILQ_EMPTY ,
 .Nm STAILQ_ENTRY ,
 .Nm STAILQ_FIRST ,
 .Nm STAILQ_FOREACH ,
 .Nm STAILQ_FORE

Re: svn commit: r289002 - head/release/scripts

2015-10-08 Thread Garrett Cooper

> On Oct 7, 2015, at 23:14, Alexey Dokuchaev  wrote:
> 
>> On Thu, Oct 08, 2015 at 03:28:15AM +, Craig Rodrigues wrote:
>> New Revision: 289002
>> URL: https://svnweb.freebsd.org/changeset/base/289002
>> 
>> Log:
>>  Use print as a function, not operator.
> 
> Because?...(even when it looks obvious, commit logs should be crystal clear
> on what was done (30%) and why (70%).

Probably because py3k turns print into a function, but it would have been nice 
if that was in the commit message.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2015-10-08 Thread Alexander Motin
Author: mav
Date: Thu Oct  8 07:34:30 2015
New Revision: 289017
URL: https://svnweb.freebsd.org/changeset/base/289017

Log:
  Add missing vnode lock in case of file modify request.
  
  Submitted by: Richard Kojedzinszky
  MFC after:1 week

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

Modified: head/sys/cam/ctl/ctl_backend_block.c
==
--- head/sys/cam/ctl/ctl_backend_block.cThu Oct  8 07:31:05 2015
(r289016)
+++ head/sys/cam/ctl/ctl_backend_block.cThu Oct  8 07:34:30 2015
(r289017)
@@ -2623,9 +2623,11 @@ ctl_be_block_modify(struct ctl_be_block_
error = ctl_be_block_open(be_lun, req);
else if (vn_isdisk(be_lun->vn, &error))
error = ctl_be_block_open_dev(be_lun, req);
-   else if (be_lun->vn->v_type == VREG)
+   else if (be_lun->vn->v_type == VREG) {
+   vn_lock(be_lun->vn, LK_SHARED | LK_RETRY);
error = ctl_be_block_open_file(be_lun, req);
-   else
+   VOP_UNLOCK(be_lun->vn, 0);
+   } else
error = EINVAL;
if ((cbe_lun->flags & CTL_LUN_FLAG_NO_MEDIA) &&
be_lun->vn != NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289016 - in stable/10/sys/dev/usb: . quirk

2015-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct  8 07:31:05 2015
New Revision: 289016
URL: https://svnweb.freebsd.org/changeset/base/289016

Log:
  MFC r287321:
  Add new USB quirk.
  
  PR:   202783

Modified:
  stable/10/sys/dev/usb/quirk/usb_quirk.c
  stable/10/sys/dev/usb/usbdevs
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c
==
--- stable/10/sys/dev/usb/quirk/usb_quirk.c Thu Oct  8 07:29:30 2015
(r289015)
+++ stable/10/sys/dev/usb/quirk/usb_quirk.c Thu Oct  8 07:31:05 2015
(r289016)
@@ -98,6 +98,7 @@ static struct usb_quirk_entry usb_quirks
USB_QUIRK(REALTEK, RTL8153, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(ELSA, MODEM1, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(PLANEX2, MZKUE150N, 0x, 0x, UQ_CFG_INDEX_1),
+   USB_QUIRK(CISCOLINKSYS, USB3GIGV1, 0x, 0x, UQ_CFG_INDEX_1),
/* Quirks for printer devices */
USB_QUIRK(HP, 895C, 0x, 0x, UQ_BROKEN_BIDIR),
USB_QUIRK(HP, 880C, 0x, 0x, UQ_BROKEN_BIDIR),

Modified: stable/10/sys/dev/usb/usbdevs
==
--- stable/10/sys/dev/usb/usbdevs   Thu Oct  8 07:29:30 2015
(r289015)
+++ stable/10/sys/dev/usb/usbdevs   Thu Oct  8 07:31:05 2015
(r289016)
@@ -1407,6 +1407,7 @@ product CISCOLINKSYS WUSB54GC 0x0020  WUS
 product CISCOLINKSYS WUSB54GR  0x0023  WUSB54GR
 product CISCOLINKSYS WUSBF54G  0x0024  WUSBF54G
 product CISCOLINKSYS AE10000x002f  AE1000
+product CISCOLINKSYS USB3GIGV1 0x0041  USB3GIGV1 USB Ethernet Adapter
 product CISCOLINKSYS2 RT3070   0x4001  RT3070
 product CISCOLINKSYS3 RT3070   0x0101  RT3070
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289015 - in stable/9/sys/dev/usb: . quirk

2015-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct  8 07:29:30 2015
New Revision: 289015
URL: https://svnweb.freebsd.org/changeset/base/289015

Log:
  MFC r287321:
  Add new USB quirk.
  
  PR:   202783

Modified:
  stable/9/sys/dev/usb/quirk/usb_quirk.c
  stable/9/sys/dev/usb/usbdevs
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c
==
--- stable/9/sys/dev/usb/quirk/usb_quirk.c  Thu Oct  8 07:27:25 2015
(r289014)
+++ stable/9/sys/dev/usb/quirk/usb_quirk.c  Thu Oct  8 07:29:30 2015
(r289015)
@@ -98,6 +98,7 @@ static struct usb_quirk_entry usb_quirks
USB_QUIRK(REALTEK, RTL8153, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(ELSA, MODEM1, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(PLANEX2, MZKUE150N, 0x, 0x, UQ_CFG_INDEX_1),
+   USB_QUIRK(CISCOLINKSYS, USB3GIGV1, 0x, 0x, UQ_CFG_INDEX_1),
/* Quirks for printer devices */
USB_QUIRK(HP, 895C, 0x, 0x, UQ_BROKEN_BIDIR),
USB_QUIRK(HP, 880C, 0x, 0x, UQ_BROKEN_BIDIR),

Modified: stable/9/sys/dev/usb/usbdevs
==
--- stable/9/sys/dev/usb/usbdevsThu Oct  8 07:27:25 2015
(r289014)
+++ stable/9/sys/dev/usb/usbdevsThu Oct  8 07:29:30 2015
(r289015)
@@ -1407,6 +1407,7 @@ product CISCOLINKSYS WUSB54GC 0x0020  WUS
 product CISCOLINKSYS WUSB54GR  0x0023  WUSB54GR
 product CISCOLINKSYS WUSBF54G  0x0024  WUSBF54G
 product CISCOLINKSYS AE10000x002f  AE1000
+product CISCOLINKSYS USB3GIGV1 0x0041  USB3GIGV1 USB Ethernet Adapter
 product CISCOLINKSYS2 RT3070   0x4001  RT3070
 product CISCOLINKSYS3 RT3070   0x0101  RT3070
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289014 - stable/9/sys/dev/usb/controller

2015-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct  8 07:27:25 2015
New Revision: 289014
URL: https://svnweb.freebsd.org/changeset/base/289014

Log:
  MFC r287355, r287772 and r287825:
  Add new USB PCI IDs.
  
  PR:   202807
  Submitted by: Dmitry Luhtionov 
  Differential Revision:https://reviews.freebsd.org/D3665

Modified:
  stable/9/sys/dev/usb/controller/uhci_pci.c
  stable/9/sys/dev/usb/controller/xhci_pci.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/controller/uhci_pci.c
==
--- stable/9/sys/dev/usb/controller/uhci_pci.c  Thu Oct  8 07:24:54 2015
(r289013)
+++ stable/9/sys/dev/usb/controller/uhci_pci.c  Thu Oct  8 07:27:25 2015
(r289014)
@@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$");
 #include "usb_if.h"
 
 #definePCI_UHCI_VENDORID_INTEL 0x8086
+#definePCI_UHCI_VENDORID_HP0x103c
 #definePCI_UHCI_VENDORID_VIA   0x1106
 
 /* PIIX4E has no separate stepping */
@@ -222,6 +223,9 @@ uhci_pci_match(device_t self)
case 0x76028086:
return ("Intel 82372FB/82468GX USB controller");
 
+   case 0x3300103c:
+   return ("HP iLO Standard Virtual USB controller");
+
case 0x30381106:
return ("VIA 83C572 USB controller");
 
@@ -309,6 +313,9 @@ uhci_pci_attach(device_t self)
case PCI_UHCI_VENDORID_INTEL:
sprintf(sc->sc_vendor, "Intel");
break;
+   case PCI_UHCI_VENDORID_HP:
+   sprintf(sc->sc_vendor, "HP");
+   break;
case PCI_UHCI_VENDORID_VIA:
sprintf(sc->sc_vendor, "VIA");
break;

Modified: stable/9/sys/dev/usb/controller/xhci_pci.c
==
--- stable/9/sys/dev/usb/controller/xhci_pci.c  Thu Oct  8 07:24:54 2015
(r289013)
+++ stable/9/sys/dev/usb/controller/xhci_pci.c  Thu Oct  8 07:27:25 2015
(r289014)
@@ -112,6 +112,9 @@ xhci_pci_match(device_t self)
case 0x8cb18086:
return ("Intel Wildcat Point USB 3.0 controller");
 
+   case 0xa01b177d:
+   return ("Cavium ThunderX USB 3.0 controller");
+
default:
break;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289013 - stable/10/sys/dev/usb/controller

2015-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct  8 07:24:54 2015
New Revision: 289013
URL: https://svnweb.freebsd.org/changeset/base/289013

Log:
  MFC r287355, r287772 and r287825:
  Add new USB PCI IDs.
  
  PR:   202807
  Submitted by: Dmitry Luhtionov 
  Differential Revision:https://reviews.freebsd.org/D3665

Modified:
  stable/10/sys/dev/usb/controller/uhci_pci.c
  stable/10/sys/dev/usb/controller/xhci_pci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/controller/uhci_pci.c
==
--- stable/10/sys/dev/usb/controller/uhci_pci.c Thu Oct  8 07:22:40 2015
(r289012)
+++ stable/10/sys/dev/usb/controller/uhci_pci.c Thu Oct  8 07:24:54 2015
(r289013)
@@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$");
 #include "usb_if.h"
 
 #definePCI_UHCI_VENDORID_INTEL 0x8086
+#definePCI_UHCI_VENDORID_HP0x103c
 #definePCI_UHCI_VENDORID_VIA   0x1106
 
 /* PIIX4E has no separate stepping */
@@ -222,6 +223,9 @@ uhci_pci_match(device_t self)
case 0x76028086:
return ("Intel 82372FB/82468GX USB controller");
 
+   case 0x3300103c:
+   return ("HP iLO Standard Virtual USB controller");
+
case 0x30381106:
return ("VIA 83C572 USB controller");
 
@@ -309,6 +313,9 @@ uhci_pci_attach(device_t self)
case PCI_UHCI_VENDORID_INTEL:
sprintf(sc->sc_vendor, "Intel");
break;
+   case PCI_UHCI_VENDORID_HP:
+   sprintf(sc->sc_vendor, "HP");
+   break;
case PCI_UHCI_VENDORID_VIA:
sprintf(sc->sc_vendor, "VIA");
break;

Modified: stable/10/sys/dev/usb/controller/xhci_pci.c
==
--- stable/10/sys/dev/usb/controller/xhci_pci.c Thu Oct  8 07:22:40 2015
(r289012)
+++ stable/10/sys/dev/usb/controller/xhci_pci.c Thu Oct  8 07:24:54 2015
(r289013)
@@ -112,6 +112,9 @@ xhci_pci_match(device_t self)
case 0x8cb18086:
return ("Intel Wildcat Point USB 3.0 controller");
 
+   case 0xa01b177d:
+   return ("Cavium ThunderX USB 3.0 controller");
+
default:
break;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289012 - head/sys/dev/wpi

2015-10-08 Thread Adrian Chadd
Author: adrian
Date: Thu Oct  8 07:22:40 2015
New Revision: 289012
URL: https://svnweb.freebsd.org/changeset/base/289012

Log:
  wpi(4): check size before transmitting frames
  
  In addition to https://bz-attachments.freebsd.org/attachment.cgi?id=156112;
  fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=144987.
  
  Tested:
  
  * Tested with Intel 3945BG, STA mode
  
  Submitted by: 
  Differential Revision:https://reviews.freebsd.org/D3762

Modified:
  head/sys/dev/wpi/if_wpi.c

Modified: head/sys/dev/wpi/if_wpi.c
==
--- head/sys/dev/wpi/if_wpi.c   Thu Oct  8 07:21:36 2015(r289011)
+++ head/sys/dev/wpi/if_wpi.c   Thu Oct  8 07:22:40 2015(r289012)
@@ -2603,6 +2603,11 @@ wpi_cmd2(struct wpi_softc *sc, struct wp
hdrlen = ieee80211_anyhdrsize(wh);
totlen = buf->m->m_pkthdr.len;
 
+   if (__predict_false(totlen < sizeof(struct ieee80211_frame_min))) {
+   error = EINVAL;
+   goto fail;
+   }
+
if (hdrlen & 3) {
/* First segment length must be a multiple of 4. */
pad = 4 - (hdrlen & 3);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289011 - head/sys/dev/wpi

2015-10-08 Thread Adrian Chadd
Author: adrian
Date: Thu Oct  8 07:21:36 2015
New Revision: 289011
URL: https://svnweb.freebsd.org/changeset/base/289011

Log:
  wpi(4): fix some byteorder conversions
  
  Submitted by: 
  Differential Revision:https://reviews.freebsd.org/D3761

Modified:
  head/sys/dev/wpi/if_wpi.c

Modified: head/sys/dev/wpi/if_wpi.c
==
--- head/sys/dev/wpi/if_wpi.c   Thu Oct  8 07:20:22 2015(r289010)
+++ head/sys/dev/wpi/if_wpi.c   Thu Oct  8 07:21:36 2015(r289011)
@@ -2265,7 +2265,8 @@ wpi_notif_intr(struct wpi_softc *sc)
"duration %u, status %x, tsf %ju, mode %x\n",
stat->rtsfailcnt, stat->ackfailcnt,
stat->btkillcnt, stat->rate, 
le32toh(stat->duration),
-   le32toh(stat->status), *tsf, *mode);
+   le32toh(stat->status), le64toh(*tsf),
+   le32toh(*mode));
 
break;
}
@@ -4121,7 +4122,7 @@ wpi_scan(struct wpi_softc *sc, struct ie
 * after the scan probe request
 */
chan = (struct wpi_scan_chan *)frm;
-   chan->chan = htole16(ieee80211_chan2ieee(ic, c));
+   chan->chan = ieee80211_chan2ieee(ic, c);
chan->flags = 0;
if (nssid) {
hdr->crc_threshold = WPI_SCAN_CRC_TH_DEFAULT;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289010 - head/sys/dev/wpi

2015-10-08 Thread Adrian Chadd
Author: adrian
Date: Thu Oct  8 07:20:22 2015
New Revision: 289010
URL: https://svnweb.freebsd.org/changeset/base/289010

Log:
  wpi(4): fix 'maybe uninitialized' warnings
  
  Submitted by: 
  Differential Revision:https://reviews.freebsd.org/D3760

Modified:
  head/sys/dev/wpi/if_wpi.c

Modified: head/sys/dev/wpi/if_wpi.c
==
--- head/sys/dev/wpi/if_wpi.c   Thu Oct  8 07:19:57 2015(r289009)
+++ head/sys/dev/wpi/if_wpi.c   Thu Oct  8 07:20:22 2015(r289010)
@@ -2731,6 +2731,7 @@ wpi_tx_data(struct wpi_softc *sc, struct
wh = mtod(m, struct ieee80211_frame *);
type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1);
+   swcrypt = 1;
 
/* Select EDCA Access Category and TX ring for this frame. */
if (IEEE80211_QOS_HAS_SEQ(wh)) {
@@ -2844,7 +2845,7 @@ wpi_tx_data(struct wpi_softc *sc, struct
tx->id = wn->id;
}
 
-   if (k != NULL && !swcrypt) {
+   if (!swcrypt) {
switch (k->wk_cipher->ic_cipher) {
case IEEE80211_CIPHER_AES_CCM:
tx->security = WPI_CIPHER_CCMP;
@@ -2894,6 +2895,7 @@ wpi_tx_data_raw(struct wpi_softc *sc, st
 
wh = mtod(m, struct ieee80211_frame *);
type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
+   swcrypt = 1;
 
ac = params->ibp_pri & 3;
 
@@ -2952,7 +2954,7 @@ wpi_tx_data_raw(struct wpi_softc *sc, st
tx->timeout = htole16(2);
}
 
-   if (k != NULL && !swcrypt) {
+   if (!swcrypt) {
switch (k->wk_cipher->ic_cipher) {
case IEEE80211_CIPHER_AES_CCM:
tx->security = WPI_CIPHER_CCMP;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289009 - in stable/9: share/man/man4 sys/dev/usb/quirk

2015-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct  8 07:19:57 2015
New Revision: 289009
URL: https://svnweb.freebsd.org/changeset/base/289009

Log:
  MFC r288180:
  Implement support for reading USB quirks from the kernel environment.
  Refer to the usb_quirk(4) manual page for more details on how to use
  this new feature.
  
  Submitted by: Maxime Soule 
  PR:   203249

Modified:
  stable/9/share/man/man4/usb_quirk.4
  stable/9/sys/dev/usb/quirk/usb_quirk.c
Directory Properties:
  stable/9/share/   (props changed)
  stable/9/share/man/   (props changed)
  stable/9/share/man/man4/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/share/man/man4/usb_quirk.4
==
--- stable/9/share/man/man4/usb_quirk.4 Thu Oct  8 07:18:28 2015
(r289008)
+++ stable/9/share/man/man4/usb_quirk.4 Thu Oct  8 07:19:57 2015
(r289009)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 7, 2015
+.Dd September 24, 2015
 .Dt USB_QUIRK 4
 .Os
 .Sh NAME
@@ -177,7 +177,53 @@ ejects after HID command
 .Pp
 See
 .Pa /sys/dev/usb/quirk/usb_quirk.h
-for the complete list of supported quirks.
+or run "usbconfig dump_quirk_names" for the complete list of supported quirks.
+.Sh LOADER TUNABLE
+The following tunable can be set at the
+.Xr loader 8
+prompt before booting the kernel, or stored in
+.Xr loader.conf 5 .
+.Bl -tag -width indent
+.It Va hw.usb.quirk.%d
+The value is a string whose format is:
+.Bd -literal -offset indent
+.Qo VendorId ProductId LowRevision HighRevision UQ_QUIRK,... Qc
+.Ed
+.Pp
+Installs the quirks
+.Ic UQ_QUIRK,...
+for all USB devices matching
+.Ic VendorId ,
+.Ic ProductId
+and has a hardware revision between and including
+.Ic LowRevision
+and
+.Ic HighRevision .
+.Pp
+.Ic VendorId ,
+.Ic ProductId ,
+.Ic LowRevision
+and
+.Ic HighRevision
+are all 16 bits numbers which can be decimal or hexadecimal based.
+.Pp
+A maximum of 100 variables
+.Ic hw.usb.quirk.0, .1, ..., .99
+can be defined.
+.Pp
+If a matching entry is found in the kernel's internal quirks table, it
+is replaced by the new definition.
+.Pp
+Else a new entry is created given that the quirk table is not full.
+.Pp
+The kernel iterates over the
+.Ic hw.usb.quirk.N
+variables starting at
+.Ic N = 0
+and stops at
+.Ic N = 99
+or the first non-existing one.
+.El
 .Sh EXAMPLES
 After attaching a
 .Nm u3g
@@ -186,6 +232,13 @@ device which appears as a USB device on
 .Bd -literal -offset indent
 usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT
 .Ed
+.Pp
+To install a quirk at boot time, place one or several lines like the
+following in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.usb.quirk.0="0x04d9 0xfa50 0 0x UQ_KBD_IGNORE"
+.Ed
 .Sh SEE ALSO
 .Xr usbconfig 8
 .Sh HISTORY

Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c
==
--- stable/9/sys/dev/usb/quirk/usb_quirk.c  Thu Oct  8 07:18:28 2015
(r289008)
+++ stable/9/sys/dev/usb/quirk/usb_quirk.c  Thu Oct  8 07:19:57 2015
(r289009)
@@ -61,6 +61,7 @@ MODULE_VERSION(usb_quirk, 1);
 
 #defineUSB_DEV_QUIRKS_MAX 384
 #defineUSB_SUB_QUIRKS_MAX 8
+#defineUSB_QUIRK_ENVROOT "hw.usb.quirk."
 
 struct usb_quirk_entry {
uint16_t vid;
@@ -607,8 +608,32 @@ static const char *usb_quirk_str[USB_QUI
 static const char *
 usb_quirkstr(uint16_t quirk)
 {
-   return ((quirk < USB_QUIRK_MAX) ?
-   usb_quirk_str[quirk] : "USB_QUIRK_UNKNOWN");
+   return ((quirk < USB_QUIRK_MAX && usb_quirk_str[quirk] != NULL) ?
+   usb_quirk_str[quirk] : "UQ_UNKNOWN");
+}
+
+/**
+ * usb_strquirk
+ *
+ * This function converts a string into a USB quirk code.
+ *
+ * Returns:
+ * Less than USB_QUIRK_MAX: Quirk code
+ * Else: Quirk code not found
+ **/
+static uint16_t
+usb_strquirk(const char *str, size_t len)
+{
+   const char *quirk;
+   uint16_t x;
+
+   for (x = 0; x != USB_QUIRK_MAX; x++) {
+   quirk = usb_quirkstr(x);
+   if (strncmp(str, quirk, len) == 0 &&
+   quirk[len] == 0)
+   break;
+   }
+   return (x);
 }
 
 /**
@@ -853,12 +878,122 @@ usb_quirk_ioctl(unsigned long cmd, caddr
return (ENOIOCTL);
 }
 
+/**
+ * usb_quirk_strtou16
+ *
+ * Helper function to scan a 16-bit integer.
+ **/
+static uint16_t
+usb_quirk_strtou16(const char **pptr, const char *name, const char *what)
+{
+   unsigned long value;
+   char *end;
+
+   value = strtoul(*pptr, &end, 0);
+   if (value > 6553

svn commit: r289008 - head/sys/dev/wpi

2015-10-08 Thread Adrian Chadd
Author: adrian
Date: Thu Oct  8 07:18:28 2015
New Revision: 289008
URL: https://svnweb.freebsd.org/changeset/base/289008

Log:
  wpi(4): add some branch predictions.
  
  Submitted by: 
  Differential Revision:https://reviews.freebsd.org/D3759

Modified:
  head/sys/dev/wpi/if_wpi.c

Modified: head/sys/dev/wpi/if_wpi.c
==
--- head/sys/dev/wpi/if_wpi.c   Thu Oct  8 07:17:35 2015(r289007)
+++ head/sys/dev/wpi/if_wpi.c   Thu Oct  8 07:18:28 2015(r289008)
@@ -1925,7 +1925,7 @@ wpi_rx_done(struct wpi_softc *sc, struct
 
stat = (struct wpi_rx_stat *)(desc + 1);
 
-   if (stat->len > WPI_STAT_MAXLEN) {
+   if (__predict_false(stat->len > WPI_STAT_MAXLEN)) {
device_printf(sc->sc_dev, "invalid RX statistic header\n");
goto fail1;
}
@@ -1955,7 +1955,7 @@ wpi_rx_done(struct wpi_softc *sc, struct
}
 
m1 = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE);
-   if (m1 == NULL) {
+   if (__predict_false(m1 == NULL)) {
DPRINTF(sc, WPI_DEBUG_ANY, "%s: no mbuf to restock ring\n",
__func__);
goto fail1;
@@ -1964,7 +1964,7 @@ wpi_rx_done(struct wpi_softc *sc, struct
 
error = bus_dmamap_load(ring->data_dmat, data->map, mtod(m1, void *),
MJUMPAGESIZE, wpi_dma_map_addr, &paddr, BUS_DMA_NOWAIT);
-   if (error != 0 && error != EFBIG) {
+   if (__predict_false(error != 0 && error != EFBIG)) {
device_printf(sc->sc_dev,
"%s: bus_dmamap_load failed, error %d\n", __func__, error);
m_freem(m1);
@@ -2198,7 +2198,7 @@ wpi_notif_intr(struct wpi_softc *sc)
/* An 802.11 frame has been received. */
wpi_rx_done(sc, desc, data);
 
-   if (sc->sc_running == 0) {
+   if (__predict_false(sc->sc_running == 0)) {
/* wpi_stop() was called. */
return;
}
@@ -2527,7 +2527,8 @@ wpi_intr(void *arg)
 
r1 = WPI_READ(sc, WPI_INT);
 
-   if (r1 == 0x || (r1 & 0xfff0) == 0xa5a5a5a0)
+   if (__predict_false(r1 == 0x ||
+  (r1 & 0xfff0) == 0xa5a5a5a0))
goto end;   /* Hardware gone! */
 
r2 = WPI_READ(sc, WPI_FH_INT);
@@ -2542,7 +2543,7 @@ wpi_intr(void *arg)
WPI_WRITE(sc, WPI_INT, r1);
WPI_WRITE(sc, WPI_FH_INT, r2);
 
-   if (r1 & (WPI_INT_SW_ERR | WPI_INT_HW_ERR)) {
+   if (__predict_false(r1 & (WPI_INT_SW_ERR | WPI_INT_HW_ERR))) {
device_printf(sc->sc_dev, "fatal firmware error\n");
 #ifdef WPI_DEBUG
wpi_debug_registers(sc);
@@ -2567,7 +2568,7 @@ wpi_intr(void *arg)
 
 done:
/* Re-enable interrupts. */
-   if (sc->sc_running)
+   if (__predict_true(sc->sc_running))
WPI_WRITE(sc, WPI_INT_MASK, WPI_INT_MASK_DEF);
 
 end:   WPI_UNLOCK(sc);
@@ -2591,7 +2592,7 @@ wpi_cmd2(struct wpi_softc *sc, struct wp
 
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__);
 
-   if (sc->sc_running == 0) {
+   if (__predict_false(sc->sc_running == 0)) {
/* wpi_stop() was called */
error = ENETDOWN;
goto fail;
@@ -2644,7 +2645,7 @@ wpi_cmd2(struct wpi_softc *sc, struct wp
 
error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map,
buf->m, segs, &nsegs, BUS_DMA_NOWAIT);
-   if (error != 0) {
+   if (__predict_false(error != 0)) {
device_printf(sc->sc_dev,
"%s: can't map mbuf (error %d)\n", __func__,
error);
@@ -3061,7 +3062,7 @@ wpi_transmit(struct ieee80211com *ic, st
DPRINTF(sc, WPI_DEBUG_XMIT, "%s: called\n", __func__);
 
/* Check if interface is up & running. */
-   if (sc->sc_running == 0) {
+   if (__predict_false(sc->sc_running == 0)) {
error = ENXIO;
goto unlock;
}
@@ -3160,7 +3161,7 @@ wpi_cmd(struct wpi_softc *sc, int code, 
 
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__);
 
-   if (sc->sc_running == 0) {
+   if (__predict_false(sc->sc_running == 0)) {
/* wpi_stop() was called */
if (code == WPI_CMD_SCAN)
error = ENETDOWN;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289006 - head/sys/dev/wpi

2015-10-08 Thread Adrian Chadd
Author: adrian
Date: Thu Oct  8 07:17:11 2015
New Revision: 289006
URL: https://svnweb.freebsd.org/changeset/base/289006

Log:
  wpi(4): drop unnecessary locking in wpi_set_pslevel().
  
  Submitted by: 
  Differential Revision:https://reviews.freebsd.org/D3758

Modified:
  head/sys/dev/wpi/if_wpi.c
  head/sys/dev/wpi/if_wpivar.h

Modified: head/sys/dev/wpi/if_wpi.c
==
--- head/sys/dev/wpi/if_wpi.c   Thu Oct  8 06:34:12 2015(r289005)
+++ head/sys/dev/wpi/if_wpi.c   Thu Oct  8 07:17:11 2015(r289006)
@@ -2116,6 +2116,7 @@ wpi_cmd_done(struct wpi_softc *sc, struc
 {
struct wpi_tx_ring *ring = &sc->txq[WPI_CMD_QUEUE_NUM];
struct wpi_tx_data *data;
+   struct wpi_tx_cmd *cmd;
 
DPRINTF(sc, WPI_DEBUG_CMD, "cmd notification qid %x idx %d flags %x "
   "type %s len %d\n", desc->qid, desc->idx,
@@ -2128,6 +2129,7 @@ wpi_cmd_done(struct wpi_softc *sc, struc
KASSERT(ring->queued == 0, ("ring->queued must be 0"));
 
data = &ring->data[desc->idx];
+   cmd = &ring->cmd[desc->idx];
 
/* If the command was mapped in an mbuf, free it. */
if (data->m != NULL) {
@@ -2138,11 +2140,16 @@ wpi_cmd_done(struct wpi_softc *sc, struc
data->m = NULL;
}
 
-   wakeup(&ring->cmd[desc->idx]);
+   wakeup(cmd);
 
if (desc->type == WPI_CMD_SET_POWER_MODE) {
+   struct wpi_pmgt_cmd *pcmd = (struct wpi_pmgt_cmd *)cmd->data;
+
+   bus_dmamap_sync(ring->data_dmat, ring->cmd_dma.map,
+   BUS_DMASYNC_POSTREAD);
+
WPI_TXQ_LOCK(sc);
-   if (sc->sc_flags & WPI_PS_PATH) {
+   if (le16toh(pcmd->flags) & WPI_PS_ALLOW_SLEEP) {
sc->sc_update_rx_ring = wpi_update_rx_ring_ps;
sc->sc_update_tx_ring = wpi_update_tx_ring_ps;
} else {
@@ -3714,13 +3721,8 @@ wpi_set_pslevel(struct wpi_softc *sc, ui
pmgt = &wpi_pmgt[1][level];
 
memset(&cmd, 0, sizeof cmd);
-   WPI_TXQ_LOCK(sc);
-   if (level != 0) {   /* not CAM */
+   if (level != 0) /* not CAM */
cmd.flags |= htole16(WPI_PS_ALLOW_SLEEP);
-   sc->sc_flags |= WPI_PS_PATH;
-   } else
-   sc->sc_flags &= ~WPI_PS_PATH;
-   WPI_TXQ_UNLOCK(sc);
/* Retrieve PCIe Active State Power Management (ASPM). */
reg = pci_read_config(sc->sc_dev, sc->sc_cap_off + 0x10, 1);
if (!(reg & 0x1))   /* L0s Entry disabled. */

Modified: head/sys/dev/wpi/if_wpivar.h
==
--- head/sys/dev/wpi/if_wpivar.hThu Oct  8 06:34:12 2015
(r289005)
+++ head/sys/dev/wpi/if_wpivar.hThu Oct  8 07:17:11 2015
(r289006)
@@ -165,8 +165,6 @@ struct wpi_softc {
device_tsc_dev;
int sc_debug;
 
-   int sc_flags;
-#define WPI_PS_PATH(1 << 0)
int sc_running;
 
struct mtx  sc_mtx;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r289007 - in stable/10: share/man/man4 sys/dev/usb/quirk

2015-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct  8 07:17:35 2015
New Revision: 289007
URL: https://svnweb.freebsd.org/changeset/base/289007

Log:
  MFC r288180:
  Implement support for reading USB quirks from the kernel environment.
  Refer to the usb_quirk(4) manual page for more details on how to use
  this new feature.
  
  Submitted by: Maxime Soule 
  PR:   203249

Modified:
  stable/10/share/man/man4/usb_quirk.4
  stable/10/sys/dev/usb/quirk/usb_quirk.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/usb_quirk.4
==
--- stable/10/share/man/man4/usb_quirk.4Thu Oct  8 07:17:11 2015
(r289006)
+++ stable/10/share/man/man4/usb_quirk.4Thu Oct  8 07:17:35 2015
(r289007)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 7, 2015
+.Dd September 24, 2015
 .Dt USB_QUIRK 4
 .Os
 .Sh NAME
@@ -177,7 +177,53 @@ ejects after HID command
 .Pp
 See
 .Pa /sys/dev/usb/quirk/usb_quirk.h
-for the complete list of supported quirks.
+or run "usbconfig dump_quirk_names" for the complete list of supported quirks.
+.Sh LOADER TUNABLE
+The following tunable can be set at the
+.Xr loader 8
+prompt before booting the kernel, or stored in
+.Xr loader.conf 5 .
+.Bl -tag -width indent
+.It Va hw.usb.quirk.%d
+The value is a string whose format is:
+.Bd -literal -offset indent
+.Qo VendorId ProductId LowRevision HighRevision UQ_QUIRK,... Qc
+.Ed
+.Pp
+Installs the quirks
+.Ic UQ_QUIRK,...
+for all USB devices matching
+.Ic VendorId ,
+.Ic ProductId
+and has a hardware revision between and including
+.Ic LowRevision
+and
+.Ic HighRevision .
+.Pp
+.Ic VendorId ,
+.Ic ProductId ,
+.Ic LowRevision
+and
+.Ic HighRevision
+are all 16 bits numbers which can be decimal or hexadecimal based.
+.Pp
+A maximum of 100 variables
+.Ic hw.usb.quirk.0, .1, ..., .99
+can be defined.
+.Pp
+If a matching entry is found in the kernel's internal quirks table, it
+is replaced by the new definition.
+.Pp
+Else a new entry is created given that the quirk table is not full.
+.Pp
+The kernel iterates over the
+.Ic hw.usb.quirk.N
+variables starting at
+.Ic N = 0
+and stops at
+.Ic N = 99
+or the first non-existing one.
+.El
 .Sh EXAMPLES
 After attaching a
 .Nm u3g
@@ -186,6 +232,13 @@ device which appears as a USB device on
 .Bd -literal -offset indent
 usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT
 .Ed
+.Pp
+To install a quirk at boot time, place one or several lines like the
+following in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.usb.quirk.0="0x04d9 0xfa50 0 0x UQ_KBD_IGNORE"
+.Ed
 .Sh SEE ALSO
 .Xr usbconfig 8
 .Sh HISTORY

Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c
==
--- stable/10/sys/dev/usb/quirk/usb_quirk.c Thu Oct  8 07:17:11 2015
(r289006)
+++ stable/10/sys/dev/usb/quirk/usb_quirk.c Thu Oct  8 07:17:35 2015
(r289007)
@@ -61,6 +61,7 @@ MODULE_VERSION(usb_quirk, 1);
 
 #defineUSB_DEV_QUIRKS_MAX 384
 #defineUSB_SUB_QUIRKS_MAX 8
+#defineUSB_QUIRK_ENVROOT "hw.usb.quirk."
 
 struct usb_quirk_entry {
uint16_t vid;
@@ -607,8 +608,32 @@ static const char *usb_quirk_str[USB_QUI
 static const char *
 usb_quirkstr(uint16_t quirk)
 {
-   return ((quirk < USB_QUIRK_MAX) ?
-   usb_quirk_str[quirk] : "USB_QUIRK_UNKNOWN");
+   return ((quirk < USB_QUIRK_MAX && usb_quirk_str[quirk] != NULL) ?
+   usb_quirk_str[quirk] : "UQ_UNKNOWN");
+}
+
+/**
+ * usb_strquirk
+ *
+ * This function converts a string into a USB quirk code.
+ *
+ * Returns:
+ * Less than USB_QUIRK_MAX: Quirk code
+ * Else: Quirk code not found
+ **/
+static uint16_t
+usb_strquirk(const char *str, size_t len)
+{
+   const char *quirk;
+   uint16_t x;
+
+   for (x = 0; x != USB_QUIRK_MAX; x++) {
+   quirk = usb_quirkstr(x);
+   if (strncmp(str, quirk, len) == 0 &&
+   quirk[len] == 0)
+   break;
+   }
+   return (x);
 }
 
 /**
@@ -853,12 +878,122 @@ usb_quirk_ioctl(unsigned long cmd, caddr
return (ENOIOCTL);
 }
 
+/**
+ * usb_quirk_strtou16
+ *
+ * Helper function to scan a 16-bit integer.
+ **/
+static uint16_t
+usb_quirk_strtou16(const char **pptr, const char *name, const char *what)
+{
+   unsigned long value;
+   char *end;
+
+   value = strtoul(*pptr, &end, 0);
+   if (value > 65535 || *pptr == end || (*end != ' ' && *end != '\t')) {
+   printf("%s: %s 16-bit %s value set to zero\n",
+   name,