aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil/ports/AVR
diff options
context:
space:
mode:
authorutzig <utzig@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-07-08 19:03:04 +0000
committerutzig <utzig@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-07-08 19:03:04 +0000
commitc4eab50690506d07ac5760c280ba93d0a18911cc (patch)
tree41d1415c576f032893fd1a3953fbcdd485027a7d /os/nil/ports/AVR
parent4a9ae2565a7169c834a2205fe6cb96f830c9c414 (diff)
downloadChibiOS-c4eab50690506d07ac5760c280ba93d0a18911cc.tar.gz
ChibiOS-c4eab50690506d07ac5760c280ba93d0a18911cc.tar.bz2
ChibiOS-c4eab50690506d07ac5760c280ba93d0a18911cc.zip
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
Diffstat (limited to 'os/nil/ports/AVR')
-rw-r--r--os/nil/ports/AVR/nilcore.h42
1 files changed, 8 insertions, 34 deletions
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
@@ -138,31 +138,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
* switching.
@@ -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))
/**