Commit Graph

412 Commits

Author SHA1 Message Date
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
Martin Stein
9c1563be67 base: ease Platform_env::Resources
It is unnecessary to remember session caps in a Resources object as the
contained connections can cast implicitely to the appropriate caps.

ref #989
2014-02-25 14:58:05 +01:00
Martin Stein
0b64328944 base: setup thread object for main thread in CRT0
For a main thread a thread object is created by the CRT0 before _main gets
called so that _main can already run in a generic environment that, e.g.,
catches stack overflows as a page-fault instead of corrupting the BSS.
Additionally dynamic programs have only one CRT0 - the one of the LDSO -
which does the initialization for both LDSO and program.

ref #989
2014-02-25 14:58:05 +01:00
Martin Stein
f7149623ca base: rename reload_parent_cap.cc
ref #989
2014-02-25 14:58:04 +01:00
Norman Feske
638a9cfd40 base: optional length argument for String::String 2014-02-25 14:58:04 +01:00
Norman Feske
6f9e15aff8 base: Add 'construct_at' utility
This utility allows for the manual placement of objects without the need
to have a global placement new operation nor the need for type-specific
new operators.

Issue #989
2014-02-25 14:58:03 +01:00
Josef Söntgen
e79044d16a core: change policy incrementation to prefix op
Using prefix incrementation makes sure a policy with id == 0 is
invalid.

Fixes #1049.
2014-02-25 14:58:02 +01:00
Christian Helmuth
41d5959ae5 base: extend thread test for stack alignment 2014-02-25 14:58:01 +01:00
Christian Prochaska
4b420f6e71 Fix stack pointer alignment for x86_64 platforms
The x86_64 ABI requires the stack pointer to be 16-byte aligned before the
call of a function and decreased by 8 at the function entrypoint (after
the return address has been pushed to the stack).

Currently, when a new Genode thread gets created, the initial stack
pointer is aligned to 16 byte. On Genode/Linux, the thread entry function
is entered by a 'call' instruction, so the stack pointer alignment at the
function entrypoint is correct. On Fiasco.OC and NOVA, however, the thread
entry function gets executed without a return address being pushed to the
stack, so at the function entrypoint the stack pointer is still aligned to
16 byte, which can cause problems with compiler-generated SSE
instructions.

With this patch, the stack pointer given to a new thread gets aligned to
16 bytes and decreased by 8 by default, since most of the currently
supported base platforms execute the thread entry function without pushing
a return address to the stack. For base-linux, the stack pointer gets
realigned to 16 bytes before the thread entry function gets called.

Fixes #1043.
2014-02-03 11:34:30 +01:00
Christian Helmuth
f91b1b6258 base: test for races in thread-context allocation
Related to #1024.
2014-01-30 10:05:44 +01:00
Christian Helmuth
aa02fb8256 Revise delete with allocators
Delete operators with additional allocator reference/pointer parameters
are needed if the constructor of an 'new(allocator)' allocated object
throws an exception. Also, destroy now uses the operator to free memory
and provides variants with allocator reference and pointer.

The commit includes a simple test scripts 'run/new_delete', which
exercises the several 'delete' cases.

Related to #1030.
2014-01-30 10:05:44 +01:00
Christian Helmuth
3234e4f775 Make Deallocator::need_size_for_free() pure virtual 2014-01-30 10:05:43 +01:00
Stefan Kalkowski
5447c406e5 thread: rearrange thread context management
Use a bit allocator for the allocation management of thread contexts,
instead of holding allocation information within the Thread_base objects,
which lead to race conditions in the past.

Moreover, extend the Thread_base class interface with the ability to
to add additional stacks to a thread, and associate the context they're
located in with the corresponding Thread_base object. Additional stacks
can be used to do user-level scheduling with stack switching, without breaking
Genode's API.

Fixes #1024
Fixes #1036
2014-01-27 18:54:09 +01:00
Stefan Kalkowski
66c5887bd3 Move Bit_allocator from base-nova to base
Change the template parameter for Bit_allocator, and Bit_array. Instead of
assigning words to be used by the bit array, you can now tell the count of
items that shall be used.

Moreover, some dead code, previously using the Bit_allocator, was removed.

Related to #1024
2014-01-27 18:54:09 +01:00
Christian Helmuth
7e517179c9 Unify stack alignment among all platforms
The alignment is now done in Thread_base::Context. Implementations are
forced to use Context::stack_top(), which aligns the stack top.
2014-01-27 18:54:08 +01:00
Norman Feske
6ec36350d6 base: New Genode::Deallocator interface
Splitting the new Genode::Deallocator interface from the former
Genode::Allocator interface enables us to restrict the accessible
operations for code that is only supposed to release memory, but not
perform any allocations.

Additionally, this patch introduces variants of the 'new' operator
that takes a reference (as opposed to a pointer) to a Genode::Allocator
as argument.
2014-01-27 18:54:08 +01:00
Norman Feske
f32a97da38 Use filename as default label for ROM connections
By assigning the file name as label, we may become able to remove the
filename argument in the future by just interpreting the last part of
the label as filename. By keeping only the label, we won't need to
consider conditional routing (via <if-arg>) based on session arguments
other than the label anymore.
2014-01-27 18:54:07 +01:00
Norman Feske
332aeba844 util/string.h: String::operator == 2014-01-27 18:54:07 +01:00
Norman Feske
8ca0f04ba0 Length and capacity accessors for Genode::String 2014-01-27 18:54:05 +01:00
Norman Feske
07b355b4e4 Clarify comment in base-libs.mk 2014-01-16 18:34:06 +01:00
Alexander Boettcher
22c1f8772b base: catch errors during ram_ds allocation
Issue #1011
2013-12-20 15:16:25 +01:00
Alexander Boettcher
b893968232 base: show size as %zu instead %zd
For big numbers otherwise negative sizes for memory chunks are displayed.

Issue #1011
2013-12-20 15:16:19 +01:00
Sebastian Sumpf
b8beba5bf3 ldso: Support for setting global object values
Make 'set_program_var' accessible outside of 'rtld.c'. Also, compile
dynamically linked programs with the '-fPIC' option. Doing not so,
yields to program-global symbols being put in the '.symtab' section
(which can be stripped) only. In order to get access to global
variables from the dynamic linker, the symbols need to reside within
the '.dynsym' section additionally. Hence the '-fPIC'.

ref #989
fix #1002
2013-12-20 14:48:06 +01:00
Martin Stein
750f5313f7 base: avoid compiler warning in Thread::stack_top
The statement _context->stack[-1] triggered the compiler warning
'array subscript is below array bounds'.

ref #989
2013-12-20 14:48:06 +01:00
Alexander Boettcher
a596bfe797 run: test for main thread_base object
ref #989
2013-12-20 14:48:05 +01:00
Martin Stein
4009619206 base: natural default align in unmanaged singleton
I have no idea where the previous default alignment = 2 in the unsynchronized
singleton came from but as at least the Arndale IC-driver in base-hw needs an
alignment of 4 = address width, unmanaged singleton now uses sizeof(addr_t)
as default alignment.

ref #989
2013-12-20 14:48:05 +01:00
Martin Stein
212fc47768 base: provide template for unmanaged singletons
An unmanaged singleton is a singleton object that isn't
constructed or destructed implicitly through the C++ runtime
enviroment. The new header provides a helper to create such objects
and is located in src/base/include.

ref #989
2013-12-20 14:48:05 +01:00
Stefan Kalkowski
7b49dbf2f3 hw: basic support for ODROID XU board (Fix #991) 2013-12-03 11:30:07 +01:00
Martin Stein
f4c724639b arm: raise stack size of main thread
With 64K stack size, when doing 'make core' in noux on base-hw, the main thread
of /libexec/gcc/arm-elf-eabi/4.7.2/cc1plus runs into a stack overflow during
the compilation of core/main.o . Thus raise the stack size to 128K.

fix #964
2013-12-03 08:33:26 +01:00