Re: [gcc v2] Enable some features for RTEMS in libstdc++

2022-06-22 Thread Sebastian Huber
On 22/06/2022 08:36, Chris Johns wrote: I see this patch is for master. Is a gcc 12 patch available so I can test it? The patch works also for GCC 12. I only did a test run of the RTEMS tests. It failed to apply for me with the gcc-12 for rtems6. The configure pieces did not apply. I updated

Fwd: New Defects reported by Coverity Scan for RTEMS

2022-06-22 Thread Joel Sherrill
-- Forwarded message - From: Date: Wed, Jun 22, 2022, 1:54 AM Subject: New Defects reported by Coverity Scan for RTEMS To: Hi, Please find the latest report on new defect(s) introduced to RTEMS found with Coverity Scan. 2 new defect(s) introduced to RTEMS found with Coverity

[PATCH] score: Use right clock for threadq timeouts

2022-06-22 Thread Sebastian Huber
Use CLOCK_REALTIME and CLOCK_MONOTONIC for relative thread queue timeouts instead of CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE. This fixes an issue with clock_nanosleep() in combination with clock_gettime(). Close #4669. --- cpukit/score/src/threadqtimeout.c | 4 ++-- 1 file changed, 2

Re: [PATCH] libstdc++: 60241.cc: tolerate slightly shorter aggregate sleep

2022-06-22 Thread Sebastian Huber
On 22/06/2022 08:22, Sebastian Huber wrote: On 22/06/2022 08:01, Alexandre Oliva via Gcc-patches wrote: On rtems under qemu, the frequently-interrupted nanosleep ends up sleeping shorter than expected, by a margin of less than 0,3%. I figured failing the library test over a system (emulator?)

[PATCH] spcpuset01: Account for API changes

2022-06-22 Thread Sebastian Huber
Update #4667. --- testsuites/sptests/spcpuset01/test.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/testsuites/sptests/spcpuset01/test.c b/testsuites/sptests/spcpuset01/test.c index b29c117370..d93be69bd3 100644 --- a/testsuites/sptests/spcpuset01/test.c +++

[newlib 10/22] bitset(9): Introduce BIT_FOREACH_ISSET and BIT_FOREACH_ISCLR

2022-06-22 Thread Sebastian Huber
From: Mark Johnston These allow one to non-destructively iterate over the set or clear bits in a bitset. The motivation is that we have several code fragments which iterate over a CPU set like this: while ((cpu = CPU_FFS()) != 0) { cpu--; CPU_CLR(cpu, ); ; } This is

[newlib 19/22] sys/_bitset.h: revert commit 74e014dbfab

2022-06-22 Thread Sebastian Huber
From: Stefan Eßer It caused kernel build for PowerPC64 to fail. A different patch is being tested with make universe to make sure it works on all architectures. MFC after: 1 month --- newlib/libc/sys/rtems/include/sys/_bitset.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)

[newlib 13/22] bitset: Reimplement BIT_FOREACH_IS(SET|CLR)

2022-06-22 Thread Sebastian Huber
From: Mark Johnston Eliminate the nested loops and re-implement following a suggestion from rlibby. Add some simple regression tests. Reviewed by:rlibby, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32472 ---

[newlib 14/22] cpuset(9): Add CPU_FOREACH_IS(SET|CLR) and modify consumers to use it

2022-06-22 Thread Sebastian Huber
From: Mark Johnston This implementation is faster and doesn't modify the cpuset, so it lets us avoid some unnecessary copying as well. No functional change intended. This is a re-application of commit 9068f6ea697b1b28ad1326a4c7a9ba86f08b985e. Reviewed by:cem, kib, jhb MFC after: 2

[newlib 09/22] iflib: Improve mapping of TX/RX queues to CPUs

2022-06-22 Thread Sebastian Huber
From: Patrick Kelsey iflib now supports mapping each (TX,RX) queue pair to the same CPU (default), to separate CPUs, or to a pair of physical and logical CPUs that share the same L2 cache. The mapping mechanism supports unequal numbers of TX and RX queues, with the excess queues always being

[newlib 21/22] Make CPU_SET macros compliant with other implementations

2022-06-22 Thread Sebastian Huber
From: Stefan Eßer The introduction of improved compatibility with some 3rd party software, but caused the configure scripts of some ports to assume that they were run in a GLIBC compatible environment. Parts of sched.h were made conditional on -D_WITH_CPU_SET_T being added to ports, but there

[newlib 22/22] newlib/libc/sys/rtems/include/sys/cpuset.h

2022-06-22 Thread Sebastian Huber
From: Stefan Eßer Fix typo in source file. Reported by:pluknet at gmail.com (Sergey Kandaurov) --- newlib/libc/sys/rtems/include/sys/_cpuset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/libc/sys/rtems/include/sys/_cpuset.h

[newlib 20/22] sys/_bitset.h: Fix fall-out from commit 5e04571cf3c

2022-06-22 Thread Sebastian Huber
From: Stefan Eßer The changes to the bitset macros allowed sched.h to be included into userland programs without name space pollution due to BIT_* and BITSET_* macros. The definition of a "struct bitset" had been overlooked. This name space pollution caused the build of port print/miktex to

[newlib 16/22] sys/bitset.h: reduce visibility of BIT_* macros

2022-06-22 Thread Sebastian Huber
From: Stefan Eßer Add two underscore characters "__" to names of BIT_* and BITSET_* macros to move them to the implementation name space and to prevent a name space pollution due to BIT_* macros in 3rd party programs with conflicting parameter signatures. These prefixed macro names are used in

[newlib 15/22] sched.h: add CPU_EQUAL() for better compatibility with Linux

2022-06-22 Thread Sebastian Huber
From: Konstantin Belousov Reviewed by:jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32901 --- newlib/libc/sys/rtems/include/sys/cpuset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[newlib 07/22] bitset: expand bit index type to `long`

2022-06-22 Thread Sebastian Huber
From: D Scott Phillips An upcoming patch to use the bitset macros for tracking vm page dump information could conceivably need more than INT_MAX bits. Expand the bit type to long so that the extra range is available on 64-bit platforms where it would most likely be needed. CPUSET_COUNT and

[newlib 11/22] cpuset(9): Add CPU_FOREACH_IS(SET|CLR) and modify consumers to use it

2022-06-22 Thread Sebastian Huber
From: Mark Johnston This implementation is faster and doesn't modify the cpuset, so it lets us avoid some unnecessary copying as well. No functional change intended. Reviewed by:cem, kib, jhb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision:

[newlib 08/22] bitset: implement BIT_TEST_CLR_ATOMIC & BIT_TEST_SET_ATOMIC

2022-06-22 Thread Sebastian Huber
From: Ryan Libby That is, provide wrappers around the atomic_testandclear and atomic_testandset primitives. Submitted by: jeff Reviewed by:cem, kib, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22702 ---

[newlib 06/22] bitset: add BIT_FFS_AT() for finding the first bit set greater than a start bit

2022-06-22 Thread Sebastian Huber
From: D Scott Phillips Reviewed by:kib Approved by:scottl (implicit) MFC after: 1 week Sponsored by: Ampere Computing, Inc. Differential Revision: https://reviews.freebsd.org/D26128 --- newlib/libc/sys/rtems/include/sys/bitset.h | 19 +++ 1 file changed, 15

[newlib 17/22] sys/_bitset.h: Fix fall-out from commit 5e04571cf3c

2022-06-22 Thread Sebastian Huber
From: Konstantin Belousov The changes to the bitset macros allowed sched.h to be included into userland programs without name space pollution due to BIT_* and BITSET_* macros. The definition of a global variable "bitset" had been overlooked. This name space pollution caused a compile failure in

[newlib 12/22] Revert "cpuset(9): Add CPU_FOREACH_IS(SET|CLR) and modify consumers to use it"

2022-06-22 Thread Sebastian Huber
From: Mark Johnston This reverts commit 9068f6ea697b1b28ad1326a4c7a9ba86f08b985e. The underlying macro needs to be reworked to avoid problems with control flow statements. Reported by:rlibby --- newlib/libc/sys/rtems/include/sys/cpuset.h | 2 -- 1 file changed, 2 deletions(-) diff --git

[newlib 18/22] sys/_bitset.h: Fix fall-out from commit 5e04571cf3c

2022-06-22 Thread Sebastian Huber
From: Stefan Eßer There is a reference to malloc() in #define __BITSET_ALLOC. Even though this macro is only defined but not used, it causes the lang/gcc ports to fail. The gcc ports "poison" a number of functions including malloc() and prevent their use (including in macro definitions). This

[newlib 03/22] bitset: avoid pessimized code when bitset size is not constant

2022-06-22 Thread Sebastian Huber
From: Ryan Libby We have a couple optimizations for when the bitset is known to be just one word. But with dynamically sized bitsets, it was actually more work to determine the size than just to do the necessary computation. Now, only use the optimization when the size is known to be constant.

[newlib 04/22] bitset: rename confusing macro NAND to ANDNOT

2022-06-22 Thread Sebastian Huber
From: Ryan Libby s/BIT_NAND/BIT_ANDNOT/, and for CPU and DOMAINSET too. The actual implementation is "and not" (or "but not"), i.e. A but not B. Fortunately this does appear to be what all existing callers want. Don't supply a NAND (not (A and B)) operation at this time. Discussed with: jeff

[newlib 02/22] Use a precise bit count for the slab free items in UMA.

2022-06-22 Thread Sebastian Huber
From: Jeff Roberson This significantly shrinks embedded slab structures. Reviewed by:markj, rlibby (prior version) Differential Revision: https://reviews.freebsd.org/D22584 --- newlib/libc/sys/rtems/include/sys/bitset.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[newlib 01/22] RTEMS: Remove FreeBSD version tags

2022-06-22 Thread Sebastian Huber
--- newlib/libc/sys/rtems/include/sys/_bitset.h | 2 +- newlib/libc/sys/rtems/include/sys/_cpuset.h | 2 +- newlib/libc/sys/rtems/include/sys/bitset.h | 2 +- newlib/libc/sys/rtems/include/sys/cpuset.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git

[newlib 05/22] Fix undefined behavior: left-shifting into the sign bit.

2022-06-22 Thread Sebastian Huber
From: Konstantin Belousov Reviewed by:dim, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D22898 --- newlib/libc/sys/rtems/include/sys/bitset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[newlib 00/22] Synchronize bitset and cpuset with FreeBSD

2022-06-22 Thread Sebastian Huber
See also: https://devel.rtems.org/ticket/4667 D Scott Phillips (2): bitset: add BIT_FFS_AT() for finding the first bit set greater than a start bit bitset: expand bit index type to `long` Jeff Roberson (1): Use a precise bit count for the slab free items in UMA. Konstantin Belousov

Re: [gcc v2] Enable some features for RTEMS in libstdc++

2022-06-22 Thread Sebastian Huber
On 22/06/2022 08:40, Chris Johns wrote: On 22/6/2022 4:39 pm, Sebastian Huber wrote: On 22/06/2022 08:36, Chris Johns wrote: The patch works also for GCC 12. I only did a test run of the RTEMS tests. It failed to apply for me with the gcc-12 for rtems6. The configure pieces did not apply.

Re: [gcc v2] Enable some features for RTEMS in libstdc++

2022-06-22 Thread Chris Johns
On 22/6/2022 4:39 pm, Sebastian Huber wrote: > On 22/06/2022 08:36, Chris Johns wrote: >>> The patch works also for GCC 12. I only did a test run of the RTEMS tests. >> It failed to apply for me with the gcc-12 for rtems6. The configure pieces >> did >> not apply. > > I tested with the GCC 12

Re: [gcc v2] Enable some features for RTEMS in libstdc++

2022-06-22 Thread Sebastian Huber
On 22/06/2022 08:36, Chris Johns wrote: The patch works also for GCC 12. I only did a test run of the RTEMS tests. It failed to apply for me with the gcc-12 for rtems6. The configure pieces did not apply. I tested with the GCC 12 branch, maybe there are some configure changes compared to the

Fwd: [PATCH] libstdc++: testsuite: use -lbsd for net_ts on RTEMS

2022-06-22 Thread Sebastian Huber
There seems to be an issue with the RTEMS pipe() implementation or the test configuration. Forwarded Message Subject: [PATCH] libstdc++: testsuite: use -lbsd for net_ts on RTEMS Date: Wed, 22 Jun 2022 02:24:19 -0300 From: Alexandre Oliva via Gcc-patches Reply-To: Alexandre

Re: [gcc v2] Enable some features for RTEMS in libstdc++

2022-06-22 Thread Chris Johns
On 22/6/2022 4:05 pm, Sebastian Huber wrote: > On 22/06/2022 05:34, Chris Johns wrote: >> On 22/6/2022 6:38 am, Chris Johns wrote: On 21 Jun 2022, at 5:39 pm, Sebastian Huber wrote: On 09/06/2022 20:19, Sebastian Huber wrote: > Remove RTEMS support from crossconfig.m4

Re: [PATCH] libstdc++: testsuite: fs rename to self may fail

2022-06-22 Thread Sebastian Huber
On 22/06/2022 08:24, Alexandre Oliva via Libstdc++ wrote: rtems6's rename() implementation errors with EEXIST when the rename-to filename exists, even when renaming a file to itself or when renaming a nonexisting file. Adjust expectations. Regstrapped on x86_64-linux-gnu, also tested with a

Re: [PATCH] libstdc++: 60241.cc: tolerate slightly shorter aggregate sleep

2022-06-22 Thread Sebastian Huber
On 22/06/2022 08:01, Alexandre Oliva via Gcc-patches wrote: On rtems under qemu, the frequently-interrupted nanosleep ends up sleeping shorter than expected, by a margin of less than 0,3%. I figured failing the library test over a system (emulator?) bug is undesirable, so I put in some

Re: [gcc v2] Enable some features for RTEMS in libstdc++

2022-06-22 Thread Sebastian Huber
On 22/06/2022 05:34, Chris Johns wrote: On 22/6/2022 6:38 am, Chris Johns wrote: On 21 Jun 2022, at 5:39 pm, Sebastian Huber wrote: On 09/06/2022 20:19, Sebastian Huber wrote: Remove RTEMS support from crossconfig.m4 since this code is not used due to "with_newlib" being "yes".