summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/m68k
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/cpu/m68k')
-rw-r--r--cpukit/score/cpu/m68k/cpu.c26
-rw-r--r--cpukit/score/cpu/m68k/cpu_asm.S8
-rw-r--r--cpukit/score/cpu/m68k/include/rtems/score/cpu.h22
3 files changed, 16 insertions, 40 deletions
diff --git a/cpukit/score/cpu/m68k/cpu.c b/cpukit/score/cpu/m68k/cpu.c
index c50a63fda1..77a91535c3 100644
--- a/cpukit/score/cpu/m68k/cpu.c
+++ b/cpukit/score/cpu/m68k/cpu.c
@@ -20,6 +20,7 @@
#include <rtems/score/isr.h>
#include <rtems/score/percpu.h>
#include <rtems/score/tls.h>
+#include <rtems/config.h>
#if ( M68K_HAS_VBR == 0 )
@@ -58,6 +59,15 @@ int (*_FPSP_install_raw_handler)(
uint32_t _CPU_cacr_shadow;
#endif
+static void m68k_install_interrupt_stack( void )
+{
+#if ( M68K_HAS_SEPARATE_STACKS == 1 )
+ uintptr_t isp = (uintptr_t) _Configuration_Interrupt_stack_area_end;
+
+ __asm__ volatile ( "movec %0,%%isp" : "=r" (isp) : "0" (isp) );
+#endif
+}
+
void _CPU_Initialize(void)
{
#if ( M68K_HAS_VBR == 0 )
@@ -74,6 +84,8 @@ void _CPU_Initialize(void)
_CPU_ISR_jump_table[slot].isr_handler = (uint32_t) 0xDEADDEAD;
}
#endif /* M68K_HAS_VBR */
+
+ m68k_install_interrupt_stack();
}
uint32_t _CPU_ISR_Get_level( void )
@@ -151,20 +163,6 @@ void _CPU_ISR_install_vector(
_ISR_Vector_table[ vector ] = new_handler;
}
-
-/*
- * _CPU_Install_interrupt_stack
- */
-
-void _CPU_Install_interrupt_stack( void )
-{
-#if ( M68K_HAS_SEPARATE_STACKS == 1 )
- void *isp = _CPU_Interrupt_stack_high;
-
- __asm__ volatile ( "movec %0,%%isp" : "=r" (isp) : "0" (isp) );
-#endif
-}
-
#if ( M68K_HAS_BFFFO != 1 )
/*
* Returns table for duplication of the BFFFO instruction (16 bits only)
diff --git a/cpukit/score/cpu/m68k/cpu_asm.S b/cpukit/score/cpu/m68k/cpu_asm.S
index a31c1588a4..6ec89d8ee0 100644
--- a/cpukit/score/cpu/m68k/cpu_asm.S
+++ b/cpukit/score/cpu/m68k/cpu_asm.S
@@ -259,7 +259,7 @@ SYM (_ISR_Handler):
andl #0x03fc,d0 | d0 = vector offset in vbr
-#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
+#if ( M68K_HAS_SEPARATE_STACKS == 0 )
| Make a0 point just above interrupt stack
movel INTERRUPT_STACK_HIGH,a0
cmpl INTERRUPT_STACK_LOW,a7 | stack below interrupt stack?
@@ -272,7 +272,7 @@ SYM (_ISR_Handler):
movel a1,a7@- | store task stack pointer
| on interrupt stack
2:
-#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
+#endif /* M68K_HAS_SEPARATE_STACKS == 0 */
addql #1,ISR_NEST_LEVEL | one nest level deeper
@@ -285,14 +285,14 @@ SYM (_ISR_Handler):
addql #4,a7 | remove vector number
subql #1,ISR_NEST_LEVEL | Reduce interrupt-nesting count
-#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
+#if ( M68K_HAS_SEPARATE_STACKS == 0 )
movel INTERRUPT_STACK_HIGH,a0
subql #4,a0
cmpl a0,a7 | At top of interrupt stack?
bne.b 1f | No, do not restore task stack pointer
movel (a7),a7 | Restore task stack pointer
1:
-#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
+#endif /* M68K_HAS_SEPARATE_STACKS == 0 */
subql #1,THREAD_DISPATCH_DISABLE_LEVEL
| unnest multitasking
bne.b exit | If dispatch disabled, exit
diff --git a/cpukit/score/cpu/m68k/include/rtems/score/cpu.h b/cpukit/score/cpu/m68k/include/rtems/score/cpu.h
index 1b1b460901..9915f36434 100644
--- a/cpukit/score/cpu/m68k/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/m68k/include/rtems/score/cpu.h
@@ -42,20 +42,6 @@ extern "C" {
#define CPU_SIMPLE_VECTORED_INTERRUPTS TRUE
/*
- * Use the m68k's hardware interrupt stack support and have the
- * interrupt manager allocate the memory for it.
- */
-
-#if ( M68K_HAS_SEPARATE_STACKS == 1)
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK 0
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK 1
-#else
-#define CPU_HAS_SOFTWARE_INTERRUPT_STACK 1
-#define CPU_HAS_HARDWARE_INTERRUPT_STACK 0
-#endif
-#define CPU_ALLOCATE_INTERRUPT_STACK 1
-
-/*
* Does the RTEMS invoke the user's ISR with the vector number and
* a pointer to the saved interrupt frame (1) or just the vector
* number (0)?
@@ -615,14 +601,6 @@ void _CPU_ISR_install_vector(
);
/*
- * _CPU_Install_interrupt_stack
- *
- * This routine installs the hardware interrupt stack pointer.
- */
-
-void _CPU_Install_interrupt_stack( void );
-
-/*
* _CPU_Context_switch
*
* This routine switches from the run context to the heir context.