diff options
Diffstat (limited to 'nuttx/arch/x86/include/i486/arch.h')
-rwxr-xr-x | nuttx/arch/x86/include/i486/arch.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nuttx/arch/x86/include/i486/arch.h b/nuttx/arch/x86/include/i486/arch.h index 89901cb0a..fcce94fa4 100755 --- a/nuttx/arch/x86/include/i486/arch.h +++ b/nuttx/arch/x86/include/i486/arch.h @@ -44,6 +44,11 @@ * Included Files ****************************************************************************/ +#include <nuttx/config.h> +#ifndef __ASSEMBLY__ +# include <stdint.h> +#endif + /**************************************************************************** * Definitions ****************************************************************************/ @@ -80,6 +85,22 @@ * Inline functions ****************************************************************************/ +#ifndef __ASSEMBLY__ + +/* Return stack pointer */ + +static inline uint32_t up_getsp() +{ + uint32_t regval; + + asm volatile( + "\tmovl %%esp, %0\n" + : "=rm" (regval) + : + : "memory"); + return regval; +} + /**************************************************************************** * Public Types ****************************************************************************/ @@ -104,5 +125,6 @@ extern "C" { } #endif +#endif /* __ASSEMBLY__ */ #endif /* __ARCH_X86_INCLUDE_I486_ARCH_H */ |