diff --git a/arch/z16/include/arch.h b/arch/z16/include/arch.h index f6db60dc78b..d3da587831a 100644 --- a/arch/z16/include/arch.h +++ b/arch/z16/include/arch.h @@ -29,6 +29,8 @@ * Included Files ****************************************************************************/ +#include + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -57,6 +59,10 @@ extern "C" #define EXTERN extern #endif +/* Return the current value of the stack pointer */ + +chipreg_t up_getsp(void); + #undef EXTERN #ifdef __cplusplus } diff --git a/arch/z16/src/common/z16_internal.h b/arch/z16/src/common/z16_internal.h index 75db710f1f9..ca72a213caf 100644 --- a/arch/z16/src/common/z16_internal.h +++ b/arch/z16/src/common/z16_internal.h @@ -164,10 +164,6 @@ void z16_netinitialize(void); # define z16_netinitialize() #endif -/* Return the current value of the stack pointer (used in stack dump logic) */ - -chipreg_t up_getsp(void); - /* Dump stack and registers */ #ifdef CONFIG_ARCH_STACKDUMP diff --git a/arch/z80/include/arch.h b/arch/z80/include/arch.h index b2a4b89e60b..ac3a93bc1bb 100644 --- a/arch/z80/include/arch.h +++ b/arch/z80/include/arch.h @@ -51,4 +51,21 @@ * Public Function Prototypes ****************************************************************************/ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/* Return the current value of the stack pointer */ + +uintptr_t up_getsp(void); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + #endif /* __ARCH_Z80_INCLUDE_ARCH_H */ diff --git a/arch/z80/src/common/z80_internal.h b/arch/z80/src/common/z80_internal.h index f4f8928613b..d9fa7d18eea 100644 --- a/arch/z80/src/common/z80_internal.h +++ b/arch/z80/src/common/z80_internal.h @@ -134,10 +134,6 @@ int up_multicastfilter(FAR struct net_driver_s *dev, FAR uint8_t *mac, # define up_multicastfilter(dev, mac, enable) #endif -/* Return the current value of the stack pointer (used in stack dump logic) */ - -uintptr_t up_getsp(void); - /* Dump stack and registers */ #ifdef CONFIG_ARCH_STACKDUMP