aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil/ports/ARMCMx
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-03 13:21:10 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-03 13:21:10 +0000
commitfa8b45cc5be41840b99d4a5468108568f93513c1 (patch)
treee04eb67455a6ad3ec6450e1cc446339060b6d44a /os/nil/ports/ARMCMx
parented4c276d6e9abd145b2a21afb12d58df61876a97 (diff)
downloadChibiOS-fa8b45cc5be41840b99d4a5468108568f93513c1.tar.gz
ChibiOS-fa8b45cc5be41840b99d4a5468108568f93513c1.tar.bz2
ChibiOS-fa8b45cc5be41840b99d4a5468108568f93513c1.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6255 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/nil/ports/ARMCMx')
-rw-r--r--os/nil/ports/ARMCMx/compilers/GCC/niltypes.h6
-rw-r--r--os/nil/ports/ARMCMx/nilcore.c15
-rw-r--r--os/nil/ports/ARMCMx/nilcore_v6m.c2
-rw-r--r--os/nil/ports/ARMCMx/nilcore_v6m.h19
4 files changed, 16 insertions, 26 deletions
diff --git a/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h b/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h
index 59cd42606..88dba58b8 100644
--- a/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h
+++ b/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h
@@ -71,6 +71,12 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
*/
#define NOINLINE __attribute__((noinline))
+/**
+ * @brief Thread function declaration macro optimized for GCC.
+ */
+#define PORT_THD_FUNCTION(tname, arg) \
+ __attribute__((noreturn)) void tname(void *arg)
+
#endif /* _NILTYPES_H_ */
/** @} */
diff --git a/os/nil/ports/ARMCMx/nilcore.c b/os/nil/ports/ARMCMx/nilcore.c
index e50dc5b80..58b86e76b 100644
--- a/os/nil/ports/ARMCMx/nilcore.c
+++ b/os/nil/ports/ARMCMx/nilcore.c
@@ -52,19 +52,4 @@
/* Module exported functions. */
/*===========================================================================*/
-/**
- * @brief Halts the system.
- * @note The function is declared as a weak symbol, it is possible
- * to redefine it in your application code.
- */
-#if !defined(__DOXYGEN__)
-__attribute__((naked, weak))
-#endif
-void port_halt(void) {
-
- port_disable();
- while (true) {
- }
-}
-
/** @} */
diff --git a/os/nil/ports/ARMCMx/nilcore_v6m.c b/os/nil/ports/ARMCMx/nilcore_v6m.c
index d8772ca54..19f1b9111 100644
--- a/os/nil/ports/ARMCMx/nilcore_v6m.c
+++ b/os/nil/ports/ARMCMx/nilcore_v6m.c
@@ -112,7 +112,7 @@ void _port_irq_epilogue(regarm_t lr) {
port_lock_from_isr();
/* The extctx structure is pointed by the PSP register.*/
- ctxp = (struct extctx *)__get_PSP();
+ ctxp = (struct port_extctx *)__get_PSP();
/* Adding an artificial exception return context, there is no need to
populate it fully.*/
diff --git a/os/nil/ports/ARMCMx/nilcore_v6m.h b/os/nil/ports/ARMCMx/nilcore_v6m.h
index 846378b65..3e3a7f14c 100644
--- a/os/nil/ports/ARMCMx/nilcore_v6m.h
+++ b/os/nil/ports/ARMCMx/nilcore_v6m.h
@@ -202,13 +202,13 @@ struct context {
* @details This code usually setup the context switching frame represented
* by an @p port_intctx structure.
*/
-#define PORT_SETUP_CONTEXT(workspace, wsize, pf, arg) { \
- tp->p_ctx.r13 = (struct port_intctx *)((uint8_t *)workspace + \
- wsize - \
- sizeof(struct port_intctx)); \
- tp->p_ctx.r13->r4 = (regarm_t)(pf); \
- tp->p_ctx.r13->r5 = (regarm_t)(arg); \
- tp->p_ctx.r13->lr = (regarm_t)(_port_thread_start); \
+#define PORT_SETUP_CONTEXT(tp, workspace, wsize, pf, arg) { \
+ (tp)->ctxp = (struct port_intctx *)((uint8_t *)workspace + \
+ (size_t)wsize - \
+ sizeof(struct port_intctx)); \
+ (tp)->ctxp->r4 = (regarm_t)(pf); \
+ (tp)->ctxp->r5 = (regarm_t)(arg); \
+ (tp)->ctxp->lr = (regarm_t)(_port_thread_start); \
}
/**
@@ -270,8 +270,8 @@ struct context {
}
#endif
-#if CH_CFG_TIMEDELTA > 0
-#include "chcore_timer.h"
+#if NIL_CFG_TIMEDELTA > 0
+#include "nilcore_timer.h"
#endif
/*===========================================================================*/
@@ -281,7 +281,6 @@ struct context {
#ifdef __cplusplus
extern "C" {
#endif
- void port_halt(void);
void _port_irq_epilogue(regarm_t lr);
void _port_switch_from_isr(void);
void _port_exit_from_isr(void);