From a32835a34a8847b5ec36ccb4f458a21c90001cb7 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 10 May 2007 18:40:49 +0000 Subject: 2007-05-10 Joel Sherrill 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. --- cpukit/score/cpu/sparc/cpu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cpukit/score/cpu/sparc/cpu.c') diff --git a/cpukit/score/cpu/sparc/cpu.c b/cpukit/score/cpu/sparc/cpu.c index ed240fc8a8..5e6bf3717d 100644 --- a/cpukit/score/cpu/sparc/cpu.c +++ b/cpukit/score/cpu/sparc/cpu.c @@ -71,6 +71,13 @@ void _CPU_Initialize( */ _CPU_Table = *cpu_table; + + /* + * Since no tasks have been created yet and no interrupts have occurred, + * there is no way that the currently executing thread can have an + * _ISR_Dispatch stack frame on its stack. + */ + _CPU_ISR_Dispatch_disable = 0; } /*PAGE @@ -327,4 +334,10 @@ void _CPU_Context_Initialize( tmp_psr |= SPARC_PSR_EF_MASK; #endif the_context->psr = tmp_psr; + + /* + * Since THIS thread is being created, there is no way that THIS + * thread can have an _ISR_Dispatch stack frame on its stack. + */ + the_context->isr_dispatch_disable = 0; } -- cgit v1.2.3