1634 Commits

Author SHA1 Message Date
Sebastian Huber
ed40c80fc1 mDNSResponder: Fix gAllocatedEventFDs allocation 2018-09-20 10:24:35 +02:00
Sebastian Huber
4d8f9e6261 mDNSResponder: Honour file descriptor maximum
Dynamically allocate a big enough file descriptor set for select().  A
better solution would be to use kqueue() instead of select().
2018-09-19 08:24:09 +02:00
Sebastian Huber
48cbe6cc1b Remove <poll.h>
This header file is provided by RTEMS.
2018-09-17 10:05:02 +02:00
Sebastian Huber
a85d90007e Optimize callout handline via static timer wheel
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.
2018-09-17 09:12:06 +02:00
Sebastian Huber
cf447b951a Remove struct callout::c_cpu
This is an optimization of the callout handling.  In libbsd all callouts
are handled by the one and only timer server.
2018-09-17 09:10:52 +02:00
Sebastian Huber
08fbf18141 Initialize interrupt server earlier
This allows to initialize other basic services which depend on the
interrupt server.
2018-09-12 08:09:38 +02:00
Sebastian Huber
6e5b088e8f Move dynamic mutex pool to separate file
This avoids false link-time dependencies.
2018-09-12 07:59:27 +02:00
Sebastian Huber
3b8f03b1e1 Fix BUS_SPACE_MAXADDR for 64-bit targets 2018-09-12 07:48:17 +02:00
Sebastian Huber
3990b45e97 Use rtems_counter_read() for get_cyclecount() 2018-09-11 11:37:34 +02:00
Sebastian Huber
0f9d58f58b dw_mmc: Avoid conflicting device ivars
Do not overwrite the device ivars used by the simplebus.  Use
unspecified unit number for child device.
2018-09-11 11:36:28 +02:00
Sebastian Huber
f56067e26c vprintf: Avoid printf() to avoid FPU usage 2018-09-10 15:15:42 +02:00
Sebastian Huber
f7d6bd2306 userspace-header-gen.py: Revert interpreter change 2018-08-31 07:00:11 +02:00
Sebastian Huber
b6c64e1447 Regenerate program header files 2018-08-28 14:35:17 +02:00
Sebastian Huber
b2e1123733 userspace-header-gen.py: Sort file content
Sort the file content to make it less dependent on compiler code
generation variances.
2018-08-28 14:35:10 +02:00
Sebastian Huber
43a39b7a5d syscalls01: Fix for IPSEC enabled 2018-08-28 12:51:49 +02:00
Sebastian Huber
fa3e012fc6 Update yacc and lex generated files
Use the FreeBSD 11.1 yacc and lex tools to generate the files.

Update #3472.
2018-08-28 12:02:41 +02:00
Sebastian Huber
100e66f560 kvaddr_t is now provided by <sys/types.h>
Update #3472.
2018-08-28 09:41:19 +02:00
Sebastian Huber
dd60daaaa3 Allow *.c as kernel space header files
This is a workaround for the FreeBSD kernel space source file

  sys/opencrypto/xform.c

which includes a bunch of *.c files.

Update #3472.
2018-08-27 07:44:23 +02:00
Sebastian Huber
4c22b5c1f2 Add FreeBSD kernel space header files
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.
2018-08-27 07:44:23 +02:00
Sebastian Huber
ee738dd7ae WPA_SUPPLICANT(8): Remove unused files
Remove unused files which may make trouble during FreeBSD baseline
updates.  It also increased the compile-time of the library for nothing.

Update #3472.
2018-08-24 09:09:51 +02:00
Sebastian Huber
63084c1988 IPFW(4): Remove FreeBSD import
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.
2018-08-24 09:09:51 +02:00
Sebastian Huber
f62c62d2fe Update rtems-bsd-kernel-namespace.h
Update #3472.
2018-08-24 09:09:51 +02:00
Sebastian Huber
0963419598 Fix alignment of getsockaddr_sockaddr 2018-08-24 09:06:31 +02:00
Sebastian Huber
12a885cd18 Update due to <sys/time.h> API changes
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.
2018-08-24 08:57:10 +02:00
Sebastian Huber
8e35aaa9df tests/termios: Fix warnings 2018-08-20 15:20:51 +02:00
Sebastian Huber
1d99262f59 libkern.h: Avoid call overhead for bcmp() 2018-08-09 07:59:38 +02:00
Christian Mauderer
9bc7b96066 libbsd.txt: Update version info and manpage links.
The information is clearly outdated. This patch updates it to the latest
release.
2018-08-06 15:10:13 +02:00
Christian Mauderer
afac48ae69 libbsd.txt: Add ipsec. 2018-08-02 10:40:45 +02:00
Christian Mauderer
baffbf3e64 testsuite/ipsec01: Add. 2018-08-02 10:32:24 +02:00
Christian Mauderer
028bf82f6d rc.conf: Fix cloned interface setup.
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.
2018-08-02 10:32:24 +02:00
Christian Mauderer
c7eec93e3c Add RTEMS_BSD_CONFIG_IPSEC. 2018-08-02 10:32:20 +02:00
Christian Mauderer
1b467ad47d Add ipsec to rc.conf. 2018-08-02 10:25:42 +02:00
Christian Mauderer
5e13963765 buildset/everything: Add some usefull comments. 2018-08-02 10:25:42 +02:00
Christian Mauderer
b376ae131d ipsec-tools: Port libipsec, setkey and racoon.
Note that this replaces the libipsec from FreeBSD with the one provided
by ipsec-tools.
2018-08-02 10:25:37 +02:00
Christian Mauderer
8645c9d720 ipsec-tools: Apply patches from FreeBSD ports.
Source: https://svnweb.freebsd.org/ports/head/security/ipsec-tools/files/ revision 468617.
2018-08-01 09:55:27 +02:00
Christian Mauderer
ff36f5e409 Import ipsec-tools 0.8.2.
Import unchanged ipsec-tools sources in the release version 0.8.2. The
homepage of ipsec-tools is http://ipsec-tools.sourceforge.net/. The
sources can be obtained from there.
2018-08-01 09:55:27 +02:00
Christian Mauderer
6215813e04 if_ipsec: Port and add to everything-buildset.
This ports the kernel space parts for ipsec and adds them to the
everything-buildset.
2018-08-01 09:55:27 +02:00
Christian Mauderer
09bbedcb65 if_ipsec: Import from FreeBSD. 2018-08-01 09:55:27 +02:00
Christian Mauderer
01855a5acd waf: Allow to only generate lex and yacc.
In some applications, it's usefull if the files generated by lex or yacc
are not build automatically. With that it is for example possible to
create a wrapper source file that sets some defines before the generated
code is parsed.
2018-08-01 09:55:27 +02:00
Christian Mauderer
879eaa7c1a userspace-header-gen: Special case for Yacc / Lex.
Some variables generated by Yacc / Lex need a special treatment. That
had been done by manual editing of the generated headers in the past.
This patch integrate these changes into the generator.
2018-08-01 09:55:27 +02:00
Christian Mauderer
9ea8664ba2 random: Implement read_random via getentropy. 2018-08-01 09:55:27 +02:00
Christian Mauderer
9efc6500fb crypto/sha2: Remove left over file.
This file seems to be imported from a long gone version.
2018-08-01 09:55:27 +02:00
Sebastian Huber
137250239e Make sure CALLOUT_DFRMIGRATION is not used
This flag supports the callout migration in FreeBSD.  This feature is
not supported by libbsd.
2018-07-26 14:49:35 +02:00
Sebastian Huber
e37f03e47a Make sure CALLOUT_PROCESSED is not used
This flag is only used in combination with the callout expire list,
which we do not use in libbsd.
2018-07-26 14:35:56 +02:00
Sebastian Huber
6d9d7b1956 Critical bug fix for callouts
FreeBSD has two callout executors, one in software and one in hardware
interrupt context.  In libbsd, all callouts are executed by the timer
server.  Entirely remove the different execution contexts for libbsd.
Previously, this was not properly done which could result an invalid
callout_drain() sequence leading to system memory corruption.
2018-07-26 14:12:46 +02:00
Sebastian Huber
3df89c0ef9 selectpollkqueue01: Invalidate file descriptor
This is not a functional change or a fix.
2018-07-26 13:53:17 +02:00
Sebastian Huber
6fb003f588 Fix sporadic test failures via uma_timeout() 2018-07-26 12:03:45 +02:00
Sebastian Huber
94b5368388 Avoid malloc() in getsockaddr()
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.
2018-07-04 07:20:37 +02:00
Nicolas Tsiogkas
e6f6b5e619 BPF(9): Pass flags to bpfopen() 2018-07-04 07:20:37 +02:00
Sebastian Huber
a1e4757a30 syscalls01: Fix sporadic test failures 2018-07-02 09:16:40 +02:00