summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/sparc/rtems/score/cpu.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-05-10 18:40:49 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-05-10 18:40:49 +0000
commita32835a34a8847b5ec36ccb4f458a21c90001cb7 (patch)
treea6bc120f01cc909810b807fe312f477aa3b50a43 /cpukit/score/cpu/sparc/rtems/score/cpu.h
parentBack off patch which should not have been committed. (diff)
downloadrtems-a32835a34a8847b5ec36ccb4f458a21c90001cb7.tar.bz2
2007-05-10 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1237/rtems * cpu.c, cpu_asm.S, rtems/score/cpu.h: Add logic to prevent stack creep when interrupts occur at a sufficient rate that the interrupted thread never gets to clean its stack. This patch ensures that an interrupted thread will not nest ISR dispatches on its stack.
Diffstat (limited to 'cpukit/score/cpu/sparc/rtems/score/cpu.h')
-rw-r--r--cpukit/score/cpu/sparc/rtems/score/cpu.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/cpukit/score/cpu/sparc/rtems/score/cpu.h b/cpukit/score/cpu/sparc/rtems/score/cpu.h
index 71a8ee59c4..dfe9978c7f 100644
--- a/cpukit/score/cpu/sparc/rtems/score/cpu.h
+++ b/cpukit/score/cpu/sparc/rtems/score/cpu.h
@@ -333,6 +333,7 @@ typedef struct {
uint32_t o7;
uint32_t psr;
+ uint32_t isr_dispatch_disable;
} Context_Control;
#endif /* ASM */
@@ -378,8 +379,9 @@ typedef struct {
#define O7_OFFSET 0x7C
#define PSR_OFFSET 0x80
+#define ISR_DISPATCH_DISABLE_STACK_OFFSET 0x84
-#define CONTEXT_CONTROL_SIZE 0x84
+#define CONTEXT_CONTROL_SIZE 0x88
/*
* The floating point context area.
@@ -553,6 +555,15 @@ SCORE_EXTERN void *_CPU_Interrupt_stack_low;
SCORE_EXTERN void *_CPU_Interrupt_stack_high;
/*
+ * This flag is context switched with each thread. It indicates
+ * that THIS thread has an _ISR_Dispatch stack frame on its stack.
+ * By using this flag, we can avoid nesting more interrupt dispatching
+ * attempts on a previously interrupted thread's stack.
+ */
+
+SCORE_EXTERN volatile uint32_t _CPU_ISR_Dispatch_disable;
+
+/*
* The following type defines an entry in the SPARC's trap table.
*
* NOTE: The instructions chosen are RTEMS dependent although one is