Commit Graph

60 Commits

Author SHA1 Message Date
590f51dbe1 dde_linux: Build net/ipv4/datagram.c for UDP connect
Fix #2683
2018-02-28 11:01:32 +01:00
Christian Helmuth
d5518aa938 lib/vfs/lxip: support configuration of MTU
The MTU can be set via the "mtu" attribute like follows.

  <vfs> <lxip mtu="1200" dhcp="yes"/> </vfs>
2017-11-30 11:23:18 +01:00
Christian Helmuth
64c8b06377 dde_linux: fix mod_delayed_work(delay)
'delay' is a relative timeout while mod_timer() needs an absolute point
in time.
2017-11-30 11:23:17 +01:00
Martin Stein
ea76b08f9f lib/vfs/lxip: provide nic link state in a file 2017-11-30 11:23:17 +01:00
Stefan Kalkowski
83a88d46b7 dde_linux: remove timer optimization
Instead of storing whether the first item in the timeout list was already
programmed using the timer service, just program the first timeout in the
list unconditionally. In the past we lost a timeout at least when using the
usb ethernet driver on hw/arndale sporadically.
2017-11-30 11:23:01 +01:00
Christian Helmuth
7b9edcf90c lxip: fix timer deletion and modification
Linux del_timer() and mod_timer() return if the timer was pending before
the modification. Additionally, these functions are potentially called
from handler function of the timer to modify and, therefore, checking
for timeout != INVALID_TIMEOUT is not sufficient as the timeout is
indeed valid when the handler is executed.
2017-10-05 17:40:03 +02:00
Christian Helmuth
9ff82d76c0 lxip: fix timer handling and jiffies update 2017-10-05 17:40:03 +02:00
Christian Helmuth
a431657851 lxip: correct msghdr initialization 2017-05-31 13:16:21 +02:00
Josef Söntgen
5b6735e1c9 lxip: fix iovec iter operations 2017-05-31 13:16:15 +02:00
Martin Stein
c70fed29f7 os/timer: interpolate time via timestamps
Previously, the Genode::Timer::curr_time always used the
Timer_session::elapsed_ms RPC as back end.  Now, Genode::Timer reads
this remote time only in a periodic fashion independently from the calls
to Genode::Timer::curr_time. If now one calls Genode::Timer::curr_time,
the function takes the last read remote time value and adapts it using
the timestamp difference since the remote-time read. The conversion
factor from timestamps to time is estimated on every remote-time read
using the last read remote-time value and the timestamp difference since
the last remote time read.

This commit also re-works the timeout test. The test now has two stages.
In the first stage, it tests fast polling of the
Genode::Timer::curr_time. This stage checks the error between locally
interpolated and timer-driver time as well as wether the locally
interpolated time is monotone and sufficiently homogeneous. In the
second stage several periodic and one-shot timeouts are scheduled at
once. This stage checks if the timeouts trigger sufficiently precise.

This commit adds the new Kernel::time syscall to base-hw. The syscall is
solely used by the Genode::Timer on base-hw as substitute for the
timestamp. This is because on ARM, the timestamp function uses the ARM
performance counter that stops counting when the WFI (wait for
interrupt) instruction is active. This instruction, however is used by
the base-hw idle contexts that get active when no user thread needs to
be scheduled.  Thus, the ARM performance counter is not a good choice for
time interpolation and we use the kernel internal time instead.

With this commit, the timeout library becomes a basic library. That means
that it is linked against the LDSO which then provides it to the program it
serves. Furthermore, you can't use the timeout library anymore without the
LDSO because through the kernel-dependent LDSO make-files we can achieve a
kernel-dependent timeout implementation.

This commit introduces a structured Duration type that shall successively
replace the use of Microseconds, Milliseconds, and integer types for duration
values.

Open issues:

* The timeout test fails on Raspberry PI because of precision errors in the
  first stage. However, this does not render the framework unusable in general
  on the RPI but merely is an issue when speaking of microseconds precision.

* If we run on ARM with another Kernel than HW the timestamp speed may
  continuously vary from almost 0 up to CPU speed. The Timer, however,
  only uses interpolation if the timestamp speed remained stable (12.5%
  tolerance) for at least 3 observation periods. Currently, one period is
  100ms, so its 300ms. As long as this is not the case,
  Timer_session::elapsed_ms is called instead.

  Anyway, it might happen that the CPU load was stable for some time so
  interpolation becomes active and now the timestamp speed drops. In the
  worst case, we would now have 100ms of slowed down time. The bad thing
  about it would be, that this also affects the timeout of the period.
  Thus, it might "freeze" the local time for more than 100ms.

  On the other hand, if the timestamp speed suddenly raises after some
  stable time, interpolated time can get too fast. This would shorten the
  period but nonetheless may result in drifting away into the far future.
  Now we would have the problem that we can't deliver the real time
  anymore until it has caught up because the output of Timer::curr_time
  shall be monotone. So, effectively local time might "freeze" again for
  more than 100ms.

  It would be a solution to not use the Trace::timestamp on ARM w/o HW but
  a function whose return value causes the Timer to never use
  interpolation because of its stability policy.

Fixes #2400
2017-05-31 13:16:11 +02:00
Christian Helmuth
1d99e7ede9 base: classify signals as I/O and application level
Fixes #2363
2017-05-31 13:15:58 +02:00
Christian Helmuth
88db3c0df7 Fix some deprecated warnings
Issue #1987
2017-03-24 16:20:03 +01:00
Norman Feske
29b8d609c9 Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
Josef Söntgen
a2cff03539 dde_linux: remove usage of deprecated env()
Fixes #2280.
2017-02-28 12:59:17 +01:00
Christian Helmuth
1f29e1854a lxip: poll_does_not_wait() for non-blocking API 2017-02-27 15:37:50 +01:00
Sebastian Sumpf
3048017d90 lxip: schedule timeout + poll wait
* poll_wait + schedule_timeout +  block on wait_and_dispatch_one_signal
2017-02-23 14:54:50 +01:00
Christian Prochaska
2d700d0b2d lxip: return zero-initialized memory in '__alloc_percpu()' 2017-02-23 14:54:49 +01:00
Christian Prochaska
59f38fe38c lxip: implement 'rt_genid_ipv4()' and "rt_genid_bump_ipv4()' 2017-02-23 14:54:49 +01:00
Sebastian Sumpf
b8b34efef9 lxip: dhcp update on link state change 2017-02-23 14:54:49 +01:00
Christian Prochaska
a1453d83ff lxip: network reconfiguration support 2017-02-23 14:54:48 +01:00
Christian Prochaska
8025f5f570 lxip: allow network reconfiguration
This commit adds the public functions 'lxip_configure_static()' and
'lxip_configure_dhcp()' for reconfiguring the network.
2017-02-23 14:54:48 +01:00
Christian Prochaska
c5b58a2df4 lxip: implement more needed functions
- rtnl_notify()
- round_jiffies()
- round_jiffies_relative()
- round_jiffies_up()
- schedule_delayed_work()

Fixes #2261
2017-02-23 14:54:47 +01:00
Christian Prochaska
8fcfcbce0e lxip: implement 'mod_delayed_work()'
Fixes #2258
2017-02-23 14:54:47 +01:00
Sebastian Sumpf
6f5c839df7 lxip/libc_lxip: adjust to new Genode API 2017-02-23 14:54:46 +01:00
Sebastian Sumpf
549c6db064 lxip: restore entrypoints + remove sig_rec 2017-02-23 14:54:46 +01:00
Norman Feske
25a7ea3d40 base: rename 'Volatile_object' to 'Reconstructible'
Fixes #2151
2016-12-01 17:46:50 +01:00
Christian Helmuth
4bc34f73f3 lxip: provide strncpy and strstr (for ipconfig) 2016-12-01 16:39:47 +01:00
Josef Söntgen
ca3be471a9 lxip: get_random_once must be called once 2016-11-25 15:27:28 +01:00
Josef Söntgen
d647b6c797 lxip: use xoroshiro128+ as random backend 2016-11-25 15:27:28 +01:00
Martin Stein
79bc0ab789 dde_linux/src/lib/lxip/: fix warning with Cstring 2016-08-29 17:29:38 +02:00
Norman Feske
17c79a9e23 base: avoid use of deprecated base/printf.h
Besides adapting the components to the use of base/log.h, the patch
cleans up a few base headers, i.e., it removes unused includes from
root/component.h, specifically base/heap.h and
ram_session/ram_session.h. Hence, components that relied on the implicit
inclusion of those headers have to manually include those headers now.

While adjusting the log messages, I repeatedly stumbled over the problem
that printing char * arguments is ambiguous. It is unclear whether to
print the argument as pointer or null-terminated string. To overcome
this problem, the patch introduces a new type 'Cstring' that allows the
caller to express that the argument should be handled as null-terminated
string. As a nice side effect, with this type in place, the optional len
argument of the 'String' class could be removed. Instead of supplying a
pair of (char const *, size_t), the constructor accepts a 'Cstring'.
This, in turn, clears the way let the 'String' constructor use the new
output mechanism to assemble a string from multiple arguments (and
thereby getting rid of snprintf within Genode in the near future).

To enforce the explicit resolution of the char * ambiguity, the 'char *'
overload of the 'print' function is marked as deleted.

Issue #1987
2016-08-29 17:27:10 +02:00
Christian Prochaska
4949f3abba dde_linux: '__wait_event()' fix
Fixes #2054
2016-08-29 17:23:19 +02:00
Sebastian Sumpf
d48219138c usb: transition to the new base API
* remove all 'Genode::env()' calls
* use attached roms to read configuration
* use compoenent framework
* remove all PDBG, PINF, PWRN macros

Issue #1987
Fixes #2019
2016-06-28 11:09:25 +02:00
Christian Helmuth
470757cf15 lxip: implement ffz() with __ffs()
Unfortunately, ffs() returns bit positions starting at 1 while ffz()
needs the semantics of __ffs(), which starts bit positions at zero.
2016-06-22 12:17:17 +02:00
Christian Helmuth
49f7d02f80 lxip: add missing memmove() to emulation library 2016-06-10 14:46:01 +02:00
Josef Söntgen
bcefc874d6 dde_linux: update lxip to 4.4.3
Issue #1974.
2016-05-26 15:54:11 +02:00
Josef Söntgen
0106045bad lx_kit: add modular lx_emul backend
The modular lx_kit seperates the required back end functionality of the
Linux emulation environment from the front end. Thereby each driver can
reuse specific parts or supply more suitable implementations by itself.
It is used to reduce the amount of redundant code in each driver.

The lx_kit is split into several layers whose structure is as follows:

The first layer in _repos/dde_linux/src/include/lx_emul_ contains those
header files that provide the structural definitions and function
declarations of the Linux API, e.g. _errno.h_ provides all error code
values. The second layer in _repos/dde_linux/src/include/lx_emul/impl_
contains the implementation of selected functions, e.g. _slab.h_
provides the implementation of 'kmalloc()'. The lx_kit back end API is
the third layer and provides the _Lx::Malloc_ interface
(_repos/dde_linux/src/include/lx_kit/malloc.h_) which is used to
implement 'kmalloc()'. There are several generic implementations of the
lx_kit interfaces that can be used by a driver.

A driver typically includes a 'lx_emul/impl/xyz.h' header once
directly in its lx_emul compilation unit. The lx_kit interface files
are only included in those compilation units that use or implement the
interface. If a driver wants to use a generic implementation it must
add the source file to its source file list. The generic
implementations are located in _repos/dde_linux/src/lx_kit/_.

The modular lx_kit still depends on the private _lx_emul.h_ header file
that is tailored to each driver. Since the lx_kit already contains much
of the declarations and definitions that were originally placed in
these private header files, those files can now ommit a large amount
of code.

Fixes #1974.
2016-05-26 15:54:10 +02:00
Norman Feske
fd401bdf53 Thread API cleanup
This patch cleans up the thread API and comes with the following
noteworthy changes:

- Introduced Cpu_session::Weight type that replaces a formerly used
  plain integer value to prevent the accidental mix-up of
  arguments.
- The enum definition of Cpu_session::DEFAULT_WEIGHT moved to
  Cpu_session::Weight::DEFAULT_WEIGHT
- New Thread constructor that takes a 'Env &' as first argument.
  The original constructors are now marked as deprecated. For the
  common use case where the default 'Weight' and 'Affinity' are
  used, a shortcut is provided. In the long term, those two
  constructors should be the only ones to remain.
- The former 'Thread<>' class template has been renamed to
  'Thread_deprecated'.
- The former 'Thread_base' class is now called 'Thread'.
- The new 'name()' accessor returns the thread's name as 'Name'
  object as centrally defined via 'Cpu_session::Name'. It is meant to
  replace the old-fashioned 'name' method that takes a buffer and size
  as arguments.
- Adaptation of the thread test to the new API

Issue #1954
2016-05-23 15:49:55 +02:00
Norman Feske
511acad507 Consolidate RM service into PD session
This patch integrates three region maps into each PD session to
reduce the session overhead and to simplify the PD creation procedure.
Please refer to the issue cited below for an elaborative discussion.

Note the API change:

With this patch, the semantics of core's RM service have changed. Now,
the service is merely a tool for creating and destroying managed
dataspaces, which are rarely needed. Regular components no longer need a
RM session. For this reason, the corresponding argument for the
'Process' and 'Child' constructors has been removed.

The former interface of the 'Rm_session' is not named 'Region_map'. As a
minor refinement, the 'Fault_type' enum values are now part of the
'Region_map::State' struct.

Issue #1938
2016-05-09 13:10:51 +02:00
Christian Helmuth
da0c467518 Deallocation in slab backend of ported drivers 2016-04-25 10:48:03 +02:00
Christian Helmuth
642ce6ca77 lxip: correct return type in send/recv socketcall
Now, error cases are reported correctly and not as gigantic ssize_t
values on 64-bit.
2016-04-25 10:48:01 +02:00
Norman Feske
fbc35cb796 base: hide slab implementation details from API
Issue #1908
2016-04-25 10:47:56 +02:00
Stefan Kalkowski
b84a47b4db lxip: do not poll for nic session signals
Instead of polling for new Nic session signals, when waiting for
network packets with a timeout, block on the signal receiver, and
register a timer event beforehand using the same signal receiver.

Fix #1862
Ref #1864
2016-01-26 16:20:47 +01:00
Adrian-Ken Rueegsegger
c2ff0ae9d4 Minor cleanup fixes
- Fix spelling errors
- Remove extra semicolons
- Remove extra spaces

Fixes #1650
2015-08-21 11:00:59 +02:00
Christian Helmuth
49333bafc2 lxip: do not whine on kfree(0) 2015-07-01 14:46:18 +02:00
Sebastian Sumpf
146b34bf40 lxip: remove dde_kit
issue #1565
2015-06-22 14:43:33 +02:00
Norman Feske
eaab23c012 base: const-correctness of Allocator interface
This patch adds const qualifiers to the functions Allocator::consumed,
Allocator::overhead, Allocator::avail, and Range_allocator::valid_addr.

Fixes #1481
2015-04-17 16:13:22 +02:00
Norman Feske
560a58e5c6 Move packet stream to Genode namespace, fix #1455 2015-03-19 08:57:22 +01:00
Sebastian Sumpf
6d2c697da1 lxip: Fix timeout handling for 'schedule_timeout'
Up until now 'schedule_timeout' did only wait for the next signal to occur.
However, we might run into situations where there won't occur signals for longer
periods of time. Therefore, we took care of the respective timeout handling.

This commit also adds Genode's tracing support

Issue #1310
2015-02-16 13:40:34 +01:00
Sebastian Sumpf
15a379894a lxip: Fix on OKL4
This has been broken for a while now. Use correct (global) signal transmission,
do not use local signal transmission, as signals seems to get lost.

Issue #1310
2015-01-26 12:28:42 +01:00