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:
Xiang Xiao
2022-06-30 03:47:43 +08:00
committed by Alan Carvalho de Assis
parent caf92cdadf
commit 3d1ce144df
38 changed files with 522 additions and 561 deletions
-22
View File
@@ -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
****************************************************************************/
+20
View File
@@ -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
****************************************************************************/