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

2022-06-23 Thread Sebastian Huber
On 23/06/2022 08:44, Sebastian Huber wrote: On 23/06/2022 02:19, Alexandre Oliva wrote: On Jun 22, 2022, Sebastian Huber wrote: The clock_nanosleep() uses the coarse resolution which may give a time before now(). Uhh, sorry, hit send too early. I also meant to ask whether you'd like me to

[PATCH] score: Make SMP only code explicit

2022-06-23 Thread Sebastian Huber
Conditional expressions with inline functions are not optimized away if optimization is disabled. Avoid such expressions to prevent dead branches. It helps also during code review to immediately see if a loop is used or not. --- cpukit/include/rtems/score/priorityimpl.h | 33

[libbsd 3/4] if_lpe.c: Move transmit initialization

2022-06-23 Thread Sebastian Huber
Move the transmit initialization out of the transmit task to be able to remove the transmit task in the next patch. --- rtemsbsd/sys/arm/lpc/if_lpe.c | 269 +++--- 1 file changed, 152 insertions(+), 117 deletions(-) diff --git a/rtemsbsd/sys/arm/lpc/if_lpe.c b/rtemsbsd

[libbsd 0/4] Replace LPC Ethernet interface driver

2022-06-23 Thread Sebastian Huber
The standard FreeBSD MII support causes severe problems on the LPC3200 chip family. If an Ethernet module register is accessed while there is no clock from the PHY, the chip completely locks up and only an external watchdog can recover from this state. The legacy driver had a custom PHY managemen

[libbsd 2/4] if_lpe.c: Port to LibBSD

2022-06-23 Thread Sebastian Huber
--- libbsd.py | 1 + rtemsbsd/sys/arm/lpc/if_lpe.c | 466 +- 2 files changed, 228 insertions(+), 239 deletions(-) diff --git a/libbsd.py b/libbsd.py index de22eaa9..983f41a1 100644 --- a/libbsd.py +++ b/libbsd.py @@ -235,6 +235,7 @@ class rtem

[libbsd 4/4] if_lpe.c: Use interface transmit

2022-06-23 Thread Sebastian Huber
This avoids the need for a transmit task and transmit interrupts. --- rtemsbsd/sys/arm/lpc/if_lpe.c | 502 ++ 1 file changed, 206 insertions(+), 296 deletions(-) diff --git a/rtemsbsd/sys/arm/lpc/if_lpe.c b/rtemsbsd/sys/arm/lpc/if_lpe.c index 0ae60884..8c58a58d 100

[libbsd 1/4] if_lpe.c: Import legacy LPC Ethernet driver

2022-06-23 Thread Sebastian Huber
The standard FreeBSD MII support causes severe problems on the LPC3200 chip family. If an Ethernet module register is accessed while there is no clock from the PHY, the chip completely locks up and only an external watchdog can recover from this state. The legacy driver had a custom PHY managemen

Re: [PATCH] Proposal for new GPIO API and example implementation for STM32F4 BSP

2022-06-23 Thread Duc Doan
On Tue, 2022-06-21 at 17:23 +0200, o...@c-mauderer.de wrote: > OK. So every BSP that want's to use that API will have a different > rtems_gpio_config_t (or every other structure) that is defined in > (for > example) bsp.h? The application has to know the details of the > current > BSP and initia

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

2022-06-23 Thread Sebastian Huber
On 23/06/2022 13:33, Alexandre Oliva wrote: Anyway... I was considering this xfail patch before, and I wonder if it would still be appropriate to install something like it, narrowed down to rtems < 6.1, or if it would be better to let it fail noisily so that people look it up, find the fix prope

Re: [PATCH] Proposal for new GPIO API and example implementation for STM32F4 BSP

2022-06-23 Thread oss
Hello Duc, Am 23.06.22 um 13:36 schrieb Duc Doan: On Tue, 2022-06-21 at 17:23 +0200, o...@c-mauderer.de wrote: OK. So every BSP that want's to use that API will have a different rtems_gpio_config_t (or every other structure) that is defined in (for example) bsp.h? The application has to know th

Re: [PATCH] score: Make SMP only code explicit

2022-06-23 Thread Joel Sherrill
Does this have a gcc issue? On Thu, Jun 23, 2022, 3:28 AM Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > Conditional expressions with inline functions are not optimized away if > optimization is disabled. Avoid such expressions to prevent dead > branches. It helps also during co

Re: [libbsd 0/4] Replace LPC Ethernet interface driver

2022-06-23 Thread Chris Johns
OK Chris On 23/6/2022 7:20 pm, Sebastian Huber wrote: > The standard FreeBSD MII support causes severe problems on the LPC3200 > chip family. If an Ethernet module register is accessed while there is > no clock from the PHY, the chip completely locks up and only an external > watchdog can recove

Re: [PATCH] score: Make SMP only code explicit

2022-06-23 Thread Sebastian Huber
On 24.06.22 00:33, Joel Sherrill wrote: Does this have a gcc issue? I don't think this is a GCC issue. Calling an inline function if optimization is disabled seems to be all right for me. -- embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.hu...

[libbsd 02/22] Fix redefinition warnings

2022-06-23 Thread Sebastian Huber
--- freebsd/sys/netinet/in_pcb.h | 4 rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/freebsd/sys/netinet/in_pcb.h b/freebsd/sys/netinet/in_pcb.h index ecbd7a22..848a9af0 100644 --- a/freebsd

[libbsd 01/22] Fix default NET_CFG_NFS_MOUNT_PATH

2022-06-23 Thread Sebastian Huber
The hostname and path must be separated by a ':'. --- waf_libbsd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waf_libbsd.py b/waf_libbsd.py index acf93a2f..60ea7535 100644 --- a/waf_libbsd.py +++ b/waf_libbsd.py @@ -308,7 +308,7 @@ class Builder(builder.ModuleManager):

[libbsd 06/22] nfsclient: Include header for rtems_version()

2022-06-23 Thread Sebastian Huber
Update #4475. --- freebsd/sys/fs/nfsclient/nfs_clrpcops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/freebsd/sys/fs/nfsclient/nfs_clrpcops.c b/freebsd/sys/fs/nfsclient/nfs_clrpcops.c index 53e4a525..85238daa 100644 --- a/freebsd/sys/fs/nfsclient/nfs_clrpcops.c +++ b/freebsd/sys/fs/nfs

[libbsd 07/22] nfsclient: Fix extra token after #else warning

2022-06-23 Thread Sebastian Huber
Update #4475. --- freebsd/sys/fs/nfsclient/nfs_clrpcops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freebsd/sys/fs/nfsclient/nfs_clrpcops.c b/freebsd/sys/fs/nfsclient/nfs_clrpcops.c index 85238daa..8ae61446 100644 --- a/freebsd/sys/fs/nfsclient/nfs_clrpcops.c +++ b/freeb

[libbsd 00/22] Remove FreeBSD file descriptors and avoid VFS

2022-06-23 Thread Sebastian Huber
This patch set removes the FreeBSD file descriptors. The VFS is no longer used if only the USB, SD/MMC, network, PCI, and NVMe support is used by the application. This change significantly reduce the memory usage of LibBSD for these applications. Using the media01 test case for the arm/lpc32xx B

[libbsd 15/22] Use define for maxfiles and maxfilesperproc

2022-06-23 Thread Sebastian Huber
Update #4475. --- freebsd/sys/sys/file.h| 5 + rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h | 2 -- rtemsbsd/rtems/rtems-kernel-init.c| 4 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/freebsd/sys/sys/file.h b/f

[libbsd 18/22] Move unmapped_buf_allowed

2022-06-23 Thread Sebastian Huber
rtems_bsd_initialize() should initialize the bare minimum. Update #4475. --- freebsd/sys/kern/vfs_bio.c | 3 +++ rtemsbsd/rtems/rtems-kernel-init.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/freebsd/sys/kern/vfs_bio.c b/freebsd/sys/kern/vfs_bio.c index 1177b907..

[libbsd 09/22] Remove FreeBSD file descriptors

2022-06-23 Thread Sebastian Huber
Remove FreeBSD file descriptors due to performance and code complexity reasons. Update #4475. --- freebsd/sys/kern/kern_descrip.c | 58 +-- freebsd/sys/kern/kern_event.c | 121 ++--- freebsd/sys/kern/sys_generic.c| 136 -- freebsd/sys/kern/uipc_s

[libbsd 22/22] Disable UNIX Domain Sockets credentials

2022-06-23 Thread Sebastian Huber
--- freebsd/sys/kern/uipc_usrreq.c | 8 freebsd/sys/sys/unpcb.h| 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/freebsd/sys/kern/uipc_usrreq.c b/freebsd/sys/kern/uipc_usrreq.c index 47cdcfbd..164f9ee3 100644 --- a/freebsd/sys/kern/uipc_usrreq.c +++ b/freebsd/s

[libbsd 10/22] Update CONTRIBUTING.rst

2022-06-23 Thread Sebastian Huber
Add porting advice. Explain file descriptor tradeoffs in CONTRIBUTING.rst. Update #4475. --- CONTRIBUTING.rst | 79 1 file changed, 79 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 04593cf6..19abb766 100644 --- a/CONTRIBUTI

[libbsd 05/22] Remove duplicate sysctl(), etc. definitions

2022-06-23 Thread Sebastian Huber
Collecting all system calls in a single translation unit is not good due to the library initialization through linker sets. Update #4475. --- freebsd/sys/kern/kern_sysctl.c | 4 ++ freebsd/sys/sys/sysctl.h | 8 rtemsbsd/rtems/rtems-bsd-syscall-api.c | 64 -

[libbsd 04/22] Move setfib() back to route.c

2022-06-23 Thread Sebastian Huber
Collecting all system calls in a single translation unit is not good due to the library initialization through linker sets. Update #4475. --- freebsd/sys/net/route.c| 18 ++ freebsd/sys/sys/sysproto.h | 2 -- .../machine/rtems-bsd-kerne

[libbsd 08/22] devfs: Do not use FreeBSD file descriptors

2022-06-23 Thread Sebastian Huber
Revert commit 6514d561587fd1527fe6a26cb43e6b5742c8c779 in "rtemsbsd/sys/fs/devfs/devfs_devs.c". Using the FreeBSD file descriptors for the device file system is unnecessary. Update #4475. --- freebsd/sys/fs/devfs/devfs_int.h | 3 +- freebsd/sys/fs/devfs/devfs_vnops.c | 4 +- rtemsbsd/sys/f

[libbsd 13/22] cryptodev: Do not use VFS

2022-06-23 Thread Sebastian Huber
Revert commit 6514d561587fd1527fe6a26cb43e6b5742c8c779 in "freebsd/sys/opencrypto/cryptodev.c". The goal is to use USB, network, PCI, and NVMe support without the VFS to reduce the memory and runtime overhead introduced by VFS. Update #4475. --- freebsd/sys/opencrypto/cryptodev.c | 70 ++

[libbsd 03/22] Update kernel namespace

2022-06-23 Thread Sebastian Huber
Update #4475. --- .../machine/rtems-bsd-kernel-namespace.h | 391 ++ 1 file changed, 391 insertions(+) diff --git a/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h b/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h index 599c7d82..85f66912 100644 --- a/rtemsbsd/in

[libbsd 17/22] Move bio_transient_maxcnt

2022-06-23 Thread Sebastian Huber
rtems_bsd_initialize() should initialize the bare minimum. Update #4475. --- freebsd/sys/kern/vfs_bio.c | 3 +++ rtemsbsd/rtems/rtems-kernel-init.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/freebsd/sys/kern/vfs_bio.c b/freebsd/sys/kern/vfs_bio.c index 50e87ff8

[libbsd 21/22] Make rtems_bsd_iop_to_file() static

2022-06-23 Thread Sebastian Huber
Update #4475. --- rtemsbsd/include/machine/rtems-bsd-libio.h | 2 -- rtemsbsd/rtems/rtems-bsd-syscall-api.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/rtemsbsd/include/machine/rtems-bsd-libio.h b/rtemsbsd/include/machine/rtems-bsd-libio.h index 6dd75394..1d2cd0d2 10

[libbsd 19/22] Move VFS BIO initialization

2022-06-23 Thread Sebastian Huber
rtems_bsd_initialize() should initialize the bare minimum. Update #4475. --- freebsd/sys/kern/vfs_bio.c| 24 ++- .../machine/rtems-bsd-kernel-namespace.h | 1 - rtemsbsd/rtems/rtems-kernel-init.c| 20 3 files changed, 23 inser

[libbsd 11/22] Add struct file wrapper

2022-06-23 Thread Sebastian Huber
Add a struct file wrapper in as an alternative to the full FreeBSD struct file in . This allows using for FreeBSD file systems (VFS) and the wrapper for other areas such as devfs, cryptodev, sockets, kqueue, poll, and select which do not need the VFS support. Update #4475. --- rtemsbsd/include

[libbsd 12/22] Move kqueue() and kevent(), avoid VFS

2022-06-23 Thread Sebastian Huber
Collecting all system calls in a single translation unit is not good due to the library initialization through linker sets. Revert commit 6514d561587fd1527fe6a26cb43e6b5742c8c779 in "freebsd/sys/kern/kern_event.c". The goal is to use USB, network, PCI, and NVMe support without the VFS to reduce t

[libbsd 16/22] Move socket system calls, avoid VFS

2022-06-23 Thread Sebastian Huber
Collecting all system calls in a single translation unit is not good due to the library initialization through linker sets. Revert commit 6514d561587fd1527fe6a26cb43e6b5742c8c779 in the socket API implementation files. The goal is to use USB, network, PCI, and NVMe support without the VFS to redu

[libbsd 20/22] Remove unused rtems_bsd_sysgen_imfsnodeops

2022-06-23 Thread Sebastian Huber
Update #4475. --- rtemsbsd/include/machine/rtems-bsd-libio.h | 11 rtemsbsd/rtems/rtems-bsd-syscall-api.c | 64 -- 2 files changed, 75 deletions(-) diff --git a/rtemsbsd/include/machine/rtems-bsd-libio.h b/rtemsbsd/include/machine/rtems-bsd-libio.h index 3c3a8bbb..6d

[libbsd 14/22] Move select(), pselect(), and poll(), avoid VFS

2022-06-23 Thread Sebastian Huber
Collecting all system calls in a single translation unit is not good due to the library initialization through linker sets. Partly revert commit 6514d561587fd1527fe6a26cb43e6b5742c8c779 in "freebsd/sys/kern/sys_generic.c". The goal is to use USB, network, PCI, and NVMe support without the VFS to

[PATCH] sys/event.h: Use rtems_libio_t

2022-06-23 Thread Sebastian Huber
Make it explicit that kqueue uses rtems_libio_t. Update #4475. --- cpukit/include/sys/event.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/cpukit/include/sys/event.h b/cpukit/include/sys/event.h index c64db98b95..6c5666030e 100644 --- a/cpukit/include/sys/event.h +++ b/cpukit/includ