Commit Graph

167 Commits

Author SHA1 Message Date
c812fdf629 Add component exit to tests
This makes it possible to detect successful test runs in a general way.
2020-01-14 11:43:38 +01:00
c51b4b5742 New VFS plugin for emulating POSIX pipes
Add a new plugin for creating pipes between pairs of VFS handles. It is
intended to replace the libc_pipe plugin, one of the last remaining libc
plugins.

In contrast to the libc_pipe plugin, this plugin defers cross-handle
notification until I/O signal handling rather than block and unblock
readers using a semaphore. This is a performance regression in the case
of multiple threads blocking on a pipe, but shall be an intermediate
mechanism pending renovations within the libc VFS and threading layers.
As a side effect, threads blocked on a pipe might not be resumed until
the main thread suspends and dispatches I/O signals.

The "test-libc_pipe" test has been adjusted to use the VFS pipe plugin
and tests both local pipes and pipes hosted remotely in the VFS server.

Merge adaptations (such as EOF handling, adjustment to VFS/libc
interface changes) by Norman Feske.

Fix #2303
2019-11-19 14:54:13 +01:00
Christian Helmuth
c50252fb35 libc: suspend/resume in pthread mutex lock/unlock
Issue #3550
2019-11-19 14:54:13 +01:00
Christian Helmuth
54002e6e6b test-pthread: refactor and cleanup test cases
Issue #3550
2019-11-19 14:54:13 +01:00
Christian Helmuth
43f28e0451 stdcxx: add more missing symbols to ABI
Fixes #3506
2019-11-19 14:42:22 +01:00
Christian Prochaska
07a40d028a libc: fix and cleanup pthread mutexes
Issue #3503
Fixes #3504
2019-11-19 14:23:57 +01:00
Christian Prochaska
a47adecdcd test-pthread: add mutex tests
Add tests for recursive and errorcheck type mutexes.

Fixes #3503
2019-11-19 14:23:57 +01:00
Norman Feske
6e86d6d699 Remove server/fatfs_fs and libc_fatfs plugin
Issue #3512
2019-11-19 14:23:56 +01:00
Norman Feske
59c60b8031 test-libc: test double dup2, dup
Issue #3477
Issue #3505
2019-11-19 14:10:55 +01:00
Norman Feske
bf92232698 libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.

The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.

The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.

There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.

Issue #3497
2019-11-19 14:10:55 +01:00
36111a2edf Libc: implement getifaddrs
Implement getifaddrs and freeifaddrs within the libc using socket
control files at the VFS. Add an "address" and "netmask" file to the
lwIP plugin.

Only a single IPv4 address is initially supported, and the broadcast
address returned will never be valid.

Fixes #3439
2019-09-02 16:36:07 +02:00
Norman Feske
6894ced63b libc: execve
This patch implements 'execve' in Genode's libc.

The mechanism relies on the dynamic linker's ability to replace the
loaded binary while keeping crucial libraries - in particular the libc -
intact. The state outside the libc is wiped. For this reason, all libc
internal state needed beyond the 'execve' call must be allocated on a
heap separate from the application-owned malloc heap. E.g.,
libc-internal file-descriptor objects must not be allocated or refer to
any memory object allocated from the malloc heap.

Issue #3481
2019-08-28 14:19:45 +02:00
Norman Feske
581785a48f Extend fork test
This patch extends the fork test with explicit checks for the cloned
content of the heap and RW segment as well as the seek position of an
open file descriptor. It adds the new libports/run/fork.run script
that exercises the fork mechanism implemented by the libc. It is based
on noux_fork.run, which tests the mechansim provided by noux. The
test program has been moved from ports to libports.

Issue #3478
2019-08-28 14:18:44 +02:00
Johannes Kliemann
1bdd18a196 ada-runtime: update to 1.1 2019-08-21 13:25:25 +02:00
Josef Söntgen
9cf5da85ef libc: change time back end to re-read RTC
Issue #3450
2019-08-21 13:25:25 +02:00
Christian Helmuth
b8ed80b7dd Simple libc-based RTC test
Issue #3450
2019-08-21 12:37:02 +02:00
Josef Söntgen
99cb585b6e libports: system RTC server and test
For now in libports because it relies on contrib sources from musl
doing the time data conversion.

Issue #3450
2019-08-21 12:37:02 +02:00
807f5d9af1 Use pthread_join in test/libc_pipe
Ref #2303
2019-07-09 08:55:24 +02:00
Sebastian Sumpf
4b72bbaa57 libc: mktime signed overflow
issue #3289
2019-05-29 10:20:52 +02:00
863654d188 Libc: update port to Freebsd 12
Fix #3289
2019-05-27 14:46:53 +02:00
3e848dff10 solo5: update bindings
Update the Solo5 upstream to accomadate changes to the Block session and
stack protection support in the base library.

Ref #3275
Ref #3283
2019-05-06 16:15:27 +02:00
Martin Stein
181c78d482 timeout: use uint64_t for all plain time values
This enforces the use of unsigned 64-bit values for time in the duration type,
the timeout framework, the timer session, the userland timer-drivers, and the
alarm framework on all platforms. The commit also adapts the code that uses
these tools accross all basic repositories (base, base-*, os. gems, libports,
ports, dde_*) to use unsigned 64-bit values for time as well as far as this
does not imply profound modifications.

Fixes #3208
2019-05-06 16:15:26 +02:00
Norman Feske
6d11591d83 test-spark: rename number_of_bits -> object_size
In the original version, I used 'number_of_bits' because Ada's 'Size
returns the size in bits, not bytes. But the values (for objects) are
always a multiple of 8. On the C++ side, performing size checks at the
granularity of bits is just awkward. The term 'object size' is more
natural.
2019-04-09 12:30:35 +02:00
e2ff776b35 Print error locations in test-libc_connect
Ref #3257
2019-04-09 12:30:34 +02:00
Christian Helmuth
9bbc91bb52 Add missing newline to pipe test
Original patch by Ben Larson <hungryninja101@gmail.com>.

Fixes #3055
2019-04-01 19:33:46 +02:00
Norman Feske
30505c7977 test-spark: add object-size assertions 2019-03-18 15:56:23 +01:00
Alexander Senier
f30a82d599 ada: provide runtime symbols for elaboration code 2019-02-28 11:32:53 +01:00
Norman Feske
b24edc1633 Remove residual uses of deprecated APIs
Issue #1987, related also to issue #3163 and issue #3164.
2019-02-19 11:12:12 +01:00
Norman Feske
b3727a9b46 Add missing override annotations
Issue #3159
2019-02-19 11:12:11 +01:00
Norman Feske
aa66b5d62f base: remove dependency from deprecated APIs
This patch adjusts the implementation of the base library and core such
that the code no longer relies on deprecated APIs except for very few
cases, mainly to keep those deprecated APIs in tact for now.

The most prominent changes are:

- Removing the use of base/printf.h

- Removing of the log backend for printf. The 'Console' with the
  format-string parser is still there along with 'snprintf.h' because
  the latter is still used at a few places, most prominently the
  'Connection' classes.

- Removing the notion of a RAM session, which does not exist in
  Genode anymore. Still the types were preserved (by typedefs to
  PD session) to keep up compatibility. But this transition should
  come to an end now.

- Slight rennovation of core's tracing service, e.g., the use of an
  Attached_dataspace as the Argument_buffer.

- Reducing the reliance on global accessors like deprecated_env() or
  core_env(). Still there is a longish way to go to eliminate all such
  calls. A useful pattern (or at least a stop-gap solution) is to
  pass the 'Env' to the individual compilation units via init functions.

- Avoiding the use of the old 'Child_policy::resolve_session_request'
  interface that returned a 'Service' instead of a 'Route'.

Issue #1987
2019-02-19 11:08:17 +01:00
Alexander Senier
5ccae43552 Rename Ada runtime to SPARK runtime
The minimal-footprint Ada runtime for implementing library-like
functionality in SPARK is now called "spark" runtime.

The full Ada runtime for entire components written in Ada and using the
libc as glue to the underlying system will move to the world repository
as "ada" runtime.

Issue #3144
2019-02-19 11:08:17 +01:00
Norman Feske
6154d9067e libports: avoid using deprecated APIs
Issue #1987
Issue #3125
2019-01-30 13:49:55 +01:00
Norman Feske
af146e7dcd Remove base/timed_semaphore.h from API
The former 'Genode::Timed_semaphore' mechanism is moved to the private
part of the two remaining users, namely dde_rump and the libc. Note
there are now two private copies of 'timed_semaphore.h'. This should be
regarded as an interim step until the use of this mechanism is removed
from both users.

This patch also cleans up the mechanism from legacy Genode API calls and
global side effects (alarm-thread singleton). The test/timed_semaphore
is now located at the libports repository as it now tests a mechanism of
the libc. The former timed_semaphore library is no more.

Fixes #3121
2019-01-30 13:35:29 +01:00
Christian Prochaska
12c10dbcd1 libc: 'connect()' test
Fixes #3114
2019-01-30 13:35:28 +01:00
Norman Feske
81fb10daaa Consistently name block components
This patch replaces abbreviations like "blk", "cli", and "srv" by their
full forms "block", "client", and "server".

Fixes #1258
2019-01-14 12:34:39 +01:00
Alexander Senier
14cd115c82 Support GNAT.IO in Ada programs 2019-01-14 12:21:10 +01:00
Josef Söntgen
f113460348 Move FUSE to world
Fixes #3104.
2019-01-07 12:43:37 +01:00
Norman Feske
a15b825418 Move libsdl and companion libs to genode-world
Fixes #3100
2019-01-07 12:43:37 +01:00
Norman Feske
9818237918 test-ada: showcase Ada/SPARK object construction 2019-01-07 12:33:55 +01:00
8cb8082206 Remove Nim support from toolchain
Nim components are best build externally using the Nimble tools and a
Genode SDK.

See https://github.com/ehmry/nim-genode

Fix #2949
2019-01-07 12:25:42 +01:00
Stefan Kalkowski
41dfc51beb test-expat: use zero-filled read buffer
Fix #3062
2018-11-29 11:54:31 +01:00
Stefan Kalkowski
d7fa4cfb8b hw: enable eager FPU context switch for ARM
* Add an ieee754 FPU test
* Remove simple fpu test

Fix #2822
2018-11-29 11:54:31 +01:00
7a11384177 Merge pthread into libc library
The pthread API is considered a standard feature of libc so better to
simply merge it with the libc. Pthreads are in fact already a part of
the libc in the form of weak symbols. This merger is also a prerequisite
for better integrating pthreads with the libc I/O task.

Fix #3054
2018-11-29 11:46:01 +01:00
Martin Stein
2d041ac0fc depot_autopilot: evaluate sets of test packages 2018-11-16 15:07:53 +01:00
bc539ce892 Native Solo5 bindings
A shared library implementation of the unikernel middleware.

https://github.com/Solo5/solo5

Fix #2945
2018-11-16 15:07:52 +01:00
Martin Stein
51cae1f0a3 Add base lib to tests
For being able to build the tests via source archives, the 'base'
library must be denoted as dependency explicitely in their 'target.mk' file.
This is because when building archives, the API dependencies of used APIs are
not taken into account.
2018-11-16 14:37:19 +01:00
Stefan Kalkowski
24e6a5ee73 test/memcpy: add Genode's memset to the suite
Ref #3016
2018-11-16 14:37:18 +01:00
6178e378c1 Test libc sleep and gettime in run/libc
Ref #3018
2018-10-29 09:36:22 +01:00
Alexander Boettcher
5446c52c43 base: make Entrypoint placeable on specific cpu
Fixes #3008
2018-10-29 09:36:22 +01:00
Norman Feske
f21493272d test for measuring memcpy throughput (fix #3016) 2018-10-29 09:36:22 +01:00