Commit Graph

436 Commits

Author SHA1 Message Date
Norman Feske 1c4e73d425 base: 'Allocator_guard::quota' accessor 2013-10-22 08:00:16 +02:00
Martin Stein 1113f36e2f arndale: specs to enable demo scenario
ref #796
2013-10-22 08:00:15 +02:00
Alexander Boettcher f14213b5f4 base/os: catch Ipc_error messages in Service class
Fixes #910
2013-10-22 08:00:15 +02:00
Martin Stein ee5d213c1f base: do not allow unnamed threads
fix #901
2013-10-22 08:00:07 +02:00
Josef Söntgen eab8217bdb base: call proper __cxa_finalize
Fixes #909.
2013-10-17 11:05:20 +02:00
Josef Söntgen da2c6b62f2 core: fix iterating over trace policies
Fixes #920.
2013-10-17 11:00:23 +02:00
Martin Stein 618b83499c base: bug in copy constructor of Signal
The copy constructor of Signal did not copy the Signal::Data contents of
the copy source. This bug could survive undetected because the compiler
can optimize code in a way, that copy constructor and destructor are not
necessary when returning by value from simple functions. I assume that
it creates the object in CPU registers instead of RAM and reuses it
instead of copying it to save time. This way the bug triggered first
after wait_for_signal was changed in a way that avoided optimization.

ref #912
2013-10-16 09:26:11 +02:00
Martin Stein 563760eb08 base: fix bug in Object_pool::first_locked
fix #899
2013-10-16 09:26:11 +02:00
Martin Stein 039bae9710 base: make FIFO elements zero-pointer save
fix #904
2013-10-16 09:26:10 +02:00
Norman Feske f80c0500af Test for 'Parent::resource_request' interface 2013-10-15 16:13:45 +02:00
Norman Feske 094c5211fd core: Fix off-by-one in quota check
The check was one byte too rigid. ;-)
2013-10-14 09:45:14 +02:00
Norman Feske 90aa4ef6b5 core: Don't account RAM metadata to RAM quota
The meta data for allocations should be accounted to the session quota
instead of the RAM accont managed by the session.
2013-10-14 09:45:14 +02:00
Norman Feske 61b94296b2 base: Use distinct error for ref_account mismatch 2013-10-14 09:45:14 +02:00
Norman Feske 65c4246f95 base/env: Implementation of 'Expanding_parent' 2013-10-14 09:45:14 +02:00
Norman Feske ae40cb545c base: Unify 'Platform_env' across platforms 2013-10-05 12:44:36 +02:00
Norman Feske 93bd4d55f8 Implement resource-balancing in parent interface 2013-10-05 12:44:35 +02:00
Norman Feske f65606f179 Add resource-balancing support to parent interface
This is just the interface. The implementation is still missing.

Issue #887
2013-10-05 12:44:35 +02:00
Norman Feske 5befab7f3d Add 'String<SIZE>' buffer type to 'util/string.h'
The new 'String' buffer type is meant to replace the manually created
character buffers that are scattered throughout Genode. It plainly holds
a null-terminated string to be stored as a member variable (e.g., a
session label) or passed as RPC argument. It is not intended to become a
string API.
2013-10-05 12:44:35 +02:00
Martin Stein 00f16be122 base: fix bug in Allocator_guard::free
ref #589
2013-09-26 15:58:05 +02:00
Martin Stein 1571e09823 base: implement Object_pool::first_locked()
ref #589
2013-09-26 15:58:04 +02:00
Martin Stein e07781dc1c base: destruct signal receiver platform specific
This is made for future signal framework in base-hw
wich needs a platform specific hook in the signal-
receiver destruction.

ref #589
2013-09-26 15:58:04 +02:00
Martin Stein bf37159eb9 base: provide class Genode::Fifo_element
ref #528
2013-09-26 15:58:04 +02:00
Christian Helmuth f763e5ec2a Move main bootstrap to platform-specific object
To prevent multiple execution of main-bootstrap, I moved the code to a
statically initialized object. The reason for this change is that
_main() is exeuted twice when starting dynamic binaries. Now, the object
is part of the base-common library which is linked with ld.lib.so.
2013-09-26 15:00:16 +02:00
Christian Helmuth 4556a9e353 Preserve thread-context area as early as possible 2013-09-26 14:42:52 +02:00
Norman Feske f1dcaa746d Enable C++11 by default 2013-09-23 14:26:01 +02:00
Josef Söntgen 8b69d91c05 trace: method for getting buffer-wrap count 2013-09-23 14:26:01 +02:00
Norman Feske 20883c52b5 trace: Frontend for reading trace-buffer entries 2013-09-23 14:26:00 +02:00
Christian Helmuth 9f3c4c227e Put entry point at start of text segment / binary
Fixes #881.
2013-09-23 14:26:00 +02:00
Norman Feske 8243329ad4 os: Move Genode::Config into 'config' library
Originally, the convenience utility for accessing a process
configuration came in the form of a header file. But this causes
aliasing problems if multiple compilation units access the config while
the configuration gets dynamically updated. Moving the implementation of
the accessor to the singleton object into a library solves those
problems.
2013-09-23 14:25:58 +02:00
Norman Feske 4b4ba30498 base: Make Signal_receiver noncopyable
This change prevents accidental copying of signal receivers via a
compile error.
2013-09-18 14:58:55 +02:00
Norman Feske 21462cdbd2 base: Add const qualifiers to 'util/list.h'
This patch adds support for iterating through a const list. This allows
users of lists to be more rigid with regard to constness. Furthermore,
the patch adds the function 'List::insert_at' for inserting an element
at a specified position. By adding this function, we can remove code
duplication in nitpicker.
2013-09-18 14:58:55 +02:00
Norman Feske 690fc51fad Minor comment fix 2013-09-18 14:58:54 +02:00
Norman Feske 78c8145d9b base-hw: Define CACHE_LINE_SIZE_LOG2 for rpi 2013-09-18 14:58:54 +02:00
Christian Helmuth 46ee8241b4 thread: convenience trace methods
Implementation of declared trace methods for (null-temrinated) C string
and character buffer with given length.
2013-09-06 16:24:48 +02:00
Christian Prochaska 3e8e55ec16 CPU affinity configuration fixes
- if no affinity was set for a new thread before calling
  Cpu_session::start(), the CPU session's affinity gets set for this
  thread
- documentation fix: <affinity_space> -> <affinity-space>

Fixes #873.
2013-09-02 19:43:36 +02:00
Josef Söntgen 2501cb189e core: explicitly throw Out_of_metadata
In case there is not enough quota left to create the trace buffer
or trace policy dataspace throw Out_of_metadata explicitly instead
of rethrowing the Ram_session::Quota_exceeded exception. Now one
can catch Trace::Out_of_metadata exception in a client application.

In addition fix Allocator_guard::withdraw() checks because this
method does not throw any exceptions and a failed withdrawal goes
unoticed.

Fixes #871.
2013-09-02 19:43:00 +02:00
Josef Söntgen 82eb5e4323 base: only commit useful trace events
If the length of a trace event entry is zero it should be ommitted.

Fixes #851.
2013-08-30 13:32:06 +02:00
Martin Stein d4e435d732 mmio: provide bitsets and test them
fix #853
2013-08-30 13:29:22 +02:00
Martin Stein 8188e85691 mmio: interpret read-verbosity switch
fix #825
2013-08-30 13:27:41 +02:00
Josef Söntgen d967be473a base: fix pausing tracing subjects
Fixes #858.
2013-08-29 15:41:40 +02:00
Alexander Boettcher 77fe612adb base: fix thread_cap initialization
Fixes #842
2013-08-29 15:41:04 +02:00
Norman Feske a652cb5110 Apply affinity subspacing to session requests 2013-08-15 09:22:50 +02:00
Josef Söntgen a4066c358e Add trace points (RPC and signal) 2013-08-15 09:22:50 +02:00
Norman Feske 149356f7ab core: TRACE service interface and implementation 2013-08-15 09:22:47 +02:00
Norman Feske fe4a6d7d81 base: User-level tracing support 2013-08-14 18:43:19 +02:00
Norman Feske a2b15349fd base: Add tracing support to CPU session interface 2013-08-13 17:27:40 +02:00
Christian Prochaska fd11bd489e base: increase maximum file name length
This patch increases the maximum file name length to support
'qt5_qnitpickerviewwidget.lib.so'.

Issue #345.
2013-08-13 17:08:26 +02:00
Martin Stein bb00aebc9e hw & signal: consider initial SLAB blocks
By now Signal_session_component has allocated initial SLAB
blocks in constructor, wich crashed with the root
components assumptions about the RAM quota needs of
session creation. Thus, if the background allocator was already
exhausted from component allocation the session was created
with broken initial SLAB blocks.

fix #574
2013-08-13 17:08:26 +02:00
Norman Feske 35723d813d core: evaluate CPU session affinity argument 2013-08-13 17:08:25 +02:00
Norman Feske fd95637289 Interface for setting CPU connection affinity 2013-08-13 17:08:25 +02:00
Norman Feske 6d837c9e26 Attach affinity information to session requests
This patch extends the 'Parent::session()' and 'Root::session()'
functions with an additional 'affinity' parameter, which is inteded to
express the preferred affinity of the new session. For CPU sessions
provided by core, the values will be used to select the set of CPUs
assigned to the CPU session. For other services, the session affinity
information can be utilized to optimize the locality of the server
thread with the client. For example, to enable the IRQ session to route
an IRQ to the CPU core on which the corresponding device driver (the IRQ
client) is running.
2013-08-13 17:08:25 +02:00
Norman Feske 5fe29e8e4a Express affinities via Cartesian coordinates
This patch introduces new types for expressing CPU affinities. Instead
of dealing with physical CPU numbers, affinities are expressed as
rectangles in a grid of virtual CPU nodes. This clears the way to
conveniently assign sets of adjacent CPUs to subsystems, each of them
managing their respective viewport of the coordinate space.

By using 2D Cartesian coordinates, the locality of CPU nodes can be
modeled for different topologies such as SMP (simple Nx1 grid), grids of
NUMA nodes, or ring topologies.
2013-08-13 17:08:24 +02:00
Alexander Boettcher 2e58428b51 run: Rpc_entrypoint test running on multiple CPUs
Add run script to autopilot list

Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher 9e8255948d base: add affinity to rpc_entrypoint constructor
Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher 0079179f05 base: store initial ax and di registers in crt0.s
The values are used by a follow up commit by nova to get the boot CPU number.

Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher fdaeda47bb run: extend affinity test
* read out supported number of CPUs
* start per CPU a thread
* monitor by main thread liveness of remote CPU threads
* add a round variable
* terminate run script after a specific round or after 90s
* on qemu wait 5 rounds, on native runs 40

Add run script to autopilot list

Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher 683832f461 base: avoid deadlock if invalid object is called
This avoids a deadlock if during issuing a printf the low level IPC fails.
. Printf uses an address space local lock and if we are trying again
to make a printf we deadlock forever ...
2013-08-13 17:08:23 +02:00
Alexander Boettcher 4ae1faf14d base: add affinity support to pager construction
Propagating the affinity information is needed to allow for assigning
a pager thread that is local to the CPU of the to-be-created thread.

issue #814
2013-08-13 17:08:23 +02:00
Alexander Boettcher 717be91e16 base: deny region creation exceeding size of a ds
The rm_session implementation expects that offset + size must be
part of one dataspace. Unfortunately the parameters are not checked
properly during an rm::attach.

During an detach memory behind the actual region can be unmapped by such
bogus region entries.

Issues #591
2013-08-05 15:15:40 +02:00
Christian Prochaska 09049278a6 Round up RM session size to page granularity
Since RM sessions can be used as dataspaces and dataspace sizes are
supposed to have page granularity, RM session sizes should have page
granularity, too.

Fixes #799.
2013-07-18 11:56:44 +02:00
Josef Söntgen 505f4290ec base: activate Rpc_entrypoint explicitly in dtor
The Rpc_exit call is delivered via RPC which results in a deadlock
if the Rpc_entrypoint has not been started yet. To prevent this
situation we active the Rpc_entrypoint explicitly before we call
Rpc_exit.

Fixes #811.
2013-07-16 12:32:29 +02:00
Stefan Kalkowski a341f744ce Cortex A15: temporarily remove -mcpu switch again
Make compiler stop complaining about every compilation unit.

Fixes #810.
2013-07-16 12:29:47 +02:00
Stefan Kalkowski 946bd297e6 Add -mcpu flag to ARM CPU spec files (Ref #797)
When using certain assembler instructions, e.g. 'smc' that are
only available on some CPUs of the same architecture like ARMv7a,
it's necessary to specify the target CPU for the assembler. Otherwise
it will complain about.
2013-07-11 12:44:24 +02:00
Christian Prochaska c962240922 crt0 cleanup
- use the generic 'crt0.s' for Linux
- move the read-only '__dso_handle' definition into the '.text' section
- move the '__initial_sp' definition into the '.bss' section
- remove the '_main_utcb' definition

Part of #766.
2013-07-05 12:37:43 +02:00
Martin Stein ee4c98e093 base: provide BSS boundary marks in genode.ld
This enables us to use the generic linker script for
base-hw also.

Ref #766
2013-07-05 12:37:43 +02:00
Josef Söntgen cb76c0c45f core: remove hardcoded 'init' from Log output
Until now the print procedure call in the Log_session_component
did contain a hardcoded 'init' string. Adding a method to filter
the session args to prefix the label and labelling the initial
Cpu_connection for the init-process enabled us to remove the
hardcoded string.

Fixes #789.
2013-07-05 12:37:42 +02:00
Josef Söntgen 136af3764d core: add session args filter to Core_child
Add the filter_session_args() method to Core_child to prefix the labels
of its children.

Fixes #789.
2013-07-05 12:37:42 +02:00
Josef Söntgen 4ba17f7ebd core: use label for init's Cpu_session
Fixes #789.
2013-07-05 12:37:42 +02:00
Josef Söntgen 9ec791db9a base: add method to withdraw memory w/o allocating
The given number of bytes is consumed but not actually allocated. This
feature may be used for accounting and use memory within core which is
in fact provided by a session client.

Fixes #792.
2013-07-05 12:37:42 +02:00
Stefan Kalkowski 770157fea0 Enable re-use of singleton, but closed IRQ session
Fix #784
2013-06-26 14:27:19 +02:00
Martin Stein 0c7c285079 mmio: provide basic verbosity
The verbosity must be enabled at two levels: at compile time
via an enum that switches the availability of verbosity code
and via two members of 'Mmio' named '_read_verbose' and
'_write_verbose'. The latter are initialized to 0 (change this to
enable verbosity globally) and can be used to locally enable
(or disable) verbosity in deriving classes.

Ref #753
2013-06-25 14:52:53 +02:00
Sebastian Sumpf 98ee7612f1 base: ARM-FPU 'memcpy_cpu' implementation
Added spec file for ARM-VFPv3 floating-point unit. This shadows
'base/include/arm/' with 'base/include/arm/vfp' and enables a 'memcpy_cpu'
version that mainly uses the FPU. Enabled VFP support for 'foc_arndale'.

Ref #773
2013-06-24 11:48:37 +02:00
Stefan Kalkowski f7034369b2 Extend clock and power units in platform driver
* Add clock and power management for SATA and USB3.0 for Arndale

Fix #771
2013-06-24 11:48:37 +02:00
Stefan Kalkowski 1d34589f84 Implement cpu frequency scaling for Arndale
* Implements platform driver for Arndale providing Regulator for CPU clock
* Implements a cpu frequency scaling test using the affinity test
* Fixes #770
2013-06-24 11:48:36 +02:00
Stefan Kalkowski 37856a0ad0 Add print-only dummy UART driver for Exynos5 SoC
Fix #759
2013-06-12 11:35:12 +02:00
Christian Prochaska 4a9b1c6aab base-linux: add ARM support
This patch introduces a new platform 'linux_arm' for building and running
Genode/Linux on an ARM device.

Known limitations:

- libc 'setjmp()'/'longjmp()' doesn't currently save/restore floating
  point registers

Fixes #746.
2013-05-24 14:55:37 +02:00
Martin Stein 1c38667a96 base: Mmio::wait_for(...) for whole registers
Ref #706
2013-05-22 18:32:05 +02:00
Martin Stein 2e7802b799 base-hw: flush cached zeroes in 'clear_ds(...)'
Ref #706
2013-05-22 18:32:05 +02:00
Martin Stein 65136c2289 hw_arndale: use core local timer in kernel
Ref #706
2013-05-22 18:32:05 +02:00
Norman Feske 8ac6d8c96c base-hw: Support for Raspberry Pi 2013-05-15 20:48:07 +02:00
Norman Feske ddffc8765e core: Be more precise in IO_MEM error message 2013-05-15 20:47:38 +02:00
Norman Feske ee572e2f8e Add missing session route to printf.run 2013-05-15 20:47:31 +02:00
Stefan Kalkowski ef4a4ea654 Implement input driver for i.MX53 tablet (fix #724)
The input driver implements support for the Egalaxy touchscreen and
for Freescale's MPR121 capacitative touch buttons.
2013-05-10 11:16:13 +02:00
Stefan Kalkowski ca92984bcc Simplify GPIO session interface (fix #707)
Changes GPIO session interface to a one-GPIO-pin-per-session style. Moreover,
this commit introduces a generic driver interface for GPIO drivers. Thereby
generalizes root- and session component for GPIO.
2013-05-10 11:16:12 +02:00
Christian Prochaska 562ac7d059 64-bit fixes
Fixes #734.
2013-05-10 11:16:12 +02:00
Norman Feske 4715ad18b0 Spelling fix 2013-05-07 21:59:15 +02:00
Christian Prochaska ea3adfef9a Create the context area RM session at startup
With this patch, the thread context area RM session gets created at
program startup to have the thread context area's virtual address range
reserved right from the beginning.

Fixes #734.

This patch implies that all Genode processes try to create an RM
session. So a route to the RM service must be present even for processes
that have only a single thread. Hence, the patch contains an update of
affected components.
2013-05-07 21:56:07 +02:00
Norman Feske 09e04d6378 Avoid leakage of signal-source reply capabilities
Issue #717
2013-05-07 21:56:06 +02:00
Stefan Kalkowski 0950b2f340 Rework i.MX53 framebuffer driver
* Simplify IPU register definitions using templates
* Distinguish between i.MX53 QSB and SMD board in driver
* Support IPU specific overlay mechanism by framebuffer session extension
2013-05-07 21:56:06 +02:00
Stefan Kalkowski 4fe158a320 Implement platform driver for i.MX53 platform
Move clock and reset controller functionality out of framebuffer driver
into platform driver.
2013-05-07 13:04:30 +02:00
Nikolay Golikov d2f5deaf33 Implement i.MX53 framebuffer driver 2013-05-07 13:04:30 +02:00
Stefan Kalkowski a5d236475a Unify GPIO driver binary names to 'gpio_drv'
Introduce 'gpio' SPEC variable to easily support a corresponding driver within
run scripts.
2013-05-07 13:04:30 +02:00
Stefan Kalkowski 8e9e866161 Unify framebuffer driver binary names (fix #720)
Introduce 'framebuffer' SPEC variable to distinguish hardware framebuffer
drivers furthermore from the SDL framebuffer driver used by Genode/Linux.
2013-05-07 13:04:30 +02:00
Christian Prochaska ac8633e0e9 Update Qt to version 4.8.4
Fixes #703.
2013-05-06 18:50:35 +02:00
Martin Stein 028ef7d776 mmio: fix bug in read/write array items
Fix #668
2013-05-06 11:11:04 +02:00
Christian Prochaska 89109cf377 core: preserve more memory
core needs to preserve more memory when built with -O0 for the 64-bit
'linux_x86' platform

Fixes #727.
2013-05-06 11:11:03 +02:00
Norman Feske 6f294eddc2 Fix warning about initializer of 'Local_addr'
Fixes #726
2013-05-06 11:11:03 +02:00
Stefan Kalkowski 814652d243 Add dependency rule for CXX_OBJECTS (fix #719) 2013-04-26 16:47:15 +02:00
Stefan Kalkowski de2b5c0925 Fix alignment bug in memcpy_arm (fix #718) 2013-04-26 16:42:59 +02:00
Martin Stein e9f4e6b37d base: bug in util_mmio.run
Fix #659
2013-04-12 10:52:29 +02:00
Martin Stein ea7ed5947a base: hand over Pd_connection label to Platform_pd
fix: #656
2013-04-08 11:42:24 +02:00
Norman Feske 0d01fd829f heap: Reduce maximum chunk size to 1 MiB on 32bit
With the previous maximum, the heap would allocate chunks of up to 4
MiB, which may lead to overly large slack memory.
2013-03-27 19:27:25 +01:00
Norman Feske 2bbe840597 core: Handle disappearing managed dataspaces
This patch adds the consideration of suddenly disappearing managed
dataspaces in the 'Rm_session_component::reverse_lookup' function.
Previously, this case resulted in a seamingly valid translation.

Fixes #701
2013-03-27 19:27:24 +01:00
Norman Feske 26710729a3 Suppress warnings in release mode
Fixes #698
2013-03-22 17:28:07 +01:00
Sebastian Sumpf a3afb3dae4 sd_card: Exynos5/MMC support
Added MMC specific parts to Sd-card implemntation. Read/Write takes advantage of
DMA. Currently we leave card in one bit mode.
2013-03-22 15:28:52 +01:00
Norman Feske 839c0263c9 Fix warning on 64bit
Because the template instantiation rules of C++ do not deal well with
null pointers specified as '0', the constructor of 'Local_addr' was
instantiated for [T = int], which does not make sense. To avoid the
warning "cast to pointer from integer of different size", we need to
explicitly state that '0' is a pointer. In C++11, there is the 'nullptr'
keyword, but until we switch to this version, we have to state (void *)0.
2013-03-22 12:41:21 +01:00
Norman Feske e38983a8fa Simple thread-affinity test 2013-03-21 12:54:02 +01:00
Norman Feske 764a3656a1 cxx: Decouple C++ runtime from 'env()->heap()' 2013-03-21 11:04:56 +01:00
Christian Prochaska 570156b38c l4lx: allocate memory in chunks
When L4Linux tries to allocate a dataspace of the size of its physical
memory, this allocation can fail, because the 'l4re_ma_alloc()' function
in the 'l4lx' library always tries to allocate a contiguous dataspace of
the given size and there might be no contiguous free area left.

With this patch, memory gets allocated in chunks: if the size to be
allocated exceeds the configured chunk size, a managed dataspace gets
created and filled with multiple memory chunks of at most the chunk size.

The chunk size is 16M by default and can be configured in an l4linux
config node:

<config args="...">
	<ram chunk_size="16M"/>
</config>

Fixes #695.
2013-03-20 14:22:04 +01:00
Alexander Boettcher 0c8b996fa4 base: calculate initial junk based on 32/64 host
Issue #666
2013-03-18 13:07:22 +01:00
Stefan Kalkowski ce58a63fb6 Remove 'epit' from generic i.MX platform spec
Remove the 'epit' variable from the generic imx31 and imx53 specification,
and only add it to base-hw specific i.MX specs. Thereby the EPIT timer
library gets build for base-hw only.
Moreover, fix some const-ness issues in the platform_timer implementation
for the EPIT timer.
Fixes #688.
2013-03-14 11:27:51 +01:00
Norman Feske 21de42c45d core: Introduce 'Address_space' interface
The new core-internal 'Address_space' interface enables cores RM service
to flush mappings of a PD in which a given 'Rm_client' thread resides.
Prior this patch, each platform invented their own way to flush mappings
in the respective 'rm_session_support.cc' implementation. However, those
implementations used to deal poorly with some corner cases. In
particular, if a PD session was destroyed prior a RM session, the RM
session would try to use no longer existing PD session. The new
'Address_space' uses the just added weak-pointer mechanism to deal with
this issue.

Furthermore, the generic 'Rm_session_component::detach' function has
been improved to avoid duplicated unmap operations for platforms that
implement the 'Address_space' interface. Therefore, it is related to
issue #595. Right now, this is OKL4 only, but other platforms will follow.
2013-03-12 21:53:08 +01:00
Norman Feske 352f58b94b core: New utilities for object lifetime management 2013-03-12 21:53:08 +01:00
Christian Prochaska a99193ad90 Rework the internal lock interface
With this patch, the 'futex' syscall gets used for blocking and unblocking
of threads in the Linux-specific lock implementation.

The 'Native_thread_id' type, which was previously used in the
lock-internal 'Applicant' class to identify a thread to be woken up,
was not suitable anymore for implementing this change. With this patch,
the 'Thread_base*' type gets used instead, which also has the positive
effect of making the public 'cancelable_lock.h' header file
platform-independent.

Fixes #646.
2013-02-25 22:14:21 +01:00
Norman Feske 7fef0ba931 base: Increase stack size of signal thread
On foc_pbxa9, the stack size did not suffice within core.
2013-02-25 16:45:50 +01:00
Torsten Hilbrich 257cf4800d Fixed some unused parameters warnings
They cause problems when using -Werror in your compilation.
2013-02-25 16:45:49 +01:00
Martin Stein 0f8803245a base: make signal framework usable for base-hw
ref #641
2013-02-22 20:28:28 +01:00
Alexander Boettcher c36f6a04a7 nova: extend pd_session by assign_pci function 2013-02-21 11:52:02 +01:00
Alexander Boettcher c374f294c8 pci: add support to provide PCI ECMA config 2013-02-21 11:52:02 +01:00
Martin Stein f6ede8cf0d arndale: base/mk platform spec
ref #601
2013-02-20 19:38:57 +01:00
Martin Stein 07b856bc8a cortex_a15: base/mk spec
ref #601
2013-02-20 19:38:42 +01:00
Martin Stein 86ddcffaf2 arndale: board driver base
ref #601
2013-02-20 19:38:32 +01:00
Martin Stein 638dcf3d40 arndale: UART driver base
ref #601
2013-02-20 19:37:58 +01:00
Christian Prochaska 519bed419d core: preserve more memory
core needs to preserve more memory when built with -O0 for the 64-bit
'linux_x86' platform

Fixes #653.
2013-02-20 14:53:42 +01:00
Norman Feske ebc73f66df Remove base-mb platform
This base platform is no longer maintained.

For supporting the Microblaze CPU in the future, we might consider
integrating support for this architecture into base-hw. Currently
though, there does not seem to be any demand for it.
2013-02-20 13:17:39 +01:00
Norman Feske fae63f4fa9 Merge base libraries into a single library
This patch simplifies the way of how Genode's base libraries are
organized. Originally, the base API was implemented in the form of many
small libraries such as 'thread', 'env', 'server', etc. Most of them
used to consist of only a small number of files. Because those libraries
are incorporated in any build, the checking of their inter-dependencies
made the build process more verbose than desired. Also, the number of
libraries and their roles (core only, non-core only, shared by both core
and non-core) were not easy to capture.

Hereby, the base libraries have been reduced to the following few
libraries:

- startup.mk contains the startup code for normal Genode processes.
  On some platform, core is able to use the library as well.
- base-common.mk contains the parts of the base library that are
  identical by core and non-core processes.
- base.mk contains the complete base API implementation for non-core
  processes

Consequently, the 'LIBS' declaration in 'target.mk' files becomes
simpler as well. In the most simple case, only the 'base' library must
be mentioned.

Fixes #18
2013-02-19 14:45:55 +01:00
Norman Feske bcdc706f42 Unify 'ipc.h' and 'ipc_generic.h' across platforms
The distinction between 'ipc.h' and 'ipc_generic.h' is no more. The only
use case for platform-specific extensions of the IPC support was the
marshalling of capabilities. However, this case is accommodated by a
function interface ('_marshal_capability', '_unmarshal_capability'). By
moving the implementation of these functions from the headers into the
respective ipc libraries, we can abandon the platform-specific 'ipc.h'
headers.
2013-02-14 13:23:37 +01:00
Norman Feske b1f63e3356 Turn 'platform_env.h' into a private header
This patch removes 'platform_env.h' from the public API headers because
this header was not part of the API anyway.
2013-02-14 13:23:36 +01:00
Norman Feske 0ed8797df2 Add sanity check to AVL tree, fix #597 2013-02-13 16:01:25 +01:00
Christian Prochaska 1947d08e78 Use the host c++ for linking hybrid applications
Some shared libraries of the host system contain search paths for finding
other needed shared libraries. These paths get evaluated only by a native
linker. To find all needed shared libraries, with this patch, the host
linker is used to link hybrid applications.

Fixes #645.
2013-02-12 12:53:35 +01:00
Alexander Boettcher 764f8335d0 base: reset _last_applicant variable
Fixes #647
2013-02-11 12:54:04 +01:00
Alexander Boettcher 6c7661ed62 base: fix sporadic context thread area faults
reverts 68156918ee
"base: apply thread.cc fix of foc to base"

Depending on the context area a fixed location is calculated where the
memory for the stack is attached to. If the context area is released before the
detach call, the very same context area can be reused and memory for the new
stack is attached for a new thread. The detach of the old thread would then
revoke the mapping for the new thread which will cause a un-handled page fault.

Issue #549
2013-02-11 12:01:27 +01:00
Norman Feske 9acad80f37 core: support upgrades of init's Env:: sessions 2013-02-11 12:01:27 +01:00
Norman Feske 622959ede4 core: always release Irq_proxy startup lock
Prior this patch the startup lock was not released if the call of
'_associate()' failed. In this condition, the caller of the constructor
was infinitely blocked.
2013-02-11 12:01:27 +01:00
Alexander Boettcher 7868156b19 base: fix deadlock in core_env on base-nova
During a ram_session->free call in 'core' the lock in core_env.h is taken.
Then in the ram_session::_free_ds implementation the dissolve function for the
dataspace is called. base-nova tries to make sure that the ds is not
accessible anymore by any kind of parallel incoming IPC by performing a
cleanup IPC. Unfortunately the dataspace_session implementation uses the very
same allocator in 'core' and may require to obtain the same lock as taken in
ram_session->free. This leads to a spurious deadlock on base-nova.

The actual free_ds implementation is mostly thread safe, since all used objects
inside there are already locked. The only missing piece is the _payload
variable. By changing the _payload variable in a atomic fashion there is no
need to lock the whole ram_session->free call which avoids deadlocks on
base-nova.

Fixes #549
2013-02-11 12:01:26 +01:00
Alexander Boettcher f50d816555 base: fix dangling session pointers in rm_session
If page faults are handled concurrently (as for base-nova) the traverse lookup
call in rm_session_component must be thread safe, which it isn't.
If the faulting area is backed by nested dataspaces which are managed by
various rm_sessions then a race happens under following circumstances
(triggered occasionally by the bomb test).

The traverse lookup may return a pointer to a rm_session of a nested dataspace.
If the rm_session is in parallel subject to destruction it happened that faults
got enqueued to the faulters list of the deleted rm_session and internally to
a list of the current rm_session of the Rm_client.

During destruction of the faulting Rm_client the associated rm_session will
be dissolved from the Rm_client, which leads to dereferencing the
dangling pointer of the already destructed rm_session.

On base-nova the memory of the rm_session object get unmapped eventually, so
that the de-referencing of the dangling pointer caused page faults in core.

The memory on other kernels inside core never get unmapped so that the
bug doesn't trigger visible faults.

The patch replace the keeping of a rm_session pointer by keeping a
capability instead. The rm_session object must be looked up now explicitly in
the Object_pool implementation, which implements proper reference counting on
the rm_session object.

Issue #549
2013-02-11 12:01:26 +01:00
Alexander Boettcher 9453d319cb base: add remove_client to rm_session
Fixes #13
2013-02-11 12:01:25 +01:00
Alexander Boettcher f02958b25f base: fix faults in rm_session de-constructor path
First make the clients inaccessible and dissolve them from the entrypoint. If
this isn't the first step the clients may be obtained again between
the unlock and lock steps in the destructor.

Additionally the clients may be removed in between the unlock and call
sequence, which renders such client pointers dangling and causes spurious page
faults. Keep instead a lock as long as possible and when it is required to
release a lock, then the pointer to the objects must be revalidated.

Replace the dissolve function with a remove_client implementation as suggested
by #13, which avoids that the cpu_session may call dissolve with a dangling
pointer of a already removed rm_client object. Instead the pager must be
released explicitly.

Related to issue #549
Related to issue #394
Related to issue #13
2013-02-11 12:01:25 +01:00
Norman Feske c2a8c48574 Coding style fixes 2013-01-24 11:35:56 +01:00
Alexander Boettcher 17ca0290a1 base: fix wrap around bug in avl allocator
Fix #631
2013-01-24 11:05:02 +01:00
Stefan Kalkowski 04b8418b54 Let memcmp correspond to the C standard (fix #628)
By now, the memcmp implementation of Genode's basic string utilities just
returned whether two memory blocks are equal or differ. It gave no hint which
block is greater, or lesser than the other one. This isn't the behaviour
anticipated by implementations that rely on the C standard memcmp, e.g. GCC's
libsupc++, or the nic_bridge's AVL tree implementation.
2013-01-24 11:02:49 +01:00
Alexander Boettcher ac5b814387 base: enable rm_fault test case for nova
Related to #621
2013-01-16 16:06:36 +01:00
Christian Prochaska e2889f3f11 Increase signal handler stack size
Fixes #616.
2013-01-15 19:26:18 +01:00
Christian Prochaska a6acab6d0d Synchronize signal context destruction
With this patch, the 'Signal_receiver::dissolve()' function does not return
as long as the signal context to be dissolved is still referenced by one
or more 'Signal' objects. This is supposed to delay the destruction of the
signal context while it is still in use.

Fixes #594.
2013-01-15 15:03:21 +01:00
Norman Feske 1aa9f9910c Add 'Service_registry::remove_all' function
This function is needed when reconfiguring init.
2013-01-15 10:18:11 +01:00
Norman Feske bef78dd9f8 Core: Fix registration of CPU exception handler 2013-01-11 22:16:25 +01:00
Norman Feske 73ab30c22c Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
Sebastian Sumpf 1a30bac3ea base: fix memmove implementation
Also make 'memcpy' to behave like memmove on region overlap.

Issue #604
2013-01-10 21:19:22 +01:00
Alexander Boettcher e8c063a8b4 base: release signal context from signal list
Remove signal context object from signal source component list (_signal_queue)
before destruction, otherwise we get a dangling pointer.

On native hardware for base-nova, the signal source thread triggered page
faults in the Signal_source_component::wait_for_signal() method when the signal
context got freed up in Signal_session_component::free_context but was still
enqueued in Signal_source_component::_signal_queue.

Fixes #600
2013-01-10 21:17:42 +01:00
Norman Feske 13d4108fea Unify 'Signal_dispatcher' interfaces
Several users of the signal API used custom convenience classes to
invoke signal-handling functions on the reception of incoming signals.
The 'Signal_dispatcher' pattern turned out to be particularly useful. To
avoid the duplication of this code across the code base, this patch
adds the interface to 'base/signal.h'.

Furthermore, the patch changes the 'Signal::num()' return type from int
to unsigned because negative numbers are meaningless here.

Fixes #511
2013-01-10 21:09:14 +01:00