arch: Rename xxx_getsp to up_getsp

All modern desgin support stack pointer and it's also an
important information, so let's standardize this interface.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-06-09 16:26:18 +08:00 committed by David Sidrane
parent fdf325c7e3
commit 6576306bca
65 changed files with 126 additions and 109 deletions

View File

@ -109,12 +109,12 @@ do { \
****************************************************************************/
/****************************************************************************
* Name: arm_getsp
* Name: up_getsp
****************************************************************************/
/* I don't know if the builtin to get SP is enabled */
static inline uint32_t arm_getsp(void)
static inline uint32_t up_getsp(void)
{
uint32_t sp;
__asm__

View File

@ -66,7 +66,7 @@
static inline FAR struct tls_info_s *up_tls_info(void)
{
DEBUGASSERT(!up_interrupt_context());
return TLS_INFO((uintptr_t)arm_getsp());
return TLS_INFO((uintptr_t)up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -75,7 +75,7 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
#ifdef CONFIG_ARCH_STACKDUMP
static void up_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -157,7 +157,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
static void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = arm_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3
@ -331,7 +331,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(arm_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -74,7 +74,7 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
#ifdef CONFIG_ARCH_STACKDUMP
static void up_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -195,7 +195,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
static void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = arm_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3
@ -384,7 +384,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(arm_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -77,7 +77,7 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
#ifdef CONFIG_ARCH_STACKDUMP
static void up_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -195,7 +195,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
static void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = arm_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 7
@ -430,7 +430,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(arm_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -77,7 +77,7 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
#ifdef CONFIG_ARCH_STACKDUMP
static void up_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -203,7 +203,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
static void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = arm_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 7
@ -422,7 +422,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(arm_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -74,7 +74,7 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
#ifdef CONFIG_ARCH_STACKDUMP
static void up_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -192,7 +192,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
static void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = arm_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 7
@ -396,7 +396,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(arm_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -77,7 +77,7 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
#ifdef CONFIG_ARCH_STACKDUMP
static void up_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -203,7 +203,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
static void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = arm_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 7
@ -422,7 +422,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(arm_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -44,10 +44,10 @@
****************************************************************************/
/****************************************************************************
* Name: avr_getsp
* Name: up_getsp
****************************************************************************/
static inline uint16_t avr_getsp(void)
static inline uint16_t up_getsp(void)
{
uint8_t spl;
uint8_t sph;

View File

@ -44,10 +44,10 @@
****************************************************************************/
/****************************************************************************
* Name: avr_getsp
* Name: up_getsp
****************************************************************************/
static inline uint32_t avr_getsp(void)
static inline uint32_t up_getsp(void)
{
uint32_t retval;
__asm__ __volatile__

View File

@ -66,7 +66,7 @@
static inline FAR struct tls_info_s *up_tls_info(void)
{
DEBUGASSERT(!up_interrupt_context());
return TLS_INFO((uintptr_t)avr_getsp());
return TLS_INFO((uintptr_t)up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -49,7 +49,7 @@
static void up_stackdump(uint16_t sp, uint16_t stack_top)
{
uint16_t stack ;
uint16_t stack;
for (stack = sp & ~3; stack < stack_top; stack += 12)
{
@ -125,7 +125,7 @@ static inline void up_registerdump(void)
void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint16_t sp = avr_getsp();
uint16_t sp = up_getsp();
uint16_t ustackbase;
uint16_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 0

View File

@ -49,7 +49,7 @@
static void up_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -95,7 +95,7 @@ static inline void up_registerdump(void)
void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = avr_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3

View File

@ -154,7 +154,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(avr_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
#ifdef CONFIG_ARCH_USBDUMP

View File

@ -40,10 +40,10 @@
****************************************************************************/
/****************************************************************************
* Name: hc_getsp
* Name: up_getsp
****************************************************************************/
static inline uint16_t hc_getsp(void)
static inline uint16_t up_getsp(void)
{
uint16_t ret;
__asm__

View File

@ -66,7 +66,7 @@
static inline FAR struct tls_info_s *up_tls_info(void)
{
DEBUGASSERT(!up_interrupt_context());
return TLS_INFO((uintptr_t)hc_getsp());
return TLS_INFO((uintptr_t)up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -170,7 +170,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
static void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint16_t sp = hc_getsp();
uint16_t sp = up_getsp();
uint16_t ustackbase;
uint16_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3
@ -329,7 +329,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(hc_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -40,10 +40,10 @@
****************************************************************************/
/****************************************************************************
* Name: mips_getsp
* Name: up_getsp
****************************************************************************/
static inline uint32_t mips_getsp(void)
static inline uint32_t up_getsp(void)
{
register uint32_t sp;
__asm__

View File

@ -66,7 +66,7 @@
static inline FAR struct tls_info_s *up_tls_info(void)
{
DEBUGASSERT(!up_interrupt_context());
return TLS_INFO((uintptr_t)mips_getsp());
return TLS_INFO((uintptr_t)up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -160,7 +160,7 @@ void up_assert(const char *filename, int lineno)
#endif
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(mips_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -50,7 +50,7 @@
static void up_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -125,7 +125,7 @@ static inline void up_registerdump(void)
void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = mips_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3

View File

@ -36,10 +36,10 @@
****************************************************************************/
/****************************************************************************
* Name: misoc_getsp
* Name: up_getsp
****************************************************************************/
static inline uint32_t misoc_getsp(void)
static inline uint32_t up_getsp(void)
{
register uint32_t sp;

View File

@ -66,7 +66,7 @@
static inline FAR struct tls_info_s *up_tls_info(void)
{
DEBUGASSERT(!up_interrupt_context());
return TLS_INFO((uintptr_t)misoc_getsp());
return TLS_INFO((uintptr_t)up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -164,7 +164,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(misoc_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -48,7 +48,7 @@
static void up_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -111,7 +111,7 @@ static inline void up_registerdump(void)
void lm32_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = misoc_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3

View File

@ -163,7 +163,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(misoc_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -113,7 +113,7 @@ static inline void up_registerdump(void)
void minerva_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = misoc_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3

View File

@ -71,10 +71,10 @@
****************************************************************************/
/****************************************************************************
* Name: or1k_getsp
* Name: up_getsp
****************************************************************************/
static inline uint32_t or1k_getsp(void)
static inline uint32_t up_getsp(void)
{
uint32_t sp;

View File

@ -66,7 +66,7 @@
static inline FAR struct tls_info_s *up_tls_info(void)
{
DEBUGASSERT(!up_interrupt_context());
return TLS_INFO((uintptr_t)or1k_getsp());
return TLS_INFO((uintptr_t)up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -73,7 +73,7 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
#ifdef CONFIG_ARCH_STACKDUMP
static void up_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -195,7 +195,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
static void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = or1k_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3
@ -384,7 +384,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(or1k_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -44,10 +44,10 @@
****************************************************************************/
/****************************************************************************
* Name: renesas_getsp
* Name: up_getsp
****************************************************************************/
static inline uint16_t renesas_getsp(void)
static inline uint16_t up_getsp(void)
{
uint16_t sp;

View File

@ -44,10 +44,10 @@
****************************************************************************/
/****************************************************************************
* Name: renesas_getsp
* Name: up_getsp
****************************************************************************/
static inline uint16_t renesas_getsp(void)
static inline uint16_t up_getsp(void)
{
uint16_t sp;

View File

@ -44,10 +44,10 @@
****************************************************************************/
/****************************************************************************
* Name: renesas_getsp
* Name: up_getsp
****************************************************************************/
static inline uint32_t renesas_getsp(void)
static inline uint32_t up_getsp(void)
{
uint32_t sp;

View File

@ -66,7 +66,7 @@
static inline FAR struct tls_info_s *up_tls_info(void)
{
DEBUGASSERT(!up_interrupt_context());
return TLS_INFO((uintptr_t)renesas_getsp());
return TLS_INFO((uintptr_t)up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -159,7 +159,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(renesas_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -122,7 +122,7 @@ static inline void m16c_registerdump(void)
void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint16_t sp = renesas_getsp();
uint16_t sp = up_getsp();
uint16_t ustackbase;
uint16_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3

View File

@ -129,7 +129,7 @@ static inline void rx65n_registerdump(void)
void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = renesas_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3

View File

@ -52,7 +52,7 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
static void sh1_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -109,7 +109,7 @@ static inline void sh1_registerdump(void)
void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = renesas_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3

View File

@ -44,10 +44,10 @@
****************************************************************************/
/****************************************************************************
* Name: riscv_getsp
* Name: up_getsp
****************************************************************************/
static inline uint32_t riscv_getsp(void)
static inline uint32_t up_getsp(void)
{
register uint32_t sp;
__asm__

View File

@ -44,10 +44,10 @@
****************************************************************************/
/****************************************************************************
* Name: riscv_getsp
* Name: up_getsp
****************************************************************************/
static inline uint64_t riscv_getsp(void)
static inline uint64_t up_getsp(void)
{
register uint64_t sp;
__asm__

View File

@ -66,7 +66,7 @@
static inline FAR struct tls_info_s *up_tls_info(void)
{
DEBUGASSERT(!up_interrupt_context());
return TLS_INFO((uintptr_t)riscv_getsp());
return TLS_INFO((uintptr_t)up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -70,7 +70,7 @@
#ifdef CONFIG_ARCH_STACKDUMP
static void riscv_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -177,7 +177,7 @@ static inline void riscv_registerdump(void)
static void riscv_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = riscv_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 15
@ -364,7 +364,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(riscv_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
riscv_assert();

View File

@ -191,7 +191,7 @@ static inline void up_registerdump(void)
static void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint64_t sp = riscv_getsp();
uint64_t sp = up_getsp();
uintptr_t ustackbase;
uintptr_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 15
@ -397,7 +397,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(riscv_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -30,10 +30,10 @@
****************************************************************************/
/****************************************************************************
* Name: sim_getsp
* Name: up_getsp
****************************************************************************/
static inline uintptr_t sim_getsp(void)
static inline uintptr_t up_getsp(void)
{
return (uintptr_t)__builtin_frame_address(0);
}

View File

@ -65,7 +65,7 @@
#ifdef CONFIG_TLS_ALIGNED
static inline FAR struct tls_info_s *up_tls_info(void)
{
return TLS_INFO(sim_getsp());
return TLS_INFO(up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -90,7 +90,7 @@ void up_assert(const char *filename, int line)
/* Allow for any board/configuration specific crash information */
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(sim_getsp(), this_task(), filename, line);
board_crashdump(up_getsp(), this_task(), filename, line);
#endif
/* Flush any buffered SYSLOG data */

View File

@ -53,7 +53,7 @@ void up_initial_state(struct tcb_s *tcb)
{
if (tcb->pid == 0)
{
tcb->stack_alloc_ptr = (void *)(sim_getsp() -
tcb->stack_alloc_ptr = (void *)(up_getsp() -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_base_ptr = tcb->stack_alloc_ptr;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;

View File

@ -357,7 +357,7 @@ begin_packed_struct struct idt_ptr_s
/* Return stack pointer */
static inline uint32_t x86_getsp()
static inline uint32_t up_getsp()
{
uint32_t regval;

View File

@ -66,7 +66,7 @@
static inline FAR struct tls_info_s *up_tls_info(void)
{
DEBUGASSERT(!up_interrupt_context());
return TLS_INFO((uintptr_t)x86_getsp());
return TLS_INFO((uintptr_t)up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -75,7 +75,7 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
#ifdef CONFIG_ARCH_STACKDUMP
static void up_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -121,7 +121,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
static void up_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = x86_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3
@ -290,7 +290,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(x86_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -454,7 +454,7 @@ static inline void write_gsbase(unsigned long val)
/* Return stack pointer */
static inline uint64_t x64_getsp()
static inline uint64_t up_getsp()
{
uint64_t regval;

View File

@ -66,7 +66,7 @@
static inline FAR struct tls_info_s *up_tls_info(void)
{
DEBUGASSERT(!up_interrupt_context());
return TLS_INFO((uintptr_t)x64_getsp());
return TLS_INFO((uintptr_t)up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -67,7 +67,7 @@
#ifdef CONFIG_ARCH_STACKDUMP
static void up_stackdump(uint64_t sp, uint64_t stack_top)
{
uint64_t stack ;
uint64_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -113,7 +113,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
static void up_dumpstate(void)
{
struct tcb_s *rtcb = this_task();
uint64_t sp = x64_getsp();
uint64_t sp = up_getsp();
uint64_t ustackbase;
uint64_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3
@ -272,7 +272,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(x64_getsp(), this_task(), filename, lineno);
board_crashdump(up_getsp(), this_task(), filename, lineno);
#endif
_up_assert();

View File

@ -44,10 +44,10 @@
****************************************************************************/
/****************************************************************************
* Name: xtensa_getsp
* Name: up_getsp
****************************************************************************/
static inline uint32_t xtensa_getsp(void)
static inline uint32_t up_getsp(void)
{
register uint32_t sp;

View File

@ -66,7 +66,7 @@
static inline FAR struct tls_info_s *up_tls_info(void)
{
DEBUGASSERT(!up_interrupt_context());
return TLS_INFO((uintptr_t)xtensa_getsp());
return TLS_INFO((uintptr_t)up_getsp());
}
#else
# define up_tls_info() tls_get_info()

View File

@ -101,7 +101,7 @@ static void xtensa_assert(void)
#ifdef CONFIG_BOARD_CRASHDUMP
/* Perform board-specific crash dump */
board_crashdump(xtensa_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
/* Flush any buffered SYSLOG data (from the above) */

View File

@ -94,7 +94,7 @@ static inline void up_showtasks(void)
static void xtensa_stackdump(uint32_t sp, uint32_t stack_top)
{
uint32_t stack ;
uint32_t stack;
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
{
@ -265,7 +265,7 @@ static inline void xtensa_btdump(void)
void xtensa_dumpstate(void)
{
struct tcb_s *rtcb = running_task();
uint32_t sp = xtensa_getsp();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 15

View File

@ -161,7 +161,7 @@ void up_assert(const char *filename, int lineno)
syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(z16_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -154,7 +154,7 @@ void z16_netinitialize(void);
/* Return the current value of the stack pointer (used in stack dump logic) */
chipreg_t z16_getsp(void);
chipreg_t up_getsp(void);
/* Dump stack and registers */

View File

@ -37,7 +37,7 @@
****************************************************************************/
/****************************************************************************
* Name: z16_getsp
* Name: up_getsp
****************************************************************************/
/* To be provided */
@ -49,7 +49,7 @@
static void z16_stackdump(void)
{
struct tcb_s *rtcb = this_task();
chipreg_t sp = z16_getsp();
chipreg_t sp = up_getsp();
chipreg_t stack_base = (chipreg_t)rtcb->stack_base_ptr;
chipreg_t stack_size = (chipreg_t)rtcb->adj_stack_size;
chipreg_t stack;

View File

@ -162,7 +162,7 @@ void up_assert(const char *filename, int lineno)
#ifdef CONFIG_BOARD_CRASHDUMP
/* Execute board-specific crash dump logic */
board_crashdump(z80_getsp(), running_task(), filename, lineno);
board_crashdump(up_getsp(), running_task(), filename, lineno);
#endif
_up_assert();

View File

@ -128,7 +128,7 @@ int up_multicastfilter(FAR struct net_driver_s *dev, FAR uint8_t *mac,
/* Return the current value of the stack pointer (used in stack dump logic) */
uintptr_t z80_getsp(void);
uintptr_t up_getsp(void);
/* Dump stack and registers */

View File

@ -44,7 +44,7 @@
void up_stackdump(void)
{
FAR struct tcb_s *rtcb = this_task();
uintptr_t sp = z80_getsp();
uintptr_t sp = up_getsp();
uintptr_t stack_base = (uintptr_t)rtcb->stack_base_ptr;
uintptr_t stack_size = (uintptr_t)rtcb->adj_stack_size;
uintptr_t stack;

View File

@ -22,7 +22,7 @@
; Global Symbols Exported
;**************************************************************************
xdef _z80_getsp
xdef _up_getsp
;**************************************************************************
; Code
@ -32,14 +32,14 @@
.assume ADL=1
;**************************************************************************
;* Name: _z80_getsp
;* Name: _up_getsp
;*
;* Description:
;* Return the current value of the stack pointer
;*
;**************************************************************************
_z80_getsp:
_up_getsp:
ld hl, 0 ; Initialize HL to zero
add hl, sp ; Add the stack pointer to HL
ret ; Return stack pointer in HL

View File

@ -1687,6 +1687,23 @@ int up_timer_cancel(FAR struct timespec *ts);
int up_timer_start(FAR const struct timespec *ts);
#endif
/****************************************************************************
* Name: up_getsp
*
* Input Parameters:
* None
*
* Returned Value:
* Current stack pointer.
*
****************************************************************************/
/* uintptr_t up_getsp(void);
*
* The actual declaration or definition is provided in arch/arch.h.
* The actual implementation may be a MACRO or an inline function.
*/
/****************************************************************************
* TLS support
****************************************************************************/