From c4eab50690506d07ac5760c280ba93d0a18911cc Mon Sep 17 00:00:00 2001 From: utzig Date: Tue, 8 Jul 2014 19:03:04 +0000 Subject: Fixed setup_context and removed unused extctx git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7020 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/nil/ports/AVR/nilcore.h | 42 ++++++++---------------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) (limited to 'os/nil/ports/AVR') diff --git a/os/nil/ports/AVR/nilcore.h b/os/nil/ports/AVR/nilcore.h index 6394eeb0b..1aa40d5b9 100644 --- a/os/nil/ports/AVR/nilcore.h +++ b/os/nil/ports/AVR/nilcore.h @@ -137,31 +137,6 @@ typedef uint16_t systime_t; */ typedef uint8_t stkalign_t; -/** - * @brief Interrupt saved context. - * @details This structure represents the stack frame saved during a - * preemption-capable interrupt handler. - */ -struct port_extctx { - uint8_t _next; - uint8_t r31; - uint8_t r30; - uint8_t r27; - uint8_t r26; - uint8_t r25; - uint8_t r24; - uint8_t r23; - uint8_t r22; - uint8_t r21; - uint8_t r20; - uint8_t r19; - uint8_t r18; - uint8_t sr; - uint8_t r1; - uint8_t r0; - uint16_t pc; -}; - /** * @brief System saved context. * @details This structure represents the inner stack frame during a context @@ -203,14 +178,14 @@ struct port_intctx { * by an @p port_intctx structure. */ #define PORT_SETUP_CONTEXT(tp, wend, pf, arg) { \ - (tp)->ctxp.sp = (struct port_intctx*)(((uint8_t *)(wend)) - \ - sizeof(struct port_intctx)); \ - (tp)->ctxp.sp->r2 = (uint8_t)(pf); \ - (tp)->ctxp.sp->r3 = (uint8_t)((pf) >> 8); \ - (tp)->ctxp.sp->r4 = (uint8_t)(arg); \ - (tp)->ctxp.sp->r5 = (uint8_t)((arg) >> 8); \ - (tp)->ctxp.sp->pcl = (uint8_t)(_port_thread_start >> 8); \ - (tp)->ctxp.sp->pch = (uint8_t)_port_thread_start; \ + (tp)->ctxp = (struct port_intctx*)(((uint8_t *)(wend)) - \ + sizeof(struct port_intctx)); \ + (tp)->ctxp->r2 = (int)pf; \ + (tp)->ctxp->r3 = (int)pf >> 8; \ + (tp)->ctxp->r4 = (int)arg; \ + (tp)->ctxp->r5 = (int)arg >> 8; \ + (tp)->ctxp->pcl = (int)_port_thread_start >> 8; \ + (tp)->ctxp->pch = (int)_port_thread_start; \ } /** @@ -218,7 +193,6 @@ struct port_intctx { * @note There is no need to perform alignments in this macro. */ #define PORT_WA_SIZE(n) ((sizeof(struct port_intctx) - 1) + \ - (sizeof(struct port_extctx) - 1) + \ (n) + (PORT_INT_REQUIRED_STACK)) /** -- cgit v1.2.3