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

2015-06-19 Thread Konstantin Belousov
Author: kib
Date: Fri Jun 19 07:25:15 2015
New Revision: 284594
URL: https://svnweb.freebsd.org/changeset/base/284594

Log:
  Restore the td_cookie value for the tmpfs directory entry which was a
  dup entry, upon detach from the parent directory.  If the node is
  renamed, the entry is re-attached at the different directory, and
  invalud cookie value triggers assert (or corrupts directory rb tree,
  it seems).
  
  Reported by:  clusteradm (gjb, antoine)
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

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

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==
--- head/sys/fs/tmpfs/tmpfs_subr.c  Fri Jun 19 06:58:05 2015
(r284593)
+++ head/sys/fs/tmpfs/tmpfs_subr.c  Fri Jun 19 07:25:15 2015
(r284594)
@@ -1031,6 +1031,7 @@ tmpfs_dir_detach(struct vnode *vp, struc
tmpfs_free_dirent(tmp, xde);
}
}
+   de->td_cookie = de->td_hash;
} else
RB_REMOVE(tmpfs_dir, head, de);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284595 - head/etc/devd

2015-06-19 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jun 19 09:37:37 2015
New Revision: 284595
URL: https://svnweb.freebsd.org/changeset/base/284595

Log:
  Regenerate usb.conf .
  
  MFC after:1 week

Modified:
  head/etc/devd/usb.conf

Modified: head/etc/devd/usb.conf
==
--- head/etc/devd/usb.conf  Fri Jun 19 07:25:15 2015(r284594)
+++ head/etc/devd/usb.conf  Fri Jun 19 09:37:37 2015(r284595)
@@ -145,7 +145,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0403";
-   match "product" 
"(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee1
 
8|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0x|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)";
+   match "product" 
"(0x5259|0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed7
 
4|0xee18|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0x|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)";
action "kldload -n uftdi";
 };
 
@@ -281,7 +281,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0411";
-   match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2|0x01ee)";
+   match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2|0x01a8|0x01ee)";
action "kldload -n if_run";
 };
 
@@ -1193,7 +1193,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x05c6";
-   match "product" "(0x1000|0x6000|0x6500|0x6613|0x9000|0x9204|0x9205)";
+   match "product" 
"(0x1000|0x6000|0x6500|0x6613|0x9000|0x9002|0x9204|0x9205)";
action "kldload -n u3g";
 };
 
@@ -2561,7 +2561,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0bda";
-   match "product" 
"(0x8176|0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e|0x817f)";
+   match "product" 
"(0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0

Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread David Chisnall
I only just caught this (having seen the fallout from NetBSD doing the same 
thing in a shipping release and the pain that it’s caused):

__weak is a reserved keyword in Objective-C, please pick another name for this. 
 This in cdefs.h makes it impossible to include any FreeBSD standard headers in 
Objective-C programs (of which we have a couple of hundred in ports) if they 
use any of the modern Objective-C language modes.

David

> On 2 Jul 2014, at 09:45, Hans Petter Selasky  wrote:
> 
> Author: hselasky
> Date: Wed Jul  2 08:45:26 2014
> New Revision: 268137
> URL: http://svnweb.freebsd.org/changeset/base/268137
> 
> Log:
>  Define a "__weak" macro for declaring symbols "weak".
> 
> Modified:
>  head/sys/sys/cdefs.h
> 
> Modified: head/sys/sys/cdefs.h
> ==
> --- head/sys/sys/cdefs.h  Wed Jul  2 05:45:40 2014(r268136)
> +++ head/sys/sys/cdefs.h  Wed Jul  2 08:45:26 2014(r268137)
> @@ -210,7 +210,9 @@
> #define   __packed
> #define   __aligned(x)
> #define   __section(x)
> +#define  __weak
> #else
> +#define  __weak  __attribute__((__weak__))
> #if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER)
> #define   __dead2
> #define   __pure2
> 

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

Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread Hans Petter Selasky

On 06/19/15 12:16, David Chisnall wrote:

I only just caught this (having seen the fallout from NetBSD doing the same 
thing in a shipping release and the pain that it’s caused):

__weak is a reserved keyword in Objective-C, please pick another name for this. 
 This in cdefs.h makes it impossible to include any FreeBSD standard headers in 
Objective-C programs (of which we have a couple of hundred in ports) if they 
use any of the modern Objective-C language modes.

David


Hi,

Appearently this will be fixed in GNUSTEP base:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/cdefs_elf.h?only_with_tag=MAIN

Is this still an issue?

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

Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread David Chisnall
On 19 Jun 2015, at 11:45, Hans Petter Selasky  wrote:
> 
> Appearently this will be fixed in GNUSTEP base:
> 
> http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/cdefs_elf.h?only_with_tag=MAIN
> 
> Is this still an issue?

It is impossible to fix it in GNUstep Base, because we can’t guarantee that 
user code doesn’t include system headers after including GNUstep headers (not 
to mention the fact that GNUstep is not the only Objective-C standard library 
implementation out there).  If the user does, for example:

#import 
#include 

void example()
{
__weak id foo = bar();
baz(foo);
}

Then they will get a compile error no matter what GNUstep’s Foundation.h does.  
It can’t prevent cdefs.h from redefining __weak to be something different.

I’ve just looked at the GNUstep base changelog since that NetBSD commit and 
there are no relevant changes, so I’ve no idea what the NetBSD people are 
thinking there.

David

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

Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread Hans Petter Selasky

On 06/19/15 13:42, David Chisnall wrote:

On 19 Jun 2015, at 11:45, Hans Petter Selasky  wrote:


Appearently this will be fixed in GNUSTEP base:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/cdefs_elf.h?only_with_tag=MAIN

Is this still an issue?


It is impossible to fix it in GNUstep Base, because we can’t guarantee that 
user code doesn’t include system headers after including GNUstep headers (not 
to mention the fact that GNUstep is not the only Objective-C standard library 
implementation out there).  If the user does, for example:

#import 
#include 

void example()
{
__weak id foo = bar();
baz(foo);
}



Hi,


Then they will get a compile error no matter what GNUstep’s Foundation.h does.  
It can’t prevent cdefs.h from redefining __weak to be something different.



Except "#undef __weak"


I’ve just looked at the GNUstep base changelog since that NetBSD commit and 
there are no relevant changes, so I’ve no idea what the NetBSD people are 
thinking there.



I think we should have a common cross-BSD solution for the proper 
definition of __weak, so that user-space applications which use it 
follow along. Is there a procedure for that? Possibly we should do an 
exp-run after changing this to ensure that we don't break more than we fix.


I'll ask some GNUstep people I know about this.

--HPS

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

svn commit: r284596 - head/sys/netinet

2015-06-19 Thread Michael Tuexen
Author: tuexen
Date: Fri Jun 19 12:48:22 2015
New Revision: 284596
URL: https://svnweb.freebsd.org/changeset/base/284596

Log:
  When setting the primary address, return an error whenever it fails.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_usrreq.c
==
--- head/sys/netinet/sctp_usrreq.c  Fri Jun 19 09:37:37 2015
(r284595)
+++ head/sys/netinet/sctp_usrreq.c  Fri Jun 19 12:48:22 2015
(r284596)
@@ -5678,16 +5678,23 @@ sctp_setopt(struct socket *so, int optna
}
 
if ((stcb != NULL) && (net != NULL)) {
-   if ((net != stcb->asoc.primary_destination) &&
-   (!(net->dest_state & 
SCTP_ADDR_UNCONFIRMED))) {
-   /* Ok we need to set it */
-   if (sctp_set_primary_addr(stcb, (struct 
sockaddr *)NULL, net) == 0) {
-   if ((stcb->asoc.alternate) &&
-   (!(net->dest_state & 
SCTP_ADDR_PF)) &&
-   (net->dest_state & 
SCTP_ADDR_REACHABLE)) {
-   
sctp_free_remote_addr(stcb->asoc.alternate);
-   stcb->asoc.alternate = 
NULL;
+   if (net != stcb->asoc.primary_destination) {
+   if (!(net->dest_state & 
SCTP_ADDR_UNCONFIRMED)) {
+   /* Ok we need to set it */
+   if (sctp_set_primary_addr(stcb, 
(struct sockaddr *)NULL, net) == 0) {
+   if 
((stcb->asoc.alternate) &&
+   (!(net->dest_state 
& SCTP_ADDR_PF)) &&
+   (net->dest_state & 
SCTP_ADDR_REACHABLE)) {
+   
sctp_free_remote_addr(stcb->asoc.alternate);
+   
stcb->asoc.alternate = NULL;
+   }
+   } else {
+   
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+   error = EINVAL;
}
+   } else {
+   SCTP_LTRACE_ERR_RET(inp, NULL, 
NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+   error = EINVAL;
}
}
} else {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread David Chisnall
On 19 Jun 2015, at 12:57, Hans Petter Selasky  wrote:
> 
> Hi,
> 
>> Then they will get a compile error no matter what GNUstep’s Foundation.h 
>> does.  It can’t prevent cdefs.h from redefining __weak to be something 
>> different.
>> 
> 
> Except "#undef __weak”

Please read the example that I wrote.  This will *not* be fixed by #undef 
__weak.  In particular, the __weak keyword is implemented in Clang as a 
pre-defined macro, so after *any* inclusion of any C standard library header, 
every program that uses zeroing weak references needs to redefine __weak to 
whatever (implementation-defined and subject to change thing) that the compiler 
defines it to.

>> I’ve just looked at the GNUstep base changelog since that NetBSD commit and 
>> there are no relevant changes, so I’ve no idea what the NetBSD people are 
>> thinking there.
>> 
> 
> I think we should have a common cross-BSD solution for the proper definition 
> of __weak, so that user-space applications which use it follow along.

Portable code should not rely on anything in cdefs.h.

> Is there a procedure for that? Possibly we should do an exp-run after 
> changing this to ensure that we don't break more than we fix.

I’m not sure what we have any code in ports yet that uses ARC or GC in 
Objective-C, but I definitely know of people building out-of-ports programs on 
FreeBSD whose code you have just broken (including myself, though I do 
Objective-C stuff on 10, so haven’t yet encountered the breakage).

> I'll ask some GNUstep people I know about this.

Taking off my FreeBSD Core Team hat and putting on my GNUstep libobjc 
maintainer hat: Please fix this and do not define C-family language keywords or 
compiler reserved words to be incompatible things in cdefs.h.

David

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

Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread Hans Petter Selasky

On 06/19/15 14:54, David Chisnall wrote:

I definitely know of people building out-of-ports programs on FreeBSD whose 
code you have just broken (including myself,
> though I do Objective-C stuff on 10, so haven’t yet encountered the 
breakage).


Hi David,

r268137 has been in 11-current for a long time (11 months) and was 
MFC'ed to 10-stable not long ago. Multiple systems are defining __weak 
for C and C++ :


Linux:

include/linux/compiler-gcc.h:

#define __weak  __attribute__((weak))

NetBSD:
> sys/cdefs_elf.h
#define __weak  __attribute__((__weak__))

FreeBSD:
> sys/cdefs.h
#define __weak  __attribute__((__weak__))


__weak is *the* way currently to say __attribute__((__weak__)) in C and 
C++ cross multiple systems. Are you sure you want to change that?


I understand that including "sys/cdefs.h" breaks objective C-code in the 
kernel, but we don't have any such code, do we?


In userspace, why is objective C-code including "sys/cdefs.h"? Is this 
perhaps a mistake in another header file which indirectly includes 
"sys/cdefs.h" when it shouldn't?



Portable code should not rely on anything in cdefs.h.


Right - can you explain why it is ending up in your ObjC code?

And you are certain this is the change causing your build breakage?

https://svnweb.freebsd.org/base?view=revision&revision=283326

Hope you bear with me, I just don't want to rush a fix.

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

svn commit: r284597 - in head/sys/boot: mips/beri/loader pc98/loader powerpc/kboot powerpc/ofw powerpc/ps3 sparc64/loader

2015-06-19 Thread Baptiste Daroussin
Author: bapt
Date: Fri Jun 19 14:20:21 2015
New Revision: 284597
URL: https://svnweb.freebsd.org/changeset/base/284597

Log:
  Fix fallouts from r284590
  
  Reported by:  kib

Modified:
  head/sys/boot/mips/beri/loader/Makefile
  head/sys/boot/pc98/loader/Makefile
  head/sys/boot/powerpc/kboot/Makefile
  head/sys/boot/powerpc/ofw/Makefile
  head/sys/boot/powerpc/ps3/Makefile
  head/sys/boot/sparc64/loader/Makefile

Modified: head/sys/boot/mips/beri/loader/Makefile
==
--- head/sys/boot/mips/beri/loader/Makefile Fri Jun 19 12:48:22 2015
(r284596)
+++ head/sys/boot/mips/beri/loader/Makefile Fri Jun 19 14:20:21 2015
(r284597)
@@ -31,6 +31,7 @@
 
 .include 
 MK_SSP=no
+MAN=
 
 PROG?= loader
 NEWVERSWHAT=   "BERI loader" ${MACHINE_CPUARCH}

Modified: head/sys/boot/pc98/loader/Makefile
==
--- head/sys/boot/pc98/loader/Makefile  Fri Jun 19 12:48:22 2015
(r284596)
+++ head/sys/boot/pc98/loader/Makefile  Fri Jun 19 14:20:21 2015
(r284597)
@@ -2,6 +2,7 @@
 
 .include 
 MK_SSP=no
+MAN=
 
 LOADER?=   loader
 PROG=  ${LOADER}.sym

Modified: head/sys/boot/powerpc/kboot/Makefile
==
--- head/sys/boot/powerpc/kboot/MakefileFri Jun 19 12:48:22 2015
(r284596)
+++ head/sys/boot/powerpc/kboot/MakefileFri Jun 19 14:20:21 2015
(r284597)
@@ -2,6 +2,7 @@
 
 .include 
 MK_SSP=no
+MAN=
 
 PROG=  loader.kboot
 NEWVERSWHAT=   "kboot loader" ${MACHINE_ARCH}

Modified: head/sys/boot/powerpc/ofw/Makefile
==
--- head/sys/boot/powerpc/ofw/Makefile  Fri Jun 19 12:48:22 2015
(r284596)
+++ head/sys/boot/powerpc/ofw/Makefile  Fri Jun 19 14:20:21 2015
(r284597)
@@ -2,6 +2,7 @@
 
 .include 
 MK_SSP=no
+MAN=
 
 PROG=  loader
 NEWVERSWHAT=   "Open Firmware loader" ${MACHINE_ARCH}

Modified: head/sys/boot/powerpc/ps3/Makefile
==
--- head/sys/boot/powerpc/ps3/Makefile  Fri Jun 19 12:48:22 2015
(r284596)
+++ head/sys/boot/powerpc/ps3/Makefile  Fri Jun 19 14:20:21 2015
(r284597)
@@ -2,6 +2,7 @@
 
 .include 
 MK_SSP=no
+MAN=
 
 PROG=  loader.ps3
 NEWVERSWHAT=   "Playstation 3 loader" ${MACHINE_ARCH}

Modified: head/sys/boot/sparc64/loader/Makefile
==
--- head/sys/boot/sparc64/loader/Makefile   Fri Jun 19 12:48:22 2015
(r284596)
+++ head/sys/boot/sparc64/loader/Makefile   Fri Jun 19 14:20:21 2015
(r284597)
@@ -2,6 +2,7 @@
 
 .include 
 MK_SSP=no
+MAN=
 
 PROG?= loader
 NEWVERSWHAT?=  "bootstrap loader" sparc64
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread David Chisnall
On 19 Jun 2015, at 14:41, Hans Petter Selasky  wrote:
> 
> On 06/19/15 14:54, David Chisnall wrote:
>> I definitely know of people building out-of-ports programs on FreeBSD whose 
>> code you have just broken (including myself,
> > though I do Objective-C stuff on 10, so haven’t yet encountered the 
> > breakage).
> 
> Hi David,
> 
> r268137 has been in 11-current for a long time (11 months) and was MFC'ed to 
> 10-stable not long ago. 

We have not yet done a release from 10 with this breakage, so I’ve not yet seen 
it in the wild.  Most people doing Objective-C development do not develop on 
FreeBSD -HEAD.  The majority develop on OS X and port to FreeBSD releases.  I 
am anxious to get this fixed before the next 10.x release is out so that we are 
not shipping something that is going to force people wanting to ship 
Objective-C code to have to have FreeBSD-specific work-arounds for the next few 
years.

> I understand that including "sys/cdefs.h" breaks objective C-code in the 
> kernel, but we don't have any such code, do we?

You fundamentally misunderstand what cdefs.h is.  It is not a kernel header, it 
is the header that provides all of the definitions required for all system 
headers.  All libc headers expect cdefs.h to be included (either directly or 
indirectly) before anything else in the file.

> Multiple systems are defining __weak for C and C++ :
> 
> Linux:
>> include/linux/compiler-gcc.h:
> #define __weak__attribute__((weak))
> 
> NetBSD:
> > sys/cdefs_elf.h
> #define __weak  __attribute__((__weak__))
> 
> FreeBSD:
> > sys/cdefs.h
> #define   __weak  __attribute__((__weak__))

NetBSD is the only system that I’m aware of that has actually shipped this, and 
it broke a lot of things.

Spot the odd one out:

$ cat tmp.m
#include 
__weak id x;
# FreeBSD 10.1:
$ cc -E tmp.m -fobjc-arc | tail -1
__attribute__((objc_ownership(weak))) id x;
# Linux
$ clang -E tmp.m -fobjc-runtime=gnustep-1.7 -fobjc-arc | tail -1
__attribute__((objc_ownership(weak))) id x;
# FreeBSD Head:
$ cc -E tmp.m -fobjc-arc | tail -1
__attribute__((__weak__)) id x;

The worst thing about this is that you have broken it so that it silently does 
the wrong thing, rather than raising a warning with the default warnings 
enabled.

>> Portable code should not rely on anything in cdefs.h.
> 
> Right - can you explain why it is ending up in your ObjC code?

Because it’s in cdefs.h, which is included by *every single userspace C 
header*.  cdefs.h must work with all C-family languages.

David

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

Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread Hans Petter Selasky

On 06/19/15 16:22, David Chisnall wrote:

>Right - can you explain why it is ending up in your ObjC code?

Because it’s in cdefs.h, which is included by*every single userspace C header*. 
 cdefs.h must work with all C-family languages.

David



Hi David,

My buildworld and buildkernel has just successfully completed. I'll 
rename the define and its clients in -current shortly. Will be MFC'ed to 
10-stable in 1 weeks time, so that any errors out there in ports will 
show up. Is this fine by you?


Instead of __weak it will be __weak_symbol . Googled a bit about 
__weak_symbol and it seems to be free.


--HPS

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

Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread Marcelo Araujo
2015-06-19 22:29 GMT+08:00 Hans Petter Selasky :

> On 06/19/15 16:22, David Chisnall wrote:
>
>> >Right - can you explain why it is ending up in your ObjC code?
>>>
>> Because it’s in cdefs.h, which is included by*every single userspace C
>> header*.  cdefs.h must work with all C-family languages.
>>
>> David
>>
>>
> Hi David,
>
> My buildworld and buildkernel has just successfully completed. I'll rename
> the define and its clients in -current shortly. Will be MFC'ed to 10-stable
> in 1 weeks time, so that any errors out there in ports will show up. Is
> this fine by you?
>
> Instead of __weak it will be __weak_symbol . Googled a bit about
> __weak_symbol and it seems to be free.
>
>
Hi,

Maybe would be a good idea run an 'exp run' with this patch? Just to double
check if any port will break, although after you rename, I don't believe it
will conflict anymore, however an 'exp run' would show you it.


Best Regards,

-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread David Chisnall
On 19 Jun 2015, at 15:32, Marcelo Araujo  wrote:
> 
> Maybe would be a good idea run an 'exp run' with this patch? Just to double 
> check if any port will break, although after you rename, I don't believe it 
> will conflict anymore, however an 'exp run' would show you it.

It’s probably worth doing, though unfortunately the failure mode for the 
previous breakage was to silently generate the wrong code in some cases and so 
may not have shown up in an exp run.

David

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

Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread Hans Petter Selasky

On 06/19/15 16:32, Marcelo Araujo wrote:

2015-06-19 22:29 GMT+08:00 Hans Petter Selasky :


On 06/19/15 16:22, David Chisnall wrote:


Right - can you explain why it is ending up in your ObjC code?


Because it’s in cdefs.h, which is included by*every single userspace C
header*.  cdefs.h must work with all C-family languages.

David



Hi David,

My buildworld and buildkernel has just successfully completed. I'll rename
the define and its clients in -current shortly. Will be MFC'ed to 10-stable
in 1 weeks time, so that any errors out there in ports will show up. Is
this fine by you?

Instead of __weak it will be __weak_symbol . Googled a bit about
__weak_symbol and it seems to be free.



Hi,

Maybe would be a good idea run an 'exp run' with this patch? Just to double
check if any port will break, although after you rename, I don't believe it
will conflict anymore, however an 'exp run' would show you it.


Best Regards,



Hi,

Here is a PR and a patch. Let's move the discussion over there if any 
further issues:


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

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

svn commit: r284598 - head/share/mk

2015-06-19 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 19 14:56:24 2015
New Revision: 284598
URL: https://svnweb.freebsd.org/changeset/base/284598

Log:
  Move include of make.conf back to its old position.
  
  This means moving include of local.sys.mk and src.sys.mk too.
  Introduce new includes to take the early slot, for the purpose
  of being able to influence toolchains and the like.
  
  Differential Revision:D2860
  Reviewed by:  imp

Added:
  head/share/mk/local.sys.env.mk
 - copied, changed from r284432, head/share/mk/local.sys.mk
  head/share/mk/src.sys.env.mk
 - copied, changed from r284432, head/share/mk/src.sys.mk
Modified:
  head/share/mk/local.sys.mk
  head/share/mk/src.sys.mk
  head/share/mk/sys.mk

Copied and modified: head/share/mk/local.sys.env.mk (from r284432, 
head/share/mk/local.sys.mk)
==
--- head/share/mk/local.sys.mk  Mon Jun 15 21:20:52 2015(r284432, copy 
source)
+++ head/share/mk/local.sys.env.mk  Fri Jun 19 14:56:24 2015
(r284598)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+# This makefile is for customizations that should be done early
+
 .if !defined(_TARGETS)
 # some things we do only once
 _TARGETS:= ${.TARGETS}
@@ -29,28 +31,6 @@ M_whence = ${M_type}:M/*:[1]
 # convert a path to a valid shell variable
 M_P2V = tu:C,[./-],_,g
 
-.if ${MK_META_MODE} == "yes"
-MAKE_PRINT_VAR_ON_ERROR+= \
-   .CURDIR \
-   .MAKE \
-   .OBJDIR \
-   .TARGETS \
-   DESTDIR \
-   LD_LIBRARY_PATH \
-   MACHINE \
-   MACHINE_ARCH \
-   MAKEOBJDIRPREFIX \
-   MAKESYSPATH \
-   MAKE_VERSION\
-   SRCTOP \
-   OBJTOP \
-   ${MAKE_PRINT_VAR_ON_ERROR_XTRAS}
-
-.if ${.MAKE.LEVEL} > 0
-MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH
-.endif
-.endif
-
 # these are handy
 # we can use this for a cheap timestamp at the start of a target's script,
 # but not at the end - since make will expand both at the same time.
@@ -60,4 +40,4 @@ TIME_STAMP = ${TIME_STAMP_FMT:localtime}
 TIME_STAMP_DATE = `date '+${TIME_STAMP_FMT}'`
 TIME_STAMP_END?= ${TIME_STAMP_DATE}
 
-.include "src.sys.mk"
+.include "src.sys.env.mk"

Modified: head/share/mk/local.sys.mk
==
--- head/share/mk/local.sys.mk  Fri Jun 19 14:20:21 2015(r284597)
+++ head/share/mk/local.sys.mk  Fri Jun 19 14:56:24 2015(r284598)
@@ -1,34 +1,5 @@
 # $FreeBSD$
 
-.if !defined(_TARGETS)
-# some things we do only once
-_TARGETS:= ${.TARGETS}
-.export _TARGETS
-.endif
-
-# some handy macros
-_this = ${.PARSEDIR:tA}/${.PARSEFILE}
-# some useful modifiers
-
-# A useful trick for testing multiple :M's against something
-# :L says to use the variable's name as its value - ie. literal
-# got = ${clean* destroy:${M_ListToMatch:S,V,.TARGETS,}}
-M_ListToMatch = L:@m@$${V:M$$m}@
-# match against our initial targets (see above)
-M_L_TARGETS = ${M_ListToMatch:S,V,_TARGETS,}
-
-# turn a list into a set of :N modifiers
-# NskipFoo = ${Foo:${M_ListToSkip}}
-M_ListToSkip= O:u:ts::S,:,:N,g:S,^,N,
-
-# type should be a builtin in any sh since about 1980,
-# AUTOCONF := ${autoconf:L:${M_whence}}
-M_type = @x@(type $$x 2> /dev/null); echo;@:sh:[0]:N* found*:[@]:C,[()],,g
-M_whence = ${M_type}:M/*:[1]
-
-# convert a path to a valid shell variable
-M_P2V = tu:C,[./-],_,g
-
 .if ${MK_META_MODE} == "yes"
 MAKE_PRINT_VAR_ON_ERROR+= \
.CURDIR \
@@ -51,13 +22,4 @@ MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFIL
 .endif
 .endif
 
-# these are handy
-# we can use this for a cheap timestamp at the start of a target's script,
-# but not at the end - since make will expand both at the same time.
-TIME_STAMP_FMT = @ %s [%Y-%m-%d %T]
-TIME_STAMP = ${TIME_STAMP_FMT:localtime}
-# this will produce the same output but as of when date(1) is run.
-TIME_STAMP_DATE = `date '+${TIME_STAMP_FMT}'`
-TIME_STAMP_END?= ${TIME_STAMP_DATE}
-
 .include "src.sys.mk"

Copied and modified: head/share/mk/src.sys.env.mk (from r284432, 
head/share/mk/src.sys.mk)
==
--- head/share/mk/src.sys.mkMon Jun 15 21:20:52 2015(r284432, copy 
source)
+++ head/share/mk/src.sys.env.mkFri Jun 19 14:56:24 2015
(r284598)
@@ -1,19 +1,17 @@
 # $FreeBSD$
 
-# Note: This file is also duplicated in the sys/conf/kern.pre.mk so
-# it will always grab SRCCONF, even if it isn't being built in-tree
-# to preserve historical (and useful) behavior. Changes here need to
-# be reflected there so SRCCONF isn't included multiple times.
+# early setup only see also src.sys.mk
 
 # make sure this is defined in a consistent manner
 SRCTOP:= ${.PARSEDIR:tA:H:H}
 
-# Allow user to configure things that only effect src tree builds.
-SRCCONF?=  /etc/src.conf
-.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && 
!target(_srcconf_included_)
-.sinclude "${SRCCONF}"
-_srcconf_included_:.NOTMAIN
+# site customizations that do n

Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread Pedro Giffuni


Hello;

Closely related to this, we are redefining _Noreturn, which is a 
reserved keyword in C11.


Not sure what effect that mess causes.

Pedro.


On 19/06/2015 05:16 a.m., David Chisnall wrote:

I only just caught this (having seen the fallout from NetBSD doing the same 
thing in a shipping release and the pain that it’s caused):

__weak is a reserved keyword in Objective-C, please pick another name for this. 
 This in cdefs.h makes it impossible to include any FreeBSD standard headers in 
Objective-C programs (of which we have a couple of hundred in ports) if they 
use any of the modern Objective-C language modes.

David


On 2 Jul 2014, at 09:45, Hans Petter Selasky  wrote:

Author: hselasky
Date: Wed Jul  2 08:45:26 2014
New Revision: 268137
URL: http://svnweb.freebsd.org/changeset/base/268137

Log:
  Define a "__weak" macro for declaring symbols "weak".

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hWed Jul  2 05:45:40 2014(r268136)
+++ head/sys/sys/cdefs.hWed Jul  2 08:45:26 2014(r268137)
@@ -210,7 +210,9 @@
#define __packed
#define __aligned(x)
#define __section(x)
+#define__weak
#else
+#define__weak  __attribute__((__weak__))
#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER)
#define __dead2
#define __pure2





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

Re: svn commit: r284546 - head/contrib/gcc

2015-06-19 Thread Dimitry Andric
On 18 Jun 2015, at 15:40, Adrian Chadd  wrote:
> 
> Author: adrian
> Date: Thu Jun 18 13:40:08 2015
> New Revision: 284546
> URL: https://svnweb.freebsd.org/changeset/base/284546
> 
> Log:
>  Fix compilation of this macro under gcc-4.9 for MIPS32.
> 
>  Some point after gcc-4.2 the MIPS inline assembly restrictions changed -
>  =h (hi register) disappeared from the list of restrictions and can no
>  longer be used.

Just for reference, this happened here (though the commit message is
completely unreadable, as usual):

https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=208414e


>  So, until someone requires an assembly version of this function,
>  just use a non-assembly version and let the compiler sort it out.

This is also precisely what upstream gcc has done. :)

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread Dimitry Andric
On 19 Jun 2015, at 17:02, Pedro Giffuni  wrote:
> 
>> On 19/06/2015 05:16 a.m., David Chisnall wrote:
>>> I only just caught this (having seen the fallout from NetBSD doing the same 
>>> thing in a shipping release and the pain that it’s caused):
>>> 
>>> __weak is a reserved keyword in Objective-C, please pick another name for 
>>> this.  This in cdefs.h makes it impossible to include any FreeBSD standard 
>>> headers in Objective-C programs (of which we have a couple of hundred in 
>>> ports) if they use any of the modern Objective-C language modes.
...
> Closely related to this, we are redefining _Noreturn, which is a reserved 
> keyword in C11.

No, sys/cdefs.h has:

   254  /*
   255   * Keywords added in C11.
   256   */
   257
   258  #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L || 
defined(lint)
[...]
   284  #if defined(__cplusplus) && __cplusplus >= 201103L
   285  #define _Noreturn   [[noreturn]]
   286  #else
   287  #define _Noreturn   __dead2
   288  #endif
[...]
   320  #endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */

So the whole block redefining all the _Xxx identifiers is skipped for
C11 and higher.

E.g.:

$ cpp -std=c99
#include 
_Noreturn void foo(void);
^D
# 1 ""
# 1 "" 1
# 1 "" 3
# 306 "" 3
# 1 "" 1
# 1 "" 2
# 1 "" 2
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 2 "" 2
__attribute__((__noreturn__)) void foo(void);

$ cpp -std=c11
#include 
_Noreturn void foo(void);
^D
# 1 ""
# 1 "" 1
# 1 "" 3
# 306 "" 3
# 1 "" 1
# 1 "" 2
# 1 "" 2
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 2 "" 2
_Noreturn void foo(void);

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread Pedro Giffuni



On 06/19/15 11:24, Dimitry Andric wrote:

On 19 Jun 2015, at 17:02, Pedro Giffuni  wrote:

On 19/06/2015 05:16 a.m., David Chisnall wrote:

I only just caught this (having seen the fallout from NetBSD doing the same 
thing in a shipping release and the pain that it’s caused):

__weak is a reserved keyword in Objective-C, please pick another name for this. 
 This in cdefs.h makes it impossible to include any FreeBSD standard headers in 
Objective-C programs (of which we have a couple of hundred in ports) if they 
use any of the modern Objective-C language modes.

...

Closely related to this, we are redefining _Noreturn, which is a reserved 
keyword in C11.

No, sys/cdefs.h has:

254  /*
255   * Keywords added in C11.
256   */
257
258  #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L || 
defined(lint)
[...]
284  #if defined(__cplusplus) && __cplusplus >= 201103L
285  #define _Noreturn   [[noreturn]]
286  #else
287  #define _Noreturn   __dead2
288  #endif
[...]
320  #endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */

So the whole block redefining all the _Xxx identifiers is skipped for
C11 and higher.


Oh yes, I had missed line 258 (and 320), sorry for the false alarm.

FWIW, there is still a minor issue: older compilers aren't supposed
to take __dead2 at the beginning. When i was discussing the
attached patch, bde suggested we should resurrect __dead.

Pedro.






E.g.:

$ cpp -std=c99
#include 
_Noreturn void foo(void);
^D
# 1 ""
# 1 "" 1
# 1 "" 3
# 306 "" 3
# 1 "" 1
# 1 "" 2
# 1 "" 2
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 2 "" 2
__attribute__((__noreturn__)) void foo(void);

$ cpp -std=c11
#include 
_Noreturn void foo(void);
^D
# 1 ""
# 1 "" 1
# 1 "" 3
# 306 "" 3
# 1 "" 1
# 1 "" 2
# 1 "" 2
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 2 "" 2
_Noreturn void foo(void);

-Dimitry



Index: include/assert.h
===
--- include/assert.h	(revision 284138)
+++ include/assert.h	(working copy)
@@ -72,7 +72,7 @@
 #endif
 
 __BEGIN_DECLS
-void __assert(const char *, const char *, int, const char *) __dead2;
+_Noreturn void	__assert(const char *, const char *, int, const char *);
 __END_DECLS
 
 #endif /* !_ASSERT_H_ */
Index: include/err.h
===
--- include/err.h	(revision 284138)
+++ include/err.h	(working copy)
@@ -44,21 +44,20 @@
 #include 
 
 __BEGIN_DECLS
-void	err(int, const char *, ...) __dead2 __printf0like(2, 3);
-void	verr(int, const char *, __va_list) __dead2 __printf0like(2, 0);
-void	errc(int, int, const char *, ...) __dead2 __printf0like(3, 4);
-void	verrc(int, int, const char *, __va_list) __dead2
-	__printf0like(3, 0);
-void	errx(int, const char *, ...) __dead2 __printf0like(2, 3);
-void	verrx(int, const char *, __va_list) __dead2 __printf0like(2, 0);
-void	warn(const char *, ...) __printf0like(1, 2);
-void	vwarn(const char *, __va_list) __printf0like(1, 0);
-void	warnc(int, const char *, ...) __printf0like(2, 3);
-void	vwarnc(int, const char *, __va_list) __printf0like(2, 0);
-void	warnx(const char *, ...) __printflike(1, 2);
-void	vwarnx(const char *, __va_list) __printflike(1, 0);
-void	err_set_file(void *);
-void	err_set_exit(void (*)(int));
+_Noreturn void	err(int, const char *, ...) __printf0like(2, 3);
+_Noreturn void	verr(int, const char *, __va_list) __printf0like(2, 0);
+_Noreturn void	errc(int, int, const char *, ...) __printf0like(3, 4);
+_Noreturn void	verrc(int, int, const char *, __va_list) __printf0like(3, 0);
+_Noreturn void	errx(int, const char *, ...) __printf0like(2, 3);
+_Noreturn void	verrx(int, const char *, __va_list) __printf0like(2, 0);
+void		warn(const char *, ...) __printf0like(1, 2);
+void		vwarn(const char *, __va_list) __printf0like(1, 0);
+void		warnc(int, const char *, ...) __printf0like(2, 3);
+void		vwarnc(int, const char *, __va_list) __printf0like(2, 0);
+void		warnx(const char *, ...) __printflike(1, 2);
+void		vwarnx(const char *, __va_list) __printflike(1, 0);
+void		err_set_file(void *);
+void		err_set_exit(void (*)(int));
 __END_DECLS
 
 #endif /* !_ERR_H_ */
Index: include/pthread.h
===
--- include/pthread.h	(revision 284138)
+++ include/pthread.h	(working copy)
@@ -199,7 +199,7 @@
 			void *(*) (void *), void *);
 int		pthread_detach(pthread_t);
 int		pthread_equal(pthread_t, pthread_t);
-void		pthread_exit(void *) __dead2;
+_Noreturn void	pthread_exit(void *);
 void		*pthread_getspecific(pthread_key_t);
 int		pthread_getcpuclockid(pthread_t, clockid_t *);
 int		pthread_join(pthread_t, void **);
Index: include/setjmp.h
===
--- include/setjmp.h	(revision 284138)
+++ include/setjmp.h	(working copy)
@@ -45,17 +45,17 @@
 
 __BEGIN_DECLS
 #if __BSD_VISIBLE || __XSI_VISIBLE >= 600
-void	_longjmp(jmp_buf, int) __dead2;
-int	_set

svn commit: r284599 - head/sys/boot/uboot/lib

2015-06-19 Thread Maxim Sobolev
Author: sobomax
Date: Fri Jun 19 17:00:36 2015
New Revision: 284599
URL: https://svnweb.freebsd.org/changeset/base/284599

Log:
  Fix bug in the ubldr introduced in the rev.283035. The new code
  fails to properly consider memory regions when the loader is
  located below of those regions or engulfs their lower limit. This
  results in "not enough RAM to load kernel" panic, which is totally
  bogus. On top of that, there are some variables that can be left
  unitialized in those cases, which might cause it fail with memory
  access violation instead of panic while trying to load kernel to
  a wrong or non-existing address of memory.
  
  Augment the code to properly deal with the loader being below or
  at the lower bound of the memory region in question. Also, don't
  leave ununitialized variables behind.
  
  Reviewed by:  ian

Modified:
  head/sys/boot/uboot/lib/copy.c

Modified: head/sys/boot/uboot/lib/copy.c
==
--- head/sys/boot/uboot/lib/copy.c  Fri Jun 19 14:56:24 2015
(r284598)
+++ head/sys/boot/uboot/lib/copy.c  Fri Jun 19 17:00:36 2015
(r284599)
@@ -118,6 +118,13 @@ uboot_loadaddr(u_int type, void *data, u
this_block = eubldr;
this_size = eblock - eubldr;
}
+   } else if (subldr < sblock && eubldr < eblock) {
+   /* Loader is below or engulfs the sblock */
+   this_block = (eubldr < sblock) ? sblock : 
eubldr;
+   this_size = eblock - this_block;
+   } else {
+   this_block = 0;
+   this_size = 0;
}
if (biggest_size < this_size) {
biggest_block = this_block;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284600 - head/sys/dev/filemon

2015-06-19 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 19 17:19:20 2015
New Revision: 284600
URL: https://svnweb.freebsd.org/changeset/base/284600

Log:
  filemon_pid_check needs to hold proctree_lock
  
  Reviewed by:  kib
  MFC after:few days

Modified:
  head/sys/dev/filemon/filemon_wrapper.c

Modified: head/sys/dev/filemon/filemon_wrapper.c
==
--- head/sys/dev/filemon/filemon_wrapper.c  Fri Jun 19 17:00:36 2015
(r284599)
+++ head/sys/dev/filemon/filemon_wrapper.c  Fri Jun 19 17:19:20 2015
(r284600)
@@ -28,6 +28,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
+
 #include "opt_compat.h"
 
 #if __FreeBSD_version > 800032
@@ -84,13 +86,17 @@ filemon_pid_check(struct proc *p)
 {
struct filemon *filemon;
 
-   while (p->p_pptr) {
+   sx_slock(&proctree_lock);
+   while (p != initproc) {
TAILQ_FOREACH(filemon, &filemons_inuse, link) {
-   if (p->p_pid == filemon->pid)
+   if (p->p_pid == filemon->pid) {
+   sx_xunlock(&proctree_lock);
return (filemon);
+   }
}
-   p = p->p_pptr;
+   p = proc_realparent(p);
}
+   sx_xunlock(&proctree_lock);
return (NULL);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r268137 - head/sys/sys

2015-06-19 Thread Bruce Evans

On Fri, 19 Jun 2015, Dimitry Andric wrote:


On 19 Jun 2015, at 17:02, Pedro Giffuni  wrote:



On 19/06/2015 05:16 a.m., David Chisnall wrote:

I only just caught this (having seen the fallout from NetBSD doing the same 
thing in a shipping release and the pain that it???s caused):

__weak is a reserved keyword in Objective-C, please pick another name for this. 
 This in cdefs.h makes it impossible to include any FreeBSD standard headers in 
Objective-C programs (of which we have a couple of hundred in ports) if they 
use any of the modern Objective-C language modes.

...

Closely related to this, we are redefining _Noreturn, which is a reserved 
keyword in C11.


No, sys/cdefs.h has:

  254  /*
  255   * Keywords added in C11.
  256   */
  257
  258  #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L || 
defined(lint)
[...]
  284  #if defined(__cplusplus) && __cplusplus >= 201103L
  285  #define _Noreturn   [[noreturn]]
  286  #else
  287  #define _Noreturn   __dead2
  288  #endif
[...]
  320  #endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */

So the whole block redefining all the _Xxx identifiers is skipped for
C11 and higher.


I probably pointed this out incorrectly to Pedro.

All uses of _Noreturn are still broken, and also ugly.  __dead2 is the
gcc-2 compatible version of the gcc-1 compatible macro __dead.  It is
syntactically different from __dead and _Noreturn.  It must be placed
after the function parameter list instead of in the function type
declarator because old versions of gcc only accept attributes there.
__dead and presumably _Noreturn must be placed in the function type
declarator.  This is incompatible, and also uglier.


E.g.:

$ cpp -std=c99
#include 
_Noreturn void foo(void);
^D
# 1 ""
# 1 "" 1
# 1 "" 3
# 306 "" 3
# 1 "" 1
# 1 "" 2
# 1 "" 2
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 2 "" 2
__attribute__((__noreturn__)) void foo(void);


Syntax error with older versions of gcc that cdefs.h is supposed to support.
Thee versions that don't support attributes in the declarator also don't
support c99, so the order can be anything with them, but this doesn't
simplify fixing the problem -- you still need massive ifdefs or ugly
declarations.


$ cpp -std=c11
#include 
_Noreturn void foo(void);
^D
# 1 ""
# 1 "" 1
# 1 "" 3
# 306 "" 3
# 1 "" 1
# 1 "" 2
# 1 "" 2
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 2 "" 2
_Noreturn void foo(void);


Correct version with ugly declarations:

__dead void
foo(void) __dead2;

where:
1. __dead is the gcc-1 compatible macro restored to handle the different
  spelling in C11.  Direct spellings should not be used, since they cause
  namespace bugs like the current ones for __weak.
2. __dead2 is the gcc-2 compatible macro.  It also works for later gcc's
  and clang, perhaps even in C11.
3. __dead is defined as follows:
  a. for gcc-1, either leave it undefined (to keep its current behaviour
 of breaking any use of it), or define as its gcc-1 value again.
  b. for C11, define it as _Noreturn
  c. otherwise, define it as empty
4. __dead2 is defined the same as now.  Hopefully it is just redundant of
   __dead is defined as _Noreturn for C11.
5. the style of the above is taken from 4.4BSD-Lite2, which still has __dead
   and still defines it as __volatile and still has almost no support for
   gcc-2.  From Lite2 stdlib.h:

__dead void
 abort __P((void));

__dead void
 exit __P((int));

  Putting __dead first messes up the formatting by requiring an extra line
  to keep the function names lined up.

When I cleaned this up in FreeBSD, the first stage was to add __dead2 while
keeping __dead in 1994, the second stage was to remove __dead from
everywhere in the source tree except cdefs.h in 1996, and the "final" stage
was to remove the definition of __dead from cdefs.h in 1998.  The current
breakage shows that this was not even the final stage.

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

svn commit: r284601 - head/sys/dev/filemon

2015-06-19 Thread Simon J. Gerraty
Author: sjg
Date: Fri Jun 19 17:34:59 2015
New Revision: 284601
URL: https://svnweb.freebsd.org/changeset/base/284601

Log:
  sx_sunlock for sx_slock

Modified:
  head/sys/dev/filemon/filemon_wrapper.c

Modified: head/sys/dev/filemon/filemon_wrapper.c
==
--- head/sys/dev/filemon/filemon_wrapper.c  Fri Jun 19 17:19:20 2015
(r284600)
+++ head/sys/dev/filemon/filemon_wrapper.c  Fri Jun 19 17:34:59 2015
(r284601)
@@ -90,13 +90,13 @@ filemon_pid_check(struct proc *p)
while (p != initproc) {
TAILQ_FOREACH(filemon, &filemons_inuse, link) {
if (p->p_pid == filemon->pid) {
-   sx_xunlock(&proctree_lock);
+   sx_sunlock(&proctree_lock);
return (filemon);
}
}
p = proc_realparent(p);
}
-   sx_xunlock(&proctree_lock);
+   sx_sunlock(&proctree_lock);
return (NULL);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r284529 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfsclient vm

2015-06-19 Thread Mark Linimon
On Wed, Jun 17, 2015 at 10:44:28PM +, Gleb Smirnoff wrote:
> Log:
>   o Un-inline vm_pager_get_pages(), vm_pager_get_pages_async().
>   o Provide an extensive set of assertions for input array of pages.
>   o Remove now duplicate assertions from different pagers.

Out of curiosity, what is the effect of these changes?

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


svn commit: r284602 - head/sys/kern

2015-06-19 Thread Sean Bruno
Author: sbruno
Date: Fri Jun 19 18:57:36 2015
New Revision: 284602
URL: https://svnweb.freebsd.org/changeset/base/284602

Log:
  Feedback from commit r284535
  
  davide:  imgact_binmisc_clear_entry() needs to use atomic ops to remove
  the enable bit.
  
  kib:  M_NOWAIT is not warranted and comment is invalid.

Modified:
  head/sys/kern/imgact_binmisc.c

Modified: head/sys/kern/imgact_binmisc.c
==
--- head/sys/kern/imgact_binmisc.c  Fri Jun 19 17:34:59 2015
(r284601)
+++ head/sys/kern/imgact_binmisc.c  Fri Jun 19 18:57:36 2015
(r284602)
@@ -317,7 +317,7 @@ imgact_binmisc_disable_entry(char *name)
return (ENOENT);
}
 
-   ibe->ibe_flags &= ~IBF_ENABLED;
+   atomic_clear_32(&ibe->ibe_flags, IBF_ENABLED);
sx_sunlock(&interp_list_sx);
 
return (0);
@@ -406,8 +406,7 @@ imgact_binmisc_get_all_entries(struct sy
 
sx_slock(&interp_list_sx);
count = interp_list_entry_count;
-   /* Don't block in malloc() while holding lock. */
-   xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_NOWAIT|M_ZERO);
+   xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_ZERO);
if (!xbe) {
sx_sunlock(&interp_list_sx);
return (ENOMEM);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284604 - head/usr.bin/sockstat

2015-06-19 Thread Michael Tuexen
Author: tuexen
Date: Fri Jun 19 19:36:29 2015
New Revision: 284604
URL: https://svnweb.freebsd.org/changeset/base/284604

Log:
  Don't leak sockets.
  
  Reported by:  Coverity
  CID:  1306785
  
  MFC after:3 days

Modified:
  head/usr.bin/sockstat/sockstat.c

Modified: head/usr.bin/sockstat/sockstat.c
==
--- head/usr.bin/sockstat/sockstat.cFri Jun 19 19:36:21 2015
(r284603)
+++ head/usr.bin/sockstat/sockstat.cFri Jun 19 19:36:29 2015
(r284604)
@@ -255,6 +255,26 @@ sockaddr(struct sockaddr_storage *sa, in
 }
 
 static void
+free_socket(struct sock *sock)
+{
+   struct addr *cur, *next;
+
+   cur = sock->laddr;
+   while (cur != NULL) {
+   next = cur->next;
+   free(cur);
+   cur = next;
+   }
+   cur = sock->faddr;
+   while (cur != NULL) {
+   next = cur->next;
+   free(cur);
+   cur = next;
+   }
+   free(sock);
+}
+
+static void
 gather_sctp(void)
 {
struct sock *sock;
@@ -366,14 +386,17 @@ gather_sctp(void)
while (offset < len) {
xstcb = (struct xsctp_tcb *)(void *)(buf + offset);
offset += sizeof(struct xsctp_tcb);
-   if (no_stcb &&
-   opt_l &&
-   (!opt_L || !local_all_loopback) &&
-   ((xinpcb->flags & SCTP_PCB_FLAGS_UDPTYPE) ||
-(xstcb->last == 1))) {
-   hash = (int)((uintptr_t)sock->socket % 
HASHSIZE);
-   sock->next = sockhash[hash];
-   sockhash[hash] = sock;
+   if (no_stcb) {
+   if (opt_l &&
+   (!opt_L || !local_all_loopback) &&
+   ((xinpcb->flags & SCTP_PCB_FLAGS_UDPTYPE) ||
+(xstcb->last == 1))) {
+   hash = (int)((uintptr_t)sock->socket % 
HASHSIZE);
+   sock->next = sockhash[hash];
+   sockhash[hash] = sock;
+   } else {
+   free_socket(sock);
+   }
}
if (xstcb->last == 1)
break;
@@ -476,11 +499,14 @@ gather_sctp(void)
prev_faddr->next = faddr;
prev_faddr = faddr;
}
-   if (opt_c &&
-   (!opt_L || !(local_all_loopback || 
foreign_all_loopback))) {
-   hash = (int)((uintptr_t)sock->socket % 
HASHSIZE);
-   sock->next = sockhash[hash];
-   sockhash[hash] = sock;
+   if (opt_c) {
+   if (!opt_L || !(local_all_loopback || 
foreign_all_loopback)) {
+   hash = (int)((uintptr_t)sock->socket % 
HASHSIZE);
+   sock->next = sockhash[hash];
+   sockhash[hash] = sock;
+   } else {
+   free_socket(sock);
+   }
}
}
xinpcb = (struct xsctp_inpcb *)(void *)(buf + offset);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2015-06-19 Thread Mateusz Guzik
On Fri, Jun 19, 2015 at 06:57:37PM +, Sean Bruno wrote:
> Author: sbruno
> Date: Fri Jun 19 18:57:36 2015
> New Revision: 284602
> URL: https://svnweb.freebsd.org/changeset/base/284602
> 
> Log:
>   Feedback from commit r284535
>   
>   davide:  imgact_binmisc_clear_entry() needs to use atomic ops to remove
>   the enable bit.
>   
>   kib:  M_NOWAIT is not warranted and comment is invalid.
> 
> Modified:
>   head/sys/kern/imgact_binmisc.c
> 
> Modified: head/sys/kern/imgact_binmisc.c
> ==
> --- head/sys/kern/imgact_binmisc.cFri Jun 19 17:34:59 2015
> (r284601)
> +++ head/sys/kern/imgact_binmisc.cFri Jun 19 18:57:36 2015
> (r284602)
> @@ -317,7 +317,7 @@ imgact_binmisc_disable_entry(char *name)
>   return (ENOENT);
>   }
>  
> - ibe->ibe_flags &= ~IBF_ENABLED;
> + atomic_clear_32(&ibe->ibe_flags, IBF_ENABLED);
>   sx_sunlock(&interp_list_sx);
>  
>   return (0);
> @@ -406,8 +406,7 @@ imgact_binmisc_get_all_entries(struct sy
>  
>   sx_slock(&interp_list_sx);
>   count = interp_list_entry_count;
> - /* Don't block in malloc() while holding lock. */
> - xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_NOWAIT|M_ZERO);
> + xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_ZERO);

You can't just remove M_NOWAIT. You have to put M_WAITOK in its place.
Once you do that, malloc cannot fail and null check below can be
removed.
>   if (!xbe) {
>   sx_sunlock(&interp_list_sx);
>   return (ENOMEM);
> 

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


svn commit: r284605 - head/sys/kern

2015-06-19 Thread Sean Bruno
Author: sbruno
Date: Fri Jun 19 19:57:39 2015
New Revision: 284605
URL: https://svnweb.freebsd.org/changeset/base/284605

Log:
  Must have one of either M_WAITOK or M_NOWAIT, read the man page bruno.
  
  Submitted by: mjg

Modified:
  head/sys/kern/imgact_binmisc.c

Modified: head/sys/kern/imgact_binmisc.c
==
--- head/sys/kern/imgact_binmisc.c  Fri Jun 19 19:36:29 2015
(r284604)
+++ head/sys/kern/imgact_binmisc.c  Fri Jun 19 19:57:39 2015
(r284605)
@@ -406,7 +406,7 @@ imgact_binmisc_get_all_entries(struct sy
 
sx_slock(&interp_list_sx);
count = interp_list_entry_count;
-   xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_ZERO);
+   xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_WAITOK|M_ZERO);
if (!xbe) {
sx_sunlock(&interp_list_sx);
return (ENOMEM);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284606 - head/sys/kern

2015-06-19 Thread Sean Bruno
Author: sbruno
Date: Fri Jun 19 20:35:17 2015
New Revision: 284606
URL: https://svnweb.freebsd.org/changeset/base/284606

Log:
  Remove uneeded NULL check since malloc the malloc is now M_WAITOK
  
  Submitted by: mjg

Modified:
  head/sys/kern/imgact_binmisc.c

Modified: head/sys/kern/imgact_binmisc.c
==
--- head/sys/kern/imgact_binmisc.c  Fri Jun 19 19:57:39 2015
(r284605)
+++ head/sys/kern/imgact_binmisc.c  Fri Jun 19 20:35:17 2015
(r284606)
@@ -407,10 +407,6 @@ imgact_binmisc_get_all_entries(struct sy
sx_slock(&interp_list_sx);
count = interp_list_entry_count;
xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_WAITOK|M_ZERO);
-   if (!xbe) {
-   sx_sunlock(&interp_list_sx);
-   return (ENOMEM);
-   }
 
xbep = xbe;
SLIST_FOREACH(ibe, &interpreter_list, link) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Notice to appear in Court #00000358583

2015-06-19 Thread County Court
Notice to Appear,

You have to appear in the Court on the June 23.
Please, prepare all the documents relating to the case and bring them to Court 
on the specified date.
Note: The case will be heard by the judge in your absence if you do not come.

The copy of Court Notice is attached to this email.

Yours faithfully,
Marion Mcgrath,
District Clerk.

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


svn commit: r284607 - head/share/man/man4

2015-06-19 Thread Xin LI
Author: delphij
Date: Fri Jun 19 21:26:06 2015
New Revision: 284607
URL: https://svnweb.freebsd.org/changeset/base/284607

Log:
  Document kern.cam.ada.legacy_aliases, while I'm there also fix some typos.
  
  MFC after:2 weeks

Modified:
  head/share/man/man4/ada.4

Modified: head/share/man/man4/ada.4
==
--- head/share/man/man4/ada.4   Fri Jun 19 20:35:17 2015(r284606)
+++ head/share/man/man4/ada.4   Fri Jun 19 21:26:06 2015(r284607)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 22, 2014
+.Dd June 19, 2015
 .Dt ADA 4
 .Os
 .Sh NAME
@@ -45,14 +45,14 @@ The host adapter must also be separately
 .Tn ATA
 direct access device can be configured.
 .Sh COMMAND QUEUING
-Command queueing allows the device to process multiple transactions
+Command queuing allows the device to process multiple transactions
 concurrently, often re-ordering them to reduce the number and length of
 seeks.
 .Tn ATA
-defines two types of queueing:
-.Tn TCQ (Tagged Command Queueing, PATA legacy)
+defines two types of queuing:
+.Tn TCQ (Tagged Command Queuing, PATA legacy)
 and
-.Tn NCQ (Native Command Queueing, SATA) .
+.Tn NCQ (Native Command Queuing, SATA) .
 The
 .Nm
 device driver takes full advantage of NCQ, when supported.
@@ -146,6 +146,16 @@ instead of
 .Pa /etc/sysctl.conf .
 The global default is currently 1.
 The per-device default is to leave it as-is (follow global setting).
+.It Va kern.cam.ada.legacy_aliases
+.Pp
+This variable determines whether
+.Pa /dev/ad Ns Ar Y
+symbolic links are created,
+which tries to mimic old
+.Xr ata 4
+numbering.
+Set to 1 to enable legacy aliases symlinks, 0 to disable.
+The default is currently enabled.
 .El
 .Sh FILES
 .Bl -tag -width ".Pa /dev/ada*" -compact
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284608 - head/share/man/man9

2015-06-19 Thread Warner Losh
Author: imp
Date: Fri Jun 19 21:30:45 2015
New Revision: 284608
URL: https://svnweb.freebsd.org/changeset/base/284608

Log:
  Back out contested change until dispute is resolved. This proved to be
  more contentious than I expected.

Modified:
  head/share/man/man9/style.9

Modified: head/share/man/man9/style.9
==
--- head/share/man/man9/style.9 Fri Jun 19 21:26:06 2015(r284607)
+++ head/share/man/man9/style.9 Fri Jun 19 21:30:45 2015(r284608)
@@ -26,7 +26,7 @@
 .\"From: @(#)style 1.14 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd June 17, 2015
+.Dd January 7, 2010
 .Dt STYLE 9
 .Os
 .Sh NAME
@@ -503,14 +503,13 @@ Code which is unreachable for non-obviou
 .Pp
 Space after keywords
 .Pq Ic if , while , for , return , switch .
-Two styles of braces
+No braces
 .Ql ( \&{
 and
 .Ql \&} )
-are allowed for single line statements.
-Either they are used for all single statements, or
-they are used only where needed for clarity.
-Usage within a file should be consistent.
+are
+used for control statements with zero or only a single statement unless that
+statement is more than a single line in which case they are permitted.
 Forever loops are done with
 .Ic for Ns 's ,
 not
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284609 - head/usr.sbin/bsdconfig/usermgmt/share

2015-06-19 Thread Devin Teske
Author: dteske
Date: Fri Jun 19 21:32:20 2015
New Revision: 284609
URL: https://svnweb.freebsd.org/changeset/base/284609

Log:
  Interim fix for "Login not found" error.
  
  PR:   bin/196514
  MFC after:3 days
  X-MFC-to: stable/10

Modified:
  head/usr.sbin/bsdconfig/usermgmt/share/group.subr
  head/usr.sbin/bsdconfig/usermgmt/share/user.subr

Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Jun 19 21:30:45 
2015(r284608)
+++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Jun 19 21:32:20 
2015(r284609)
@@ -82,9 +82,9 @@ f_group_add()
#
# NB: pw(8) has a ``feature'' wherein `-n name' can be taken as GID
# instead of name. Work-around is to also pass `-g GID' at the same
-   # time (any GID will do; but `-1' is appropriate for this context).
+   # time (the GID is ignored in this case, so any GID will do).
#
-   if [ "$input" ] && f_quietly pw groupshow -n "$input" -g -1; then
+   if [ "$input" ] && f_quietly pw groupshow -n "$input" -g 1337; then
f_show_err "$msg_group_already_used" "$input"
return $FAILURE
fi
@@ -182,7 +182,7 @@ f_group_add()
1) # Group Name (prompt for new group name)
   f_dialog_input_group_name input "$group_name" ||
continue
-  if f_quietly pw groupshow -n "$input" -g -1; then
+  if f_quietly pw groupshow -n "$input" -g 1337; then
f_show_err "$msg_group_already_used" "$input"
continue
   fi
@@ -368,9 +368,9 @@ f_group_edit()
#
# NB: pw(8) has a ``feature'' wherein `-n name' can be taken as GID
# instead of name. Work-around is to also pass `-g GID' at the same
-   # time (any GID will do; but `-1' is appropriate for this context).
+   # time (the GID is ignored in this case, so any GID will do).
#
-   if [ "$input" ] && ! f_quietly pw groupshow -n "$input" -g -1; then
+   if [ "$input" ] && ! f_quietly pw groupshow -n "$input" -g 1337; then
f_show_err "$msg_group_not_found" "$input"
return $FAILURE
fi

Modified: head/usr.sbin/bsdconfig/usermgmt/share/user.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/share/user.subrFri Jun 19 21:30:45 
2015(r284608)
+++ head/usr.sbin/bsdconfig/usermgmt/share/user.subrFri Jun 19 21:32:20 
2015(r284609)
@@ -231,9 +231,9 @@ f_user_add()
#
# NB: pw(8) has a ``feature'' wherein `-n name' can be taken as UID
# instead of name. Work-around is to also pass `-u UID' at the same
-   # time (any UID will do; but `-1' is appropriate for this context).
+   # time (the UID is ignored in this case, so any UID will do).
#
-   if [ "$input" ] && f_quietly pw usershow -n "$input" -u -1; then
+   if [ "$input" ] && f_quietly pw usershow -n "$input" -u 1337; then
f_show_err "$msg_login_already_used" "$input"
return $FAILURE
fi
@@ -414,7 +414,7 @@ f_user_add()
1) # Login (prompt for new login name)
   f_dialog_input_name input "$user_name" ||
continue
-  if f_quietly pw usershow -n "$input" -u -1; then
+  if f_quietly pw usershow -n "$input" -u 1337; then
f_show_err "$msg_login_already_used" "$input"
continue
   fi
@@ -920,9 +920,9 @@ f_user_edit()
#
# NB: pw(8) has a ``feature'' wherein `-n name' can be taken as UID
# instead of name. Work-around is to also pass `-u UID' at the same
-   # time (any UID will do; but `-1' is appropriate for this context).
+   # time (the UID is ignored in this case, so any UID will do).
#
-   if [ "$input" ] && ! f_quietly pw usershow -n "$input" -u -1; then
+   if [ "$input" ] && ! f_quietly pw usershow -n "$input" -u 1337; then
f_show_err "$msg_login_not_found" "$input"
return $FAILURE
fi
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284610 - head/share/man/man4

2015-06-19 Thread Xin LI
Author: delphij
Date: Fri Jun 19 21:35:24 2015
New Revision: 284610
URL: https://svnweb.freebsd.org/changeset/base/284610

Log:
  Fix markups.
  
  MFC after:2 weeks

Modified:
  head/share/man/man4/aacraid.4

Modified: head/share/man/man4/aacraid.4
==
--- head/share/man/man4/aacraid.4   Fri Jun 19 21:32:20 2015
(r284609)
+++ head/share/man/man4/aacraid.4   Fri Jun 19 21:35:24 2015
(r284610)
@@ -23,7 +23,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd April 09, 2013
+.Dd June 19, 2015
 .Dt AACRAID 4
 .Os
 .Sh NAME
@@ -58,8 +58,9 @@ The RAID containers are handled via the
 bus.
 The physical buses are represented by the
 .Nm aacraidp?
-devices (beginning with aacraidp1). These devices enable the
-SCSI pass-thru interface and allows devices connected
+devices (beginning with aacraidp1).
+These devices enable the
+SCSI pass-passthrough interface and allows devices connected
 to the card such as CD-ROMs to be available via the CAM
 .Xr scsi 4
 subsystem.
@@ -129,7 +130,7 @@ and are also queued for retrieval by a m
 .Xr kldload 8
 .Sh AUTHORS
 .An Achim Leubner Aq Mt ac...@freebsd.org
-.An Ed Maste Aq Mt ema...@freebsd.org
+.An \&Ed Maste Aq Mt ema...@freebsd.org
 .An Scott Long Aq Mt sco...@freebsd.org
 .Sh BUGS
 The controller is not actually paused on suspend/resume.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284611 - head/share/man/man4

2015-06-19 Thread Xin LI
Author: delphij
Date: Fri Jun 19 21:35:56 2015
New Revision: 284611
URL: https://svnweb.freebsd.org/changeset/base/284611

Log:
  Fix markups and change e.g./eg. to e.g.,.
  
  MFC after:2 weeks

Modified:
  head/share/man/man4/acpi_hp.4
  head/share/man/man4/acpi_ibm.4
  head/share/man/man4/acpi_panasonic.4

Modified: head/share/man/man4/acpi_hp.4
==
--- head/share/man/man4/acpi_hp.4   Fri Jun 19 21:35:24 2015
(r284610)
+++ head/share/man/man4/acpi_hp.4   Fri Jun 19 21:35:56 2015
(r284611)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 8, 2010
+.Dd June 19, 2015
 .Dt ACPI_HP 4
 .Os
 .Sh NAME
@@ -48,7 +48,7 @@ acpi_hp_load="YES"
 The
 .Nm
 driver provides support for ACPI-controlled features found on HP laptops
-that use a WMI enabled BIOS (e.g. HP Compaq 8510p and 6510p).
+that use a WMI enabled BIOS (e.g., HP Compaq 8510p and 6510p).
 .Pp
 The main purpose of this driver is to provide an interface,
 accessible via
@@ -58,7 +58,7 @@ accessible via
 through which applications can determine and change the status of
 various laptop components and BIOS settings.
 .Pp
-.Ss Xr devd 8 Ss Events
+.Ss Xr devd 8 Events
 Devd events received by
 .Xr devd 8
 provide the following information:
@@ -91,7 +91,7 @@ WWAN on air status changed to 0 (not on 
 .It Li 0xe1
 WWAN on air status changed to 1 (on air)
 .El
-.Ss Xr devfs 8 Ss Device
+.Ss Xr devfs 8 Device
 You can read /dev/hpcmi to see your current BIOS settings.
 The detail level can be adjusted by setting the sysctl
 .Va cmi_detail
@@ -197,8 +197,7 @@ Interface to read BIOS settings
 .Sh EXAMPLES
 The following can be added to
 .Xr devd.conf 5
-in order disable the LAN interface when WLAN on air and reenable if it's
-not:
+in order disable the LAN interface when WLAN on air and reenable if it is not:
 .Bd -literal -offset indent
 notify 0 {
match "system"  "ACPI";
@@ -281,7 +280,10 @@ This driver is experimental and has only
 HP Compaq 8510p which featured all supported wireless devices (WWAN/BT/WLAN).
 Expect undefined results when operating on different hardware.
 .Pp
-Loading the driver is slow. Reading from /dev/hpcmi is even slower.
+Loading the driver is slow.
+Reading from
+.Pa /dev/hpcmi
+is even slower.
 .Pp
 Additional features like HP specific sensor readings or writing BIOS
 settings are not supported.

Modified: head/share/man/man4/acpi_ibm.4
==
--- head/share/man/man4/acpi_ibm.4  Fri Jun 19 21:35:24 2015
(r284610)
+++ head/share/man/man4/acpi_ibm.4  Fri Jun 19 21:35:56 2015
(r284611)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 24, 2012
+.Dd June 19, 2015
 .Dt ACPI_IBM 4
 .Os
 .Sh NAME
@@ -74,7 +74,7 @@ sysctl, is set to
 .Va availmask
 by default, a value representing all possible keypress events on the specific
 ThinkPad model.
-.Ss Xr devd 8 Ss Events
+.Ss Xr devd 8 Events
 Hotkey events received by
 .Xr devd 8
 provide the following information:
@@ -144,7 +144,7 @@ Mute
 .It Li 0x18
 Access IBM Button
 .El
-.Ss Xr led 4 Ss Interface
+.Ss Xr led 4 Interface
 The
 .Nm
 driver provides a
@@ -344,7 +344,7 @@ when
 is set to 1.
 Events are specified as a whitespace-separated list of event code in
 hexadecimal or decimal form.
-Note that the event maybe handled twice (eg. Brightness up/down) if ACPI BIOS
+Note that the event maybe handled twice (e.g., Brightness up/down) if ACPI BIOS
 already handled the event.
 .El
 .Pp

Modified: head/share/man/man4/acpi_panasonic.4
==
--- head/share/man/man4/acpi_panasonic.4Fri Jun 19 21:35:24 2015
(r284610)
+++ head/share/man/man4/acpi_panasonic.4Fri Jun 19 21:35:56 2015
(r284611)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 25, 2012
+.Dd June 19, 2015
 .Dt ACPI_PANASONIC 4
 .Os
 .Sh NAME
@@ -100,7 +100,7 @@ For the other events such as
 mixer control and showing battery status,
 .Xr devd 8
 should take the role as described below.
-.Ss Xr devd 8 Ss Events
+.Ss Xr devd 8 Events
 When notified to
 .Xr devd 8 ,
 the hotkey event provides the following information:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284612 - head/sys/dev/ixl

2015-06-19 Thread Andrew Gallatin
Author: gallatin
Date: Fri Jun 19 21:40:26 2015
New Revision: 284612
URL: https://svnweb.freebsd.org/changeset/base/284612

Log:
  Fix typo in baudrate initialization that was causing ixl to be seen as
  a 4GbE NIC, rather than a 40GbE NIC.
  
  Reviewed by:  Eric Joyner 
  MFC after:3 days
  Sponsored by: Netflix

Modified:
  head/sys/dev/ixl/if_ixl.c

Modified: head/sys/dev/ixl/if_ixl.c
==
--- head/sys/dev/ixl/if_ixl.c   Fri Jun 19 21:35:56 2015(r284611)
+++ head/sys/dev/ixl/if_ixl.c   Fri Jun 19 21:40:26 2015(r284612)
@@ -2551,7 +2551,7 @@ ixl_setup_interface(device_t dev, struct
}
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_mtu = ETHERMTU;
-   ifp->if_baudrate = 40;  // ??
+   ifp->if_baudrate = IF_Gbps(40);
ifp->if_init = ixl_init;
ifp->if_softc = vsi;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r284162 - head/bin/ls

2015-06-19 Thread Jilles Tjoelker
On Mon, Jun 08, 2015 at 07:13:05PM +, Xin LI wrote:
> Author: delphij
> Date: Mon Jun  8 19:13:04 2015
> New Revision: 284162
> URL: https://svnweb.freebsd.org/changeset/base/284162

> Log:
>   It has been long time that when doing 'ls -G /path/to/a/symlink', instead of
>   using the color of symbolic link, the color is determined by the link 
> target.
>   This behavior was quite confusing.

>   Looking at the file history, it looks like that r203665 intends to fix this
>   but the issue was never actually fixed.

>   Fix this by not setting FTS_COMFOLLOW when color is requested like what was
>   done in r203665.

>   MFC after:  2 weeks

> Modified:
>   head/bin/ls/ls.c

> Modified: head/bin/ls/ls.c
> ==
> --- head/bin/ls/ls.c  Mon Jun  8 18:59:14 2015(r284161)
> +++ head/bin/ls/ls.c  Mon Jun  8 19:13:04 2015(r284162)
> @@ -413,9 +413,14 @@ main(int argc, char *argv[])
>  
>   /*
>* If not -F, -P, -d or -l options, follow any symbolic links listed on
> -  * the command line.
> +  * the command line, unless in color mode in which case we need to
> +  * distinguish file type for a symbolic link itself and its target.
>*/
> - if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash))
> + if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash)
> +#ifdef COLORLS
> + && !f_color
> +#endif
> + )
>   fts_options |= FTS_COMFOLLOW;
>  
>   /*

Hmm. This makes -G or CLICOLOR env behave like -F in that symlinks are
no longer followed by default. This at least needs a change in the man
page to document it, and I'm not sure whether -G should actually modify
ls's action beyond adding colour.

For example, in stable/10 doing ls /sys, ls -p /sys and ls -G /sys show
a directory listing of the kernel source, while ls -F /sys shows just
the symlink.

What r203665 fixed was colour, inode number, etc. when -P was given and
-F/-d/-l were not.

I'll admit that this -F/-d/-l thing is bizarre but it has grown that way
historically and I've found ls implementations that deviate from this
annoying (e.g. on some embedded systems).

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


svn commit: r284613 - head/sys/netinet

2015-06-19 Thread Michael Tuexen
Author: tuexen
Date: Fri Jun 19 21:55:12 2015
New Revision: 284613
URL: https://svnweb.freebsd.org/changeset/base/284613

Log:
  Fix two KTRACE related bugs.
  
  Reported by:  Coverity
  CID:  1018058, 1018060
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_syscalls.c

Modified: head/sys/netinet/sctp_syscalls.c
==
--- head/sys/netinet/sctp_syscalls.cFri Jun 19 21:40:26 2015
(r284612)
+++ head/sys/netinet/sctp_syscalls.cFri Jun 19 21:55:12 2015
(r284613)
@@ -277,6 +277,10 @@ sys_sctp_generic_sendmsg (td, uap)
auio.uio_td = td;
auio.uio_offset = 0;/* XXX */
auio.uio_resid = 0;
+#ifdef KTRACE
+   if (KTRPOINT(td, KTR_GENIO))
+   ktruio = cloneuio(&auio);
+#endif /* KTRACE */
len = auio.uio_resid = uap->mlen;
CURVNET_SET(so->so_vnet);
error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL,
@@ -400,6 +404,10 @@ sys_sctp_generic_sendmsg_iov(td, uap)
goto sctp_bad;
}
}
+#ifdef KTRACE
+   if (KTRPOINT(td, KTR_GENIO))
+   ktruio = cloneuio(&auio);
+#endif /* KTRACE */
len = auio.uio_resid;
CURVNET_SET(so->so_vnet);
error = sctp_lower_sosend(so, to, &auio,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284614 - head/sys/boot/uboot/lib

2015-06-19 Thread Maxim Sobolev
Author: sobomax
Date: Fri Jun 19 22:24:58 2015
New Revision: 284614
URL: https://svnweb.freebsd.org/changeset/base/284614

Log:
  Provide bug4bug workaround for certain dumbiness of the u-boot's API_env_enum
  function, which is expected to set returned env to NULL upon reaching the end
  of the environment list but fails to do so in certain cases. The respective
  u-boot code looks like the following (HEAD at the time of this commit):
  
  --- api.c ---
   496 static int API_env_enum(va_list ap)
   ...
   510 *next = last;
   511
   512 for (i = 0; env_get_char(i) != '\0'; i = n + 1) {
   513 for (n = i; env_get_char(n) != '\0'; ++n) {
   514 if (n >= CONFIG_ENV_SIZE) {
   515 /* XXX shouldn't we set *next = 
NULL?? */
   516 return 0;
   517 }
   518 }
  -
  
  The net result is that any unfortunate user of the loader's ub_env_enum()
  function hitting this condition would be trapped in the infinite loop, as
  the main use pattern of ub_env_enum() is basically the following:
  
  while ((env = ub_env_enum(env)) != NULL) { DO STUFF }
  
  Which would stuck forever with the last element.

Modified:
  head/sys/boot/uboot/lib/glue.c

Modified: head/sys/boot/uboot/lib/glue.c
==
--- head/sys/boot/uboot/lib/glue.c  Fri Jun 19 21:55:12 2015
(r284613)
+++ head/sys/boot/uboot/lib/glue.c  Fri Jun 19 22:24:58 2015
(r284614)
@@ -513,7 +513,7 @@ ub_env_enum(const char *last)
if (!syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env))
return (NULL);
 
-   if (env == NULL)
+   if (env == NULL || last == env)
/* no more env. variables to enumerate */
return (NULL);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r284613 - head/sys/netinet

2015-06-19 Thread NGie Cooper
On Fri, Jun 19, 2015 at 2:55 PM, Michael Tuexen  wrote:
> Author: tuexen
> Date: Fri Jun 19 21:55:12 2015
> New Revision: 284613
> URL: https://svnweb.freebsd.org/changeset/base/284613
>
> Log:
>   Fix two KTRACE related bugs.
>
>   Reported by:  Coverity
>   CID:  1018058, 1018060

The commit doesn't tell me what the two KTRACE bugs were...
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284615 - head/sys/dev/xen/blkfront

2015-06-19 Thread Colin Percival
Author: cperciva
Date: Fri Jun 19 22:40:58 2015
New Revision: 284615
URL: https://svnweb.freebsd.org/changeset/base/284615

Log:
  Minor clean up to xbd_queue_cb:
  * nsegs must be at most BLKIF_MAX_SEGMENTS_PER_REQUEST (since we specify
that limit to bus_dma_tag_create), so KASSERT that rather than silently
adjusting the request.
  * block_segs is now a synonym for nsegs, so garbage collect that variable.
  * nsegs is never read during or after the while loop, so remove the dead
decrement from the loop.
  
  These were all left behind from the pre-r284296 support for a "segment
  block" extension.

Modified:
  head/sys/dev/xen/blkfront/blkfront.c

Modified: head/sys/dev/xen/blkfront/blkfront.c
==
--- head/sys/dev/xen/blkfront/blkfront.cFri Jun 19 22:24:58 2015
(r284614)
+++ head/sys/dev/xen/blkfront/blkfront.cFri Jun 19 22:40:58 2015
(r284615)
@@ -168,7 +168,6 @@ xbd_queue_cb(void *arg, bus_dma_segment_
uint64_t fsect, lsect;
int ref;
int op;
-   int block_segs;
 
cm = arg;
sc = cm->cm_sc;
@@ -180,6 +179,9 @@ xbd_queue_cb(void *arg, bus_dma_segment_
return;
}
 
+   KASSERT(nsegs <= BLKIF_MAX_SEGMENTS_PER_REQUEST,
+   ("Too many segments in a blkfront I/O"));
+
/* Fill out a communications ring structure. */
ring_req = RING_GET_REQUEST(&sc->xbd_ring, sc->xbd_ring.req_prod_pvt);
sc->xbd_ring.req_prod_pvt++;
@@ -190,9 +192,8 @@ xbd_queue_cb(void *arg, bus_dma_segment_
ring_req->nr_segments = nsegs;
cm->cm_nseg = nsegs;
 
-   block_segs= MIN(nsegs, BLKIF_MAX_SEGMENTS_PER_REQUEST);
sg= ring_req->seg;
-   last_block_sg = sg + block_segs;
+   last_block_sg = sg + nsegs;
sg_ref= cm->cm_sg_refs;
 
while (sg < last_block_sg) {
@@ -227,7 +228,6 @@ xbd_queue_cb(void *arg, bus_dma_segment_
sg++;
sg_ref++;
segs++;
-   nsegs--;
}
 
if (cm->cm_operation == BLKIF_OP_READ)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284616 - head/sys/opencrypto

2015-06-19 Thread John-Mark Gurney
Author: jmg
Date: Fri Jun 19 22:42:26 2015
New Revision: 284616
URL: https://svnweb.freebsd.org/changeset/base/284616

Log:
  change the KASSERT so it is meaningful, var is unsigned, so even
  when it wraps, it's still >= 0...
  
  Reported by:  Coverity
  CID:  1017564

Modified:
  head/sys/opencrypto/crypto.c

Modified: head/sys/opencrypto/crypto.c
==
--- head/sys/opencrypto/crypto.cFri Jun 19 22:40:58 2015
(r284615)
+++ head/sys/opencrypto/crypto.cFri Jun 19 22:42:26 2015
(r284616)
@@ -1181,8 +1181,8 @@ crypto_kdone(struct cryptkop *krp)
/* XXX: What if driver is loaded in the meantime? */
if (krp->krp_hid < crypto_drivers_num) {
cap = &crypto_drivers[krp->krp_hid];
+   KASSERT(cap->cc_koperations > 0, ("cc_koperations == 0"));
cap->cc_koperations--;
-   KASSERT(cap->cc_koperations >= 0, ("cc_koperations < 0"));
if (cap->cc_flags & CRYPTOCAP_F_CLEANUP)
crypto_remove(cap);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284617 - head/release/tools

2015-06-19 Thread Glen Barber
Author: gjb
Date: Fri Jun 19 23:03:05 2015
New Revision: 284617
URL: https://svnweb.freebsd.org/changeset/base/284617

Log:
  Fix path to waagent.
  
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/tools/azure.conf

Modified: head/release/tools/azure.conf
==
--- head/release/tools/azure.conf   Fri Jun 19 22:42:26 2015
(r284616)
+++ head/release/tools/azure.conf   Fri Jun 19 23:03:05 2015
(r284617)
@@ -14,8 +14,8 @@ export VM_EXTRA_PACKAGES="sysutils/azure
 export VM_RC_LIST=
 
 vm_extra_pre_umount() {
-   chroot ${DESTDIR} /usr/sbin/waagent -verbose -install
-   yes | chroot ${DESTDIR} /usr/sbin/waagent -deprovision
+   chroot ${DESTDIR} /usr/local/sbin/waagent -verbose -install
+   yes | chroot ${DESTDIR} /usr/local/sbin/waagent -deprovision
echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf
echo 'ifconfig_hn0="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
echo 'waagent_enable="YES"' >> ${DESTDIR}/etc/rc.conf
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r284614 - head/sys/boot/uboot/lib

2015-06-19 Thread Ian Lepore
On Fri, 2015-06-19 at 22:24 +, Maxim Sobolev wrote:
> Author: sobomax
> Date: Fri Jun 19 22:24:58 2015
> New Revision: 284614
> URL: https://svnweb.freebsd.org/changeset/base/284614
> 
> Log:
>   Provide bug4bug workaround for certain dumbiness of the u-boot's 
> API_env_enum
>   function, which is expected to set returned env to NULL upon reaching the 
> end
>   of the environment list but fails to do so in certain cases. The respective
>   u-boot code looks like the following (HEAD at the time of this commit):
>   
>   --- api.c ---
>496 static int API_env_enum(va_list ap)
>...
>510 *next = last;
>511
>512 for (i = 0; env_get_char(i) != '\0'; i = n + 1) {
>513 for (n = i; env_get_char(n) != '\0'; ++n) {
>514 if (n >= CONFIG_ENV_SIZE) {
>515 /* XXX shouldn't we set *next 
> = NULL?? */
>516 return 0;
>517 }
>518 }
>   -
>   
>   The net result is that any unfortunate user of the loader's ub_env_enum()
>   function hitting this condition would be trapped in the infinite loop, as
>   the main use pattern of ub_env_enum() is basically the following:
>   
>   while ((env = ub_env_enum(env)) != NULL) { DO STUFF }
>   
>   Which would stuck forever with the last element.
> 
> Modified:
>   head/sys/boot/uboot/lib/glue.c
> 
> Modified: head/sys/boot/uboot/lib/glue.c
> ==
> --- head/sys/boot/uboot/lib/glue.cFri Jun 19 21:55:12 2015
> (r284613)
> +++ head/sys/boot/uboot/lib/glue.cFri Jun 19 22:24:58 2015
> (r284614)
> @@ -513,7 +513,7 @@ ub_env_enum(const char *last)
>   if (!syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env))
>   return (NULL);
>  
> - if (env == NULL)
> + if (env == NULL || last == env)
>   /* no more env. variables to enumerate */
>   return (NULL);
>  
> 

This is only a problem with an unpatched u-boot, which has a completely
bogus and un-useful implementation of API_env_enum().  That's why every
one of our u-boot ports has the same patch to put in an implementation
that actually works.

Your change works around the worst part of the bug (the infinite loop)
but leaves the major problem of the implementation only returning values
initially loaded from the saved environment, not anything set by the
scripts that loaded ubldr().

-- Ian

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


svn commit: r284618 - head/sys/dev/xen/blkfront

2015-06-19 Thread Colin Percival
Author: cperciva
Date: Sat Jun 20 00:02:03 2015
New Revision: 284618
URL: https://svnweb.freebsd.org/changeset/base/284618

Log:
  Refactor xbd_queue_cb, extracting the code which converts bus_dma segments
  into blkif segments, and moving it into a new function.  This will be used
  by upcoming support for indirect-segment blkif requests.
  
  This commit should not result in any functional changes.

Modified:
  head/sys/dev/xen/blkfront/blkfront.c

Modified: head/sys/dev/xen/blkfront/blkfront.c
==
--- head/sys/dev/xen/blkfront/blkfront.cFri Jun 19 23:03:05 2015
(r284617)
+++ head/sys/dev/xen/blkfront/blkfront.cSat Jun 20 00:02:03 2015
(r284618)
@@ -156,45 +156,14 @@ xbd_free_command(struct xbd_command *cm)
 }
 
 static void
-xbd_queue_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
+mksegarray(bus_dma_segment_t *segs, int nsegs,
+grant_ref_t * gref_head, int otherend_id, int readonly,
+grant_ref_t * sg_ref, blkif_request_segment_t * sg)
 {
-   struct xbd_softc *sc;
-   struct xbd_command *cm;
-   blkif_request_t *ring_req;
-   struct blkif_request_segment *sg;
-   struct blkif_request_segment *last_block_sg;
-   grant_ref_t *sg_ref;
+   struct blkif_request_segment *last_block_sg = sg + nsegs;
vm_paddr_t buffer_ma;
uint64_t fsect, lsect;
int ref;
-   int op;
-
-   cm = arg;
-   sc = cm->cm_sc;
-
-   if (error) {
-   cm->cm_bp->bio_error = EIO;
-   biodone(cm->cm_bp);
-   xbd_free_command(cm);
-   return;
-   }
-
-   KASSERT(nsegs <= BLKIF_MAX_SEGMENTS_PER_REQUEST,
-   ("Too many segments in a blkfront I/O"));
-
-   /* Fill out a communications ring structure. */
-   ring_req = RING_GET_REQUEST(&sc->xbd_ring, sc->xbd_ring.req_prod_pvt);
-   sc->xbd_ring.req_prod_pvt++;
-   ring_req->id = cm->cm_id;
-   ring_req->operation = cm->cm_operation;
-   ring_req->sector_number = cm->cm_sector_number;
-   ring_req->handle = (blkif_vdev_t)(uintptr_t)sc->xbd_disk;
-   ring_req->nr_segments = nsegs;
-   cm->cm_nseg = nsegs;
-
-   sg= ring_req->seg;
-   last_block_sg = sg + nsegs;
-   sg_ref= cm->cm_sg_refs;
 
while (sg < last_block_sg) {
buffer_ma = segs->ds_addr;
@@ -205,7 +174,7 @@ xbd_queue_cb(void *arg, bus_dma_segment_
"cross a page boundary"));
 
/* install a grant reference. */
-   ref = gnttab_claim_grant_reference(&cm->cm_gref_head);
+   ref = gnttab_claim_grant_reference(gref_head);
 
/*
 * GNTTAB_LIST_END == 0x, but it is private
@@ -215,9 +184,9 @@ xbd_queue_cb(void *arg, bus_dma_segment_
 
gnttab_grant_foreign_access_ref(
ref,
-   xenbus_get_otherend_id(sc->xbd_dev),
+   otherend_id,
buffer_ma >> PAGE_SHIFT,
-   ring_req->operation == BLKIF_OP_WRITE);
+   readonly);
 
*sg_ref = ref;
*sg = (struct blkif_request_segment) {
@@ -229,6 +198,42 @@ xbd_queue_cb(void *arg, bus_dma_segment_
sg_ref++;
segs++;
}
+}
+
+static void
+xbd_queue_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
+{
+   struct xbd_softc *sc;
+   struct xbd_command *cm;
+   blkif_request_t *ring_req;
+   int op;
+
+   cm = arg;
+   sc = cm->cm_sc;
+
+   if (error) {
+   cm->cm_bp->bio_error = EIO;
+   biodone(cm->cm_bp);
+   xbd_free_command(cm);
+   return;
+   }
+
+   KASSERT(nsegs <= BLKIF_MAX_SEGMENTS_PER_REQUEST,
+   ("Too many segments in a blkfront I/O"));
+
+   /* Fill out a communications ring structure. */
+   ring_req = RING_GET_REQUEST(&sc->xbd_ring, sc->xbd_ring.req_prod_pvt);
+   sc->xbd_ring.req_prod_pvt++;
+   ring_req->id = cm->cm_id;
+   ring_req->operation = cm->cm_operation;
+   ring_req->sector_number = cm->cm_sector_number;
+   ring_req->handle = (blkif_vdev_t)(uintptr_t)sc->xbd_disk;
+   ring_req->nr_segments = nsegs;
+   cm->cm_nseg = nsegs;
+   mksegarray(segs, nsegs, &cm->cm_gref_head,
+   xenbus_get_otherend_id(sc->xbd_dev),
+   cm->cm_operation == BLKIF_OP_WRITE,
+   cm->cm_sg_refs, ring_req->seg);
 
if (cm->cm_operation == BLKIF_OP_READ)
op = BUS_DMASYNC_PREREAD;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284619 - head/share/doc/usd/13.viref

2015-06-19 Thread Baptiste Daroussin
Author: bapt
Date: Sat Jun 20 00:13:28 2015
New Revision: 284619
URL: https://svnweb.freebsd.org/changeset/base/284619

Log:
  Readd merge.awk forgotten while importing the old vi documentation directly 
into
  the tree.
  
  Do not rely on SRCDIR to find the merge.awk script but use .CURDIR
  Fix a long standing bug making the generated documents never including the 
index

Added:
  head/share/doc/usd/13.viref/merge.awk   (contents, props changed)
Modified:
  head/share/doc/usd/13.viref/Makefile

Modified: head/share/doc/usd/13.viref/Makefile
==
--- head/share/doc/usd/13.viref/MakefileSat Jun 20 00:02:03 2015
(r284618)
+++ head/share/doc/usd/13.viref/MakefileSat Jun 20 00:13:28 2015
(r284619)
@@ -2,7 +2,6 @@
 # $FreeBSD$
 
 VOLUME=usd/13.viref
-SRCS=  vi.ref-patched
 EXTRA= ex.cmd.roff ref.so set.opt.roff vi.cmd.roff
 MACROS=-me
 CLEANFILES=vi.ref-patched index
@@ -15,18 +14,22 @@ vi.ref-patched: vi.ref
 
 PRINTERDEVICE?=ascii
 .for _dev in ${PRINTERDEVICE}
+SRCS+= vi.ref-${_dev}
 EXTRA+=index.so.${_dev}
-CLEANFILES+=   index.so.${_dev}
+CLEANFILES+=   index.so.${_dev} vi.ref-${_dev}
+
+vi.ref-${_dev}: index.so.${_dev}
+   sed -e 's:^\.so index\.so\.\\\*\[\.T\]$$:${_dev}:' vi.ref-patched > 
${.TARGET}
 
 # Build index.so as a side-effect of building the paper.
-index.so.${_dev}: ${SRCS} ${EXTRA:Nindex.so.${_dev}}
+index.so.${_dev}: vi.ref-patched ${EXTRA:Nindex.so.${_dev}}
sed -e 's:^\.so index\.so\.\\\*\[\.T\]$$::' vi.ref-patched | \
${ROFF.${_dev}} -U -z
sed -e 's/MINUSSIGN/-/' \
-e 's/DOUBLEQUOTE/""/' \
-e "s/SQUOTE/'/" \
-e 's/ /__SPACE/g' < index | \
-   sort -u '-t ' -k 1,1 -k 2n | awk -f ${SRCDIR}/merge.awk | \
+   sort -u '-t ' -k 1,1 -k 2n | awk -f ${.CURDIR}/merge.awk | \
sed -e 's/__SPACE/ /g' \
-e "s/^\\(['\\.]\\)/\&\\1/" > ${.TARGET}
 .endfor

Added: head/share/doc/usd/13.viref/merge.awk
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/doc/usd/13.viref/merge.awk   Sat Jun 20 00:13:28 2015
(r284619)
@@ -0,0 +1,17 @@
+# $FreeBSD$
+#  @(#)merge.awk   8.3 (Berkeley) 5/25/94
+#
+# merge index entries into one line per label
+$1 == prev {
+   printf ", %s", $2;
+   next;
+}
+{
+   if (NR != 1)
+   printf "\n";
+   printf "%s \t%s", $1, $2;
+   prev = $1;
+}
+END {
+   printf "\n"
+}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284620 - head/share/mk

2015-06-19 Thread Baptiste Daroussin
Author: bapt
Date: Sat Jun 20 00:17:57 2015
New Revision: 284620
URL: https://svnweb.freebsd.org/changeset/base/284620

Log:
  Use .CURDIR in soelim's include path instead of SRCDIR
  This fixes build when a user has defined SRCDIR in make.conf as required by
  some ports

Modified:
  head/share/mk/bsd.doc.mk

Modified: head/share/mk/bsd.doc.mk
==
--- head/share/mk/bsd.doc.mkSat Jun 20 00:13:28 2015(r284619)
+++ head/share/mk/bsd.doc.mkSat Jun 20 00:17:57 2015(r284620)
@@ -75,7 +75,7 @@ TRFLAGS+= -p
 TRFLAGS+=  -R
 .endif
 .if defined(USE_SOELIM)
-TRFLAGS+=  -I${SRCDIR}
+TRFLAGS+=  -I${.CURDIR}
 .endif
 .if defined(USE_TBL)
 TRFLAGS+=  -t
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r284614 - head/sys/boot/uboot/lib

2015-06-19 Thread Maxim Sobolev
Ian, that's cool and dandy, but I still suggest we put some sanity checking
and have certain workarounds in the loader (whenever it does not add
ambiguity or blows up a code too much of course), so that new folks in town
trying to port to new platforms like myself won't spend hours and hours
hunting known issues and bugs. And hitting those infinite loops is very
frustrating with no errors or anything. On top of that, in some cases you
may be stuck with vendor-provided u-boot with no way to patch and
re-compile. BTW, there is another stupid bug existing in the u-boot loader,
which basically sets fdtaddr in decimal not in hex. On my particular board
this makes ubldr to blow up with CPU exception, unfortunately no workaround
is possible since there is no 0x for hex values and majority of cases when
this variable is set is in hex.

-Maxim

On Fri, Jun 19, 2015 at 4:09 PM, Ian Lepore  wrote:

> On Fri, 2015-06-19 at 22:24 +, Maxim Sobolev wrote:
> > Author: sobomax
> > Date: Fri Jun 19 22:24:58 2015
> > New Revision: 284614
> > URL: https://svnweb.freebsd.org/changeset/base/284614
> >
> > Log:
> >   Provide bug4bug workaround for certain dumbiness of the u-boot's
> API_env_enum
> >   function, which is expected to set returned env to NULL upon reaching
> the end
> >   of the environment list but fails to do so in certain cases. The
> respective
> >   u-boot code looks like the following (HEAD at the time of this commit):
> >
> >   --- api.c ---
> >496 static int API_env_enum(va_list ap)
> >...
> >510 *next = last;
> >511
> >512 for (i = 0; env_get_char(i) != '\0'; i = n + 1) {
> >513 for (n = i; env_get_char(n) != '\0'; ++n)
> {
> >514 if (n >= CONFIG_ENV_SIZE) {
> >515 /* XXX shouldn't we set
> *next = NULL?? */
> >516 return 0;
> >517 }
> >518 }
> >   -
> >
> >   The net result is that any unfortunate user of the loader's
> ub_env_enum()
> >   function hitting this condition would be trapped in the infinite loop,
> as
> >   the main use pattern of ub_env_enum() is basically the following:
> >
> >   while ((env = ub_env_enum(env)) != NULL) { DO STUFF }
> >
> >   Which would stuck forever with the last element.
> >
> > Modified:
> >   head/sys/boot/uboot/lib/glue.c
> >
> > Modified: head/sys/boot/uboot/lib/glue.c
> >
> ==
> > --- head/sys/boot/uboot/lib/glue.cFri Jun 19 21:55:12 2015
> (r284613)
> > +++ head/sys/boot/uboot/lib/glue.cFri Jun 19 22:24:58 2015
> (r284614)
> > @@ -513,7 +513,7 @@ ub_env_enum(const char *last)
> >   if (!syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env))
> >   return (NULL);
> >
> > - if (env == NULL)
> > + if (env == NULL || last == env)
> >   /* no more env. variables to enumerate */
> >   return (NULL);
> >
> >
>
> This is only a problem with an unpatched u-boot, which has a completely
> bogus and un-useful implementation of API_env_enum().  That's why every
> one of our u-boot ports has the same patch to put in an implementation
> that actually works.
>
> Your change works around the worst part of the bug (the infinite loop)
> but leaves the major problem of the implementation only returning values
> initially loaded from the saved environment, not anything set by the
> scripts that loaded ubldr().
>
> -- Ian
>
>
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2015-06-19 Thread Alexander Motin
Author: mav
Date: Sat Jun 20 03:40:19 2015
New Revision: 284622
URL: https://svnweb.freebsd.org/changeset/base/284622

Log:
  Remove device queue freeze handling and replace it with dummy.
  
  At this point CTL has no known use case for device queue freezes.
  Same time existing (considered to be broken) code was found to cause
  modify-after-free issues.
  
  Discussed with:   ken
  MFC after:1 week

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

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Sat Jun 20 00:58:46 2015(r284621)
+++ head/sys/cam/ctl/scsi_ctl.c Sat Jun 20 03:40:19 2015(r284622)
@@ -848,15 +848,6 @@ ctlfestart(struct cam_periph *periph, un
atio->ccb_h.target_lun = CAM_LUN_WILDCARD;
}
 
-   if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) {
-   cam_release_devq(periph->path,
-/*relsim_flags*/0,
-/*reduction*/0,
-/*timeout*/0,
-/*getcount_only*/0);
-   atio->ccb_h.status &= ~CAM_DEV_QFRZN;
-   }
-
if (atio->ccb_h.func_code != XPT_ACCEPT_TARGET_IO) {
xpt_print(periph->path, "%s: func_code "
  "is %#x\n", __func__,
@@ -966,15 +957,6 @@ ctlfestart(struct cam_periph *periph, un
xpt_action(start_ccb);
cam_periph_lock(periph);
 
-   if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) {
-   cam_release_devq(periph->path,
-/*relsim_flags*/0,
-/*reduction*/0,
-/*timeout*/0,
-/*getcount_only*/0);
-   atio->ccb_h.status &= ~CAM_DEV_QFRZN;
-   }
-
/*
 * If we still have work to do, ask for another CCB.
 */
@@ -1107,6 +1089,19 @@ ctlfedone(struct cam_periph *periph, uni
   done_ccb->ccb_h.func_code);
 #endif
 
+   /*
+* At this point CTL has no known use case for device queue freezes.
+* In case some SIM think different -- drop its freeze right here.
+*/
+   if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
+   cam_release_devq(periph->path,
+/*relsim_flags*/0,
+/*reduction*/0,
+/*timeout*/0,
+/*getcount_only*/0);
+   done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN;
+   }
+
softc = (struct ctlfe_lun_softc *)periph->softc;
bus_softc = softc->parent_softc;
mtx = cam_periph_mtx(periph);
@@ -1417,12 +1412,9 @@ ctlfedone(struct cam_periph *periph, uni
union ctl_io *io;
struct ccb_immediate_notify *inot;
cam_status status;
-   int frozen, send_ctl_io;
+   int send_ctl_io;
 
inot = &done_ccb->cin1;
-
-   frozen = (done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0;
-
printf("%s: got XPT_IMMEDIATE_NOTIFY status %#x tag %#x "
   "seq %#x\n", __func__, inot->ccb_h.status,
   inot->tag_id, inot->seq_id);
@@ -1524,14 +1516,6 @@ ctlfedone(struct cam_periph *periph, uni
done_ccb->ccb_h.func_code = XPT_NOTIFY_ACKNOWLEDGE;
xpt_action(done_ccb);
}
-
-   if (frozen != 0) {
-   cam_release_devq(periph->path,
-/*relsim_flags*/ 0,
-/*opening reduction*/ 0,
-/*timeout*/ 0,
-/*getcount_only*/ 0);
-   }
break;
}
case XPT_NOTIFY_ACKNOWLEDGE:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2015-06-19 Thread Marcel Moolenaar
Author: marcel
Date: Sat Jun 20 04:02:33 2015
New Revision: 284623
URL: https://svnweb.freebsd.org/changeset/base/284623

Log:
  Add support for the Intel Atom E3800 series SoC (aka Bay Trail).
  
  Sponsored by: XipLink, Inc

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

Modified: head/sys/dev/uart/uart_bus_pci.c
==
--- head/sys/dev/uart/uart_bus_pci.cSat Jun 20 03:40:19 2015
(r284622)
+++ head/sys/dev/uart/uart_bus_pci.cSat Jun 20 04:02:33 2015
(r284623)
@@ -69,6 +69,7 @@ struct pci_id {
const char  *desc;
int rid;
int rclk;
+   int regshft;
 };
 
 static const struct pci_id pci_ns8250_ids[] = {
@@ -118,6 +119,10 @@ static const struct pci_id pci_ns8250_id
 { 0x151f, 0x, 0x, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
 { 0x1fd4, 0x1999, 0x1fd4, 0x0001, "Sunix SER5 Serial Port", 0x10,
8 * DEFAULT_RCLK },
+{ 0x8086, 0x0f0a, 0x, 0, "Intel ValleyView LPIO1 HSUART#1", 0x10,
+   24 * DEFAULT_RCLK, 2 },
+{ 0x8086, 0x0f0c, 0x, 0, "Intel ValleyView LPIO1 HSUART#2", 0x10,
+   24 * DEFAULT_RCLK, 2 },
 { 0x8086, 0x1c3d, 0x, 0, "Intel AMT - KT Controller", 0x10 },
 { 0x8086, 0x1d3d, 0x, 0, "Intel C600/X79 Series Chipset KT Controller", 
0x10 },
 { 0x8086, 0x2a07, 0x, 0, "Intel AMT - PM965/GM965 KT Controller", 0x10 },
@@ -186,7 +191,7 @@ uart_pci_probe(device_t dev)
return (ENXIO);
 
  match:
-   result = uart_bus_probe(dev, 0, id->rclk, id->rid, 0);
+   result = uart_bus_probe(dev, id->regshft, id->rclk, id->rid, 0);
/* Bail out on error. */
if (result > 0)
return (result);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2015-06-19 Thread Konstantin Belousov
On Fri, Jun 19, 2015 at 06:57:37PM +, Sean Bruno wrote:
> Author: sbruno
> Date: Fri Jun 19 18:57:36 2015
> New Revision: 284602
> URL: https://svnweb.freebsd.org/changeset/base/284602
> 
> Log:
>   Feedback from commit r284535
>   
>   davide:  imgact_binmisc_clear_entry() needs to use atomic ops to remove
>   the enable bit.
>   
>   kib:  M_NOWAIT is not warranted and comment is invalid.
> 
> Modified:
>   head/sys/kern/imgact_binmisc.c
> 
> Modified: head/sys/kern/imgact_binmisc.c
> ==
> --- head/sys/kern/imgact_binmisc.cFri Jun 19 17:34:59 2015
> (r284601)
> +++ head/sys/kern/imgact_binmisc.cFri Jun 19 18:57:36 2015
> (r284602)
> @@ -317,7 +317,7 @@ imgact_binmisc_disable_entry(char *name)
>   return (ENOENT);
>   }
>  
> - ibe->ibe_flags &= ~IBF_ENABLED;
> + atomic_clear_32(&ibe->ibe_flags, IBF_ENABLED);
>   sx_sunlock(&interp_list_sx);
>  
>   return (0);
> @@ -406,8 +406,7 @@ imgact_binmisc_get_all_entries(struct sy
>  
>   sx_slock(&interp_list_sx);
>   count = interp_list_entry_count;
> - /* Don't block in malloc() while holding lock. */
> - xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_NOWAIT|M_ZERO);
> + xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_ZERO);
Was the change tested at all ? Malloc(9) requires either M_WAITOK or M_NOWAIT
flags to be present.

>   if (!xbe) {
>   sx_sunlock(&interp_list_sx);
>   return (ENOMEM);
As I noted in my mail, xbe == NULL is impossible with M_WAITOK.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284624 - head/sys/dev/ofw

2015-06-19 Thread Warner Losh
Author: imp
Date: Sat Jun 20 04:48:48 2015
New Revision: 284624
URL: https://svnweb.freebsd.org/changeset/base/284624

Log:
  Add ofw_bus_find_child_by_phandle, a helper routine to find a device_t
  child matchig a given phandle_t.
  
  Differential Revision: https://reviews.freebsd.org/D2871

Modified:
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/dev/ofw/ofw_bus_subr.h

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==
--- head/sys/dev/ofw/ofw_bus_subr.c Sat Jun 20 04:02:33 2015
(r284623)
+++ head/sys/dev/ofw/ofw_bus_subr.c Sat Jun 20 04:48:48 2015
(r284624)
@@ -551,3 +551,44 @@ ofw_bus_find_compatible(phandle_t node, 
}
return (0);
 }
+
+/**
+ * @brief Return child of bus whose phandle is node
+ *
+ * A direct child of @p will be returned if it its phandle in the
+ * OFW tree is @p node. Otherwise, NULL is returned.
+ *
+ * @param bus  The bus to examine
+ * @param node The phandle_t to look for.
+ */
+device_t
+ofw_bus_find_child_device_by_phandle(device_t bus, phandle_t node)
+{
+   device_t *children, retval, child;
+   int nkid, i;
+
+   /*
+* Nothing can match the flag value for no node.
+*/
+   if (node == -1)
+   return (NULL);
+
+   /*
+* Search the children for a match. We microoptimize
+* a bit by not using ofw_bus_get since we already know
+* the parent. We do not recurse.
+*/
+   if (device_get_children(bus, &children, &nkid) != 0)
+   return (NULL);
+   retval = NULL;
+   for (i = 0; i < nkid; i++) {
+   child = children[i];
+   if (OFW_BUS_GET_NODE(bus, child) == node) {
+   retval = child;
+   break;
+   }
+   }
+   free(children, M_TEMP);
+
+   return (retval);
+}

Modified: head/sys/dev/ofw/ofw_bus_subr.h
==
--- head/sys/dev/ofw/ofw_bus_subr.h Sat Jun 20 04:02:33 2015
(r284623)
+++ head/sys/dev/ofw/ofw_bus_subr.h Sat Jun 20 04:48:48 2015
(r284624)
@@ -107,4 +107,7 @@ phandle_t ofw_bus_find_compatible(phandl
 /* Helper to search for a child with a given name */
 phandle_t ofw_bus_find_child(phandle_t, const char *);
 
+/* Helper routine to find a device_t child matchig a given phandle_t */
+device_t ofw_bus_find_child_device_by_phandle(device_t bus, phandle_t node);
+
 #endif /* !_DEV_OFW_OFW_BUS_SUBR_H_ */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284625 - head/sys/dev/gpio

2015-06-19 Thread Warner Losh
Author: imp
Date: Sat Jun 20 04:48:53 2015
New Revision: 284625
URL: https://svnweb.freebsd.org/changeset/base/284625

Log:
  Use ofw_bus_find_child_device_by_phandle to see if the child we're
  adding already exists and if so just return that. The typical use case
  is from identify routines, which shouldn't be adding multiple copies
  of the same phandle_t to the gpiobus. Only one per phandle_t is needed
  (or expected by the current code).
  
  Differential Revision: https://reviews.freebsd.org/D2871

Modified:
  head/sys/dev/gpio/ofw_gpiobus.c

Modified: head/sys/dev/gpio/ofw_gpiobus.c
==
--- head/sys/dev/gpio/ofw_gpiobus.c Sat Jun 20 04:48:48 2015
(r284624)
+++ head/sys/dev/gpio/ofw_gpiobus.c Sat Jun 20 04:48:53 2015
(r284625)
@@ -56,6 +56,14 @@ ofw_gpiobus_add_fdt_child(device_t bus, 
struct ofw_gpiobus_devinfo *dinfo;
 
/*
+* Check to see if we already have a child for @p child, and if so
+* return it.
+*/
+   childdev = ofw_bus_find_child_device_by_phandle(bus, child);
+   if (childdev != NULL)
+   return (childdev);
+
+   /*
 * Set up the GPIO child and OFW bus layer devinfo and add it to bus.
 */
childdev = device_add_child(bus, drvname, -1);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r284626 - head/sys/compat/linux

2015-06-19 Thread Dmitry Chagin
Author: dchagin
Date: Sat Jun 20 05:40:35 2015
New Revision: 284626
URL: https://svnweb.freebsd.org/changeset/base/284626

Log:
  Add EPOLLRDHUP support.
  
  Tested by:abi at abinet dot ru

Modified:
  head/sys/compat/linux/linux_event.c
  head/sys/compat/linux/linux_event.h

Modified: head/sys/compat/linux/linux_event.c
==
--- head/sys/compat/linux/linux_event.c Sat Jun 20 04:48:53 2015
(r284625)
+++ head/sys/compat/linux/linux_event.c Sat Jun 20 05:40:35 2015
(r284626)
@@ -260,6 +260,8 @@ epoll_to_kevent(struct thread *td, struc
*kev_flags |= EV_CLEAR;
if ((levents & LINUX_EPOLLERR) != 0)
*kev_flags |= EV_ERROR;
+   if ((levents & LINUX_EPOLLRDHUP) != 0)
+   *kev_flags |= EV_EOF;
 
/* flags related to what event is registered */
if ((levents & LINUX_EPOLL_EVRD) != 0) {
@@ -309,6 +311,8 @@ kevent_to_epoll(struct kevent *kevent, s
switch (kevent->filter) {
case EVFILT_READ:
l_event->events = 
LINUX_EPOLLIN|LINUX_EPOLLRDNORM|LINUX_EPOLLPRI;
+   if ((kevent->flags & EV_EOF) != 0)
+   l_event->events |= LINUX_EPOLLRDHUP;
break;
case EVFILT_WRITE:
l_event->events = LINUX_EPOLLOUT|LINUX_EPOLLWRNORM;

Modified: head/sys/compat/linux/linux_event.h
==
--- head/sys/compat/linux/linux_event.h Sat Jun 20 04:48:53 2015
(r284625)
+++ head/sys/compat/linux/linux_event.h Sat Jun 20 05:40:35 2015
(r284626)
@@ -49,7 +49,7 @@
|LINUX_EPOLLHUP|LINUX_EPOLLERR|LINUX_EPOLLPRI)
 #defineLINUX_EPOLL_EVWR(LINUX_EPOLLOUT|LINUX_EPOLLWRNORM)
 #defineLINUX_EPOLL_EVSUP   (LINUX_EPOLLET|LINUX_EPOLLONESHOT   
\
-   |LINUX_EPOLL_EVRD|LINUX_EPOLL_EVWR)
+   |LINUX_EPOLL_EVRD|LINUX_EPOLL_EVWR|LINUX_EPOLLRDHUP)
 
 #defineLINUX_EPOLL_CTL_ADD 1
 #defineLINUX_EPOLL_CTL_DEL 2
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"