diff options
Diffstat (limited to 'os/rt/ports/ARMCMx/chcore_v6m.h')
-rw-r--r-- | os/rt/ports/ARMCMx/chcore_v6m.h | 11 |
1 files changed, 5 insertions, 6 deletions
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);
|