base: add 'Thread::mystack() function

The static 'Thread::mystack()' function returns the stack boundaries of
the calling thread. It is useful when a thread uses a diffent stack than
the primary one.

Fixes #2037
This commit is contained in:
Christian Prochaska
2016-06-29 18:23:39 +02:00
committed by Norman Feske
parent bea48b636e
commit 29a12ab9a2
4 changed files with 25 additions and 9 deletions

View File

@ -190,6 +190,14 @@ void *Thread::stack_base() const { return (void*)_stack->base(); }
void Thread::stack_size(size_t const size) { _stack->size(size); }
Thread::Stack_info Thread::mystack()
{
addr_t base = Stack_allocator::addr_to_base(&base);
Stack *stack = Stack_allocator::base_to_stack(base);
return { stack->base(), stack->top() };
}
size_t Thread::stack_virtual_size()
{
return Genode::stack_virtual_size();