arch/sim: implement sim_getsp
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
60b7b8b3f0
commit
4176a3828b
|
@ -52,6 +52,15 @@
|
|||
* Inline functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sim_getsp
|
||||
****************************************************************************/
|
||||
|
||||
static inline uintptr_t sim_getsp(void)
|
||||
{
|
||||
return (uintptr_t)__builtin_frame_address(0);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
#ifdef CONFIG_TLS_ALIGNED
|
||||
static inline FAR struct tls_info_s *up_tls_info(void)
|
||||
{
|
||||
return TLS_INFO((uintptr_t)__builtin_frame_address(0));
|
||||
return TLS_INFO(sim_getsp());
|
||||
}
|
||||
#else
|
||||
# define up_tls_info() tls_get_info()
|
||||
|
|
|
@ -123,7 +123,7 @@ void up_assert(const uint8_t *filename, int line)
|
|||
/* Allow for any board/configuration specific crash information */
|
||||
|
||||
#ifdef CONFIG_BOARD_CRASHDUMP
|
||||
board_crashdump(up_getsp(), this_task(), filename, line);
|
||||
board_crashdump(sim_getsp(), this_task(), filename, line);
|
||||
#endif
|
||||
|
||||
/* Exit the simulation */
|
||||
|
|
Loading…
Reference in New Issue