The number of callouts is a compile-time constant in libbsd. Use this
in struct callout_cpu and avoid dynamic allocation of tables. This
signficantly reduces the count of load instructions in the callout
handling.
Move the kernel space content of some Newlib provided header files to
RTEMS and libbsd. This allows to use the Newlib provided header files
with different FreeBSD baselines.
Update #3472.
This firewall was not ported to RTEMS and is just dead code which may
make trouble during FreeBSD baseline updates. It also increased the
compile-time of the library for nothing.
Update #3472.
Changes correspond to FreeBSD commit:
"Make timespecadd(3) and friends public
The timespecadd(3) family of macros were imported from NetBSD back in
r35029. However, they were initially guarded by #ifdef _KERNEL. In the
meantime, we have grown at least 28 syscalls that use timespecs in some
way, leading many programs both inside and outside of the base system to
redefine those macros. It's better just to make the definitions public.
Our kernel currently defines two-argument versions of timespecadd and
timespecsub. NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define
three-argument versions. Solaris also defines a three-argument version, but
only in its kernel. This revision changes our definition to match the
common three-argument version.
Bump _FreeBSD_version due to the breaking KPI change.
Discussed with: cem, jilles, ian, bde
Differential Revision: https://reviews.freebsd.org/D14725"
Update #3472.
The cloned interfaces have to be set up befor the interface list is
created. Otherwise it's not possible to configure a cloned interface
with a `ifconfig_gifX` line.
The getsockaddr() function is used to allocate a struct sockaddr of the
right length and initialize it with userspace provided data. It is used
for the connect(), bind() and sendit() family functions. In particular,
the sendit() function is used by the UDP send functions. This means
each UDP send needs a malloc() and free() invocation. This is a
performance problem in RTEMS (first-fit heap) and may lead to heap
fragmentation. Replace the malloc() allocation with a stack allocation.
This requires SOCK_MAXADDRLEN (= 255) of additional stack space for
libbsd.
A further optimization would be to get rid of the stack copy of the
socket address. However, this would require to check each consumer of
the address to ensure that it is not modified.
This adds two new buildset configurations: One that leaves out as much
features as possible and one that enables all features. For the default
configuration WiFi support is now disabled.
To disable IPv6 for the minimal configuration, all -DINET6 are
eliminated in libbsd.py. They are now replaced by a #ifdef that checks
for RTEMS_BSD_MODULE_NETINET6 instead.
Close#3351.
Using panic() with interrupts disabled could lead to an additional error
(INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT) due to a potentially
blocking output.