mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-18 07:08:18 +00:00
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:
committed by
Norman Feske
parent
bea48b636e
commit
29a12ab9a2
@ -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();
|
||||
|
Reference in New Issue
Block a user