parent
43c73eff13
commit
a7dd2b3171
|
@ -17,11 +17,17 @@
|
||||||
#include <base/stdint.h>
|
#include <base/stdint.h>
|
||||||
|
|
||||||
namespace Abi {
|
namespace Abi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On ARM a call (or branch) will not change the stack pointer, so we do not
|
* On ARM a call (or branch) will not change the stack pointer, so we do not
|
||||||
* need stack adjustment
|
* need stack adjustment
|
||||||
*/
|
*/
|
||||||
static constexpr Genode::size_t stack_adjustment() { return 0; }
|
static constexpr Genode::size_t stack_adjustment() { return 0; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do ABI specific initialization to a freshly created stack
|
||||||
|
*/
|
||||||
|
inline void init_stack(Genode::addr_t) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _INCLUDE__ARM__CPU__CONSTS_H_ */
|
#endif /* _INCLUDE__ARM__CPU__CONSTS_H_ */
|
||||||
|
|
|
@ -39,6 +39,20 @@ namespace Abi {
|
||||||
* On x86 a call will result in a growth of the stack by machine word size
|
* On x86 a call will result in a growth of the stack by machine word size
|
||||||
*/
|
*/
|
||||||
static constexpr Genode::size_t stack_adjustment() { return sizeof(Genode::addr_t); }
|
static constexpr Genode::size_t stack_adjustment() { return sizeof(Genode::addr_t); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do ABI specific initialization to a freshly created stack
|
||||||
|
*
|
||||||
|
* \param stack_top top of the stack
|
||||||
|
*/
|
||||||
|
inline void init_stack(Genode::addr_t const stack_top)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* The value at the top of the stack might get interpreted as return
|
||||||
|
* address of the thread start function by GDB, so we set it to 0.
|
||||||
|
*/
|
||||||
|
*(Genode::addr_t *)stack_top = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _INCLUDE__X86__CPU__CONSTS_H_ */
|
#endif /* _INCLUDE__X86__CPU__CONSTS_H_ */
|
||||||
|
|
|
@ -91,12 +91,7 @@ Thread_base::_alloc_context(size_t stack_size, bool main_thread)
|
||||||
context->stack_base = ds_addr;
|
context->stack_base = ds_addr;
|
||||||
context->ds_cap = ds_cap;
|
context->ds_cap = ds_cap;
|
||||||
|
|
||||||
/*
|
Abi::init_stack(context->stack_top());
|
||||||
* The value at the top of the stack might get interpreted as return
|
|
||||||
* address of the thread start function by GDB, so we set it to 0.
|
|
||||||
*/
|
|
||||||
*(addr_t*)context->stack_top() = 0;
|
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue