169 Commits

Author SHA1 Message Date
Sebastian Huber
a5ddb0ea69 Update to FreeBSD head 2019-09-24
Git mirror commit 6b0307a0a5184339393f555d5d424190d8a8277a.
2019-11-13 10:47:04 +01:00
Sebastian Huber
5f2d63683a Add support for EARLY_COUNTER 2019-09-25 10:58:17 +02:00
Sebastian Huber
cff1625f27 Add pselect() 2019-09-23 14:29:00 +02:00
Sebastian Huber
989e2dd76e CONFIG_INTRHOOK(9): Call handlers after boot
This enables adding drivers on demand which use this service after
initialization.
2019-09-23 10:55:49 +02:00
Sebastian Huber
4789b90b18 tty.c: Disable unused functions 2019-08-27 10:31:48 +02:00
Sebastian Huber
d67d2c9f61 kern_intr.c: Disable unused functions 2019-08-27 10:31:46 +02:00
Sebastian Huber
54fcbf1d4a Remove superfluous support for preloaded modules 2019-08-27 10:31:44 +02:00
Sebastian Huber
abbce3f757 SLEEPQUEUE(9): Optimize sleepq_set_timeout_sbt()
Avoid an extra ISR disable/enable in SMP configurations.
2019-08-26 08:18:13 +02:00
Vijay Kumar Banerjee
b68ca55c96 Add mmap 2019-07-27 13:49:07 +02:00
Sebastian Huber
313e1d5f1c SLEEPQUEUE(9): Fix timeout handling 2019-07-05 10:20:18 +02:00
Sebastian Huber
c727e4a22e Separate libbsd and RTEMS clock ticks 2019-05-15 12:43:06 +02:00
Sebastian Huber
ac9974c358 Add hostname related sysctls conditionally
This helps to the reduce code size for USB only use cases.
2019-05-13 10:13:37 +02:00
Sebastian Huber
2b2563da95 Update to FreeBSD head 2018-12-20
Git mirror commit 19a6ceb89dbacf74697d493e48c388767126d418.

It includes an update of wpa_supplicant to version 2.7.

It includes an update of the OpenSSL baseline to version 1.1.1a.

Update #3472.
2018-12-20 13:36:34 +01:00
Christian Mauderer
e3b595273a SLEEPQUEUE(9): Fix typo that prevent non-SMP build. 2018-12-19 10:41:47 +01:00
Sebastian Huber
1b47c61d2b SLEEPQUEUE(9): SMP only cache line alignment 2018-12-14 10:37:26 +01:00
Sebastian Huber
e0b4edbdcc Update to FreeBSD head 2018-11-15
Git mirror commit a18b0830c4be01b39489a891b63d6023ada6358a.

Update #3472.
2018-11-15 10:56:14 +01:00
Sebastian Huber
d4bf70e497 Disable or make static kern_* functions 2018-11-15 10:06:58 +01:00
Sebastian Huber
b3169c2a6a Update to FreeBSD head 2018-10-23
Git mirror commit 59f44d20be3f99d181ca742e636d45fc39ec982b.

This commit updates OpenSSL to version 1.1.1.  This required an update
of racoon which uses some internal stuff from OpenSSL and seems to be
mostly unmaintained, e.g. there is update in the FreeBSD ports to cope
with OpenSSL 1.1.1.

Update #3472.
2018-10-25 08:38:45 +02:00
Sebastian Huber
b42dea9e51 CONFIG_INTRHOOK(9): Port to RTEMS
Some device drivers (e.g. MMC) need a complex intialization with working
callouts.  Remove the dummy CONFIG_INTRHOOK() implementation and replace
it with the real one from FreeBSD.  Make sure TIMEOUT(9) services work
at this point.

Update #3525.
2018-09-25 10:01:15 +02:00
Sebastian Huber
3489e3b639 Update to FreeBSD head 2018-09-17
Git mirror commit 6c2192b1ef8c50788c751f878552526800b1e319.

Update #3472.
2018-09-21 10:29:41 +02:00
Sebastian Huber
bcdce02d9b Update to FreeBSD head 2018-06-01
Git mirror commit fb63610a69b0eb7f69a201ba05c4c1a7a2739cf9.

Update #3472.
2018-09-21 10:29:41 +02:00
Sebastian Huber
2df56dbd60 Update to FreeBSD head 2018-04-01
Git mirror commit 8dfb1ccc26d1cea7e2529303003ff61f9f1784c4.

Update #3472.
2018-09-21 10:29:40 +02:00
Sebastian Huber
18fa92c2dc Update to FreeBSD head 2018-02-01
Git mirror commit d079ae0442af8fa3cfd6d7ede190d04e64a2c0d4.

Update #3472.
2018-09-21 10:29:39 +02:00
Sebastian Huber
bb80d9df8b Update to FreeBSD head 2017-12-01
Git mirror commit e724f51f811a4b2bd29447f8b85ab5c2f9b88266.

Update #3472.
2018-09-21 10:29:38 +02:00
Sebastian Huber
e4a8065910 Update to FreeBSD head 2017-10-01
Git mirror commit b2f0376b45428f13151d229c5ae9d4d8f74acbd1.

Update #3472.
2018-09-21 10:29:37 +02:00
Sebastian Huber
c37f9fba70 Update to FreeBSD head 2017-08-01
Git mirror commit f5002f5e5f78cae9f0269d812dc0aedb0339312c.

Update #3472.
2018-09-21 10:29:37 +02:00
Sebastian Huber
de261e0404 Update to FreeBSD head 2017-06-01
Git mirror commit dfb26efac4ce9101dda240e94d9ab53f80a9e131.

Update #3472.
2018-09-21 10:29:36 +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
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
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
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
Sebastian Huber
a0633c51db SLEEPQUEUE(9): Update due to API changes
Update #3264.
2018-02-05 10:56:39 +01:00
Sebastian Huber
b03a1c0b59 Fix file descriptor reference counting in accept()
Update #3132.
2017-11-15 13:25:28 +01:00
Sebastian Huber
057656b706 Disable HHOOK(9) support for sockets
Support was only partly disabled leading to NULL pointer accesses.
Disable it completely.
2017-11-10 11:16:14 +01:00
Sebastian Huber
72d5fa11a8 Fix reference counting for file descriptors
Update #3132.
2017-11-10 11:01:54 +01:00
Sebastian Huber
f7f3c4b0de blist: Import from FreeBSD 2017-10-20 14:59:55 +02:00
Sebastian Huber
62c8ca0ead Fix INVARIANTS support 2017-10-20 14:59:55 +02:00
Sebastian Huber
a8e84c62ae DEVICE(9): Avoid NULL pointer access 2017-10-20 14:59:54 +02:00
Sebastian Huber
9a583a94d3 SLEEPQUEUE(9): Update due to API changes
Update #3117.
Update #3182.
2017-10-17 13:56:38 +02:00
Sebastian Huber
894c965d95 Support reference counting for file descriptors
Close #3132.
2017-09-15 12:46:57 +02:00
Sebastian Huber
6e328c38b1 KQUEUE(2): Add missing file handler 2017-07-28 08:46:21 +02:00
Sebastian Huber
17ab62cbdd PIPE(2): Add missing file handler 2017-07-28 08:46:20 +02:00
Sebastian Huber
091321081a SOCKET(2): Add missing file handler 2017-07-28 08:46:18 +02:00
Sebastian Huber
3c967ca238 Use <sys/lock.h> provided by Newlib 2017-06-08 13:20:09 +02:00
Sebastian Huber
02373194fe Update due to Newlib 2017-06-07 changes
The following files are now provided by Newlib:

  * arpa/inet.h
  * net/if.h
  * netinet/in.h
  * netinet/tcp.h
  * sys/socket.h
  * sys/uio.h
  * sys/un.h

The <sys/param.h> and <sys/cpuset.h> are now compatible enough to be
used directly.

Update #2833.
2017-06-08 13:19:54 +02:00
Kevin Kirspel
817cbf7201 devfs: Fix some issues
Fix issue with cdev private data usage with RTEMS iop structure. Add
support for cdev alias device names. Add support for cdev fstat.
2017-05-12 14:20:33 +02:00