Commit Graph

112 Commits

Author SHA1 Message Date
Norman Feske 76db3b9c06 base: retire 'Native_config'
This commit moves the parameters of the stack area to the base-internal
header 'stack_area.h'.

Issue #1832
2016-03-08 17:00:54 +01:00
Josef Söntgen 2490e399dc ldso: check binary pointer before lookup
Check if the binary pointer is valid before attempting to lookup the
symbol. Shared objects with unresolved symbols and missing depencies,
e.g a library that references 'errno' but is not linked against libc,
will now produce an error message when they are loaded by the dynamic
linker.

Fixes #1904.
2016-03-08 17:07:36 +01:00
Emery Hemingway f46a504bb6 use Arg_string::set_arg_string to set session labels
Issue #1861
2016-03-07 16:10:32 +01:00
Christian Helmuth 688e86ab68 core: increase initial quota to 224K 2016-03-07 12:34:47 +01:00
Norman Feske 7f73e5e879 base: hide internals of the Thread API
This patch moves details about the stack allocation and organization
the base-internal headers. Thereby, I replaced the notion of "thread
contexts" by "stacks" as this term is much more intuitive. The fact that
we place thread-specific information at the bottom of the stack is not
worth introducing new terminology.

Issue #1832
2016-03-07 12:34:46 +01:00
Norman Feske 3473955212 base-linux/nova: unify include/rm_session/client.h
By moving the stub implementation to rm_session_client.cc, we can use
the generic base/include/rm_session/client.h for base-linux and
base-nova and merely use platform-specific implementations.

Issue #1832
2016-03-07 12:34:45 +01:00
Norman Feske 6e7f7bdad4 base: move crt0.h and elf.h to base/internal
Those headers remained unused outside the internal framework. So it is
better to remove them from the public API.

Issue #1832
2016-03-07 12:34:45 +01:00
Norman Feske 2e701f9afa base: update include guards
This patch cleans up the include guards, assisted by the
tool/fix_include_ifndef script.
2016-03-07 12:34:45 +01:00
Norman Feske e6729316ff base: uniform base-internal header structure
This patch establishes a common organization of header files
internal to the base framework. The internal headers are located at
'<repository>/src/include/base/internal/'. This structure has been
choosen to make the nature of those headers immediately clear when
included:

  #include <base/internal/lock_helper.h>

Issue #1832
2016-03-07 12:34:45 +01:00
Norman Feske be496c6dc1 base: remove kernel-specific base/sleep.h
With this patch, the platform differences reside solely in the
implementation of the base library.

Issue #1832
2016-03-07 12:34:44 +01:00
Norman Feske 62b1c55399 Integrate CAP session into PD session
This patch integrates the functionality of the former CAP session into
the PD session and unifies the approch of supplementing the generic PD
session with kernel-specific functionality. The latter is achieved by
the new 'Native_pd' interface. The kernel-specific interface can be
obtained via the Pd_session::native_pd accessor function. The
kernel-specific interfaces are named Nova_native_pd, Foc_native_pd, and
Linux_native_pd.

The latter change allowed for to deduplication of the
pd_session_component code among the various base platforms.

To retain API compatibility, we keep the 'Cap_session' and
'Cap_connection' around. But those classes have become mere wrappers
around the PD session interface.

Issue #1841
2016-03-07 12:34:44 +01:00
Norman Feske b1910cdd54 Integrate SIGNAL session into PD session
This patch removes the SIGNAL service from core and moves its
functionality to the PD session. Furthermore, it unifies the PD service
implementation and terminology across the various base platforms.

Issue #1841
2016-03-07 12:34:44 +01:00
Sebastian Sumpf d17134baef ldso: Support for RISC-V
issue #1880
2016-02-26 11:36:51 +01:00
Sebastian Sumpf d424134073 cxx: Simplify C++ exception wrapper functions
The wrapper functions (e.g., 'Unwind_*' and friends) now have the same signature
as the original function in 'libgcc', reside in a separate C file which is
archived to cxx.lib.a. In supc++.o we prefix the wrapped functions with '_cxx_'.

This also enables support for riscv.

related to #1880
2016-02-16 14:38:02 +01:00
Sebastian Sumpf bfe5208e0e base: Align heap/slab allocation to machine word size
required by riscv

related to #1880
2016-02-16 14:38:02 +01:00
Christian Helmuth 2a698ffd5f signal: prevent submission of contexts w/o receiver
This prevents a sporadic null-pointer dereference in the nic_loopback
test, which occurred once in 100 runs. I'm not sure if there's still a
race window (we may investigate) with context dissolve.
2016-01-26 16:20:47 +01:00
Sebastian Sumpf 41b9f6bd03 ldso: Make truly self relocatable
On Linux the linker can now be loaded at arbitrary addresses, this became
necessary for newer kernel versions. The 'linux_arm' target is not supported.

Issue #1728
2015-12-10 13:16:25 +01:00
Alexander Boettcher e49a5ee19f base: make reference ram cap part of child policy
Issue #1539
2015-11-27 12:18:54 +01:00
Sebastian Sumpf 0c3dfbad65 base-hw: use signal context list for pending signals
'block_for_signal' and 'pending_signal' now set pending flag in signal context
in order to determine pending signal. The context list is also used by the
'Signal_receiver' during destruction.

Fixes #1738
2015-11-27 12:18:50 +01:00
Alexander Boettcher c7df65e1da base: invalidate thread cap if task creation fails
Issue #1778
2015-11-18 12:22:09 +01:00
Norman Feske 82991ba378 base: fix warning in console.cc 2015-11-04 13:49:01 +01:00
Alexander Boettcher f42f946f3b base: support parsing multiboot for phys. memory
Issue #1741
2015-11-04 14:09:27 +01:00
Alexander Boettcher 7ea5884ffc base: use mmio framework for multiboot handling
Issue #1741
2015-11-04 14:09:26 +01:00
Alexander Boettcher f9fbe34644 base: avoid detaching not attached trace_control 2015-10-28 15:06:23 +01:00
Sebastian Sumpf 2b429ee84c base: Dispatch server signal in entry point
Currently, when a signal arrives in the main thread, the signal dispatcher is
retrieved and called from the main thread, the dispatcher uses a proxy object
that in turn sends an RPC to the entry point. This becomes a problem when the
entry point destroys the dispatcher object, before the dispatch function has
been called by the main thread. Therefore, the main thread should simply send an
RPC to the entry point upon signal arrival and the dispatching should be handled
solely by the entry point.

Issue #1738
2015-10-28 15:06:22 +01:00
Alexander Boettcher 2e62543fdb nova: use remote revoke
Fixes #1733
2015-10-09 16:38:48 +02:00
Alexander Boettcher 286edaed68 base: detect and stop self de-structing threads
Issue #1687
2015-10-06 12:18:51 +02:00
Stefan Kalkowski b585583ec7 core: do not destroy in object pool's apply scope
Destroying an object within the scope of a lambda/functor executed
in the object pool's apply function leads potentially to memory corruption.
Within the scope the corresponding object is locked and unlocked when
leaving the scope. Therefore, it is illegal to free the object's memory meanwhile.
This commit eliminates several places in core that destroyed wrongly in
the object pool's scope.

Fix #1713
2015-09-30 12:20:40 +02:00
Stefan Kalkowski ccb968ff7d safeguard the synchronized allocator template
* Move the Synced_interface from os -> base
* Align the naming of "synchronized" helpers to "Synced_*"
* Move Synced_range_allocator to core's private headers
* Remove the raw() and lock() members from Synced_allocator and
  Synced_range_allocator, and re-use the Synced_interface for them
* Make core's Mapped_mem_allocator a friend class of Synced_range_allocator
  to enable the needed "unsafe" access of its physical and virtual allocators

Fix #1697
2015-09-30 12:20:39 +02:00
Alexander Boettcher 9b21c88bc6 base: handle unsupported printf commands better
The commit consumes the argument of a unsupported printf command.

Without the commit - a subsequent command uses the argument of the preceding
command, which may cause memory corruption or page faults for sequences using
string commands, e.g.

Genode::printf("%#x %s\n", 0x20, "Test");

'#' is not supported by Genode::printf. In this scenario a pagefault at
address 0x20 is caused.

Fixes #1701
2015-09-30 12:20:38 +02:00
Stefan Kalkowski ed52d5a211 Introduce 'spec' subdirectories to outline aspects
Instead of holding SPEC-variable dependent files and directories inline
within the repository structure, move them into 'spec' subdirectories
at the corresponding levels, e.g.:

  repos/base/include/spec
  repos/base/mk/spec
  repos/base/lib/mk/spec
  repos/base/src/core/spec
  ...

Moreover, this commit removes the 'platform' directories. That term was
used in an overloaded sense. All SPEC-relative 'platform' directories are
now named 'spec'. Other files, like for instance those related to the
kernel/architecture specific startup library, where moved from 'platform'
directories to explicit, more meaningful places like e.g.: 'src/lib/startup'.

Fix #1673
2015-09-16 13:58:50 +02:00
Stefan Kalkowski acc46f70b7 codezero: remove support from Genode (fix #1668) 2015-09-09 15:14:29 +02:00
Stefan Kalkowski 458b4d6fc4 base: redesign object pool using lambda interface
Instead of returning pointers to locked objects via a lookup function,
the new object pool implementation restricts object access to
functors resp. lambda expressions that are applied to the objects
within the pool itself.

Fix #884
Fix #1658
2015-09-09 15:14:28 +02:00
Alexander Boettcher 6e481127ce hw: increase stack size for thread test
Stack size of cpu helper is insufficient if a exception is thrown during
'test_create_as_many_threads()'

Related to #1652
2015-09-09 15:14:27 +02: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
Stefan Kalkowski eafe5e81e3 core: unify and simplify paging code (Fix #1641)
For most platforms except of NOVA a distinction between pager entrypoint
and pager activation is not needed, and only exists due to historical
reasons. Moreover, the pager thread's execution path is almost identical
between most platforms excluding NOVA, HW, and Fisco.OC. Therefore,
this commit unifies the pager loop for the other platforms, and removes
the pager activation class.
2015-08-21 10:58:59 +02:00
Alexander Boettcher 626b0a68f3 base: increase base-control size for 32bit
It is insufficient for creating threads up to the maximum supported limit
(256 by now).

Issue #1601
2015-08-21 10:58:58 +02:00
Alexander Boettcher 9081653c96 Extend thread test
Issue #1601
2015-08-21 10:58:58 +02:00
Alexander Boettcher fe4e0702d4 base: contain chunk_size heap consumption
Increase internal chunk size of heap only if an allocation succeeded
beforehand. Otherwise the chunk size increases with every unsuccessful
invocation and a upgrade of the used ram session will be insufficient and of
no use at all.

Fixes #1632
2015-07-21 09:36:46 +02:00
Martin Stein c6f73d365a unmanaged singleton: allow private constructors
Introduces a class Unmanaged_singleton_constructor that can be declared as
friend to be able to call unmanaged_singleton on classes with a private
constructor. Enables the appliance of the singleton pattern.

Ref #1625
2015-07-21 09:30:12 +02:00
Stefan Kalkowski 0f05fa6fd4 base: resolve dead lock in weak pointer templates
This commit eliminates the mutual interlaced taking of destruction lock,
list lock and weak pointer locks that could lead to a dead-lock situation
when a lock pointer was tried to construct while a weak object is in
destruction progress.
Now, all weak pointers are invalidated and dequeued at the very
beginning of the weak object's destruction. Moreover, before a weak pointer
gets invalidated during destruction of a weak object, it gets dequeued, and
the list lock is freed again to avoid the former dead-lock.

Fix #1607
2015-07-21 09:30:04 +02:00
Josef Söntgen 7e40f5f587 base: use proper Cpu_session when tracing threads
Up to now it was not possible to trace threads that use a different
Cpu_session rather than env()->cpu_session() (as done by VirtualBox).
This problem is now solved by setting the Cpu_session explicitly when
creating the event logger and attaching the trace control area when
creating the thread.

Fixes #1618.
2015-07-21 09:28:26 +02:00
Alexander Boettcher c42e770384 detach ds from all rm sessions before destruction
Fixes #1617
2015-07-21 09:28:24 +02:00
Norman Feske 0cd93c64aa ldso: add lx_environ to symbol map
This symbol must be exported to build dynamically-linked executables on
the lx_hybrid_x86 base platform.
2015-07-07 19:48:07 +02:00
Stefan Kalkowski c951c30d8a base: extend weak pointer test (Ref #1607)
Add a test where a locked pointer shall be taken during object destruction.
Moreover, extend the run-script so it runs on different platforms with
"real" timers.
2015-07-07 19:48:06 +02:00
Emery Hemingway 46b7227ef0 cxx: notify parent on abort() (in main thread)
Fixes #1605
2015-07-01 15:09:32 +02:00
Stefan Kalkowski 691df908aa core: remove Rm_member from RM session component
Rm_member does not fulfill a useful role, but makes understanding of
the RM session component more difficult.

Ref #956
2015-07-01 14:46:17 +02:00
Stefan Kalkowski 2a351215f4 base: remove pager code from public API
Fix #1593
2015-07-01 14:46:15 +02:00
Norman Feske 5d678dba9e core: throw Trace::Out_of_metadata in subjects()
While importing trace sources as trace subjects into a TRACE session,
the session quota might become depleted. The TRACE session already keeps
track of the session quota via an allocator guard but the 'subjects' RPC
function missed to handle the out-of-memory condition. This patch
reflects the error condition as an 'Out_of_metadata' exception to the
TRACE client. It also contains an extension of the trace test to
exercise the corner case.
2015-06-22 14:43:39 +02:00
Alexander Boettcher 705257cf22 cxx: show thread name in event of abort
Issue #1591
2015-06-22 14:43:39 +02:00