-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 17.09.2014 09:26, Valentin Hauner wrote:
Hi,
On 09/17/2014 08:02 AM, Björn Döbel wrote:
How is thread_stack declared?
It's declared on line 21 in lib/src/edft.c:
l4_umword_t *thread_stack[THREAD_MAX_NUM];
Currently, THREAD_MAX_NUM is set to 20.
What call are you using to map the actual stack to the task?
I thought that the mapping of the stack happens when iterating from _start & L4_PAGEMASK to _end & L4_PAGEMASK and mapping the single pages.
That is unlikely. The range [_start, _end] only contains static memory that comes from your binary (i.e., the code and data sections). Your thread stacks are allocated dynamically from the parent's heap and therefore lie outside this range. You will have to map those pages manually.
Before that loop, I do a read-write touch on the stack:
l4_touch_rw(thread_stack[count], sizeof(thread_stack[count]));
I tried to map the stack array separately, but I failed because l4_task_map wants a l4_fpage_t object that does not fit to the type of the stack array.
An fpage() wants an address and a size. Your malloc() call yields an address (note: this is probably unaligned, maybe prefer to use posix_memalign()), the size is what you pass to malloc(). What would be the problem?
Can you please clarify what you mean with the last sentence?
The execution of all threads including the access on the function parameters on the stack works if I assign all threads to L4RE_THIS_TASK_CAP and do not create new tasks.
That is, if you execute the thread code within the parent?
Bjoern