diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-02-21 11:14:24 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-02-21 11:14:24 +0000 |
commit | 73a6c86af1bb7f4c16f5aaf8d170176adc609fc8 (patch) | |
tree | 8ed5b49743dccecded1d0abb2fea4a9fb4444a22 | |
parent | 3139ee3c532881a23fb5d4171cdc7120f4f1f869 (diff) | |
download | ChibiOS-73a6c86af1bb7f4c16f5aaf8d170176adc609fc8.tar.gz ChibiOS-73a6c86af1bb7f4c16f5aaf8d170176adc609fc8.tar.bz2 ChibiOS-73a6c86af1bb7f4c16f5aaf8d170176adc609fc8.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@798 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | demos/ARM7-LPC214x-G++/main.cpp | 2 | ||||
-rw-r--r-- | demos/ARM7-LPC214x-GCC-minimal/main.c | 4 | ||||
-rw-r--r-- | demos/ARM7-LPC214x-GCC/chconf.h | 4 | ||||
-rw-r--r-- | demos/ARM7-LPC214x-GCC/main.c | 4 | ||||
-rw-r--r-- | ports/ARM7/chcore.h | 25 | ||||
-rw-r--r-- | readme.txt | 2 |
6 files changed, 33 insertions, 8 deletions
diff --git a/demos/ARM7-LPC214x-G++/main.cpp b/demos/ARM7-LPC214x-G++/main.cpp index a269189ab..37d79c04d 100644 --- a/demos/ARM7-LPC214x-G++/main.cpp +++ b/demos/ARM7-LPC214x-G++/main.cpp @@ -80,7 +80,7 @@ static const seqop_t LED3_sequence[] = * Any sequencer is just an instance of this class, all the details are
* totally encapsulated and hidden to the application level.
*/
-class SequencerThread : EnhancedThread<64> {
+class SequencerThread : EnhancedThread<128> {
private:
const seqop_t *base, *curr; // Thread local variables.
diff --git a/demos/ARM7-LPC214x-GCC-minimal/main.c b/demos/ARM7-LPC214x-GCC-minimal/main.c index b80264ed7..59dc04158 100644 --- a/demos/ARM7-LPC214x-GCC-minimal/main.c +++ b/demos/ARM7-LPC214x-GCC-minimal/main.c @@ -24,7 +24,7 @@ /*
* Red LEDs blinker thread, times are in milliseconds.
*/
-static WORKING_AREA(waThread1, 64);
+static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) {
while (TRUE) {
@@ -43,7 +43,7 @@ static msg_t Thread1(void *arg) { /*
* Yellow LED blinker thread, times are in milliseconds.
*/
-static WORKING_AREA(waThread2, 64);
+static WORKING_AREA(waThread2, 128);
static msg_t Thread2(void *arg) {
while (TRUE) {
diff --git a/demos/ARM7-LPC214x-GCC/chconf.h b/demos/ARM7-LPC214x-GCC/chconf.h index cb606580b..72407ff5b 100644 --- a/demos/ARM7-LPC214x-GCC/chconf.h +++ b/demos/ARM7-LPC214x-GCC/chconf.h @@ -368,7 +368,7 @@ * may not be implemented at all.
*/
#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__)
-#define CH_DBG_ENABLE_STACK_CHECK FALSE
+#define CH_DBG_ENABLE_STACK_CHECK TRUE
#endif
/**
@@ -376,7 +376,7 @@ * pattern when a thread is created. */
#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__)
-#define CH_DBG_FILL_THREADS FALSE
+#define CH_DBG_FILL_THREADS TRUE
#endif
/**
diff --git a/demos/ARM7-LPC214x-GCC/main.c b/demos/ARM7-LPC214x-GCC/main.c index 96b117f8a..c83d9a419 100644 --- a/demos/ARM7-LPC214x-GCC/main.c +++ b/demos/ARM7-LPC214x-GCC/main.c @@ -29,7 +29,7 @@ /*
* Red LEDs blinker thread, times are in milliseconds.
*/
-static WORKING_AREA(waThread1, 64);
+static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) {
while (TRUE) {
@@ -48,7 +48,7 @@ static msg_t Thread1(void *arg) { /*
* Yellow LED blinker thread, times are in milliseconds.
*/
-static WORKING_AREA(waThread2, 64);
+static WORKING_AREA(waThread2, 128);
static msg_t Thread2(void *arg) {
while (TRUE) {
diff --git a/ports/ARM7/chcore.h b/ports/ARM7/chcore.h index e2c6481b5..5cc6fc276 100644 --- a/ports/ARM7/chcore.h +++ b/ports/ARM7/chcore.h @@ -277,9 +277,34 @@ struct context { * @param ntp the thread to be switched in
*/
#ifdef THUMB
+#if CH_DBG_ENABLE_STACK_CHECK
+#define port_switch(otp, ntp) { \
+ register Thread *_otp asm ("r0") = (otp); \
+ register Thread *_ntp asm ("r1") = (ntp); \
+ register char *sp asm ("sp"); \
+ if (sp - sizeof(struct intctx) - sizeof(Thread) < (char *)_otp) \
+ asm volatile ("mov r0, #0 \n\t" \
+ "ldr r1, =chDbgPanic \n\t" \
+ "bx r1"); \
+ _port_switch_thumb(_otp, _ntp); \
+}
+#else /* !CH_DBG_ENABLE_STACK_CHECK */
#define port_switch(otp, ntp) _port_switch_thumb(otp, ntp)
+#endif /* !CH_DBG_ENABLE_STACK_CHECK */
#else /* !THUMB */
+#if CH_DBG_ENABLE_STACK_CHECK
+#define port_switch(otp, ntp) { \
+ register Thread *_otp asm ("r0") = (otp); \
+ register Thread *_ntp asm ("r1") = (ntp); \
+ register char *sp asm ("sp"); \
+ if (sp - sizeof(struct intctx) - sizeof(Thread) < (char *)_otp) \
+ asm volatile ("mov r0, #0 \n\t" \
+ "b chDbgPanic"); \
+ _port_switch_arm(_otp, _ntp); \
+}
+#else /* !CH_DBG_ENABLE_STACK_CHECK */
#define port_switch(otp, ntp) _port_switch_arm(otp, ntp)
+#endif /* !CH_DBG_ENABLE_STACK_CHECK */
#endif /* !THUMB */
#ifdef __cplusplus
diff --git a/readme.txt b/readme.txt index c3505a8bc..26f545b37 100644 --- a/readme.txt +++ b/readme.txt @@ -91,7 +91,7 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process, is not used into the kernel, it is meant for debugging.
- NEW: Added a debug option CH_DBG_ENABLE_STACK_CHECK for stack overflow
checking. The check is not performed in the kernel but in the port code.
- Currently no port implements it.
+ Currently only the ARM7 and ARMCM3 ports implements it.
- NEW: Unified makefiles for ARM7 and ARMCM3 projects, the new makefiles
share a common part making them easier to maintain. Also reorganized the
demo-specific part of the makefile, now it is easier to configure and the
|