Commit Graph

435 Commits

Author SHA1 Message Date
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
e5f27b44b5 block_session: turn 'Connection' into template
As a preparatory step for introducing the new block-client API, we have
to turn the 'Block::Connection' into a class template. The template
argument will be used to tie an application-defined job type to the
block connection.

Issue #3283
2019-05-06 16:15:25 +02:00
Norman Feske
593e971121 block_session: SYNC and TRIM as async operations
This patch removes the blocking Block::Session::sync RPC function and
adds the asynchronous operations SYNC and TRIM to the block session's
packet-stream interface.

Even though the patch adjusts all block components to the interface
change, the components keep the former blocking handling of sync
internally for now because of the design of the 'Block::Driver'
interface. This old interface is not worth changing. We should instead
migrate the block servers step by step to the new
'Block::Request_stream' API.

Fixes #3274
2019-05-06 16:15:24 +02:00
Norman Feske
bbe3ee8dc5 block_session: server-defined payload alignment
This patch replaces the formerly fixed 2 KiB data alignment within the
packet-stream buffer by a server-defined alignment. This has two
benefits.

First, when using block servers that provide small block sizes like 512
bytes, we avoid fragmenting the packet-stream buffer, which occurs when
aligning 512-byte requests at 2 KiB boundaries. This reduces meta data
costs for the packet-stream allocator and also allows fitting more
requests into the buffer.

Second, block drivers with alignment constraints dictated by the
hardware can now pass those constraints to the client, thereby easing
the use of zero-copy DMA directly into the packet stream.

The alignment is determined by the Block::Session_client at construction
time and applied by the Block::Session_client::alloc_packet method.
Block-session clients should always use this method, not the 'alloc_packet'
method of the packet stream (tx source) directly. The latter merely
applies a default alignment of 2 KiB.

At the server side, the alignment is automatically checked by
block/component.h (old API) and block/request_stream.h (new API).

Issue #3274
2019-05-03 13:53:12 +02:00
Norman Feske
2208220c12 block session: remove Block::Session::Operations
This patch modernizes the 'Block::Session::info' interface. Instead of
using out parameters, the 'init' RPC function returns a compound 'Info'
object now. The rather complicated 'Operations' struct is replaced by
a 'writeable' attribute in the 'Info' object.

Fixes #3275
2019-05-03 13:53:12 +02:00
66f49e6c42 VFS lwIP: support opening a handle on the root directory
The "nameserver" file cannot be opened through a VFS File_system client
if the plugin does not support opening the parent directory of
"/nameserver", which would be "/".

Ref #3269
2019-04-09 12:30:34 +02:00
a635873568 VFS: Replace global response handlers with local handlers
Replace the I/O response handler that is passed to the VFS at
construction with an object that is dynamically attached to handles.
This object shall also accept read-ready notifications, and plugins are
encouraged to keep handles awaiting ready-ready notifications separate
from handles that await I/O progress.

Replace the use of handle lists in plugins with handle queues, this
makes the code easier to understand and the ordering of notifications to
the application more explicit.

These changes replace the use of the Post_signal_hook from all VFS
plugins, applications must assume that read-ready and I/O notifications
occur during I/O signal dispatch and use an Io_progress_handler at its
entrypoints to defer response until after signal dispatching.

Fix #3257
2019-04-09 12:30:34 +02:00
Josef Söntgen
38a10c92d3 pthread: initialize static rwlocks/conds
Make sure that the rwlock is allocated before a lock operation is
performed. This case occurs if a static rwlock was create by using
PTHREAD_RWLOCK_INITIALIZER. Same goes for PTHREAD_CONDS_INITIALIZER.

Fixes #3262.
2019-04-09 12:30:34 +02:00
Josef Söntgen
b9e12d7c23 libc: always set O_RDWR in fcntl on a socket
For better or worse we have no proper way of handling this right now
but contrib libraries, e.g. glib, use it to determine if they can use
the underlying fd.

Fxies #3265.
2019-04-09 12:30:34 +02:00
Josef Söntgen
5af0162b3f libc: fix storing TIOCGWINSZ result
Fixes #3266.
2019-04-09 12:30:34 +02:00
800b4e44b1 Reduce Vfs::Vfs_handle::Context to empty struct type
The "Vfs::Vfs_handle" type should not contain any public members that
can be initialized by the VFS internally and by the application, so
remove inheritance from the "Genode::list::Element" class. The VFS
plugins must instead use lists of "Vfs::Vfs_handle" sub-classes, the
lifetime of which are always managed by the plugin.

Ref #3036
2019-04-01 19:33:47 +02:00
Sebastian Sumpf
98e2f91036 qemu-usb: fix multiple device support
bus or device should be different (not both) when comparing a device to
already present devices. Because of this the second USB device was
marked as existent when the bus matched or the bus did not but the
device number.
2019-03-18 15:56:59 +01:00
Christian Prochaska
2a71c8fa82 pcsc-lite: read vendor id and product id from USB device
Fixes #3211
2019-03-18 15:56:23 +01:00
Alexander Senier
a58fcc3b1e Update runtime ALIs 2019-03-18 15:56:23 +01:00
57fd4e9148 Add Io_progress_handler to Entrypoint interface
The "schedule_post_signal_hook" method of the Genode::Entrypoint class
is problematic because the signal hook can be scheduled and replaced
multiple times during the signal dispatch cycle. Add an alternative to
this method with "register_io_progress_handler" and the "Post_signal_
hook" class with "Io_progress_handler". The difference being an
"Io_progress_handler" may be registered once during the lifetime of an
entrypoint to prevent arbitrary libraries from replacing a pending hook.

The "register_io_progress_handler" remains as a deprecated API, and is
now invoked for every I/O signal received and only for I/O signals
rather than for any signal.

Ref #3132
2019-03-18 15:56:22 +01:00
Christian Helmuth
a5d0f6a2af ada: fix ada-runtime-alis for current changes
Note, this also adapts the spark depot recipe to preserve source-file
time stamps.
2019-02-28 11:34:07 +01:00
2fa7964a39 VFS lwIP: fix TCP pbuf unchaining
The lwIP VFS plugin uses lwIP pbuf chains to queue recieved TCP data and
must rechain them when the application dequeues data. Remove an
"pbuf_realloc" call which is not needed for updating pbuf metadata when
dequeuing the head of the chain.

Fix #3169
2019-02-26 14:44:31 +01:00
Christian Prochaska
ee423e5bf1 qt5: remove deprecated APIs
Issue #3162
2019-02-26 14:38:03 +01:00
Josef Söntgen
5bab5f4cca libc: extent vbox specific pthread_create API
Make it possible to adopt normal Genode::Threads for use within in a
pthread environment.

Issue #3164.
2019-02-19 11:12:13 +01:00
Christian Prochaska
fb18e7e95d qt5: use 'qt_nanosleep()' for sleeping
Fixes #3162
2019-02-19 11:12:12 +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
38ab456c78 Remove pointers from Genode::Fifo interface
Replace methods of Genode::Fifo returning pointers with methods which
call lambdas with references.

Ref #3135
2019-02-19 11:08:17 +01:00
Christian Prochaska
db9ff821a2 libc: sync 'listen' socket fs control file
Fixes #3124
2019-02-12 10:33:14 +01:00
Christian Prochaska
342ddcf71a libsanitizer: replace use of 'Genode::printf()'
Fixes #3129
2019-01-30 13:49:55 +01:00
Norman Feske
6154d9067e libports: avoid using deprecated APIs
Issue #1987
Issue #3125
2019-01-30 13:49:55 +01:00
Norman Feske
8cc11d6cc6 libc_terminal: remove use of deprecated APIs
Issue #1987
2019-01-30 13:49:54 +01:00
Norman Feske
d7e552a169 libusb: remove use of deprecated APIs
Issue #1987
2019-01-30 13:49:53 +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
e8ea28d897 socket fs: support non-blocking 'connect()'
Fixes #3113
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
Norman Feske
bf62d6b896 Move timer from os to base repository
Since the timer and timeout handling is part of the base library (the
dynamic linker), it belongs to the base repository.

Besides moving the timer and its related infrastructure (alarm, timeout
libs, tests) to the base repository, this patch also moves the timer
from the 'drivers' subdirectory directly to 'src' and disamibuates the
timer's build locations for the various kernels. Otherwise the different
timer implementations could interfere with each other when using one
build directory with multiple kernels.

Note that this patch changes the include paths for the former os/timer,
os/alarm.h, os/duration.h, and os/timed_semaphore.h to base/.

Issue #3101
2019-01-14 12:33:57 +01:00
Josef Söntgen
f113460348 Move FUSE to world
Fixes #3104.
2019-01-07 12:43:37 +01:00
Norman Feske
39085f08fc Move libav, avplay, and qt_avplay to genode-world
Fixes #3103
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
Josef Söntgen
c58ad11f2f libports: update OpenSSL to 1.0.2q
And enable SSL_CONF_* in libssl, needed by lighttpd's mod_openssl.

Issue #3069.
2019-01-07 12:33:54 +01:00
Christian Prochaska
c2884a6e63 libports: libubsan and libsanitizer_common
Issue #3072
2019-01-07 12:33:54 +01:00
bd53e5b496 VFS lwIP: send application data immediately
Call 'tcp_output' if application data has been successfully queued. This
sends data immediately that may otherwise remain queued until the next
periodic TCP timer event.

This reverts a change made in 3e31e2ba53.

Fix #3067
2019-01-07 12:25:46 +01:00
Christian Prochaska
97d8bea5ec gcov: print selected annotated source files only
Fixes #3070
2019-01-07 12:25:46 +01:00
Christian Helmuth
8236a18260 Revert "Use strictly-typed Microseconds for Libc timeout scheduling"
This reverts commit 4808565a28afe9ff248fb5c98aceb6f8d3e791c1.
2019-01-07 12:25:44 +01:00
Christian Prochaska
ac8d030855 gcov: open files in buffered mode
Fixes #3065
2019-01-07 12:25:43 +01:00
5c2599e24e Remove 'clock()' implementation, print warning
FreeBSD implements 'clock' with an accuracy of 128 ticks-per-second for
compatibility reasons, Linux uses 1000000 per-second. Remove 'clock' and
print an error because it is unlikely that this is the resolution
expected by the application.

Fix #3057
2019-01-07 12:25:43 +01:00
8a3b0ebea9 Use strictly-typed Microseconds for Libc timeout scheduling
Fix #3050
2019-01-07 12:25:42 +01:00
Sebastian Sumpf
d3dbdae395 libc: add SO_LINGER and TCP_NODELY to socket fs plugin
issue #3060
2018-11-29 11:54:30 +01:00
2d17af9f28 Libc: use caller integer width for return value of sysctl PHYSMEM
Return a value in the same width as provided by the caller of sysctl for
PHYSMEM and USERMEM. This is to ensure that if a caller provides a
64-bit integer, a 64-bit value will be returned for 32-bit machines.

issue #3060
2018-11-29 11:54:29 +01:00
Sebastian Sumpf
91225fbcca qt5: forward window title to nitpicker
This enables Qt5 applications to set a Genode label via 'setWindowTitle'
from within Qt5 applications, and thus, making them identifiable to
other Genode components, like a layout manager.

fixes #3046
2018-11-29 11:54:29 +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
Christian Prochaska
e74771e047 libports: add libgcov and gcov tool
Issue #3048
2018-11-29 11:46:01 +01:00
Ben Larson
cde542c37c libc: read whole file into buffer
Fix #3023
2018-11-27 11:36:36 +01:00
Johannes Kliemann
eb7c367e25 ada: replace local runtime implementation with port
Fixes #3044
2018-11-27 11:36:36 +01:00