Commit Graph

87 Commits

Author SHA1 Message Date
Norman Feske b3727a9b46 Add missing override annotations
Issue #3159
2019-02-19 11:12:11 +01:00
Norman Feske 6b289a1423 base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:

* The contract between caller and callee becomes more obvious. When
  passing a reference, the contract says that the argument cannot be
  a null pointer. The caller is responsible to ensure that. Therefore,
  the use of reference eliminates the need to add defensive null-pointer
  checks at the callee site, which sometimes merely exist to be on the
  safe side. The bottom line is that the code becomes easier to follow.

* Reference members must be initialized via an object initializer,
  which promotes a programming style that avoids intermediate object-
  construction states. Within core, there are still a few pointers
  as member variables left though. E.g., caused by the late association
  of 'Platform_thread' objects with their 'Platform_pd' objects.

* If no pointers are present as member variables, we don't need to
  manually provide declarations of a private copy constructor and
  an assignment operator to avoid -Weffc++ errors "class ... has
  pointer data members [-Werror=effc++]".

This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.

Fixes #3135
2019-02-12 10:33:13 +01:00
Stefan Kalkowski 7f1692b3ca core: support unmap of managed dataspace generally
This commit solves several issues:

* correct calculation of overlap region when detaching regions
  in managed dataspaces
* prevent unmap of Fiasco.OC's core log buffer
* calculate the core-local address of regions in managed dataspaces
  if possible at all and use it to unmap on kernels where this is
  needed

Fix #976
Fix #3082
2019-01-07 12:33:56 +01:00
Alexander Boettcher a8ed11e75b sel4/arm: make alignment faults visible
Fixes #2993
2018-10-01 10:41:46 +02:00
Martin Stein 52a69b8a6f base-sel4: handle PTE selectors exceeded
In Vm_space::map when allocating a new page-table-entry selector, the
allocator may throw an exception that there are no selecztors left which
was not caught by now.  Now, we catch this exception, flush the mapping
cache to free all selectors again and retry to allocate.

Fixes #2781
2018-05-03 15:31:22 +02:00
Hinnerk van Bruinehsen 2278104a8d sel4: update to version 9.0.0 2018-05-03 15:31:21 +02:00
Alexander Boettcher 0b7e2a1642 sel4: invalidate ram if used uncached later on
Fixes #2665
2018-04-10 11:06:01 +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
Alexander Boettcher 16b395dce3 sel4: use kernel branch 7.0 + our mastered commits
Fixes #2562
2017-12-21 15:01:45 +01:00
Alexander Boettcher 4761826843 sel4: change a error message into warning
This condition is non-fatal in the most cases, so leave it as a
diagnostic message.
2017-11-30 11:23:17 +01:00
Alexander Boettcher 7d54d1da0c sel4: enable support for direct unmap in core
Issue #2563
2017-11-30 11:23:06 +01:00
Alexander Boettcher 9655ebbefe sel4: enable nx bit handling for ARM
Issue #1723
2017-11-01 08:39:49 +01:00
Alexander Boettcher db329b02b5 base: enable executable memory fault handling
Fixes #1723
2017-11-01 08:39:48 +01:00
Alexander Boettcher 013efb58ac sel4: free up top root directory of processes
Issue #2514
2017-10-05 17:39:55 +02:00
Alexander Boettcher bcfcc1db9c sel4: handle unmap error more gracefully
Issue #2505
2017-08-30 10:00:00 +02:00
Alexander Boettcher 4de2e52b34 sel4: provide ACPI infos by 'platform_info' ROM
Issue #2242
2017-08-28 16:49:47 +02:00
Alexander Boettcher 430bde3636 core: remove unmap from rm_client
The flush/unmap of memory is tied to an address space and not to a thread.
Move the handling from the Rm_client to the Adress_space class.

Issue #2209
2017-08-28 16:49:44 +02:00
Alexander Boettcher fd0b256f7c sel4: support cpu utilization via TRACE service
using benchmark infrastructure of the seL4 kernel

Issue #2451
2017-08-18 10:24:47 +02:00
Alexander Boettcher 0ddda79511 sel4: add priority support
Issue #2451
2017-08-17 11:04:24 +02:00
Alexander Boettcher 7a8e0e59af sel4: enable smp for x86
Issue #2451
2017-08-17 11:04:24 +02:00
Alexander Boettcher da5441292a sel4: add Wandboard Quad (iMX6) support
Issue #2451
2017-08-17 11:04:21 +02:00
Alexander Boettcher 66c0c7b6f1 sel4: add x86_64 support
Issue #2451
2017-08-17 11:04:20 +02:00
Alexander Boettcher 95329c82e2 sel4: update to 5.2.0
Issue #2451
2017-08-17 11:04:19 +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 bc82cce72b core: add Platform::max_caps()
This method returns the kernel-specific system-global limit of the total
number of capabilities.

Issue #2398
2017-05-31 13:16:03 +02:00
Norman Feske 29b8d609c9 Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
Norman Feske cd3a5852d6 Warn about the use of deprecated headers
This commit enables compile-time warnings displayed whenever a deprecated
API header is included, and adjusts the existing #include directives
accordingly.

Issue #1987
2017-01-31 12:01:18 +01:00
Norman Feske 25a7ea3d40 base: rename 'Volatile_object' to 'Reconstructible'
Fixes #2151
2016-12-01 17:46:50 +01:00
Stefan Kalkowski 2a2e5c2df4 base-*: remove usage of printf
base generic code:
  * Remove unused verbosity code from mmio framework
  * Remove escape sequence end heuristic from LOG
  * replace Core_console with Core_log (no format specifiers)
  * move test/printf to test/log
  * remove `printf()` tests from the log test
  * check for exact match of the log test output
base-fiasco:
  * remove unused Fiasco::print_l4_threadid function
base-nova:
  * remove unused hexdump utility from core
base-hw:
  * remove unused Kernel::Thread::_print_* debug utilities
  * always print resource summary of core during startup
  * remove Kernel::Ipc_node::pd_label (not used anymore)
base*:
  * Turn `printf`,`PWRN`, etc. calls into their log equivalents

Ref #1987
Fix #2119
2016-10-21 12:39:36 +02:00
Stefan Kalkowski 2147c42ec6 base: unify page-fault notification for kernels
* Enable page-fault messages for regions not directly managed by core
* Unify output given when a page-fault occurs related to those regions

Fix #2082
2016-09-09 11:49:34 +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
Alexander Boettcher 9988089862 sel4: workaround deadlock in core
Issue #2044
2016-08-10 11:07:56 +02:00
Alexander Boettcher b57c33159f sel4: improve allocation in initial_untyped_pool
Required to boot on hardware. The fragmentation is such unfortunate with the
old allocator that alloc() will throw an exception during very early core boot
phase.

Issue #2044
2016-08-10 11:07:56 +02:00
Alexander Boettcher 356e6498b6 sel4: update to 3.2.0
- disable iommu
- increase root_cnode further for native boot
- support vesa driver on native hardware
- don't mask edge triggered ioapic irqs
- increase various allocators to get noux_tool_chain_* booting natively

Issue #2044
2016-08-10 11:07:56 +02:00
Alexander Boettcher bee0e11049 sel4: use notification objects for Genode::Lock
Fixes #1717
Issue #2044
2016-08-10 11:07:55 +02:00
Alexander Boettcher 1472c0629b sel4: allocate thread selectors during bind_thread
That seems nowadays the right place in order to tell the caller that the
thread couldn't be completely constructed. The return value false of
bind_thread causes in Cpu_thread_component the throwing of
Thread_creation_failed.

thread.run now passes
pthread.run now passes

Issue #2044
2016-08-10 11:07:55 +02:00
Alexander Boettcher c4c7979163 sel4: quirk for vanishing page table
Issue #2044
2016-08-10 11:07:54 +02:00
Alexander Boettcher 9c8676b2ae sel4: add revoke option to destruct cnode
Issue #2044
2016-08-10 11:07:54 +02:00
Alexander Boettcher c4ed38cfbc sel4: fix vm_space has_page_table_at
Issue #2044
2016-08-10 11:07:54 +02:00
Alexander Boettcher b0c3427ed4 sel4: handle platform_pd destruction
Issue #2044
2016-08-10 11:07:54 +02:00
Alexander Boettcher 657dd5faad sel4: support region fault manager outside core
rm_fault.run works

Issue #2044
2016-08-10 11:07:53 +02:00
Alexander Boettcher 253f2aef0f sel4: show pd name if flushing page table
Issue #2044
2016-08-10 11:07:53 +02:00
Alexander Boettcher 998dfa6c5e sel4: flush page table allocator if full
Issue #2044
2016-08-10 11:07:53 +02:00
Alexander Boettcher 90390fe053 sel4: increase root cnode size in kernel
required to boot setups like noux*

Issue #2044
2016-08-10 11:07:53 +02:00
Alexander Boettcher 3a9c6eab17 sel4: use first free cap index reported by kernel
required to bootstrap scenarios with more rom binaries, e.g. noux

Issue #2044
2016-08-10 11:07:53 +02:00
Alexander Boettcher 5b9a61fcb9 sel4: properly detach core local regions
Issue #2044
2016-08-10 11:07:52 +02:00
Alexander Boettcher a396fa9563 sel4: support up to 16K capabilities per pd
before we had 256 capabilities

Issue #2044
2016-08-10 11:07:52 +02:00
Alexander Boettcher 2aaeb8db1b sel4: convert frame pages back to untyped memory
to implement _revoke_ram_ds and to fix _unmap_local

Issue #2044
2016-08-10 11:07:52 +02:00
Alexander Boettcher e89b28ca1b sel4: add signal support
Fixes #1716
Issue #2044
2016-08-10 11:07:51 +02:00
Alexander Boettcher 93e2eecc52 sel4: add irq support
Fixes #1718
Issue #2044
2016-08-10 11:07:51 +02:00