diff options
Diffstat (limited to 'os/rt')
-rw-r--r-- | os/rt/ports/ARMCMx/chcore_v6m.c | 2 | ||||
-rw-r--r-- | os/rt/ports/ARMCMx/chcore_v6m.h | 11 | ||||
-rw-r--r-- | os/rt/ports/ARMCMx/chcore_v7m.h | 10 | ||||
-rw-r--r-- | os/rt/src/chthreads.c | 2 |
4 files changed, 12 insertions, 13 deletions
diff --git a/os/rt/ports/ARMCMx/chcore_v6m.c b/os/rt/ports/ARMCMx/chcore_v6m.c index 4886496da..03688709a 100644 --- a/os/rt/ports/ARMCMx/chcore_v6m.c +++ b/os/rt/ports/ARMCMx/chcore_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/rt/ports/ARMCMx/chcore_v6m.h b/os/rt/ports/ARMCMx/chcore_v6m.h index 846378b65..759041b8a 100644 --- a/os/rt/ports/ARMCMx/chcore_v6m.h +++ b/os/rt/ports/ARMCMx/chcore_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 + \
+#define PORT_SETUP_CONTEXT(tp, 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); \
+ (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); \
}
/**
@@ -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);
diff --git a/os/rt/ports/ARMCMx/chcore_v7m.h b/os/rt/ports/ARMCMx/chcore_v7m.h index f4db6f884..57b5fc40f 100644 --- a/os/rt/ports/ARMCMx/chcore_v7m.h +++ b/os/rt/ports/ARMCMx/chcore_v7m.h @@ -301,13 +301,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 + \
+#define PORT_SETUP_CONTEXT(tp, 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); \
+ (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); \
}
/**
diff --git a/os/rt/src/chthreads.c b/os/rt/src/chthreads.c index 051cf0cc3..35f53a072 100644 --- a/os/rt/src/chthreads.c +++ b/os/rt/src/chthreads.c @@ -184,7 +184,7 @@ thread_t *chThdCreateI(void *wsp, size_t size, chDbgCheck((wsp != NULL) && (size >= THD_WA_SIZE(0)) &&
(prio <= HIGHPRIO) && (pf != NULL));
- PORT_SETUP_CONTEXT(wsp, size, pf, arg);
+ PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg);
return _thread_init(tp, prio);
}
|