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/ARM7-LPC214x-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/ARM7-LPC214x-GCC/chcore.h')
-rw-r--r-- | demos/ARM7-LPC214x-GCC/chcore.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/demos/ARM7-LPC214x-GCC/chcore.h b/demos/ARM7-LPC214x-GCC/chcore.h index d5ad07040..5c595ae4f 100644 --- a/demos/ARM7-LPC214x-GCC/chcore.h +++ b/demos/ARM7-LPC214x-GCC/chcore.h @@ -71,13 +71,13 @@ typedef struct { /*
* Platform dependent part of the \p chThdCreate() API.
*/
-#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \
- tp->p_ctx.r13 = (struct intctx *)((BYTE8 *)workspace + \
- wsize - \
- sizeof(struct intctx)); \
- tp->p_ctx.r13->r4 = pf; \
- tp->p_ctx.r13->r5 = arg; \
- tp->p_ctx.r13->lr = threadstart; \
+#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \
+ tp->p_ctx.r13 = (struct intctx *)((BYTE8 *)workspace + \
+ wsize - \
+ sizeof(struct intctx)); \
+ tp->p_ctx.r13->r4 = pf; \
+ tp->p_ctx.r13->r5 = arg; \
+ tp->p_ctx.r13->lr = threadstart; \
}
#ifdef THUMB
@@ -88,19 +88,16 @@ extern void chSysUnlock(void); #define chSysUnlock() asm("msr CPSR_c, #0x1F")
#endif /* THUMB */
-#define chSysPuts(msg) {}
-
#ifdef THUMB
#define INT_REQUIRED_STACK 0x10
#else /* !THUMB */
#define INT_REQUIRED_STACK 0
#endif /* THUMB */
-#define UserStackSize(n) (((sizeof(Thread) + \
- sizeof(struct intctx) + \
- sizeof(struct extctx) + \
- (INT_REQUIRED_STACK) + \
- (n) - 1) | 3) + 1)
-
+#define StackAlign(n) ((((n) - 1) | 3) + 1)
+#define UserStackSize(n) StackAlign(sizeof(Thread) + \
+ sizeof(struct intctx) + \
+ sizeof(struct extctx) + \
+ (n) + (INT_REQUIRED_STACK))
#define WorkingArea(s, n) ULONG32 s[UserStackSize(n) >> 2];
/* It requires zero bytes, but better be safe.*/
@@ -109,6 +106,7 @@ void _IdleThread(void *p) __attribute__((noreturn)); void chSysHalt(void) __attribute__((noreturn));
void chSysSwitchI(Context *oldp, Context *newp);
+void chSysPuts(char *msg);
void threadstart(void);
void DefFiqHandler(void);
void DefIrqHandler(void);
|