arm/irq.h: fix ARCH_ARM7TDMI missing up_getusrsp after move to irq.h

Causing c5471evm/httpd ci break.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
buxiasen 2025-01-07 13:04:56 +08:00 committed by Xiang Xiao
parent 55da7d89b5
commit 7e0e4dea75

View file

@ -256,6 +256,25 @@ static inline_function void up_set_interrupt_context(bool flag)
#endif #endif
} }
static inline_function uint32_t up_getsp(void)
{
register uint32_t sp;
__asm__ __volatile__
(
"mov %0, sp\n"
: "=r" (sp)
);
return sp;
}
static inline_function uintptr_t up_getusrsp(void *regs)
{
uint32_t *ptr = (uint32_t *)regs;
return ptr[REG_SP];
}
/**************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
****************************************************************************/ ****************************************************************************/