arch/sim: fix visual studio Linker Tools Error LNK2019
nuttx_all.lib(up_initialstate.obj) : error LNK2019: unresolved external symbol '___builtin_frame_addres' referenced in function '_up_getsp' Return stack pointer from esp Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
d78ffeca71
commit
da6d526e9c
|
@ -77,7 +77,13 @@ extern "C"
|
||||||
|
|
||||||
static inline uintptr_t up_getsp(void)
|
static inline uintptr_t up_getsp(void)
|
||||||
{
|
{
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
uintptr_t regval;
|
||||||
|
__asm mov regval, esp;
|
||||||
|
return regval;
|
||||||
|
#else
|
||||||
return (uintptr_t)__builtin_frame_address(0);
|
return (uintptr_t)__builtin_frame_address(0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue