From 15a54ae359d342b296b7740dcfaf0580d606b3c6 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 5 Sep 2013 14:54:24 +0000 Subject: Nil working on M3/M4. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6265 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/nil/ports/ARMCMx/nilcore_v6m.h | 7 +++---- os/nil/ports/ARMCMx/nilcore_v7m.h | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'os/nil/ports') diff --git a/os/nil/ports/ARMCMx/nilcore_v6m.h b/os/nil/ports/ARMCMx/nilcore_v6m.h index 60a2549a2..159ce9989 100644 --- a/os/nil/ports/ARMCMx/nilcore_v6m.h +++ b/os/nil/ports/ARMCMx/nilcore_v6m.h @@ -192,9 +192,8 @@ struct port_intctx { * @details This code usually setup the context switching frame represented * by an @p port_intctx structure. */ -#define PORT_SETUP_CONTEXT(tp, workspace, wsize, pf, arg) { \ - (tp)->ctxp = (struct port_intctx *)((uint8_t *)workspace + \ - (size_t)wsize - \ +#define PORT_SETUP_CONTEXT(tp, wend, pf, arg) { \ + (tp)->ctxp = (struct port_intctx *)(((uint8_t *)(wend)) - \ sizeof(struct port_intctx)); \ (tp)->ctxp->r4 = (regarm_t)(pf); \ (tp)->ctxp->r5 = (regarm_t)(arg); \ @@ -254,7 +253,7 @@ struct port_intctx { #else #define port_switch(ntp, otp) { \ struct port_intctx *r13 = (struct port_intctx *)__get_PSP(); \ - if ((stkalign_t *)(r13 - 1) < otp->p_stklimit) \ + if ((stkalign_t *)(r13 - 1) < (otp)->stklim) \ chSysHalt("stack overflow"); \ _port_switch(ntp, otp); \ } diff --git a/os/nil/ports/ARMCMx/nilcore_v7m.h b/os/nil/ports/ARMCMx/nilcore_v7m.h index 4cbcc6e28..0bc4fdf05 100644 --- a/os/nil/ports/ARMCMx/nilcore_v7m.h +++ b/os/nil/ports/ARMCMx/nilcore_v7m.h @@ -291,9 +291,8 @@ struct port_intctx { * @details This code usually setup the context switching frame represented * by an @p port_intctx structure. */ -#define PORT_SETUP_CONTEXT(tp, workspace, wsize, pf, arg) { \ - (tp)->ctxp = (struct port_intctx *)((uint8_t *)workspace + \ - (size_t)wsize - \ +#define PORT_SETUP_CONTEXT(tp, wend, pf, arg) { \ + (tp)->ctxp = (struct port_intctx *)(((uint8_t *)(wend)) - \ sizeof(struct port_intctx)); \ (tp)->ctxp->r4 = (regarm_t)(pf); \ (tp)->ctxp->r5 = (regarm_t)(arg); \ @@ -351,7 +350,7 @@ struct port_intctx { #else #define port_switch(ntp, otp) { \ struct port_intctx *r13 = (struct port_intctx *)__get_PSP(); \ - if ((stkalign_t *)(r13 - 1) < otp->p_stklimit) \ + if ((stkalign_t *)(r13 - 1) < (otp)->stklim) \ chSysHalt("stack overflow"); \ _port_switch(ntp, otp); \ } -- cgit v1.2.3