2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
# C Library including string, locale
|
|
|
|
#
|
|
|
|
LIBS = libc-string libc-locale libc-stdlib libc-stdio libc-gen libc-gdtoa \
|
2017-09-14 19:00:36 +00:00
|
|
|
libc-inet libc-stdtime libc-regex libc-compat libc-setjmp libc-mem \
|
2019-04-26 10:47:33 +00:00
|
|
|
libc-resolv libc-isc libc-nameser libc-net libc-rpc libc-tzcode \
|
|
|
|
libc-libkern
|
2012-05-24 13:26:59 +00:00
|
|
|
|
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-04-21 22:52:23 +00:00
|
|
|
LIBS += base vfs
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Back end
|
|
|
|
#
|
2012-10-08 12:44:31 +00:00
|
|
|
SRC_CC = atexit.cc dummies.cc rlimit.cc sysctl.cc \
|
2024-08-30 13:39:29 +00:00
|
|
|
issetugid.cc errno.cc gai_strerror.cc time.cc alarm.cc \
|
2017-12-20 11:11:11 +00:00
|
|
|
malloc.cc progname.cc fd_alloc.cc file_operations.cc \
|
2019-04-26 10:47:33 +00:00
|
|
|
plugin.cc plugin_registry.cc select.cc exit.cc environ.cc sleep.cc \
|
2016-12-29 17:27:45 +00:00
|
|
|
pread_pwrite.cc readv_writev.cc poll.cc \
|
2019-08-12 14:28:29 +00:00
|
|
|
vfs_plugin.cc dynamic_linker.cc signal.cc \
|
2020-09-01 08:30:58 +00:00
|
|
|
socket_operations.cc socket_fs_plugin.cc syscall.cc \
|
2020-08-20 18:06:16 +00:00
|
|
|
getpwent.cc getrandom.cc fork.cc execve.cc kernel.cc component.cc \
|
2023-10-23 07:58:20 +00:00
|
|
|
genode.cc spinlock.cc
|
2014-04-24 10:40:18 +00:00
|
|
|
|
2018-11-21 16:17:25 +00:00
|
|
|
#
|
|
|
|
# Pthreads
|
|
|
|
#
|
|
|
|
SRC_CC += semaphore.cc rwlock.cc \
|
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-09-18 18:19:10 +00:00
|
|
|
pthread.cc pthread_create.cc
|
2018-11-21 16:17:25 +00:00
|
|
|
|
2019-04-26 10:47:33 +00:00
|
|
|
#
|
|
|
|
# FreeBSD headers use the C99 restrict keyword
|
|
|
|
#
|
|
|
|
CXX_DEF += -Drestrict=__restrict
|
|
|
|
|
|
|
|
#
|
|
|
|
# Extra include path for internal dummies
|
|
|
|
#
|
|
|
|
CC_OPT_dummies += -I$(LIBC_DIR)/sys
|
2016-04-15 12:19:51 +00:00
|
|
|
|
2014-04-24 10:40:18 +00:00
|
|
|
INC_DIR += $(REP_DIR)/src/lib/libc
|
2015-12-23 14:22:33 +00:00
|
|
|
INC_DIR += $(REP_DIR)/src/lib/libc/include
|
|
|
|
|
|
|
|
# needed for base/internal/unmanaged_singleton.h
|
|
|
|
INC_DIR += $(BASE_DIR)/src/include
|
2019-04-26 10:47:33 +00:00
|
|
|
INC_DIR += $(BASE_DIR)/sys
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Files from string library that are not included in libc-raw_string because
|
|
|
|
# they depend on the locale library.
|
|
|
|
#
|
|
|
|
SRC_C += strcoll.c strxfrm.c wcscoll.c wcsxfrm.c
|
|
|
|
|
|
|
|
include $(REP_DIR)/lib/mk/libc-common.inc
|
|
|
|
|
|
|
|
vpath % $(REP_DIR)/src/lib/libc
|
2014-05-07 21:52:52 +00:00
|
|
|
vpath % $(LIBC_DIR)/lib/libc/string
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Shared library, for libc we need symbol versioning
|
|
|
|
#
|
|
|
|
SHARED_LIB = yes
|
2019-04-26 10:47:33 +00:00
|
|
|
LD_OPT += --version-script=$(LIBC_DIR)/lib/libc/Versions.def
|