diff options
Diffstat (limited to 'os/nil/ports')
-rw-r--r-- | os/nil/ports/AVR/nilcore.h | 42 |
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))
/**
|