Commit Graph

440 Commits

Author SHA1 Message Date
Christian Helmuth
de0a771fae Generic sleep_forever() based on lock
The old implementation of sleep_forever() used a local Ipc_server
object, which is not announced (i.e., known) outside of the blocking
process/thread, to infinitely wait for incoming messages. In past and
present, this leads to problems (e.g., issues #538 and #1032).

Fixes #1135.
Fixes #538.
Fixes #1032.
2014-05-07 10:37:39 +02:00
Stefan Kalkowski
b888a26d57 core: extend core memory allocator
* Allow to translate physical to virtual core addresses and vice versa
* Eliminate race introduced by commit "core: re-design memory allocator"

Ref #723
2014-05-07 10:37:38 +02:00
Alexander Boettcher
0b04f9de25 run: limit created threads in test
The rm_session quota of the context area is not sufficient to start more
then ~95 threads per address space. If one really needs so many threads per
address space one could increase the quota or dynamically respond to it using
the Expanding_rm_session class. Until now there is no need to support so much
threads per address space.

Issue #1122
2014-05-07 10:37:35 +02:00
Alexander Boettcher
9fd6034e94 base: check cpu_session pointer during destruction
Issue #1122
2014-04-29 15:30:27 +02:00
Christian Helmuth
2c7c814e19 Generate Genode version string on each build
The version string was generated when core/main.cc was rebuilt, which
happens on changes in the file itself or in a header file it includes.
But, the version should reflect if the Genode repository was changed at
any place. Therefore, I moved the version string to its own version.cc
which is forcedly rebuilt any time core is examined by the build system.

@nfeske what do you think about it? Core is now relinked on any build.

Fixes #551.
2014-04-16 17:30:31 +02:00
Alexander Boettcher
9ae441e469 nova: replacement of generic Genode spinlock
Turn Genode user-level spinlock into a user-level "helpinglock". This requires
support by the kernel introduced with kernel branch r5.

The commit avoids live-locks when multiple threads with SCs on different
priority levels compete for the same user-level Genode "spinlock".

Issue #986
2014-04-16 17:30:31 +02:00
Alexander Boettcher
03ce614c23 base: add cpu_session parameter to thread creation
Fixes #1114
2014-04-14 12:32:31 +02:00
Alexander Boettcher
5169de72c4 base: set default cpu affinity
Set cpu_session default affinity space already during
construction of the thread, so that main thread is placed in the cpu affinity
space as defined by the parent. Otherwise the main thread is placed potentially
outside the affinity space, typically on the first/boot CPU.

Fixes #1107
2014-04-14 12:32:31 +02:00
Christian Helmuth
cd0d378142 Provide Genode version information in log
Fixes #551
2014-04-01 16:38:49 +02:00
Johannes Schlatow
2262eb8347 base: fix bug in String::valid()
String::valid() does not check whether _length is zero.
Consequently, this leads to _buf[-1] being evaluated.
2014-04-01 16:37:09 +02:00
Alexander Boettcher
869fbc92b1 base: allocate contexts solely inside context area
Reserve first bit in bit allocator for main thread of context allocator and
remove special cases in context allocator. Without the reservation there is
is one context outside the context area allocated.

Fixes #1100
2014-03-31 21:05:20 +02:00
Christian Helmuth
2e5cb2ea82 Use do statement in PDBG and PWRN
The do statement ensures the macros to generate just one expression that
is compatible with any programming construct. The concrete bug was

  if (cond)
    PDBG(...);
  else
    ...

which was expanded to

  if (cond)
    if (DO_PDBG)
      Genode::printf(...);
  else
    ...

This is obviously wrong as the *else* branch is then connected to the
second *if*.
2014-03-31 16:47:12 +02:00
Stefan Kalkowski
0dece91973 core: re-design memory allocator (fix #1091)
* Core_mem_allocator: implement Range_allocator interface
* Core_mem_allocator: allocate with page-granularity only
* Use slab allocators in core where meaningful (e.g. dataspace objects)
2014-03-18 14:24:55 +01:00
Martin Stein
36bfb56e49 util_mmio: make memory dumps easier to read
fix #1095
2014-03-14 13:24:20 +01:00
Martin Stein
9a9d093e01 util_mmio: test bitsets with a width of 64bit
ref #1095
2014-03-14 13:24:09 +01:00
Martin Stein
6476cb3bbd mmio: fix type inaccuracy in bitset reads
We must ensure that the type in use fits the shift value that gets
applied while combining the bitset sub-values.

ref #1095
2014-03-14 13:23:44 +01:00
Martin Stein
76668f0774 util_mmio: replace test_failed by error
ref #1095
2014-03-14 13:23:31 +01:00
Martin Stein
db8957562f util_mmio: test Mmio::Register with 64bit width
ref #1095
2014-03-14 13:23:19 +01:00
Martin Stein
358b2ef0c7 util_mmio: refer to failed tests via line number
ref #1095
2014-03-14 13:23:10 +01:00
Torsten Hilbrich
0b7ea4abab Genode::Connection: Mark as noncopyable
When an object derived from Genode::Connection is copied we had
strange issues. An example is that the first RPC invocation works
correctly but the second one blocks or even delivers incorrect data.

We can avoid this issue if the object is always passed by reference.
Ensure this by deriving from Genode::Noncopyable.
2014-03-14 13:17:37 +01:00
Martin Stein
3f9b098b70 base: provide Thread_base::stack_size(size_t)
The new method enhances the stack of the targeted thread if it is smaller
than a given size.

ref #1075
2014-03-14 13:17:36 +01:00
Martin Stein
aeb9213e73 mp_server.run: allow testing with hw_arndale
fix #1076
2014-03-14 13:16:05 +01:00
Martin Stein
d605681ce4 affinity.run: allow testing with hw_arndale
ref #1076
2014-03-14 13:16:05 +01:00
Martin Stein
6a3368ee27 hw_arndale: idle threads on secondary processors
fix #1006
2014-03-04 15:03:43 +01:00
Martin Stein
864189762c mmio: provide set and get method for bitsets
ref #1006
2014-03-04 14:52:01 +01:00
Norman Feske
1914f5ae2e Clarify comment 2014-03-04 14:51:17 +01:00
Martin Stein
ff70ca6427 mmio: provide bits method for bitsets
ref #1006
2014-03-04 14:49:27 +01:00
Martin Stein
b6a28795dd base & x86: setup GOT pointer in crt0.s
This is normally needed in LDSO and was previously done by the LDSO specific crt0.s.
I forgot to keep it during the unification of the different crt0s.

fix #1077
2014-03-03 12:48:29 +01:00
Alexander Boettcher
93605c2b15 test: be more strict for affinity.run
Check that in every round really all threads are alive on all CPUs. It
happened that only the first round was ok (all alive) and in the next rounds
some were dead. Unfortunately the test claimed to be successful.
2014-02-28 10:11:50 +01:00
Josef Söntgen
f407bc4cbb base: interim forked trace control fix
The destructor of the Area object uses invalid caps which results in
a wanted abort of the process on nova. This is mainly the case in forked
process in noux.
2014-02-28 10:11:13 +01:00
Martin Stein
e7f370f779 base: enable tracing not before reinit_main_thread
ref #989
2014-02-28 10:11:13 +01:00
Martin Stein
a7dd2b3171 base: ABI specific stack creation
ref #1042
2014-02-28 10:11:12 +01:00
Sebastian Sumpf
b4612d24ce base-linux: Repair hybrid programs
Do not link 'startup' and 'cxx' libraries against hybrid programs.
2014-02-28 10:11:12 +01:00
Alexander Boettcher
491817c00c base: add flex page iterator
Issue #8
2014-02-28 10:11:10 +01:00
Norman Feske
db2fe17269 base: Add Allocator_avl::size_at function
This function provides a way to request the size of an previously
allocated block. It is useful to to ease the implementation of realloc
functionality based on Allocator_avl.
2014-02-28 10:11:10 +01:00
Sebastian Sumpf
1c4c4d6961 base: Make 'LD_SCRIPT_SO' overwritable
Issue #1048
2014-02-25 14:58:09 +01:00
Martin Stein
f74c70ec05 base: add startup lib to the base libs
Startup lib can now be filtered according to the same rules like
the other base libraries.

Issue #1042
2014-02-25 14:58:08 +01:00
Martin Stein
bd52e49698 os: remove startup lib from dynamic programs
All the pre- and post-processing of the startup lib around the main
function of a dynamic program is now done by LDSO. Hence LDSO directly
calls the main function of the program.

Issue #1042
2014-02-25 14:58:07 +01:00
Martin Stein
8d21064b5e ldso: use generic CRT0 files
Issue #1042
2014-02-25 14:58:07 +01:00
Martin Stein
324af5d769 os: make program ctors and dtors visible to LDSO
This is needed later when eliminating the need for a startup lib in
dynamic programs to enable LDSO to call ctors and dtors of the program.

Issue #1042
2014-02-25 14:58:07 +01:00
Martin Stein
a100b37fdf base: provide a weak init_rtld dummy in base lib
This is needed later to eliminate LDSO specific CRT0 implementations.

Issue #1042
2014-02-25 14:58:07 +01:00
Martin Stein
3893dae673 cxx: implement __aeabi_atexit
Issue #1042
2014-02-25 14:58:07 +01:00
Sebastian Sumpf
433a216919 base: Fix stack pointer alignment for ARM
After some research we found that the stack pointer on ARM platforms must be
at least double word aligned (See: "Procedure Call Standard for the ARM
Architecture" - 5.2.1.1). Since a 'call' on ARM will not result in a stack pointer
change (like on x86), the current behavior resulted in a 4 Byte aligned stack
only.

Follow up to #1043
2014-02-25 14:58:07 +01:00
Stefan Kalkowski
6ca8a41232 core: lower default verbosity when quota exceeds
* only print quota exceeded message and statistic when explicitly enabled
* turn init's error message "cannot respond to request" into a warning
2014-02-25 14:58:06 +01:00
Stefan Kalkowski
746011ee28 blk_cache: fix deadlock in allocator hierarchy
This commit generalizes the bit array in 'base/util/bit_array.h',
so that it can be used in a statically, when the array size is known
at compile time, or dynamically. It uses the dynamic approach of the
bit array for a more generalized version of the packet allocator,
formerly only used by NIC session clients. The more generic packet
allocator is used by the block cache to circumvent the allocation
deadlock described in issue #1059.

Fixes #1059
2014-02-25 14:58:06 +01:00
Sebastian Sumpf
f447fbe1a5 base: Do not link base libs against shared libs
Base libraries are already contained within ldso.lib.so. Remove unnecessary
filtering from 'dep_lib.mk', make ldso depend on base libs.

Issue #1017
Issue #989
2014-02-25 14:58:06 +01:00
Martin Stein
4a61d008be base: beautify BSS stuff in CRT0s
fix #989
2014-02-25 14:58:05 +01:00
Martin Stein
5a6253eeff base: downsize initial main-thread stack
As the initial main-thread stack is not used for the whole main-thread life
anymore but only for the initialization of the Genode environment it can be
downsized to 32Kb for all architectures.

ref #989
2014-02-25 14:58:05 +01:00
Martin Stein
83b0cdf709 base: bin out-commented EH_FRAME stuff in CRT0s
ref #989
2014-02-25 14:58:05 +01:00
Martin Stein
523791b361 base: generic implementation of Context_allocator
ref #989
2014-02-25 14:58:05 +01:00