svn commit: r363824 - in head: . lib

2020-08-03 Thread Kyle Evans
Author: kevans
Date: Tue Aug  4 03:43:28 2020
New Revision: 363824
URL: https://svnweb.freebsd.org/changeset/base/363824

Log:
  Ensure libregex is built in time for googletest
  
  In lib/Makefile, we document the dependency with SUBDIR_DEPEND
  
  For buildworld orchestration, just prebuild libregex if GOOGLETEST is
  enabled. googletest will get built in a later pass.

Modified:
  head/Makefile.inc1
  head/lib/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Aug  4 02:47:24 2020(r363823)
+++ head/Makefile.inc1  Tue Aug  4 03:43:28 2020(r363824)
@@ -2741,6 +2741,10 @@ _prebuild_libs+= gnu/lib/libdialog
 gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L
 .endif
 
+.if ${MK_GOOGLETEST} != "no"
+_prebuild_libs+= lib/libregex
+.endif
+
 .if ${MK_LIBCPLUSPLUS} != "no"
 _prebuild_libs+= lib/libc++
 .endif

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Tue Aug  4 02:47:24 2020(r363823)
+++ head/lib/Makefile   Tue Aug  4 03:43:28 2020(r363824)
@@ -107,6 +107,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
 # libraries, those libraries should be listed as build order dependencies here.
 
 SUBDIR_DEPEND_geom=libufs
+SUBDIR_DEPEND_googletest= libregex
 SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
 SUBDIR_DEPEND_libauditdm= libbsm
 SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: Introduce WITH(OUT)_LTO? (was: Re: svn commit: r362987 - in head: contrib/bc usr.bin/gh-bc) (LLVMgold.so and gnu's ld.gold)

2020-08-03 Thread Mark Millard via svn-src-head
On 2020-Jul-25, at 13:59, Mark Millard  wrote:

> On 2020-Jul-8, at 01:28, Stefan Eßer  wrote:
> 
>> Am 08.07.20 um 09:01 schrieb Mark Millard:
>>> The following is more informational than anything as far
>>> as I'm concerned. But there may be implications that I'm
>>> unaware of. (I sometimes experiment with toolchain use
>>> to see what the current status is for such use.)
>>> 
>>> I attempted to build a system for 32-bit powerpc using clang
>>> and binutils, building head -r363000 ( from -r363000 ). (This
>>> was a cross build, amd64 -> powerpc.) It got a new type of
>>> failure, compared to my past experience:
>> 
>> Hi Mark,
>> 
>> thank you for the report. I have tested with "make universe" (with
>> default settings) that this version builds on all architectures,
>> but Ed Maste has already disabled -flto for powerpc64, due to run
>> time issues (floating point exception, IIRC).
>> 
>> I know that you are actively working on PowerPC and I'd appreciate,
>> if you could provide me with information on which parameters cause
>> breakage and which work for you. The combination of CLANG with LTO
>> and GNU binutils cannot work - CLANG and GCC use incompatible file
>> formats to represent the intermediate object files.
> 
> Hmm. It looks a little more complicated than that . . .
> 
> Looks like the devel/llvm80 devel/llvm90 and devel/llvm10
> options for powerpc64 include one for:
> 
> GOLD=on: Build the LLVM Gold plugin for LTO
> 
> That produces a plugin (LLVMgold.so) for use with gnu's
> ld.gold ( from devel/binutils ).
> 
> . . .

Ignore those notes. It looks like I greatly misinterpreted. For
example doing some personal software builds with -flto in use
resulted in (using devel/llvm11 as an example context):
(powerpc64 context used)

"/usr/local/llvm11/bin/ld" . . . -plugin 
/usr/local/llvm11/bin/../lib/LLVMgold.so -plugin-opt=mcpu=ppc64 -plugin-opt=O3 
. . .

LLVMgold.so is for the llvm linker to use. I had built
llvm10 with the gold option selected and there is:

# ls -ldT /usr/local/llvm11/bin/../lib/LLVMgold.so
-rwxr-xr-x  1 root  wheel  94160 Jul 29 14:50:07 2020 
/usr/local/llvm11/bin/../lib/LLVMgold.so

But, for the system clang 10 with -flto involved:

"/usr/bin/ld" . . . -plugin /usr/bin/../lib/LLVMgold.so -plugin-opt=mcpu=ppc64 
-plugin-opt=O3 . . .

(yet there is no /usr/bin/../lib/LLVMgold.so present).

And for even the likes of just:

static volatile char big_area[67001] = "This is a test";

int main ()
{
big_area[67000] = '9';
}

commands like ( system clang and devel/llvm10 ):

cc -flto main.c
clang10 -flto main.c

for powerpc64 produce invalid a.out files that do
not even contain a main function when looked at
with the likes of objdump -d --prefix-addresses
and produce an a.out that does:

# ./a.out
Segmentation fault (core dumped)

Or when run inside gdb such builds produce things like:

Starting program: /root/c_tests/a.out 

Program received signal SIGSEGV, Segmentation fault.

(gdb) bt
#0  0x100412e8 in main ()
#1  0x10010718 in _start (argc=, argv=0xfbfffebb8, 
env=, obj=, cleanup=, 
ps_strings=)
at /usr/src/lib/csu/powerpc64/crt1_c.c:127
(gdb) disass
Dump of assembler code for function main:
=> 0x100412e8 <+0>: .long 0x0
   0x100412ec <+4>: mullhwu r0,r1,r1
   0x100412f0 <+8>: .long 0x0
   0x100412f4 <+12>:vmsumshm v0,v2,v17,v19
   0x100412f8 <+16>:.long 0x0
   0x100412fc <+20>:.long 0x0
   0x10041300 <+0>: .long 0xf
   0x10041304 <+4>: stmwr31,-4128(r31)
   0x10041308 <+0>: .long 0xf
   0x1004130c <+4>: stmwr31,-5176(r31)
   0x10041310 <+0>: .long 0x0
End of assembler dump.

For reference:

# uname -apKU
FreeBSD FBSDG5L2 13.0-CURRENT FreeBSD 13.0-CURRENT #13 r363590M: Sun Jul 26 
20:14:08 PDT 2020 
root@FBSDFHUGE:/usr/obj/powerpc64vtsc_clang/powerpc.powerpc64/usr/src/powerpc.powerpc64/sys/GENERIC64vtsc-NODBG
  powerpc powerpc64 1300102 1300102

# svnlite info /usr/ports/
Path: /usr/ports
Working Copy Root Path: /usr/ports
URL: svn://svn.freebsd.org/ports/head
Relative URL: ^/head
Repository Root: svn://svn.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 543890
Node Kind: directory
Schedule: normal
Last Changed Author: gerald
Last Changed Rev: 543890
Last Changed Date: 2020-07-31 22:52:17 -0700 (Fri, 31 Jul 2020)



===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

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


svn commit: r363823 - head/usr.bin/grep

2020-08-03 Thread Kyle Evans
Author: kevans
Date: Tue Aug  4 02:47:24 2020
New Revision: 363823
URL: https://svnweb.freebsd.org/changeset/base/363823

Log:
  bsdgrep: switch to libregex for GNU_GREP_COMPAT
  
  libregex is incomplete, but it's a bit less buggy than the in-base
  libgnuregex and mostly OK.
  
  While here, rename -DIWTH_GNU -> -DWITH_GNU_COMPAT; the option implies
  that we're compatible with the GNU counterpart, not that we're including GNU
  anything.

Modified:
  head/usr.bin/grep/Makefile
  head/usr.bin/grep/grep.c

Modified: head/usr.bin/grep/Makefile
==
--- head/usr.bin/grep/Makefile  Tue Aug  4 02:31:52 2020(r363822)
+++ head/usr.bin/grep/Makefile  Tue Aug  4 02:47:24 2020(r363823)
@@ -61,8 +61,8 @@ MLINKS+= grep.1 egrep.1 \
 .endif
 
 .if ${MK_GNU_GREP_COMPAT} != "no"
-CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DWITH_GNU
-LIBADD+=   gnuregex
+CFLAGS+=   -DWITH_GNU_COMPAT
+LIBADD+=   regex
 .endif
 
 HAS_TESTS=

Modified: head/usr.bin/grep/grep.c
==
--- head/usr.bin/grep/grep.cTue Aug  4 02:31:52 2020(r363822)
+++ head/usr.bin/grep/grep.cTue Aug  4 02:47:24 2020(r363823)
@@ -555,7 +555,7 @@ main(int argc, char *argv[])
filebehave = FILE_MMAP;
break;
case 'V':
-#ifdef WITH_GNU
+#ifdef WITH_GNU_COMPAT
printf(errstr[9], getprogname(), VERSION);
 #else
printf(errstr[8], getprogname(), VERSION);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363821 - head/contrib/googletest/googletest/test

2020-08-03 Thread Kyle Evans
Author: kevans
Date: Tue Aug  4 02:20:15 2020
New Revision: 363821
URL: https://svnweb.freebsd.org/changeset/base/363821

Log:
  Re-enable disabled googletest-port-test tests after r363820
  
  gtest now links against libregex here, and the tests pass locally.
  
  PR:   248452

Modified:
  head/contrib/googletest/googletest/test/googletest-port-test.cc

Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc
==
--- head/contrib/googletest/googletest/test/googletest-port-test.cc Tue Aug 
 4 02:18:24 2020(r363820)
+++ head/contrib/googletest/googletest/test/googletest-port-test.cc Tue Aug 
 4 02:20:15 2020(r363821)
@@ -403,8 +403,6 @@ typedef testing::Types<
 TYPED_TEST_CASE(RETest, StringTypes);
 
 // Tests RE's implicit constructors.
-/*
-https://bugs.freebsd.org/248452
 TYPED_TEST(RETest, ImplicitConstructorWorks) {
   const RE empty(TypeParam(""));
   EXPECT_STREQ("", empty.pattern());
@@ -415,7 +413,6 @@ TYPED_TEST(RETest, ImplicitConstructorWorks) {
   const RE normal(TypeParam(".*(\\w+)"));
   EXPECT_STREQ(".*(\\w+)", normal.pattern());
 }
-*/
 
 // Tests that RE's constructors reject invalid regular expressions.
 TYPED_TEST(RETest, RejectsInvalidRegex) {
@@ -864,8 +861,6 @@ TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNo
 }
 
 // Tests RE's implicit constructors.
-/*
-https://bugs.freebsd.org/248452
 TEST(RETest, ImplicitConstructorWorks) {
   const RE empty("");
   EXPECT_STREQ("", empty.pattern());
@@ -873,7 +868,6 @@ TEST(RETest, ImplicitConstructorWorks) {
   const RE simple("hello");
   EXPECT_STREQ("hello", simple.pattern());
 }
-*/
 
 // Tests that RE's constructors reject invalid regular expressions.
 TEST(RETest, RejectsInvalidRegex) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363820 - in head: lib/googletest/gtest share/mk

2020-08-03 Thread Kyle Evans
Author: kevans
Date: Tue Aug  4 02:18:24 2020
New Revision: 363820
URL: https://svnweb.freebsd.org/changeset/base/363820

Log:
  gtest: link against libregex for GNU extensions
  
  gtest tests want to use \w ([[:alnum:]]) at the very least, which was
  causing them to fail after r363679.
  
  Start linking against libregex so that this shorthand is implemented.
  
  PR:   248452

Modified:
  head/lib/googletest/gtest/Makefile
  head/share/mk/src.libnames.mk

Modified: head/lib/googletest/gtest/Makefile
==
--- head/lib/googletest/gtest/Makefile  Tue Aug  4 02:16:43 2020
(r363819)
+++ head/lib/googletest/gtest/Makefile  Tue Aug  4 02:18:24 2020
(r363820)
@@ -45,7 +45,7 @@ INTERNAL_CUSTOM_INCS+=gtest/internal/custom/gtest.h
 
 SRCS+= gtest-all.cc
 
-LIBADD+=   pthread
+LIBADD+=   pthread regex
 
 HAS_TESTS=
 SUBDIR.${MK_TESTS}+= tests

Modified: head/share/mk/src.libnames.mk
==
--- head/share/mk/src.libnames.mk   Tue Aug  4 02:16:43 2020
(r363819)
+++ head/share/mk/src.libnames.mk   Tue Aug  4 02:18:24 2020
(r363820)
@@ -320,7 +320,7 @@ _DP_dpv=dialog figpar util ncursesw
 _DP_dialog=ncursesw m
 _DP_cuse=  pthread
 _DP_atf_cxx=   atf_c
-_DP_gtest= pthread
+_DP_gtest= pthread regex
 _DP_gmock= gtest
 _DP_gmock_main=gmock
 _DP_gtest_main=gtest
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363819 - head/lib/libregex/tests

2020-08-03 Thread Kyle Evans
Author: kevans
Date: Tue Aug  4 02:16:43 2020
New Revision: 363819
URL: https://svnweb.freebsd.org/changeset/base/363819

Log:
  libregex: disable some of the unimplemented test cases for now
  
  This should allow the tests to actually pass. Future work will uncomment the
  unimplemented tests as they're implemented.

Modified:
  head/lib/libregex/tests/gnuext.in
  head/lib/libregex/tests/libregex_test.sh

Modified: head/lib/libregex/tests/gnuext.in
==
--- head/lib/libregex/tests/gnuext.in   Tue Aug  4 02:14:51 2020
(r363818)
+++ head/lib/libregex/tests/gnuext.in   Tue Aug  4 02:16:43 2020
(r363819)
@@ -17,14 +17,16 @@ a\|b\|c b   abc a
 \s\+   b   aSNTb   SNT
 # Word boundaries (\b, \B, \<, \>, \`, \')
 # (is/not boundary, start/end word, start/end subject string)
-\babc\b&  abc
+# Most of these are disabled for the moment, and will be re-enabled as
+# we become feature complete.
+#\babc\b   &  abc
 \ & abc
-\Babc\B&   abc
-\B[abc]\B  &  b
-\B[abc]+   -  bc
-\B[abc]\+  b  bc
-\`abc\'&   abc abc
-\`.+\' -   abNcabNc
-\`.\+\'b   abNcabNc
-(\`a)  -   Na
-(a\')  -   aN
+#\Babc\B   &   abc
+#\B[abc]\B &  b
+#\B[abc]+  -  bc
+#\B[abc]\+ b  bc
+#\`abc\'   &   abc abc
+#\`.+\'-   abNcabNc
+#\`.\+\'   b   abNcabNc
+#(\`a) -   Na
+#(a\') -   aN

Modified: head/lib/libregex/tests/libregex_test.sh
==
--- head/lib/libregex/tests/libregex_test.shTue Aug  4 02:14:51 2020
(r363818)
+++ head/lib/libregex/tests/libregex_test.shTue Aug  4 02:16:43 2020
(r363819)
@@ -30,10 +30,6 @@ check()
 {
local dataname="${1}"; shift
 
-   if [ "${dataname}" == "gnuext" ]; then
-   atf_expect_fail "GNU extensions are not currently implemented"
-   fi
-
prog="$(atf_get_srcdir)/h_regex"
data="$(atf_get_srcdir)/data/${dataname}.in"
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363818 - head/lib/libc/regex

2020-08-03 Thread Kyle Evans
Author: kevans
Date: Tue Aug  4 02:14:51 2020
New Revision: 363818
URL: https://svnweb.freebsd.org/changeset/base/363818

Log:
  libregex: Implement a subset of the GNU extensions
  
  The entire patch-set is not yet mature enough for commit, but this usable
  subset is generally enough for googletest to be happy with and mostly map to
  some existing concepts, so they're not as invasive.
  
  The specific changes included here are:
  
  - Branching in BREs with \|
  - \w and \W for [[:alnum:]] and [^[:alnum:]] respectively
  - \s and \S for [[:space:]] and [^[:space:]] respectively
  - Additional quantifiers in BREs, \? and \+ (self-explanatory)
  
  There's some #ifdef'd out work for allowing empty branches as a match-all.
  This is a feature that's under assessment... future work will determine
  how standard this behavior is and act accordingly.

Modified:
  head/lib/libc/regex/regcomp.c
  head/lib/libc/regex/regex2.h

Modified: head/lib/libc/regex/regcomp.c
==
--- head/lib/libc/regex/regcomp.c   Tue Aug  4 02:06:49 2020
(r363817)
+++ head/lib/libc/regex/regcomp.c   Tue Aug  4 02:14:51 2020
(r363818)
@@ -92,6 +92,7 @@ struct parse {
const char *next;   /* next character in RE */
const char *end;/* end of string (-> NUL normally) */
int error;  /* has an error been seen? */
+   int gnuext;
sop *strip; /* malloced strip */
sopno ssize;/* malloced strip size (allocated) */
sopno slen; /* malloced strip length (used) */
@@ -131,7 +132,9 @@ static int p_count(struct parse *p);
 static void p_bracket(struct parse *p);
 static int p_range_cmp(wchar_t c1, wchar_t c2);
 static void p_b_term(struct parse *p, cset *cs);
+static int p_b_pseudoclass(struct parse *p, char c);
 static void p_b_cclass(struct parse *p, cset *cs);
+static void p_b_cclass_named(struct parse *p, cset *cs, const char[]);
 static void p_b_eclass(struct parse *p, cset *cs);
 static wint_t p_b_symbol(struct parse *p);
 static wint_t p_b_coll_elem(struct parse *p, wint_t endc);
@@ -181,6 +184,7 @@ static char nuls[10];   /* place to point 
scanner in ev
 #defineSEESPEC(a)  (p->bre ? SEETWO('\\', a) : SEE(a))
 #defineEAT(c)  ((SEE(c)) ? (NEXT(), 1) : 0)
 #defineEATTWO(a, b)((SEETWO(a, b)) ? (NEXT2(), 1) : 0)
+#defineEATSPEC(a)  (p->bre ? EATTWO('\\', a) : EAT(a))
 #defineNEXT()  (p->next++)
 #defineNEXT2() (p->next += 2)
 #defineNEXTn(n)(p->next += (n))
@@ -270,14 +274,22 @@ regcomp_internal(regex_t * __restrict preg,
p->pbegin[i] = 0;
p->pend[i] = 0;
}
+#ifdef LIBREGEX
+   if (cflags_POSIX) {
+   p->gnuext = false;
+   p->allowbranch = (cflags & REG_EXTENDED) != 0;
+   } else
+   p->gnuext = p->allowbranch = true;
+#else
+   p->gnuext = false;
+   p->allowbranch = (cflags & REG_EXTENDED) != 0;
+#endif
if (cflags & REG_EXTENDED) {
-   p->allowbranch = true;
p->bre = false;
p->parse_expr = p_ere_exp;
p->pre_parse = NULL;
p->post_parse = NULL;
} else {
-   p->allowbranch = false;
p->bre = true;
p->parse_expr = p_simp_re;
p->pre_parse = p_bre_pre_parse;
@@ -388,6 +400,10 @@ p_ere_exp(struct parse *p, struct branchc *bc)
sopno pos;
int count;
int count2;
+#ifdef LIBREGEX
+   int i;
+   int handled;
+#endif
sopno subno;
int wascaret = 0;
 
@@ -395,6 +411,9 @@ p_ere_exp(struct parse *p, struct branchc *bc)
assert(MORE()); /* caller should have ensured this */
c = GETNEXT();
 
+#ifdef LIBREGEX
+   handled = 0;
+#endif
pos = HERE();
switch (c) {
case '(':
@@ -457,6 +476,47 @@ p_ere_exp(struct parse *p, struct branchc *bc)
case '\\':
(void)REQUIRE(MORE(), REG_EESCAPE);
wc = WGETNEXT();
+#ifdef LIBREGEX
+   if (p->gnuext) {
+   handled = 1;
+   switch (wc) {
+   case 'W':
+   case 'w':
+   case 'S':
+   case 's':
+   p_b_pseudoclass(p, wc);
+   break;
+   case '1':
+   case '2':
+   case '3':
+   case '4':
+   case '5':
+   case '6':
+   case '7':
+   case '8':
+   case '9':
+   i = wc - '0';
+   assert(i < NPAREN);
+   if (p->pend[i] != 

svn commit: r363817 - head/lib/libc/regex

2020-08-03 Thread Kyle Evans
Author: kevans
Date: Tue Aug  4 02:06:49 2020
New Revision: 363817
URL: https://svnweb.freebsd.org/changeset/base/363817

Log:
  regex(3): belatedly document REG_POSIX from r363734
  
  My original patch included this documented, but it appears that I failed to
  include the manpage update. Do so now.

Modified:
  head/lib/libc/regex/regex.3

Modified: head/lib/libc/regex/regex.3
==
--- head/lib/libc/regex/regex.3 Tue Aug  4 00:28:06 2020(r363816)
+++ head/lib/libc/regex/regex.3 Tue Aug  4 02:06:49 2020(r363817)
@@ -32,7 +32,7 @@
 .\"@(#)regex.3 8.4 (Berkeley) 3/20/94
 .\" $FreeBSD$
 .\"
-.Dd May 25, 2016
+.Dd April 15, 2017
 .Dt REGEX 3
 .Os
 .Sh NAME
@@ -178,6 +178,17 @@ member is of type
 .Ft "const char *" .
 This flag permits inclusion of NULs in the RE;
 they are considered ordinary characters.
+This is an extension,
+compatible with but not specified by
+.St -p1003.2 ,
+and should be used with
+caution in software intended to be portable to other systems.
+.It Dv REG_POSIX
+Compile only
+.St -p1003.2
+compliant expressions.
+This flag has no effect unless linking against
+.Nm libregex .
 This is an extension,
 compatible with but not specified by
 .St -p1003.2 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363813 - in head: lib/libc/gen share/man/man4 sys/kern sys/sys

2020-08-03 Thread Konstantin Belousov
Author: kib
Date: Mon Aug  3 22:13:02 2020
New Revision: 363813
URL: https://svnweb.freebsd.org/changeset/base/363813

Log:
  Add SOL_LOCAL symbolic constant for unix socket option level.
  
  The constant seems to exists on MacOS X >= 10.8.
  
  Requested by: swills
  Reviewed by:  allanjude, kevans
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D25933

Modified:
  head/lib/libc/gen/getpeereid.c
  head/share/man/man4/unix.4
  head/sys/kern/uipc_usrreq.c
  head/sys/sys/un.h

Modified: head/lib/libc/gen/getpeereid.c
==
--- head/lib/libc/gen/getpeereid.c  Mon Aug  3 22:12:18 2020
(r363812)
+++ head/lib/libc/gen/getpeereid.c  Mon Aug  3 22:13:02 2020
(r363813)
@@ -47,7 +47,7 @@ getpeereid(int s, uid_t *euid, gid_t *egid)
int error;
 
xuclen = sizeof(xuc);
-   error = _getsockopt(s, 0, LOCAL_PEERCRED, , );
+   error = _getsockopt(s, SOL_LOCAL, LOCAL_PEERCRED, , );
if (error != 0)
return (error);
if (xuc.cr_version != XUCRED_VERSION) {

Modified: head/share/man/man4/unix.4
==
--- head/share/man/man4/unix.4  Mon Aug  3 22:12:18 2020(r363812)
+++ head/share/man/man4/unix.4  Mon Aug  3 22:13:02 2020(r363813)
@@ -28,7 +28,7 @@
 .\" @(#)unix.4 8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd August 19, 2018
+.Dd August 3, 2020
 .Dt UNIX 4
 .Os
 .Sh NAME
@@ -195,7 +195,9 @@ The sending process could have exited and its process 
 reused for a new process.
 .Sh SOCKET OPTIONS
 .Tn UNIX
-domain sockets support a number of socket options which can be set with
+domain sockets support a number of socket options for the options level
+.Dv SOL_LOCAL ,
+which can be set with
 .Xr setsockopt 2
 and tested with
 .Xr getsockopt 2 :

Modified: head/sys/kern/uipc_usrreq.c
==
--- head/sys/kern/uipc_usrreq.c Mon Aug  3 22:12:18 2020(r363812)
+++ head/sys/kern/uipc_usrreq.c Mon Aug  3 22:13:02 2020(r363813)
@@ -1470,7 +1470,7 @@ uipc_ctloutput(struct socket *so, struct sockopt *sopt
struct xucred xu;
int error, optval;
 
-   if (sopt->sopt_level != 0)
+   if (sopt->sopt_level != SOL_LOCAL)
return (EINVAL);
 
unp = sotounpcb(so);

Modified: head/sys/sys/un.h
==
--- head/sys/sys/un.h   Mon Aug  3 22:12:18 2020(r363812)
+++ head/sys/sys/un.h   Mon Aug  3 22:13:02 2020(r363813)
@@ -62,6 +62,8 @@ struct sockaddr_un {
 
 #if __BSD_VISIBLE
 
+#defineSOL_LOCAL   0   /* Options for local socket */
+
 /* Socket options. */
 #defineLOCAL_PEERCRED  1   /* retrieve peer credentials */
 #defineLOCAL_CREDS 2   /* pass credentials to receiver 
*/
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363812 - head/sys/kern

2020-08-03 Thread Warner Losh
Author: imp
Date: Mon Aug  3 22:12:18 2020
New Revision: 363812
URL: https://svnweb.freebsd.org/changeset/base/363812

Log:
  Some function had the blank lines, others didn't. Most of the ones that didn't
  were newer, so remove this now-optional blank line everywhere.

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cMon Aug  3 20:26:04 2020(r363811)
+++ head/sys/kern/subr_bus.cMon Aug  3 22:12:18 2020(r363812)
@@ -234,7 +234,6 @@ devclass_sysctl_handler(SYSCTL_HANDLER_ARGS)
 static void
 devclass_sysctl_init(devclass_t dc)
 {
-
if (dc->sysctl_tree != NULL)
return;
sysctl_ctx_init(>sysctl_ctx);
@@ -453,7 +452,6 @@ devinit(void)
 static int
 devopen(struct cdev *dev, int oflags, int devtype, struct thread *td)
 {
-
mtx_lock();
if (devsoftc.inuse) {
mtx_unlock();
@@ -468,7 +466,6 @@ devopen(struct cdev *dev, int oflags, int devtype, str
 static int
 devclose(struct cdev *dev, int fflag, int devtype, struct thread *td)
 {
-
mtx_lock();
devsoftc.inuse = 0;
devsoftc.nonblock = 0;
@@ -522,7 +519,6 @@ static  int
 devioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread 
*td)
 {
switch (cmd) {
-
case FIONBIO:
if (*(int*)data)
devsoftc.nonblock = 1;
@@ -585,7 +581,6 @@ devkqfilter(struct cdev *dev, struct knote *kn)
 static void
 filt_devctl_detach(struct knote *kn)
 {
-
knlist_remove(_note, kn, 0);
 }
 
@@ -661,7 +656,6 @@ out:
 void
 devctl_queue_data(char *data)
 {
-
devctl_queue_data_f(data, M_NOWAIT);
 }
 
@@ -704,7 +698,6 @@ void
 devctl_notify(const char *system, const char *subsystem, const char *type,
 const char *data)
 {
-
devctl_notify_f(system, subsystem, type, data, M_NOWAIT);
 }
 
@@ -876,7 +869,6 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS)
 void
 devctl_safe_quote_sb(struct sbuf *sb, const char *src)
 {
-
while (*src != '\0') {
if (*src == '"' || *src == '\\')
sbuf_putc(sb, '\\');
@@ -2597,7 +2589,6 @@ device_claim_softc(device_t dev)
 void *
 device_get_ivars(device_t dev)
 {
-
KASSERT(dev != NULL, ("device_get_ivars(NULL, ...)"));
return (dev->ivars);
 }
@@ -2608,7 +2599,6 @@ device_get_ivars(device_t dev)
 void
 device_set_ivars(device_t dev, void * ivars)
 {
-
KASSERT(dev != NULL, ("device_set_ivars(NULL, ...)"));
dev->ivars = ivars;
 }
@@ -3087,7 +3077,6 @@ device_detach(device_t dev)
 int
 device_quiesce(device_t dev)
 {
-
PDEBUG(("%s", DEVICENAME(dev)));
if (dev->state == DS_BUSY)
return (EBUSY);
@@ -3148,7 +3137,6 @@ device_set_unit(device_t dev, int unit)
 void
 resource_init_map_request_impl(struct resource_map_request *args, size_t sz)
 {
-
bzero(args, sz);
args->size = sz;
args->memattr = VM_MEMATTR_UNCACHEABLE;
@@ -3704,7 +3692,6 @@ resource_list_purge(struct resource_list *rl)
 device_t
 bus_generic_add_child(device_t dev, u_int order, const char *name, int unit)
 {
-
return (device_add_child_ordered(dev, order, name, unit));
 }
 
@@ -3852,7 +3839,6 @@ bus_generic_suspend_child(device_t dev, device_t child
 int
 bus_generic_resume_child(device_t dev, device_t child)
 {
-
DEVICE_RESUME(child);
child->flags &= ~DF_SUSPENDED;
 
@@ -3944,7 +3930,6 @@ bus_helper_reset_post(device_t dev, int flags)
 static void
 bus_helper_reset_prepare_rollback(device_t dev, device_t child, int flags)
 {
-
child = TAILQ_NEXT(child, link);
if (child == NULL)
return;
@@ -4356,7 +4341,6 @@ int
 bus_generic_bind_intr(device_t dev, device_t child, struct resource *irq,
 int cpu)
 {
-
/* Propagate up the bus hierarchy until someone handles it. */
if (dev->parent)
return (BUS_BIND_INTR(dev->parent, child, irq, cpu));
@@ -4373,7 +4357,6 @@ int
 bus_generic_config_intr(device_t dev, int irq, enum intr_trigger trig,
 enum intr_polarity pol)
 {
-
/* Propagate up the bus hierarchy until someone handles it. */
if (dev->parent)
return (BUS_CONFIG_INTR(dev->parent, irq, trig, pol));
@@ -4390,7 +4373,6 @@ int
 bus_generic_describe_intr(device_t dev, device_t child, struct resource *irq,
 void *cookie, const char *descr)
 {
-
/* Propagate up the bus hierarchy until someone handles it. */
if (dev->parent)
return (BUS_DESCRIBE_INTR(dev->parent, child, irq, cookie,
@@ -4408,7 +4390,6 @@ int
 bus_generic_get_cpus(device_t dev, device_t child, enum cpu_sets op,
 size_t setsize, cpuset_t *cpuset)
 {
-
/* Propagate up the bus hierarchy until someone handles it. */
if (dev->parent != NULL)
return (BUS_GET_CPUS(dev->parent, child, op, setsize, cpuset));

svn commit: r363811 - in head: etc/mtree usr.bin/gh-bc usr.bin/gh-bc/tests

2020-08-03 Thread Stefan Eßer
Author: se
Date: Mon Aug  3 20:26:04 2020
New Revision: 363811
URL: https://svnweb.freebsd.org/changeset/base/363811

Log:
  Connect the tests provided with the new bc and dc
  
  The tests compare the command output (including of error cases) with the
  expected output and exit code.
  
  Not all tests are executed, since some expect to have a known good bc and
  dc binary installed and compare results of large amounts of generated data
  being processed by both versions to test for regressions.

Added:
  head/usr.bin/gh-bc/tests/
  head/usr.bin/gh-bc/tests/Makefile   (contents, props changed)
Modified:
  head/etc/mtree/BSD.tests.dist
  head/usr.bin/gh-bc/Makefile

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Mon Aug  3 19:20:26 2020
(r363810)
+++ head/etc/mtree/BSD.tests.dist   Mon Aug  3 20:26:04 2020
(r363811)
@@ -1002,6 +1002,8 @@
 ..
 getconf
 ..
+gh-bc
+..
 grep
 ..
 gzip

Modified: head/usr.bin/gh-bc/Makefile
==
--- head/usr.bin/gh-bc/Makefile Mon Aug  3 19:20:26 2020(r363810)
+++ head/usr.bin/gh-bc/Makefile Mon Aug  3 20:26:04 2020(r363811)
@@ -59,9 +59,8 @@ MAN_SRC_DC=   dc/A.1
 CFLAGS+=   -flto
 .endif
 
-.if ${MK_TESTS} != "no"
-#SUBDIR+=  tests
-.endif
+HAS_TESTS=
+SUBDIR.${MK_TESTS}+= tests
 
 .for catalog in ${CATALOGS}
 NLS+=   ${catalog:C/.*://}

Added: head/usr.bin/gh-bc/tests/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/gh-bc/tests/Makefile   Mon Aug  3 20:26:04 2020
(r363811)
@@ -0,0 +1,67 @@
+# $FreeBSD$
+
+.include 
+
+PACKAGE=   tests
+
+TEST_DIR=  ${SRCTOP}/contrib/bc
+
+TESTSDIR=  ${TESTSBASE}/usr.bin/gh-bc
+
+.PATH: ${SRCTOP}/tests
+
+FILESGROUPS+=  FILESf
+FILESfPACKAGE= ${PACKAGE}
+FILESfDIR= ${TESTSDIR}
+FILESf=${TEST_DIR}/functions.sh
+FILESfMODE=0755
+
+FILESGROUPS+=  FILEStests
+FILEStestsPACKAGE= ${PACKAGE}
+FILEStestsDIR= ${TESTSDIR}/tests
+FILEStests!=   echo ${TEST_DIR}/tests/*.py ${TEST_DIR}/tests/*.sh 
${TEST_DIR}/tests/*.txt
+FILEStestsMODE=0755
+
+FILESGROUPS+=  FILESbc
+FILESbcPACKAGE=${PACKAGE}
+FILESbcDIR=${TESTSDIR}/tests/bc
+FILESbc!=  echo ${TEST_DIR}/tests/bc/*.*
+
+FILESGROUPS+=  FILESbc_errors
+FILESbc_errorsPACKAGE= ${PACKAGE}
+FILESbc_errorsDIR= ${TESTSDIR}/tests/bc/errors
+FILESbc_errors!=   echo ${TEST_DIR}/tests/bc/errors/*.*
+
+FILESGROUPS+=  FILESbc_scripts
+FILESbc_scriptsPACKAGE=${PACKAGE}
+FILESbc_scriptsDIR=${TESTSDIR}/tests/bc/scripts
+FILESbc_scripts!=  echo ${TEST_DIR}/tests/bc/scripts/*.*
+FILESbc_scriptsMODE=   0755
+
+FILESGROUPS+=  FILESdc
+FILESdcPACKAGE=${PACKAGE}
+FILESdcDIR=${TESTSDIR}/tests/dc
+FILESdc!=  echo ${TEST_DIR}/tests/dc/*.*
+
+FILESGROUPS+=  FILESdc_errors
+FILESdc_errorsPACKAGE= ${PACKAGE}
+FILESdc_errorsDIR= ${TESTSDIR}/tests/dc/errors
+FILESdc_errors!=   echo ${TEST_DIR}/tests/dc/errors/*.*
+
+FILESGROUPS+=  FILESdc_scripts
+FILESdc_scriptsPACKAGE=${PACKAGE}
+FILESdc_scriptsDIR=${TESTSDIR}/tests/dc/scripts
+FILESdc_scripts!=  echo ${TEST_DIR}/tests/dc/scripts/*.*
+FILESdc_scriptsMODE=   0755
+
+PLAIN_TESTS_SH=bc_tests dc_tests
+
+bc_tests.sh:
+   echo "#!/bin/sh" > ${.TARGET}
+   echo "env LANG=C ${TESTSDIR}/tests/all.sh bc 1 1 0 0 bc" >> ${.TARGET}
+
+dc_tests.sh:
+   echo "#!/bin/sh" > ${.TARGET}
+   echo "env LANG=C ${TESTSDIR}/tests/all.sh dc 1 1 0 0 dc" >> ${.TARGET}
+
+.include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363810 - in head/contrib/bc: . include manuals manuals/bc manuals/dc src src/bc src/dc tests/bc

2020-08-03 Thread Stefan Eßer
Author: se
Date: Mon Aug  3 19:20:26 2020
New Revision: 363810
URL: https://svnweb.freebsd.org/changeset/base/363810

Log:
  Upgrade   to version 3.1.4
  
  This version omits the printing   of a copyright header in interactive 
mode
  and the dc command now exits afterexecution ofthe commands passed via 
-e
  or -f instead of switching to interactive mode.   To pass further commands
  via STDIN when dc has been invoked with   -e or -f, add "-f -" to the
  parameter list.

Added:
  head/contrib/bc/tests/bc/misc6.txt
 - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc6.txt
  head/contrib/bc/tests/bc/misc6_results.txt
 - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc6_results.txt
  head/contrib/bc/tests/bc/misc7.txt
 - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc7.txt
  head/contrib/bc/tests/bc/misc7_results.txt
 - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc7_results.txt
  head/contrib/bc/tests/bc/stdin1.txt
 - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin1.txt
  head/contrib/bc/tests/bc/stdin1_results.txt
 - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin1_results.txt
  head/contrib/bc/tests/bc/stdin2.txt
 - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin2.txt
  head/contrib/bc/tests/bc/stdin2_results.txt
 - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin2_results.txt
Modified:
  head/contrib/bc/Makefile.in
  head/contrib/bc/NEWS.md
  head/contrib/bc/README.md
  head/contrib/bc/include/bc.h
  head/contrib/bc/include/vm.h
  head/contrib/bc/manuals/bc.1.md.in
  head/contrib/bc/manuals/bc/A.1
  head/contrib/bc/manuals/bc/A.1.md
  head/contrib/bc/manuals/bc/E.1
  head/contrib/bc/manuals/bc/E.1.md
  head/contrib/bc/manuals/bc/EH.1
  head/contrib/bc/manuals/bc/EH.1.md
  head/contrib/bc/manuals/bc/EHN.1
  head/contrib/bc/manuals/bc/EHN.1.md
  head/contrib/bc/manuals/bc/EHNP.1
  head/contrib/bc/manuals/bc/EHNP.1.md
  head/contrib/bc/manuals/bc/EHP.1
  head/contrib/bc/manuals/bc/EHP.1.md
  head/contrib/bc/manuals/bc/EN.1
  head/contrib/bc/manuals/bc/EN.1.md
  head/contrib/bc/manuals/bc/ENP.1
  head/contrib/bc/manuals/bc/ENP.1.md
  head/contrib/bc/manuals/bc/EP.1
  head/contrib/bc/manuals/bc/EP.1.md
  head/contrib/bc/manuals/bc/H.1
  head/contrib/bc/manuals/bc/H.1.md
  head/contrib/bc/manuals/bc/HN.1
  head/contrib/bc/manuals/bc/HN.1.md
  head/contrib/bc/manuals/bc/HNP.1
  head/contrib/bc/manuals/bc/HNP.1.md
  head/contrib/bc/manuals/bc/HP.1
  head/contrib/bc/manuals/bc/HP.1.md
  head/contrib/bc/manuals/bc/N.1
  head/contrib/bc/manuals/bc/N.1.md
  head/contrib/bc/manuals/bc/NP.1
  head/contrib/bc/manuals/bc/NP.1.md
  head/contrib/bc/manuals/bc/P.1
  head/contrib/bc/manuals/bc/P.1.md
  head/contrib/bc/manuals/dc.1.md.in
  head/contrib/bc/manuals/dc/A.1
  head/contrib/bc/manuals/dc/A.1.md
  head/contrib/bc/manuals/dc/E.1
  head/contrib/bc/manuals/dc/E.1.md
  head/contrib/bc/manuals/dc/EH.1
  head/contrib/bc/manuals/dc/EH.1.md
  head/contrib/bc/manuals/dc/EHN.1
  head/contrib/bc/manuals/dc/EHN.1.md
  head/contrib/bc/manuals/dc/EHNP.1
  head/contrib/bc/manuals/dc/EHNP.1.md
  head/contrib/bc/manuals/dc/EHP.1
  head/contrib/bc/manuals/dc/EHP.1.md
  head/contrib/bc/manuals/dc/EN.1
  head/contrib/bc/manuals/dc/EN.1.md
  head/contrib/bc/manuals/dc/ENP.1
  head/contrib/bc/manuals/dc/ENP.1.md
  head/contrib/bc/manuals/dc/EP.1
  head/contrib/bc/manuals/dc/EP.1.md
  head/contrib/bc/manuals/dc/H.1
  head/contrib/bc/manuals/dc/H.1.md
  head/contrib/bc/manuals/dc/HN.1
  head/contrib/bc/manuals/dc/HN.1.md
  head/contrib/bc/manuals/dc/HNP.1
  head/contrib/bc/manuals/dc/HNP.1.md
  head/contrib/bc/manuals/dc/HP.1
  head/contrib/bc/manuals/dc/HP.1.md
  head/contrib/bc/manuals/dc/N.1
  head/contrib/bc/manuals/dc/N.1.md
  head/contrib/bc/manuals/dc/NP.1
  head/contrib/bc/manuals/dc/NP.1.md
  head/contrib/bc/manuals/dc/P.1
  head/contrib/bc/manuals/dc/P.1.md
  head/contrib/bc/src/args.c
  head/contrib/bc/src/bc/bc.c
  head/contrib/bc/src/bc/parse.c
  head/contrib/bc/src/dc/dc.c
  head/contrib/bc/src/vm.c
  head/contrib/bc/tests/bc/all.txt
Directory Properties:
  head/contrib/bc/   (props changed)

Modified: head/contrib/bc/Makefile.in
==
--- head/contrib/bc/Makefile.in Mon Aug  3 19:18:38 2020(r363809)
+++ head/contrib/bc/Makefile.in Mon Aug  3 19:20:26 2020(r363810)
@@ -29,7 +29,7 @@
 #
 .POSIX:
 
-VERSION = 3.1.3
+VERSION = 3.1.4
 
 SRC = %%SRC%%
 OBJ = %%OBJ%%

Modified: head/contrib/bc/NEWS.md
==
--- head/contrib/bc/NEWS.md Mon Aug  3 19:18:38 2020(r363809)
+++ head/contrib/bc/NEWS.md Mon Aug  3 19:20:26 2020(r363810)
@@ -1,5 +1,24 @@
 # News
 
+## 3.1.4
+
+This is a production release that fixes one bug, changes two behaviors, and
+removes one environment variable.
+
+The bug is like 

svn commit: r363809 - head/usr.bin/gh-bc

2020-08-03 Thread Stefan Eßer
Author: se
Date: Mon Aug  3 19:18:38 2020
New Revision: 363809
URL: https://svnweb.freebsd.org/changeset/base/363809

Log:
  Upgrade to version 3.1.4
  
  This version omits the printing of a copyright header in interactive mode
  and the dc command now exits after execution of the commands passed via -e
  or -f instead of switching to interactive mode. To pass further commands
  via STDIN when dc has been invoked with -e or -f, add "-f -" to the
  parameter list.

Modified:
  head/usr.bin/gh-bc/Makefile

Modified: head/usr.bin/gh-bc/Makefile
==
--- head/usr.bin/gh-bc/Makefile Mon Aug  3 19:00:12 2020(r363808)
+++ head/usr.bin/gh-bc/Makefile Mon Aug  3 19:18:38 2020(r363809)
@@ -59,6 +59,10 @@ MAN_SRC_DC=  dc/A.1
 CFLAGS+=   -flto
 .endif
 
+.if ${MK_TESTS} != "no"
+#SUBDIR+=  tests
+.endif
+
 .for catalog in ${CATALOGS}
 NLS+=   ${catalog:C/.*://}
 NLSSRCFILES_${catalog:C/.*://}= ${catalog:C/.*://}.msg
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363805 - head/lib/libc/gen

2020-08-03 Thread Alex Richardson
Author: arichardson
Date: Mon Aug  3 18:08:04 2020
New Revision: 363805
URL: https://svnweb.freebsd.org/changeset/base/363805

Log:
  Allow building setmode.c on Linux/macOS
  
  We bootstrap this file to allow compiling FreeBSD on Linux systems since
  some boostrap tools use setmode(). Unfortunately, glibc's sys/stat.h
  declares a non-static getumask() function (which is unimplemented!) and
  that conflicts with the local getumask() function. To work around this
  simply use a different name here.
  
  Reviewed By:  brooks, emaste
  Differential Revision: https://reviews.freebsd.org/D25929

Modified:
  head/lib/libc/gen/setmode.c

Modified: head/lib/libc/gen/setmode.c
==
--- head/lib/libc/gen/setmode.c Mon Aug  3 17:53:15 2020(r363804)
+++ head/lib/libc/gen/setmode.c Mon Aug  3 18:08:04 2020(r363805)
@@ -70,7 +70,7 @@ typedef struct bitcmd {
 #defineCMD2_OBITS  0x08
 #defineCMD2_UBITS  0x10
 
-static mode_t   getumask(void);
+static mode_t   get_current_umask(void);
 static BITCMD  *addcmd(BITCMD *, mode_t, mode_t, mode_t, mode_t);
 static void compress_mode(BITCMD *);
 #ifdef SETMODE_DEBUG
@@ -186,7 +186,7 @@ setmode(const char *p)
 * Get a copy of the mask for the permissions that are mask relative.
 * Flip the bits, we want what's not set.
 */
-   mask = ~getumask();
+   mask = ~get_current_umask();
 
setlen = SET_LEN + 2;
 
@@ -343,13 +343,14 @@ out:
 }
 
 static mode_t
-getumask(void)
+get_current_umask(void)
 {
sigset_t sigset, sigoset;
size_t len;
mode_t mask;
u_short smask;
 
+#ifdef KERN_PROC_UMASK
/*
 * First try requesting the umask without temporarily modifying it.
 * Note that this does not work if the sysctl
@@ -359,7 +360,7 @@ getumask(void)
if (sysctl((int[4]){ CTL_KERN, KERN_PROC, KERN_PROC_UMASK, 0 },
4, , , NULL, 0) == 0)
return (smask);
-
+#endif
/*
 * Since it's possible that the caller is opening files inside a signal
 * handler, protect them as best we can.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363806 - head/usr.sbin/nmtree

2020-08-03 Thread Alex Richardson
Author: arichardson
Date: Mon Aug  3 18:08:10 2020
New Revision: 363806
URL: https://svnweb.freebsd.org/changeset/base/363806

Log:
  Allow bootstrapping mtree on Linux systems
  
  Linux glibc has a dummy lchmod that always fails and emitting a linker
  warning when used. Don't fail the build due to that warning when
  bootstrapping by setting LD_FATAL_WARNINGS=no.
  
  Reviewed By:  brooks, emaste
  Differential Revision: https://reviews.freebsd.org/D25930

Modified:
  head/usr.sbin/nmtree/Makefile

Modified: head/usr.sbin/nmtree/Makefile
==
--- head/usr.sbin/nmtree/Makefile   Mon Aug  3 18:08:04 2020
(r363805)
+++ head/usr.sbin/nmtree/Makefile   Mon Aug  3 18:08:10 2020
(r363806)
@@ -22,4 +22,10 @@ MLINKS=  mtree.8 nmtree.8
 HAS_TESTS=
 SUBDIR.${MK_TESTS}+= tests
 
+.if defined(BOOTSTRAPPING)
+# Linux glibc has a dummy lchmod that always fails. Don't fail due to
+# the linker warning that it emits.
+LD_FATAL_WARNINGS=no
+.endif
+
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r363733 - head/usr.sbin/bhyve

2020-08-03 Thread Ravi Pokala
-Original Message-
From:  on behalf of Peter Grehan 

Date: 2020-07-31, Friday at 05:10
To: , , 

Subject: svn commit: r363733 - head/usr.sbin/bhyve

Author: grehan
Date: Fri Jul 31 12:10:28 2020
New Revision: 363733
URL: https://svnweb.freebsd.org/changeset/base/363733

Log:
  Replace magic numbers in Identify page register 0 with ATA definitions.

  No functional change. Verified with objdump output before/after.

  Requested by: rpokala
  Reviewed by:  rpokala
  MFC after:3 weeks

Thanks! :-)

-Ravi (rpokala@)

Modified:
  head/usr.sbin/bhyve/pci_ahci.c

Modified: head/usr.sbin/bhyve/pci_ahci.c

==
--- head/usr.sbin/bhyve/pci_ahci.c  Fri Jul 31 12:09:59 2020
(r363732)
+++ head/usr.sbin/bhyve/pci_ahci.c  Fri Jul 31 12:10:28 2020
(r363733)
@@ -999,7 +999,8 @@ ata_identify_init(struct ahci_port* p, int atapi)
struct ata_params* ata_ident = >ata_ident;

if (atapi) {
-   ata_ident->config = (2 << 14 | 5 << 8 | 1 << 7 | 2 << 5);
+   ata_ident->config = ATA_PROTO_ATAPI | ATA_ATAPI_TYPE_CDROM |
+   ATA_ATAPI_REMOVABLE | ATA_DRQ_FAST;
ata_ident->capabilities1 = ATA_SUPPORT_LBA |
ATA_SUPPORT_DMA;
ata_ident->capabilities2 = (1 << 14 | 1);


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


svn commit: r363804 - head/lib/ncurses/ncurses

2020-08-03 Thread John Baldwin
Author: jhb
Date: Mon Aug  3 17:53:15 2020
New Revision: 363804
URL: https://svnweb.freebsd.org/changeset/base/363804

Log:
  Pass the full CFLAGS to cpp for MKlib_gen.sh.
  
  GCC's cpp was exiting immediately when it failed to find requested
  includes ( and ).  clang-cpp emitted an
  error for the missing header files but continued processing the file
  (thus not honoring any macros defined in the missing headers).
  
  Arguably, the awk script is buggy since it doesn't check the return
  value of the command it executes.
  
  Reviewed by:  kevans
  Differential Revision:https://reviews.freebsd.org/D25731

Modified:
  head/lib/ncurses/ncurses/Makefile

Modified: head/lib/ncurses/ncurses/Makefile
==
--- head/lib/ncurses/ncurses/Makefile   Mon Aug  3 17:51:57 2020
(r363803)
+++ head/lib/ncurses/ncurses/Makefile   Mon Aug  3 17:53:15 2020
(r363804)
@@ -345,7 +345,7 @@ codes.c: MKcodes.awk
${AWK} -f ${NCURSES_DIR}/ncurses/tinfo/MKcodes.awk 
bigstrings=${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps > codes.c
 
 lib_gen.c: MKlib_gen.sh curses.h ncurses_dll.h
-   LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh 
"${CPP:N${CCACHE_BIN}} ${CPPFLAGS}" \
+   LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh 
"${CPP:N${CCACHE_BIN}} ${CFLAGS}" \
"${AWK}" generated < curses.h >$@
 
 lib_keyname.c: keys.list MKkeyname.awk
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363802 - in head/sys: arm/broadcom/bcm2835 conf

2020-08-03 Thread Andrew Turner
Author: andrew
Date: Mon Aug  3 17:18:12 2020
New Revision: 363802
URL: https://svnweb.freebsd.org/changeset/base/363802

Log:
  Add a GPIO driver for the Raspberry Pi firmware GPIOs
  
  These exist on the Raspberry Pi 3 and 4 and control and external IO
  expander.
  
  Reviewed by:  manu
  Sponsored by: Innovate UK
  Differential Revision:https://reviews.freebsd.org/D25858

Added:
  head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c   (contents, props changed)
Modified:
  head/sys/conf/files.arm64

Added: head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.cMon Aug  3 17:18:12 
2020(r363802)
@@ -0,0 +1,457 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2012 Oleksandr Tymoshenko 
+ * Copyright (c) 2012-2015 Luiz Otavio O Souza 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "opt_platform.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include "gpio_if.h"
+
+#defineRPI_FW_GPIO_PINS8
+#defineRPI_FW_GPIO_BASE128
+#defineRPI_FW_GPIO_DEFAULT_CAPS(GPIO_PIN_INPUT | 
GPIO_PIN_OUTPUT)
+
+struct rpi_fw_gpio_softc {
+   device_tsc_busdev;
+   device_tsc_firmware;
+   struct sx   sc_sx;
+   struct gpio_pin sc_gpio_pins[RPI_FW_GPIO_PINS];
+   uint8_t sc_gpio_state;
+};
+
+#defineRPI_FW_GPIO_LOCK(_sc)   sx_xlock(&(_sc)->sc_sx)
+#defineRPI_FW_GPIO_UNLOCK(_sc) sx_xunlock(&(_sc)->sc_sx)
+
+static struct ofw_compat_data compat_data[] = {
+   {"raspberrypi,firmware-gpio",   1},
+   {NULL,  0}
+};
+
+static int
+rpi_fw_gpio_pin_configure(struct rpi_fw_gpio_softc *sc, struct gpio_pin *pin,
+unsigned int flags)
+{
+   union msg_get_gpio_config old_cfg;
+   union msg_set_gpio_config new_cfg;
+   int rv;
+
+   bzero(_cfg, sizeof(old_cfg));
+   bzero(_cfg, sizeof(new_cfg));
+   old_cfg.req.gpio = RPI_FW_GPIO_BASE + pin->gp_pin;
+
+   RPI_FW_GPIO_LOCK(sc);
+   rv = bcm2835_firmware_property(sc->sc_firmware,
+   BCM2835_FIRMWARE_TAG_GET_GPIO_CONFIG, _cfg, sizeof(old_cfg));
+   if (rv == 0 && old_cfg.resp.gpio != 0)
+   rv = EIO;
+   if (rv != 0)
+   goto fail;
+
+   new_cfg.req.gpio = RPI_FW_GPIO_BASE + pin->gp_pin;
+   if (flags & GPIO_PIN_INPUT) {
+   new_cfg.req.dir = BCM2835_FIRMWARE_GPIO_IN;
+   new_cfg.req.state = 0;
+   pin->gp_flags = GPIO_PIN_INPUT;
+   } else if (flags & GPIO_PIN_OUTPUT) {
+   new_cfg.req.dir = BCM2835_FIRMWARE_GPIO_OUT;
+   if (flags & (GPIO_PIN_PRESET_HIGH | GPIO_PIN_PRESET_LOW)) {
+   if (flags & GPIO_PIN_PRESET_HIGH) {
+   new_cfg.req.state = 1;
+   sc->sc_gpio_state |= (1 << pin->gp_pin);
+   } else {
+   new_cfg.req.state = 0;
+   sc->sc_gpio_state &= ~(1 << pin->gp_pin);
+   }
+   } else {
+   if ((sc->sc_gpio_state & (1 << pin->gp_pin)) != 0) {
+   new_cfg.req.state = 1;
+   } else {
+   new_cfg.req.state = 0;
+

svn commit: r363801 - head/sys/kern

2020-08-03 Thread Konstantin Belousov
Author: kib
Date: Mon Aug  3 17:17:17 2020
New Revision: 363801
URL: https://svnweb.freebsd.org/changeset/base/363801

Log:
  Provide more correct description for sysctl kern.smp.cores.
  
  Reported by:  dewa...@heuristicsystems.com.au
  PR:   248454
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/sys/kern/subr_smp.c

Modified: head/sys/kern/subr_smp.c
==
--- head/sys/kern/subr_smp.cMon Aug  3 16:43:40 2020(r363800)
+++ head/sys/kern/subr_smp.cMon Aug  3 17:17:17 2020(r363801)
@@ -104,7 +104,7 @@ SYSCTL_INT(_kern_smp, OID_AUTO, threads_per_core, CTLF
 
 int mp_ncores = -1;/* how many physical cores running */
 SYSCTL_INT(_kern_smp, OID_AUTO, cores, CTLFLAG_RD|CTLFLAG_CAPRD, _ncores, 0,
-"Number of CPUs online");
+"Number of physical cores online");
 
 int smp_topology = 0;  /* Which topology we're using. */
 SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RDTUN, _topology, 0,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363800 - head/sys/arm/broadcom/bcm2835

2020-08-03 Thread Andrew Turner
Author: andrew
Date: Mon Aug  3 16:43:40 2020
New Revision: 363800
URL: https://svnweb.freebsd.org/changeset/base/363800

Log:
  Allow the Raspberry Pi firmware driver to be a bus
  
  There are child nodes in the device tree, e.g. the Raspberry Pi firmware
  GPIO device. Add support for this to be a bus so we can attach these
  children.
  
  Reviewed by:  manu
  Sponsored by: Innovate UK
  Differential Revision:https://reviews.freebsd.org/D25848

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.cMon Aug  3 16:26:10 
2020(r363799)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.cMon Aug  3 16:43:40 
2020(r363800)
@@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 
@@ -47,7 +49,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 struct bcm2835_firmware_softc {
-   device_tsc_dev;
+   struct simplebus_softc  sc;
phandle_t   sc_mbox;
 };
 
@@ -82,7 +84,6 @@ bcm2835_firmware_attach(device_t dev)
int rv;
 
sc = device_get_softc(dev);
-   sc->sc_dev = dev;
 
node = ofw_bus_get_node(dev);
rv = OF_getencprop(node, "mboxes", , sizeof(mbox));
@@ -94,14 +95,17 @@ bcm2835_firmware_attach(device_t dev)
 
OF_device_register_xref(OF_xref_from_node(node), dev);
 
-   ctx = device_get_sysctl_ctx(sc->sc_dev);
-   tree_node = device_get_sysctl_tree(sc->sc_dev);
+   ctx = device_get_sysctl_ctx(dev);
+   tree_node = device_get_sysctl_tree(dev);
tree = SYSCTL_CHILDREN(tree_node);
SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "revision",
CTLTYPE_UINT | CTLFLAG_RD, sc, sizeof(*sc),
sysctl_bcm2835_firmware_get_revision, "IU",
"Firmware revision");
-   return (0);
+
+   /* The firmwaare doesn't have a ranges property */
+   sc->sc.flags |= SB_FLAG_NO_RANGES;
+   return (simplebus_attach(dev));
 }
 
 int
@@ -150,7 +154,7 @@ sysctl_bcm2835_firmware_get_revision(SYSCTL_HANDLER_AR
uint32_t rev;
int err;
 
-   if (bcm2835_firmware_property(sc->sc_dev,
+   if (bcm2835_firmware_property(sc->sc.dev,
BCM2835_MBOX_TAG_FIRMWARE_REVISION, , sizeof(rev)) != 0)
return (ENXIO);
 
@@ -171,11 +175,9 @@ static device_method_t bcm2835_firmware_methods[] = {
 };
 
 static devclass_t bcm2835_firmware_devclass;
-static driver_t bcm2835_firmware_driver = {
-   "bcm2835_firmware",
-   bcm2835_firmware_methods,
-   sizeof(struct bcm2835_firmware_softc),
-};
+DEFINE_CLASS_1(bcm2835_firmware, bcm2835_firmware_driver,
+bcm2835_firmware_methods, sizeof(struct bcm2835_firmware_softc),
+simplebus_driver);
 
 EARLY_DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver,
 bcm2835_firmware_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363799 - head/sys/dev/fdt

2020-08-03 Thread Andrew Turner
Author: andrew
Date: Mon Aug  3 16:26:10 2020
New Revision: 363799
URL: https://svnweb.freebsd.org/changeset/base/363799

Log:
  Allow child classes of simplebus to call attach directly
  
  Reduce code duplication when a bus is subclassed from simplebus by allowing
  them to call simplebus_attach directly. This is useful when the child bus
  will just implement the same calls.
  
  As not all children will expect to have a ranges property, e.g. the
  Raspberry Pi firmware, allow this property to be missing.
  
  Reviewed by:  manu
  Sponsored by: Innovate UK
  Differential Revision:https://reviews.freebsd.org/D25925

Modified:
  head/sys/dev/fdt/simplebus.c
  head/sys/dev/fdt/simplebus.h

Modified: head/sys/dev/fdt/simplebus.c
==
--- head/sys/dev/fdt/simplebus.cMon Aug  3 13:12:07 2020
(r363798)
+++ head/sys/dev/fdt/simplebus.cMon Aug  3 16:26:10 2020
(r363799)
@@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
  * Bus interface.
  */
 static int simplebus_probe(device_t dev);
-static int simplebus_attach(device_t dev);
 static struct resource *simplebus_alloc_resource(device_t, device_t, int,
 int *, rman_res_t, rman_res_t, rman_res_t, u_int);
 static voidsimplebus_probe_nomatch(device_t bus, device_t child);
@@ -134,7 +133,7 @@ simplebus_probe(device_t dev)
return (BUS_PROBE_GENERIC);
 }
 
-static int
+int
 simplebus_attach(device_t dev)
 {
struct  simplebus_softc *sc;
@@ -142,7 +141,8 @@ simplebus_attach(device_t dev)
 
sc = device_get_softc(dev);
simplebus_init(dev, 0);
-   if (simplebus_fill_ranges(sc->node, sc) < 0) {
+   if ((sc->flags & SB_FLAG_NO_RANGES) == 0 &&
+   simplebus_fill_ranges(sc->node, sc) < 0) {
device_printf(dev, "could not get ranges\n");
return (ENXIO);
}

Modified: head/sys/dev/fdt/simplebus.h
==
--- head/sys/dev/fdt/simplebus.hMon Aug  3 13:12:07 2020
(r363798)
+++ head/sys/dev/fdt/simplebus.hMon Aug  3 16:26:10 2020
(r363799)
@@ -47,6 +47,8 @@ struct simplebus_softc {
 
struct simplebus_range *ranges;
int nranges;
+#defineSB_FLAG_NO_RANGES   (1 << 0) /* Bus doesn't have ranges 
property */
+   int flags;
 
pcell_t acells, scells;
 };
@@ -63,4 +65,7 @@ struct simplebus_devinfo *simplebus_setup_dinfo(device
 struct simplebus_devinfo *di);
 int simplebus_fill_ranges(phandle_t node,
 struct simplebus_softc *sc);
+
+int simplebus_attach(device_t dev);
+
 #endif /* _FDT_SIMPLEBUS_H */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363798 - head/share/man/man7

2020-08-03 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Mon Aug  3 13:12:07 2020
New Revision: 363798
URL: https://svnweb.freebsd.org/changeset/base/363798

Log:
  Do not mention portsnap(8) in ports.7
  
  As we are moving away from portsnap,
  let's not recommend it in the manual page.
  
  Reviewed by:  bcr (manpages), mat (portmgr)
  Differential Revision:https://reviews.freebsd.org/D25847

Modified:
  head/share/man/man7/ports.7

Modified: head/share/man/man7/ports.7
==
--- head/share/man/man7/ports.7 Mon Aug  3 12:51:14 2020(r363797)
+++ head/share/man/man7/ports.7 Mon Aug  3 13:12:07 2020(r363798)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 17, 2020
+.Dd August 3, 2020
 .Dt PORTS 7
 .Os
 .Sh NAME
@@ -70,9 +70,7 @@ branch contains all the latest changes, while the
 branches only provide critical fixes.
 The
 .Em head
-branch can be installed or updated using either
-.Xr portsnap 8 ,
-or from Subversion repository at:
+branch can be installed or updated from the Subversion repository located at:
 .Pp
 .Lk https://svn.FreeBSD.org/ports/head
 .Pp
@@ -626,8 +624,7 @@ is going to be built with Python 3.7 support.)
 .Xr make 1 ,
 .Xr make.conf 5 ,
 .Xr development 7 ,
-.Xr pkg 7 ,
-.Xr portsnap 8
+.Xr pkg 7
 .Pp
 Additional developer documentation:
 .Bl -dash -width "" -offset indent
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363797 - head/contrib/googletest/googletest/test

2020-08-03 Thread Li-Wen Hsu
Author: lwhsu
Date: Mon Aug  3 12:51:14 2020
New Revision: 363797
URL: https://svnweb.freebsd.org/changeset/base/363797

Log:
  Disable tests failing after r363679
  
  PR:   248452
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/googletest/googletest/test/googletest-port-test.cc

Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc
==
--- head/contrib/googletest/googletest/test/googletest-port-test.cc Mon Aug 
 3 12:48:51 2020(r363796)
+++ head/contrib/googletest/googletest/test/googletest-port-test.cc Mon Aug 
 3 12:51:14 2020(r363797)
@@ -403,6 +403,8 @@ typedef testing::Types<
 TYPED_TEST_CASE(RETest, StringTypes);
 
 // Tests RE's implicit constructors.
+/*
+https://bugs.freebsd.org/248452
 TYPED_TEST(RETest, ImplicitConstructorWorks) {
   const RE empty(TypeParam(""));
   EXPECT_STREQ("", empty.pattern());
@@ -413,6 +415,7 @@ TYPED_TEST(RETest, ImplicitConstructorWorks) {
   const RE normal(TypeParam(".*(\\w+)"));
   EXPECT_STREQ(".*(\\w+)", normal.pattern());
 }
+*/
 
 // Tests that RE's constructors reject invalid regular expressions.
 TYPED_TEST(RETest, RejectsInvalidRegex) {
@@ -861,6 +864,8 @@ TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNo
 }
 
 // Tests RE's implicit constructors.
+/*
+https://bugs.freebsd.org/248452
 TEST(RETest, ImplicitConstructorWorks) {
   const RE empty("");
   EXPECT_STREQ("", empty.pattern());
@@ -868,6 +873,7 @@ TEST(RETest, ImplicitConstructorWorks) {
   const RE simple("hello");
   EXPECT_STREQ("hello", simple.pattern());
 }
+*/
 
 // Tests that RE's constructors reject invalid regular expressions.
 TEST(RETest, RejectsInvalidRegex) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363796 - in head: lib/libc/riscv/gen sys/riscv/include

2020-08-03 Thread Kristof Provost
Author: kp
Date: Mon Aug  3 12:48:51 2020
New Revision: 363796
URL: https://svnweb.freebsd.org/changeset/base/363796

Log:
  libc: Provide sub fp(s|g)etmask() implementations for RISC-V
  
  RISC-V doesn't support floating-point exceptions.
  
  RISC-V Instruction Set Manual: Volume I: User-Level ISA, 11.2 Floating-Point
  Control and Status Register: "As allowed by the standard, we do not support
  traps on floating-point exceptions in the base ISA, but instead require
  explicit checks of the flags in software. We considered adding branches
  controlled directly by the contents of the floating-point accrued exception
  flags, but ultimately chose to omit these instructions to keep the ISA 
simple."
  
  We still need these functions, because some applications (notably Perl) call
  them, but we cannot provide a meaningful implementation.
  
  Sponsored by: Axiado
  Differential Revision:https://reviews.freebsd.org/D25740

Added:
  head/lib/libc/riscv/gen/fpgetmask.c   (contents, props changed)
  head/lib/libc/riscv/gen/fpsetmask.c   (contents, props changed)
Modified:
  head/lib/libc/riscv/gen/Makefile.inc
  head/sys/riscv/include/ieeefp.h

Modified: head/lib/libc/riscv/gen/Makefile.inc
==
--- head/lib/libc/riscv/gen/Makefile.incMon Aug  3 10:19:50 2020
(r363795)
+++ head/lib/libc/riscv/gen/Makefile.incMon Aug  3 12:48:51 2020
(r363796)
@@ -3,6 +3,8 @@
 SRCS+= _ctx_start.S \
fabs.S \
flt_rounds.c \
+   fpgetmask.c \
+   fpsetmask.c \
infinity.c \
ldexp.c \
makecontext.c \

Added: head/lib/libc/riscv/gen/fpgetmask.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/riscv/gen/fpgetmask.c Mon Aug  3 12:48:51 2020
(r363796)
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2020 Axiado
+ * All rights reserved.
+ *
+ * This software was developed by Kristof Provost under
+ * sponsorship from Axiado.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+fp_except_t
+fpgetmask(void)
+{
+
+   return (0);
+}

Added: head/lib/libc/riscv/gen/fpsetmask.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/riscv/gen/fpsetmask.c Mon Aug  3 12:48:51 2020
(r363796)
@@ -0,0 +1,53 @@
+/*-
+ * Copyright (c) 2020 Axiado
+ * All rights reserved.
+ *
+ * This software was developed by Kristof Provost under
+ * sponsorship from Axiado.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, 

svn commit: r363795 - in head/sys: arm/broadcom/bcm2835 conf dev/usb/controller

2020-08-03 Thread Andrew Turner
Author: andrew
Date: Mon Aug  3 10:19:50 2020
New Revision: 363795
URL: https://svnweb.freebsd.org/changeset/base/363795

Log:
  Handle Raspberry Pi 4 xhci firmware loading.
  
  The newer hardware revisions of the Raspberry Pi 4 removed the ability of
  the VIA VL805 xhci controller to load its own firmware. Instead the
  firmware must be installed at the appropriate time by the VideoCore
  coprocessor.
  
  Submitted by: Robert Crowston 
  Differential Revision:https://reviews.freebsd.org/D25261

Added:
  head/sys/arm/broadcom/bcm2835/bcm2838_xhci.c   (contents, props changed)
Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
  head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h
  head/sys/arm/broadcom/bcm2835/files.bcm283x
  head/sys/conf/files.arm64
  head/sys/dev/usb/controller/xhci.h
  head/sys/dev/usb/controller/xhci_pci.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cMon Aug  3 09:20:32 
2020(r363794)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cMon Aug  3 10:19:50 
2020(r363795)
@@ -397,10 +397,10 @@ int
 bcm2835_mbox_property(void *msg, size_t msg_size)
 {
struct bcm_mbox_softc *sc;
-   struct msg_set_power_state *buf;
bus_dma_tag_t msg_tag;
bus_dmamap_t msg_map;
bus_addr_t msg_phys;
+   char *buf;
uint32_t reg;
device_t mbox;
int err;
@@ -468,6 +468,26 @@ bcm2835_mbox_set_power_state(uint32_t device_id, boole
 }
 
 int
+bcm2835_mbox_notify_xhci_reset(uint32_t pci_dev_addr)
+{
+   struct msg_notify_xhci_reset msg;
+   int err;
+
+   memset(, 0, sizeof(msg));
+   msg.hdr.buf_size = sizeof(msg);
+   msg.hdr.code = BCM2835_MBOX_CODE_REQ;
+   msg.tag_hdr.tag = BCM2835_MBOX_TAG_NOTIFY_XHCI_RESET;
+   msg.tag_hdr.val_buf_size = sizeof(msg.body);
+   msg.tag_hdr.val_len = sizeof(msg.body.req);
+   msg.body.req.pci_device_addr = pci_dev_addr;
+   msg.end_tag = 0;
+
+   err = bcm2835_mbox_property(, sizeof(msg));
+
+   return (err);
+}
+
+int
 bcm2835_mbox_get_clock_rate(uint32_t clock_id, uint32_t *hz)
 {
struct msg_get_clock_rate msg;
@@ -572,3 +592,4 @@ bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb)
 
return (err);
 }
+

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h   Mon Aug  3 09:20:32 
2020(r363794)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h   Mon Aug  3 10:19:50 
2020(r363795)
@@ -112,6 +112,24 @@ struct msg_set_power_state {
 /* Sets the power state for a given device */
 int bcm2835_mbox_set_power_state(uint32_t, boolean_t);
 
+#define BCM2835_MBOX_TAG_NOTIFY_XHCI_RESET 0x00030058
+
+struct msg_notify_xhci_reset {
+   struct bcm2835_mbox_hdr hdr;
+   struct bcm2835_mbox_tag_hdr tag_hdr;
+   union {
+   struct {
+   uint32_t pci_device_addr;
+   } req;
+   struct {
+   } resp;
+   } body;
+   uint32_t end_tag;
+};
+
+/* Prompts the VideoCore processor to reload the xhci firmware. */
+int bcm2835_mbox_notify_xhci_reset(uint32_t);
+
 #define BCM2835_MBOX_CLOCK_ID_EMMC 0x0001
 #define BCM2838_MBOX_CLOCK_ID_EMMC20x000c
 

Added: head/sys/arm/broadcom/bcm2835/bcm2838_xhci.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/broadcom/bcm2835/bcm2838_xhci.cMon Aug  3 10:19:50 
2020(r363795)
@@ -0,0 +1,217 @@
+/*-
+ * SPDX-License-Identifier: ISC
+ *
+ * Copyright (c) 2020 Dr Robert Harvey Crowston 
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ *
+ * $FreeBSD$
+ *
+ */
+
+/*
+ * VIA VL805 controller on the Raspberry Pi 4.
+ * The VL805 is a generic xhci controller. However, in the newer hardware
+ * revisions of the Raspberry Pi 4, it is incapable of loading its own 
firmware.
+ * Instead, the VideoCore GPU must load the firmware into the controller at the
+ * appropriate time. This