Commit Graph

95 Commits

Author SHA1 Message Date
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
Norman Feske
5f1f67153b Xml_node: safe alternatives to unsafe accessors
Issue #3125
2019-01-30 13:49:54 +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
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
Christian Prochaska
a5547e5b1d base: improve floating point output
Fixes #2876
2019-01-07 12:33:54 +01:00
Christian Prochaska
9c8e76b190 base: 'sanitizer' test
Issue #3072
2019-01-07 12:33:54 +01:00
Stefan Kalkowski
34480c9269 test-rm_fault: use ld.lib.so to test read-only mem
Due to the changing environment this test is executed (like depot_autopilot)
the binary test-rm_fault used to check ROM dataspace's read-only property
does not suit anymore. This commit changes the binary to ld.lib.so that is
normally still provided as a ROM dataspace.

Ref #3027
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
Christian Prochaska
fe322b8e82 test-xml_generator: enable code coverage analysis
Issue #3048
2018-11-29 11:46:01 +01:00
Martin Stein
abd3855161 test/rm_nested: fix EP double dissolve
Fixes #3045
2018-11-27 11:36:35 +01:00
Stefan Kalkowski
a062ba6dd2 base: add tlb shootdown test metric to smp test
Fix #3041
2018-11-27 11:36:35 +01:00
Stefan Kalkowski
36fe50ebad base: unify mp_server and affinity test
* remove outdated cpufreq test for Arndale
* execute new SMP test on hardware not in Qemu in nightly tests

Ref #3041
2018-11-27 11:36:35 +01:00
Martin Stein
4e29c1ca40 test/xml_node: move to base 2018-11-16 14:37:19 +01:00
Martin Stein
ed1cec2efa test/xml_generator: move to base 2018-11-16 14:37:19 +01:00
Martin Stein
510d7644fa test/weak_ptr: move to os/ as it uses a timer 2018-11-16 14:37:19 +01:00
Martin Stein
0b8ea50589 test/slab: move to os/ as it uses timer driver 2018-11-16 14:37:19 +01:00
Martin Stein
0eef5b506c test-util_mmio: rename test-mmio 2018-11-16 14:37:19 +01:00
Martin Stein
590dc1ac59 test/util_mmio: simplify success conditions 2018-11-16 14:37:19 +01:00
Martin Stein
f439cf0de1 test/rm_nested: destroy all objects before finish
Explicit destruction of test objects (esp. RM connection) tests for
regressions in the service life-time implementation.

Issue #3012
2018-11-16 14:37:19 +01:00
Alexander Boettcher
5446c52c43 base: make Entrypoint placeable on specific cpu
Fixes #3008
2018-10-29 09:36:22 +01:00
Alexander Boettcher
b8cc468f02 base: support assignment of invalid weak_ptr
This fixes the region-map component implementation in core, which uses a
'Genode::Weak_ptr<Genode::Region_map_component> _faulting_region_map'
member. This member is assigned a valid weak_ptr or an invalid weak_ptr
according to the state machine.

Fixes #3012
2018-10-29 09:36:22 +01:00
Norman Feske
c270e4fb30 base: exception safety during registry iteration
This patch fixes a problem in the non-const 'for_each' method of the
'Registry' data structure. If an exception was thrown from within the
functor of the 'for_each' operation, the not yet processed items of the
registry were dropped from the registry, which is not expected.
2018-08-28 17:10:54 +02:00
Christian Prochaska
1d3ec6f0ae Test successive thread creation and destruction
Fixes #2887
2018-07-03 09:39:34 +02:00
Alexander Boettcher
30d004ab64 base: extend rm_nested test 2018-05-31 12:28:16 +02:00
Alexander Boettcher
e6d20aba93 base: support to attach RAM dataspaces readonly
Fixes #1633
2018-05-30 13:36:27 +02:00
Johannes Kliemann
1261c18ce9 ada: runtime and library support
The Ada runtime can now be set with the ADA_RTS variable. The ada
library builds a (currently) minimal runtime from the gcc sources that
come with Genode (to stay consistent with the used compiler) and sets
the runtime path accordingly. It is build as a shared library ada.lib.so
which needs to be added to the build files.

I split the existing Ada test into program and library, and moved it
to libports as it depends on the runtime library residing in this
repository too.

Fixes #2748
2018-04-19 12:38:54 +02:00
Norman Feske
eba9c15746 Follow practices suggested by "Effective C++"
The patch adjust the code of the base, base-<kernel>, and os repository.
To adapt existing components to fix violations of the best practices
suggested by "Effective C++" as reported by the -Weffc++ compiler
argument. The changes follow the patterns outlined below:

* A class with virtual functions can no longer publicly inherit base
  classed without a vtable. The inherited object may either be moved
  to a member variable, or inherited privately. The latter would be
  used for classes that inherit 'List::Element' or 'Avl_node'. In order
  to enable the 'List' and 'Avl_tree' to access the meta data, the
  'List' must become a friend.

* Instead of adding a virtual destructor to abstract base classes,
  we inherit the new 'Interface' class, which contains a virtual
  destructor. This way, single-line abstract base classes can stay
  as compact as they are now. The 'Interface' utility resides in
  base/include/util/interface.h.

* With the new warnings enabled, all member variables must be explicitly
  initialized. Basic types may be initialized with '='. All other types
  are initialized with braces '{ ... }' or as class initializers. If
  basic types and non-basic types appear in a row, it is nice to only
  use the brace syntax (also for basic types) and align the braces.

* If a class contains pointers as members, it must now also provide a
  copy constructor and assignment operator. In the most cases, one
  would make them private, effectively disallowing the objects to be
  copied. Unfortunately, this warning cannot be fixed be inheriting
  our existing 'Noncopyable' class (the compiler fails to detect that
  the inheriting class cannot be copied and still gives the error).
  For now, we have to manually add declarations for both the copy
  constructor and assignment operator as private class members. Those
  declarations should be prepended with a comment like this:

        /*
         * Noncopyable
         */
        Thread(Thread const &);
        Thread &operator = (Thread const &);

  In the future, we should revisit these places and try to replace
  the pointers with references. In the presence of at least one
  reference member, the compiler would no longer implicitly generate
  a copy constructor. So we could remove the manual declaration.

Issue #465
2018-01-17 12:14:35 +01:00
Christian Helmuth
1b4128d3d9 Adapt sub_rm test to current Linux 32-bit
As noted above the former enum for the local-attachment address we
discovered address clashes on current Linux installations, esp. 32-bit
runtime on 64-bit Linux. The local_attach_addr is now configurable in
the run script and the memory maps heuristics were removed.
2017-11-06 13:57:23 +01:00
Alexander Boettcher
03b8e70d3f rm_fault: add fault test for exec access violation
Issue #1723
2017-10-20 11:45:21 +02:00
Christian Helmuth
0da420c104 Limit max string length in log session for okl4
This commit also adds a test to test-log.
2017-10-19 13:31:16 +02:00
Johannes Kliemann
d3f5a369a7 ada: implemented add in ada
Fixes #2515
2017-10-05 17:39:55 +02:00
Alexander Boettcher
5aab244ce3 sub_rm.run: use config rom for steering test
instead of compile time config enums.
2017-08-18 10:24:47 +02:00
Christian Helmuth
132748a783 Fix location setting in affinity test
This fixes a regression introduced by me in
16914bddc8.
2017-08-17 11:04:22 +02:00
Alexander Boettcher
0743ea87ed rm_fault.run: check for write faults on ROM
Issue #2451
2017-08-17 11:04:21 +02:00
Christian Helmuth
019528ee6a Disable lock tests on platforms without priorities
The implementations of the lock and C++ guards tests depend on
thread-execution priorities, which produces false negatives of the whole
thread test on platforms without priority support.
2017-06-29 11:59:49 +02:00
Christian Helmuth
d5b85da8de Prevent warning about tiny stack in weak_ptr test 2017-06-19 12:35:57 +02:00
Christian Helmuth
5e1fb42b54 Fix warnings in ADA example 2017-06-02 15:58:22 +02:00
Christian Helmuth
8bd0efced6 Remove obsolete RAM/CAP services from run scripts
Adapted launchpad and also the rm_fault and resource_request tests.

Issue #2407
2017-05-31 13:16:22 +02:00
Norman Feske
0167d5af50 Integrate core's RAM service into the PD service
Fixes #2407
2017-05-31 13:16:14 +02:00
Norman Feske
4d442bca30 Streamline exception types
This patch reduces the number of exception types by facilitating
globally defined exceptions for common usage patterns shared by most
services. In particular, RPC functions that demand a session-resource
upgrade not longer reflect this condition via a session-specific
exception but via the 'Out_of_ram' or 'Out_of_caps' types.

Furthermore, the 'Parent::Service_denied', 'Parent::Unavailable',
'Root::Invalid_args', 'Root::Unavailable', 'Service::Invalid_args',
'Service::Unavailable', and 'Local_service::Factory::Denied' types have
been replaced by the single 'Service_denied' exception type defined in
'session/session.h'.

This consolidation eases the error handling (there are fewer exceptions
to handle), alleviates the need to convert exceptions along the
session-creation call chain, and avoids possible aliasing problems
(catching the wrong type with the same name but living in a different
scope).
2017-05-31 13:16:07 +02:00
Norman Feske
1f4f119b1e Capability quota accounting and trading
This patch mirrors the accounting and trading scheme that Genode employs
for physical memory to the accounting of capability allocations.

Capability quotas must now be explicitly assigned to subsystems by
specifying a 'caps=<amount>' attribute to init's start nodes.
Analogously to RAM quotas, cap quotas can be traded between clients and
servers as part of the session protocol. The capability budget of each
component is maintained by the component's corresponding PD session at
core.

At the current stage, the accounting is applied to RPC capabilities,
signal-context capabilities, and dataspace capabilities. Capabilities
that are dynamically allocated via core's CPU and TRACE service are not
yet covered. Also, the capabilities allocated by resource multiplexers
outside of core (like nitpicker) must be accounted by the respective
servers, which is not covered yet.

If a component runs out of capabilities, core's PD service prints a
warning to the log. To observe the consumption of capabilities per
component in detail, the PD service is equipped with a diagnostic
mode, which can be enabled via the 'diag' attribute in the target
node of init's routing rules. E.g., the following route enables the
diagnostic mode for the PD session of the "timer" component:

  <default-route>
    <service name="PD" unscoped_label="timer">
      <parent diag="yes"/>
    </service>
    ...
  </default-route>

For subsystems based on a sub-init instance, init can be configured
to report the capability-quota information of its subsystems by
adding the attribute 'child_caps="yes"' to init's '<report>'
config node. Init's own capability quota can be reported by adding
the attribute 'init_caps="yes"'.

Fixes #2398
2017-05-31 13:16:06 +02:00
Norman Feske
58f44d39c5 base: use 'Ram_quota' in 'Ram_session' args
This patch replaces the former use of size_t with the use of the
'Ram_quota' type to improve type safety (in particular to avoid
accidentally mixing up RAM quotas with cap quotas).

Issue #2398
2017-05-31 13:16:04 +02:00
Norman Feske
c1b981ede4 Annotate session interfaces with CAP_QUOTA
The new 'CAP_QUOTA' enum value denotes the capability quota to be
transferred from the client to the server at session-creation time.

Issue #2398
2017-05-31 13:16:04 +02:00
Christian Prochaska
58f2088d3e gcc: update to version 6.3.0
Issue #2372
2017-05-31 13:15:49 +02:00
Alexander Boettcher
1c79ba4182 slab: detect corrupted slab and invalid frees
and report about that.

Fixes #2350
2017-05-02 15:28:54 +02:00
Alexander Boettcher
16e6533a0a base: extend thread test to test cxa guards
with various priorities.

Showcases issue #2299
2017-03-15 12:24:45 +01:00
Alexander Boettcher
8102b78d22 base: extend thread test to test locks
Showcase issue #2300
2017-03-15 12:24:42 +01:00
Norman Feske
29b8d609c9 Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
Alexander Boettcher
dd5592cc50 Fix String(Hex()) usage
- additional add test casye to log.run

Fixes #2265
2017-01-31 12:02:21 +01:00