diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-27 11:43:28 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-27 11:43:28 +0000 |
commit | a134cd919ea3e6fee591bc29d360f3da74f46a8b (patch) | |
tree | 621c6bd96434a06ce6fd517934f1db6255187c60 /demos/AVR-AT90CANx-GCC/chcore.h | |
parent | a62cb84475bb6212554b847751a409a6183f05a0 (diff) | |
download | ChibiOS-a134cd919ea3e6fee591bc29d360f3da74f46a8b.tar.gz ChibiOS-a134cd919ea3e6fee591bc29d360f3da74f46a8b.tar.bz2 ChibiOS-a134cd919ea3e6fee591bc29d360f3da74f46a8b.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@115 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/AVR-AT90CANx-GCC/chcore.h')
-rw-r--r-- | demos/AVR-AT90CANx-GCC/chcore.h | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/demos/AVR-AT90CANx-GCC/chcore.h b/demos/AVR-AT90CANx-GCC/chcore.h index 07cb45f64..9e1b95db8 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.h +++ b/demos/AVR-AT90CANx-GCC/chcore.h @@ -83,26 +83,21 @@ typedef struct { /**
* Platform dependent part of the \p chThdCreate() API.
*/
-#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \
- tp->p_ctx.sp--; \
- tp->p_ctx.sp->r2 = (int)pf; \
- tp->p_ctx.sp->r3 = (int)pf >> 8; \
- tp->p_ctx.sp->r4 = (int)arg; \
- tp->p_ctx.sp->r5 = (int)arg >> 8; \
- tp->p_ctx.sp->pc = (UWORD16)threadstart; \
+#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \
+ tp->p_ctx.sp--; \
+ tp->p_ctx.sp->r2 = (int)pf; \
+ tp->p_ctx.sp->r3 = (int)pf >> 8; \
+ tp->p_ctx.sp->r4 = (int)arg; \
+ tp->p_ctx.sp->r5 = (int)arg >> 8; \
+ tp->p_ctx.sp->pc = (UWORD16)threadstart; \
}
-/*
- * Interrupt stack usage except for saved registers.
- */
-#define EXTRA_INT_STACK 0x10
-
-#define UserStackSize(n) (sizeof(Thread) + \
- sizeof(struct intctx) + \
- sizeof(struct extctx) + \
- EXTRA_INT_STACK + \
- (n))
-
+#define INT_REQUIRED_STACK 0x10
+#define StackAlign(n) (n)
+#define UserStackSize(n) StackAlign(sizeof(Thread) + \
+ sizeof(struct intctx) + \
+ sizeof(struct extctx) + \
+ (n) + (INT_REQUIRED_STACK))
#define WorkingArea(s, n) BYTE8 s[UserStackSize(n)];
#define chSysLock() asm("cli")
|