aboutsummaryrefslogtreecommitdiffstats
path: root/ports/ARM7
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-11-29 10:54:24 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-11-29 10:54:24 +0000
commitb3e92dc72078603137a7182759419e2b801755b9 (patch)
treef6a55965ea67966ed2cb283ea7830a428878818d /ports/ARM7
parent4c4689df98554b3089d1dd66c60f92deab9d1603 (diff)
downloadChibiOS-b3e92dc72078603137a7182759419e2b801755b9.tar.gz
ChibiOS-b3e92dc72078603137a7182759419e2b801755b9.tar.bz2
ChibiOS-b3e92dc72078603137a7182759419e2b801755b9.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@521 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports/ARM7')
-rw-r--r--ports/ARM7/chcore.h33
1 files changed, 25 insertions, 8 deletions
diff --git a/ports/ARM7/chcore.h b/ports/ARM7/chcore.h
index daf8df77c..86f138669 100644
--- a/ports/ARM7/chcore.h
+++ b/ports/ARM7/chcore.h
@@ -20,8 +20,16 @@
#ifndef _CHCORE_H_
#define _CHCORE_H_
+/**
+ * Macro defining the ARM7 architecture.
+ */
#define CH_ARCHITECTURE_ARM7
+/*
+ * 32 bit stack alignment.
+ */
+typedef uint32_t stkalign_t;
+
typedef void *regarm;
/*
@@ -113,13 +121,22 @@ extern "C" {
#else /* !THUMB */
#define INT_REQUIRED_STACK 0
#endif /* !THUMB */
-#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) uint32_t s[UserStackSize(n) >> 2];
+
+/*
+ * Enforces a 32 bit alignment for a stack area size value.
+ */
+#define STACK_ALIGN(n) ((((n) - 1) | sizeof(stkalign_t)) + 1)
+
+#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \
+ sizeof(struct intctx) + \
+ sizeof(struct extctx) + \
+ (n) + \
+ INT_REQUIRED_STACK)
+
+/*
+ * Declares a 32bit aligned thread working area.
+ */
+#define WORKING_AREA(s, n) stkalign_t s[THD_WA_SIZE(n)];
#ifdef THUMB
#define chSysSwitchI chSysSwitchI_thumb
@@ -154,7 +171,7 @@ extern "C" {
#ifdef __cplusplus
extern "C" {
#endif
- void _IdleThread(void *p) __attribute__((noreturn));
+ void _idle(void *p) __attribute__((weak, noreturn));
void chSysHalt(void);
void chSysSwitchI(Thread *otp, Thread *ntp);
void chSysPuts(char *msg);