genode/repos/libports/lib/mk
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
..
spec libc: enhance quirk for building libc-gen on ARM 2017-05-02 15:29:04 +02:00
acpica.mk Adapt high-level components to new parent API 2016-11-30 13:37:03 +01:00
av.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
avcodec.inc libav: improve port check 2017-03-15 12:32:27 +01:00
avfilter.mk libav: improve port check 2017-03-15 12:32:27 +01:00
avformat.mk libav: improve port check 2017-03-15 12:32:27 +01:00
avresample.mk libav: improve port check 2017-03-15 12:32:27 +01:00
avutil.inc libav: improve port check 2017-03-15 12:32:27 +01:00
builtins-rust.mk Fixed linking and memory allocation for rust 2016-05-23 15:49:56 +02:00
ccid.mk libports: add CCID library 2016-11-08 15:26:28 +01:00
curl.inc libports: enable curl on arm 2014-05-27 11:14:45 +02:00
expat.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
ffat_block.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
freetype.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
fribidi.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
gallium-aux.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
gallium-egl.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
gallium-failover.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
gallium-i915.mk Remove superfluous 'cxx' from LIBS in target.mk 2017-05-02 15:28:53 +02:00
gallium-identity.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
gallium-softpipe.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
gallium-trace.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
gallium.inc Remove superfluous 'cxx' from LIBS in target.mk 2017-05-02 15:28:53 +02:00
gallium.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
gmp-mpf.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
gmp-mpq.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
gmp-mpz.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
gmp.inc libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
gmp.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
history.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
icu.mk gcc: update to version 6.3.0 2017-05-31 13:15:49 +02:00
jbig2dec.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
jitterentropy.inc Enforce building jitterentropy library with -O0 2017-01-31 12:01:13 +01:00
jpeg.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
liballoc_system-rust.mk Move rust support to libports 2016-05-23 15:52:38 +02:00
liballoc-rust.mk Added rust support 2016-03-17 17:02:04 +01:00
libbz2.mk libports: libbz2 (Bzip2) 2015-01-20 11:23:52 +01:00
libc_ffat.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc_fuse_exfat.mk vfs: pass Env and allocator when creating file-systems 2016-11-08 15:26:31 +01:00
libc_fuse_ext2.mk vfs: pass Env and allocator when creating file-systems 2016-11-08 15:26:31 +01:00
libc_fuse_ntfs-3g.mk vfs: pass Env and allocator when creating file-systems 2016-11-08 15:26:31 +01:00
libc_fuse.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
libc_lwip_loopback.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
libc_lwip_nic_dhcp.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
libc_lwip.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
libc_pipe.mk libc: pipe plugin 2016-05-23 15:52:35 +02:00
libc_resolv.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
libc_terminal.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
libc-common.inc vfs: use 64bit for file offset and size 2014-10-10 13:02:28 +02:00
libc-compat.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-gdtoa.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-gen.inc libc: read sysctl info from /.sysctl/... 2016-05-09 13:09:56 +02:00
libc-inet.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-isc.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-locale.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-mem.mk Generalize ABI mechanism to shared objects 2017-01-13 13:06:54 +01:00
libc-nameser.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-net.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-regex.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-resolv.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-rpc.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-stdio.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-stdlib.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-stdtime.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc-string.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libc.mk os/timer: interpolate time via timestamps 2017-05-31 13:16:11 +02:00
libcollections-rust.mk Added rust support 2016-03-17 17:02:04 +01:00
libcore-rust.mk Fixed linking and memory allocation for rust 2016-05-23 15:49:56 +02:00
libcrypto.inc libcrypto: remove redundant ) from .mk 2015-05-26 09:39:52 +02:00
libdrm.mk Remove superfluous 'cxx' from LIBS in target.mk 2017-05-02 15:28:53 +02:00
libexfat.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libext2fs.mk fuse_ext2: build with '-std=gnu89' 2017-05-31 13:15:51 +02:00
libfuse.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
libiconv.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
liblibc-rust.mk Generalize ABI mechanism to shared objects 2017-01-13 13:06:54 +01:00
libm.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libntfs-3g.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
libpng.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
librand-rust.mk Fixed linking and memory allocation for rust 2016-05-23 15:49:56 +02:00
librustc_unicode-rust.mk Added rust support 2016-03-17 17:02:04 +01:00
libssh.mk libports: update libssh to 0.7.2 2015-12-10 13:16:29 +01:00
libssl.inc libssl: use platform specific mk files 2014-08-22 16:16:41 +02:00
libunwind-rust.mk Move rust support to libports 2016-05-23 15:52:38 +02:00
libusb.mk libports: add libusb 2016-11-08 15:26:28 +01:00
libutil.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
lua.inc libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
lua.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
luacxx.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
lwip.mk lwip: use symbol.map to avoid clash with dns_init 2016-08-29 17:29:37 +02:00
mesa_host_tools.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
mesa-egl.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
mesa.inc Remove superfluous 'cxx' from LIBS in target.mk 2017-05-02 15:28:53 +02:00
mesa.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
mpc.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
mpfr.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
mupdf_host_tools.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
mupdf.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
ncurses.mk tool: remove deprecated 'make prepare' mechanism 2016-03-17 17:02:04 +01:00
openjpeg.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
pcre.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
pcsc-lite.mk libports: add pcsc-lite library 2016-11-08 15:26:29 +01:00
posix.mk Turn posix lib into shared library 2017-05-31 13:16:02 +02:00
pthread.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
python.inc libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
qemu-usb_include.mk Skip binary files in GEN_INCLUDES 2017-02-23 15:03:28 +01:00
qemu-usb.mk qemu-usb: xHCI model as library 2016-02-05 10:47:43 +01:00
qoost.mk qoost: call 'select_from_ports' in qoost.mk 2016-12-14 11:22:28 +01:00
qt5_core_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_core.mk qt5: remove launchpad-based 'QProcess' implementation 2016-11-25 15:27:26 +01:00
qt5_gui_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_gui.mk qt5: improve port check 2017-03-15 12:32:28 +01:00
qt5_host_tools_qmake.inc Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5_host_tools.inc Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5_host_tools.mk Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5_jscore_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_jscore.mk qt5: improve port check 2017-03-15 12:32:28 +01:00
qt5_network_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_network.mk Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5_printsupport_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_printsupport.mk Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5_qml_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_qml.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_qnitpickerviewwidget.mk Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5_qpa_nitpicker.mk qt5: add clipboard support 2015-11-09 13:17:56 +01:00
qt5_qpluginwidget.mk Qt5: set the parent view of a QPluginWidget's view 2014-06-26 10:57:25 +02:00
qt5_qtquick2plugin_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_qtquick2plugin.mk qt5: improve port check 2017-03-15 12:32:28 +01:00
qt5_quick_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_quick.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_script_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_script.mk Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5_scriptclassic_generated.inc Remove repos/qt4, fix #1451 2015-03-19 08:57:20 +01:00
qt5_scriptclassic.mk Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5_sql_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_sql.mk Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5_ui_tools_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_ui_tools.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_v8_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_v8.mk qt5: fix build errors with GCC 6 2017-05-31 13:15:51 +02:00
qt5_version.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_webcore_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_webcore.mk qt5: improve port check 2017-03-15 12:32:28 +01:00
qt5_webkit_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_webkit.mk Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5_webkitwidgets_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_webkitwidgets.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_widgets_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_widgets.mk Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5_wtf_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_wtf.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_xml_generated.inc Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
qt5_xml.mk Qt5: migrate to new ports mechanism 2014-08-22 16:16:40 +02:00
qt5.inc qt5: save generated source files in the contrib directory 2015-03-13 12:17:23 +01:00
readline.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
rust.inc Added rust support 2016-03-17 17:02:04 +01:00
sdl_image.mk libports/sdl_image: enable XPM, add include/SDL 2014-11-12 14:44:17 +01:00
sdl_mixer.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
sdl_net.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
sdl_ttf.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
sdl.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00
stdcxx-c++98.mk stdcxx: update to version 6.3.0 2017-05-31 13:15:50 +02:00
stdcxx.mk stdcxx: update to version 6.3.0 2017-05-31 13:15:50 +02:00
swscale.mk libav: improve port check 2017-03-15 12:32:27 +01:00
test-ldso_lib_1.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
test-ldso_lib_2.mk Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
test-ldso_lib_dl.mk base: Genode's dynamic linker 2014-11-12 14:44:15 +01:00
vfs_jitterentropy.mk libports: add vfs_jitterentropy library 2014-08-26 11:00:13 +02:00
x86emu.mk x86emu: prevent warnings about uninitialized vars 2015-05-26 09:39:51 +02:00
zlib.mk libports: migrate to new ports mechanism 2014-05-27 11:14:42 +02:00