From 0ea08f4a96ca331276fa6162d6eb4335d9805ae4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 16 Dec 2018 08:35:02 +0000 Subject: Added extern "C" declarations to IRQ macros. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12475 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/common/ports/ARM/chcore.h | 4 ++++ os/common/ports/ARMCAx-TZ/chcore.h | 7 +++++-- os/common/ports/ARMCMx/chcore_v6m.h | 8 ++++++++ os/common/ports/ARMCMx/chcore_v7m.h | 8 ++++++++ os/common/ports/SIMIA32/chcore.h | 8 ++++++++ os/common/ports/e200/chcore.h | 8 ++++++++ os/common/ports/templates/chcore.h | 8 ++++++++ 7 files changed, 49 insertions(+), 2 deletions(-) (limited to 'os/common') diff --git a/os/common/ports/ARM/chcore.h b/os/common/ports/ARM/chcore.h index cc3c6fa53..d9f56d016 100644 --- a/os/common/ports/ARM/chcore.h +++ b/os/common/ports/ARM/chcore.h @@ -332,7 +332,11 @@ struct port_context { * @note @p id can be a function name or a vector number depending on the * port implementation. */ +#ifdef __cplusplus +#define PORT_IRQ_HANDLER(id) extern "C" bool id(void) +#else #define PORT_IRQ_HANDLER(id) bool id(void) +#endif /** * @brief Fast IRQ handler function declaration. diff --git a/os/common/ports/ARMCAx-TZ/chcore.h b/os/common/ports/ARMCAx-TZ/chcore.h index d31f0f736..67f6395f9 100644 --- a/os/common/ports/ARMCAx-TZ/chcore.h +++ b/os/common/ports/ARMCAx-TZ/chcore.h @@ -297,8 +297,11 @@ struct port_context { * @note @p id can be a function name or a vector number depending on the * port implementation. */ -#define PORT_IRQ_HANDLER(id) \ - bool id(void) +#ifdef __cplusplus +#define PORT_IRQ_HANDLER(id) extern "C" bool id(void) +#else +#define PORT_IRQ_HANDLER(id) bool id(void) +#endif /** * @brief Fast IRQ handler function declaration. diff --git a/os/common/ports/ARMCMx/chcore_v6m.h b/os/common/ports/ARMCMx/chcore_v6m.h index d895f84a8..eb1193600 100644 --- a/os/common/ports/ARMCMx/chcore_v6m.h +++ b/os/common/ports/ARMCMx/chcore_v6m.h @@ -269,14 +269,22 @@ struct port_intctx { * @note @p id can be a function name or a vector number depending on the * port implementation. */ +#ifdef __cplusplus +#define PORT_IRQ_HANDLER(id) extern "C" void id(void) +#else #define PORT_IRQ_HANDLER(id) void id(void) +#endif /** * @brief Fast IRQ handler function declaration. * @note @p id can be a function name or a vector number depending on the * port implementation. */ +#ifdef __cplusplus +#define PORT_FAST_IRQ_HANDLER(id) extern "C" void id(void) +#else #define PORT_FAST_IRQ_HANDLER(id) void id(void) +#endif /** * @brief Performs a context switch between two threads. diff --git a/os/common/ports/ARMCMx/chcore_v7m.h b/os/common/ports/ARMCMx/chcore_v7m.h index 28e18239c..408568cc8 100644 --- a/os/common/ports/ARMCMx/chcore_v7m.h +++ b/os/common/ports/ARMCMx/chcore_v7m.h @@ -435,14 +435,22 @@ struct port_intctx { * @note @p id can be a function name or a vector number depending on the * port implementation. */ +#ifdef __cplusplus +#define PORT_IRQ_HANDLER(id) extern "C" void id(void) +#else #define PORT_IRQ_HANDLER(id) void id(void) +#endif /** * @brief Fast IRQ handler function declaration. * @note @p id can be a function name or a vector number depending on the * port implementation. */ +#ifdef __cplusplus +#define PORT_FAST_IRQ_HANDLER(id) extern "C" void id(void) +#else #define PORT_FAST_IRQ_HANDLER(id) void id(void) +#endif /** * @brief Performs a context switch between two threads. diff --git a/os/common/ports/SIMIA32/chcore.h b/os/common/ports/SIMIA32/chcore.h index ba86c2f19..e6b254c33 100644 --- a/os/common/ports/SIMIA32/chcore.h +++ b/os/common/ports/SIMIA32/chcore.h @@ -266,14 +266,22 @@ struct port_context { * @note @p id can be a function name or a vector number depending on the * port implementation. */ +#ifdef __cplusplus +#define PORT_IRQ_HANDLER(id) extern "C" void id(void) +#else #define PORT_IRQ_HANDLER(id) void id(void) +#endif /** * @brief Fast IRQ handler function declaration. * @note @p id can be a function name or a vector number depending on the * port implementation. */ +#ifdef __cplusplus +#define PORT_FAST_IRQ_HANDLER(id) extern "C" void id(void) +#else #define PORT_FAST_IRQ_HANDLER(id) void id(void) +#endif /*===========================================================================*/ /* External declarations. */ diff --git a/os/common/ports/e200/chcore.h b/os/common/ports/e200/chcore.h index aabe70fee..dd6861fd2 100644 --- a/os/common/ports/e200/chcore.h +++ b/os/common/ports/e200/chcore.h @@ -403,14 +403,22 @@ struct port_context { * @note @p id can be a function name or a vector number depending on the * port implementation. */ +#ifdef __cplusplus +#define PORT_IRQ_HANDLER(id) extern "C" void id(void) +#else #define PORT_IRQ_HANDLER(id) void id(void) +#endif /** * @brief Fast IRQ handler function declaration. * @note @p id can be a function name or a vector number depending on the * port implementation. */ +#ifdef __cplusplus +#define PORT_FAST_IRQ_HANDLER(id) extern "C" void id(void) +#else #define PORT_FAST_IRQ_HANDLER(id) void id(void) +#endif /** * @brief Priority level verification macro. diff --git a/os/common/ports/templates/chcore.h b/os/common/ports/templates/chcore.h index 98c4b9502..e3dc48d8e 100644 --- a/os/common/ports/templates/chcore.h +++ b/os/common/ports/templates/chcore.h @@ -248,14 +248,22 @@ struct port_context { * @note @p id can be a function name or a vector number depending on the * port implementation. */ +#ifdef __cplusplus +#define PORT_IRQ_HANDLER(id) extern "C" void id(void) +#else #define PORT_IRQ_HANDLER(id) void id(void) +#endif /** * @brief Fast IRQ handler function declaration. * @note @p id can be a function name or a vector number depending on the * port implementation. */ +#ifdef __cplusplus +#define PORT_FAST_IRQ_HANDLER(id) extern "C" void id(void) +#else #define PORT_FAST_IRQ_HANDLER(id) void id(void) +#endif /** * @brief Performs a context switch between two threads. -- cgit v1.2.3