446 Commits

Author SHA1 Message Date
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
1d99262f59 libkern.h: Avoid call overhead for bcmp() 2018-08-09 07:59:38 +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
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
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
ef5d536f84 at91_mci: Simplify XDMA usage 2018-04-27 10:14:44 +02:00
Sebastian Huber
d45899bce8 at91_mci: Get rid of bounce buffer 2018-04-27 09:05:37 +02:00
Sebastian Huber
3fac9e9cd4 at91_mci: Use real interrupt
Execute at91_mci_intr() in interrupt context.  Synchronize MMC requests
via RTEMS interrupt lock.
2018-04-26 15:23:08 +02:00
Sebastian Huber
c7e162abd8 mmc: Optimize mmc_wait_for_req()
Use a self-contained RTEMS binary semaphore instead of msleep() and
wakeup().  This is itself more efficient and in addition allows the use
of mmc_wakeup() in interrupt context.
2018-04-26 15:19:42 +02:00
Sebastian Huber
4b1426368b at91_mci: Fix use of BOARD_MCK 2018-04-26 11:14:39 +02:00
Sebastian Huber
f092186c84 at91_mci: Fix use of pre-processor defines 2018-04-26 11:14:10 +02:00
Sebastian Huber
8189ea825a CRYPTO(4): Port to RTEMS 2018-03-28 07:59:12 +02:00
Sebastian Huber
6600368589 CRYPTO(4): Import from FreeBSD 2018-03-27 14:42:46 +02:00
Sebastian Huber
b8f7836e44 DEVFS(5): Fix warning 2018-03-27 14:42:46 +02:00
Sebastian Huber
2275776d21 dwc_otg: Default to USB host mode
In case no "dr_mode" property is present in the device tree, then
default to USB host mode.  This is necessary to support the Cyclone V
SoC Development Kit.
2018-02-06 09:56:35 +01:00
Sebastian Huber
b79c025a12 dwc_otg: Add compatibility string, constify
Support device tree of  Cyclone V SoC Development Kit.
2018-02-06 09:56:35 +01:00
Sebastian Huber
c30fa94277 Add device tree support for Altera/Intel Cyclone V
Close #3290.
2018-02-06 09:55:31 +01:00
Sebastian Huber
a0633c51db SLEEPQUEUE(9): Update due to API changes
Update #3264.
2018-02-05 10:56:39 +01:00
Sebastian Huber
ea121a0c59 ZONE(9): Avoid function call overhead 2018-01-19 14:51:51 +01:00
Sebastian Huber
4e17f143de DEVICE(9): Fix __BUS_ACCESSOR() 2018-01-08 14:01:02 +01:00
Christian Mauderer
9569b39515 at91_mci: Fix for 32k buffer. 2017-11-17 14:28:56 +01:00
Sebastian Huber
c360b1a2dc Revert "RWLOCK(9): Add reader/writer lock implementation"
This was accidentally committed.

This reverts commit 97a98f6cd767b3a68279890488c7b451788f84f4.
2017-11-17 10:49:59 +01:00
Sebastian Huber
b5822c2a0a Revert "SX(9): Implement with reader/writer lock"
This was accidentally committed.

This reverts commit cc7a8d87e7307db738bf39ab1ca3ce1053f1c163.
2017-11-17 10:49:31 +01:00
Sebastian Huber
cc7a8d87e7 SX(9): Implement with reader/writer lock 2017-11-16 09:02:28 +01:00
Sebastian Huber
97a98f6cd7 RWLOCK(9): Add reader/writer lock implementation 2017-11-16 09:02:24 +01:00
Sebastian Huber
b03a1c0b59 Fix file descriptor reference counting in accept()
Update #3132.
2017-11-15 13:25:28 +01:00
Sebastian Huber
06f06d4fdf Fix warning 2017-11-10 14:19:29 +01:00
Christian Mauderer
a506ba970a at91_mci: Add timing to read_ivar. 2017-11-10 14:13:19 +01:00
Christian Mauderer
e7f3260886 freebsd/bus: Check return value of bus_accessor. 2017-11-10 14:13:18 +01:00
Christian Mauderer
ec29b2a0c2 at91_mci: Port to RTEMS and adapt for atsam. 2017-11-10 14:13:15 +01:00
Sebastian Huber
ea5880a3cc at91_mci: Import from FreeBSD 2017-11-10 14:01:58 +01:00
Christian Mauderer
589220752b saf1761_otg: Port to RTEMS. 2017-11-10 14:01:55 +01:00
Christian Mauderer
cf8e1d47e2 usb/saf1761: Import from FreeBSD.
Import the files for the SAF1761 USB controller from
FreeBSD commit:
    642b174daddbd0efd9bb5f242c43f4ab4db6869f
    Tue Apr 4 04:01:02 2017
2017-11-10 13:33:04 +01:00
Sebastian Huber
847de24eb0 Fix build for non-FDT platforms 2017-11-10 13:32:14 +01:00
Sichen Zhao
7e52ab9cd0 Import BBB sd driver files from FreeBSD. 2017-11-10 13:10:02 +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
936b597a57 ffec: Fix comment
Update #3090.
2017-10-26 08:44:27 +02:00
Sebastian Huber
a8a9cf1847 ffec: Add checksum offload
Update #3090.
2017-10-25 14:30:04 +02:00
Sebastian Huber
0323c286e3 ffec: Add interrupt coalescing support
Code is an adapted from the TSEC (if_tsec) network interface driver.

Update #3090.
2017-10-25 14:30:01 +02:00
Sebastian Huber
fd5ee57372 ffec: Increase buffer descriptor count to 512
Update #3090.
2017-10-25 14:29:58 +02:00
Sebastian Huber
0cb40755cc ffec: Defragment transmit mbuf only if necessary
Use structure similar to TSEC (if_tsec) driver.

The use of bus_dmamap_sync() differs these network interface drivers.
This should not be the case.

Update #3090.
2017-10-25 14:29:55 +02:00
Sebastian Huber
798d308be8 ffec: Fix NULL pointer access
Update #3090.
2017-10-25 14:29:51 +02:00