Commit Graph

440 Commits

Author SHA1 Message Date
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
Martin Stein
8d19aad601 hw_pbxa9: provide 768 MB RAM
The previously used RAM 0x0..0x10000000 was just an alias for
0x70000000..0x80000000. Qemu provides up to of 768 MB RAM with the
correct -m argument. This RAM is located at 0x70000000..0x90000000 and
0x20000000..0x30000000. At least the noux_tool_chain scripts are
happy to have that much RAM.

ref #964
2013-12-03 08:33:25 +01:00
Martin Stein
062aa2851c usb & panda: move EHCI-interrupt to board spec
ref #981
2013-11-28 08:22:24 +01:00
Martin Stein
06f8848b36 base: spelling fix in signal/signal.h
ref #980
2013-11-28 08:22:24 +01:00
Norman Feske
0d3f5be95b Dissolve sig contexts in rm_fault and signal tests 2013-11-26 14:32:07 +01:00
Alexander Boettcher
7ab863b495 base: Warn on undissolved signal contexts 2013-11-26 14:32:07 +01:00
Stefan Kalkowski
0c6c70a612 cpu_session: follow-up fix for scale_priority
This is a fixup for commit 5a42f40f04.

ref #961
2013-11-26 14:32:07 +01:00
Sebastian Sumpf
864a047206 base: Local signal submit 2013-11-25 12:12:31 +01:00
Norman Feske
148206d757 rpi: Framebuffer and platform drivers
The platform driver is used to access the features provided by the
Videocore mboxes, i.e., power configuration and framebuffer setup. The
framebuffer driver uses the platform interface to setup a screen mode of
1024x768.
2013-11-25 09:46:09 +01:00
Norman Feske
c52b7d3076 rpi: Videocore cache definitions 2013-11-25 09:46:09 +01:00
Norman Feske
435bdd5755 dde_linux: Support for Raspberry Pi
At the current stage, the USB HID and storage drivers are prinicpally
working but not stable. If interrupts are not processed fast enough,
devices will get sporadically disconnected.

The USB host-controller driver is not part of the normal Linux kernel.
For this reason, we need to download it separately. There exists a
'prepare_rpi' rule in the 'dde_linux/Makefile' to automate this process.
2013-11-25 09:46:09 +01:00
Norman Feske
5b5ea76039 hw_rpi: Hand out IRQ for USB host controller 2013-11-25 09:46:08 +01:00
Stefan Kalkowski
a7d7337b16 vmm: add i.MX53 platform as target (ref #954) 2013-11-25 09:46:08 +01:00
Stefan Kalkowski
6f136bef7a hw: add TrustZone support for i.MX53 (ref #954) 2013-11-25 09:46:08 +01:00
Alexander Boettcher
a6af6c80ab base: count caps replied by a rpc function
Issue #905
2013-11-18 11:01:45 +01:00
Alexander Boettcher
772616bf38 base: call deconstructor of context area
Issue #905
2013-11-18 11:01:45 +01:00
Martin Stein
1c6c90fed5 core: provide signals before other services
Provide core-local signal service before other services to enable the use
of signal connections while initialzing the other services. This has been
introduced due to the use of the signal framework by the pager lib in
base-hw (RM service).

ref #935
2013-11-14 19:57:30 +01:00
Martin Stein
20e91d0b60 base: individual implementations of pager-object
ref #935
2013-11-14 19:57:30 +01:00
Martin Stein
b88d7e3370 vea9x4: centralize spec of interrupt names
ref #874
2013-11-14 19:56:39 +01:00
Martin Stein
7c70a9bf7d rpi: centralize spec of interrupt names
ref #874
2013-11-14 19:56:39 +01:00
Martin Stein
cc17d82d92 panda: centralize spec of interrupt names
ref #874
2013-11-14 19:56:39 +01:00
Martin Stein
7e294a39f4 imx53: remove unused IPU-interrupt specs
ref #874
2013-11-14 19:56:39 +01:00
Martin Stein
e849cce39e pbxa9: centralize spec of interrupt names
ref #874
2013-11-14 19:56:39 +01:00
Martin Stein
ba1a82b485 arndale: centralize spec of interrupt names
ref #874
2013-11-14 19:56:39 +01:00
Stefan Kalkowski
5a42f40f04 cpu_session: fix semantic of scale_priority
Remove "inverse" argument from function, because its documented behaviour
wasn't implemented correctly, nor was it used by any code.
2013-11-12 15:02:17 +01:00
Christian Prochaska
1a22664fee Call exit handlers before notfying the parent
Fixes #941.
2013-11-05 12:01:13 +01:00
Christian Prochaska
cc04ffcf42 GDB monitor: find out page faulting thread
Fixes #898.
2013-10-25 23:49:00 +02:00
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