From b01d7c7eebb94896e56335a8775f2ce3f7923df4 Mon Sep 17 00:00:00 2001 From: Till Straumann Date: Thu, 29 Oct 2009 16:29:46 +0000 Subject: 2009-10-29 Till Straumann * rtems/score/cpu.h: Define _CPU_Interrupt_stack_setup() macro which reserves space for the 'vector' arg to _C_dispatch_isr() routine and aligns the irq stack to CPU_STACK_ALIGNMENT. --- cpukit/score/cpu/i386/ChangeLog | 6 ++++++ cpukit/score/cpu/i386/rtems/score/cpu.h | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/cpukit/score/cpu/i386/ChangeLog b/cpukit/score/cpu/i386/ChangeLog index 82b0f810ad..012c4038f5 100644 --- a/cpukit/score/cpu/i386/ChangeLog +++ b/cpukit/score/cpu/i386/ChangeLog @@ -1,3 +1,9 @@ +2009-10-29 Till Straumann + + * rtems/score/cpu.h: Define _CPU_Interrupt_stack_setup() macro + which reserves space for the 'vector' arg to _C_dispatch_isr() + routine and aligns the irq stack to CPU_STACK_ALIGNMENT. + 2009-10-28 Till Straumann * rtems/score/cpu.h: Replaced misleading typedef of diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h index 354166b336..c8218d1a04 100644 --- a/cpukit/score/cpu/i386/rtems/score/cpu.h +++ b/cpukit/score/cpu/i386/rtems/score/cpu.h @@ -287,6 +287,16 @@ SCORE_EXTERN void *_CPU_Interrupt_stack_high; uint32_t _CPU_ISR_Get_level( void ); +/* Make sure interrupt stack has space for ISR + * 'vector' arg at the top and that it is aligned + * properly. + */ + +#define _CPU_Interrupt_stack_setup( _lo, _hi ) \ + do { \ + _hi = (void*)(((uintptr_t)(_hi) - 4) & ~ (CPU_STACK_ALIGNMENT - 1)); \ + } while (0) + #endif /* ASM */ /* end of ISR handler macros */ -- cgit v1.2.3