toolchain/ghs: Fix green hills toolchain build Vela link error

[elxr] (error #412) unresolved symbols:
 __builtin_frame_address     from libarch.a(arm_checkstack.o)

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
This commit is contained in:
yanghuatao 2024-04-24 01:06:17 +08:00 committed by Alan Carvalho de Assis
parent 47b0414eab
commit 3e171489bd
8 changed files with 91 additions and 2 deletions

View File

@ -330,6 +330,19 @@ static inline void setcontrol(uint32_t control)
: "memory");
}
static inline_function uint32_t up_getsp(void)
{
register uint32_t sp;
__asm__ __volatile__
(
"mov %0, sp\n"
: "=r" (sp)
);
return sp;
}
#endif /* __ASSEMBLY__ */
/****************************************************************************

View File

@ -406,6 +406,19 @@ noinstrument_function static inline void up_irq_restore(irqstate_t flags)
);
}
static inline_function uint32_t up_getsp(void)
{
register uint32_t sp;
__asm__ __volatile__
(
"mov %0, sp\n"
: "=r" (sp)
);
return sp;
}
#endif /* __ASSEMBLY__ */
/****************************************************************************

View File

@ -535,6 +535,19 @@ static inline void setcontrol(uint32_t control)
: "memory");
}
static inline_function uint32_t up_getsp(void)
{
register uint32_t sp;
__asm__ __volatile__
(
"mov %0, sp\n"
: "=r" (sp)
);
return sp;
}
#endif /* __ASSEMBLY__ */
/****************************************************************************

View File

@ -402,6 +402,19 @@ static inline void up_irq_restore(irqstate_t flags)
);
}
static inline_function uint32_t up_getsp(void)
{
register uint32_t sp;
__asm__ __volatile__
(
"mov %0, sp\n"
: "=r" (sp)
);
return sp;
}
#endif /* __ASSEMBLY__ */
/****************************************************************************

View File

@ -508,6 +508,19 @@ static inline void setcontrol(uint32_t control)
: "memory");
}
static inline_function uint32_t up_getsp(void)
{
uint32_t sp;
__asm__ __volatile__
(
"mov %0, sp\n"
: "=r" (sp)
);
return sp;
}
#endif /* __ASSEMBLY__ */
/****************************************************************************

View File

@ -402,6 +402,19 @@ static inline void up_irq_restore(irqstate_t flags)
);
}
static inline_function uint32_t up_getsp(void)
{
register uint32_t sp;
__asm__ __volatile__
(
"mov %0, sp\n"
: "=r" (sp)
);
return sp;
}
#endif /* __ASSEMBLY__ */
/****************************************************************************

View File

@ -66,8 +66,6 @@
* Pre-processor Prototypes
****************************************************************************/
#define up_getsp() (uintptr_t)__builtin_frame_address(0)
#ifndef __ASSEMBLY__
#ifdef __cplusplus

View File

@ -236,6 +236,19 @@ static inline uint32_t getcontrol(void)
return 0;
}
static inline_function uint32_t up_getsp(void)
{
register uint32_t sp;
__asm__ __volatile__
(
"tmov %0, sp\n"
: "=r" (sp)
);
return sp;
}
#endif /* __ASSEMBLY__ */
/****************************************************************************