mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 13:27:01 +08:00
arch: Move up_getsp from arch.h to irq.h
since all other special register operation in irq.h Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
caf92cdadf
commit
3d1ce144df
@@ -35,28 +35,6 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Inline functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_getsp
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint32_t up_getsp(void)
|
||||
{
|
||||
uint32_t retval;
|
||||
|
||||
do
|
||||
{
|
||||
retval = 0;
|
||||
__asm__ volatile("mov %%sp, %0" : "=r" (retval) : "0" (retval));
|
||||
}
|
||||
while (0);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
@@ -68,6 +68,26 @@ extern "C"
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Inline functions
|
||||
****************************************************************************/
|
||||
|
||||
/* Return the current value of the stack pointer */
|
||||
|
||||
static inline uint32_t up_getsp(void)
|
||||
{
|
||||
uint32_t retval;
|
||||
|
||||
do
|
||||
{
|
||||
retval = 0;
|
||||
__asm__ volatile("mov %%sp, %0" : "=r" (retval) : "0" (retval));
|
||||
}
|
||||
while (0);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user