summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/m68k/mcf5235/startup/init5235.c
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-12-01 14:55:23 +1100
committerChris Johns <chrisj@rtems.org>2014-12-01 14:55:23 +1100
commitdd309b10544bfceda968ac847ad34c3d90ca8281 (patch)
tree87460bf9b0a723359ede9eede8fcaa74aa355ab0 /c/src/lib/libbsp/m68k/mcf5235/startup/init5235.c
parentlibmisc/shell: Edit history hack is corrupting memory. Remove it. (diff)
downloadrtems-dd309b10544bfceda968ac847ad34c3d90ca8281.tar.bz2
m68k/mcf5235: GCC 4.9.2 generates invalid code for Init5235.
Move the vector table copy out of the Init5235 source to avoid stipping the GCC bug. Fixes #2204.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/m68k/mcf5235/startup/init5235.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/c/src/lib/libbsp/m68k/mcf5235/startup/init5235.c b/c/src/lib/libbsp/m68k/mcf5235/startup/init5235.c
index 7d8ee23a00..5066941be0 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/startup/init5235.c
+++ b/c/src/lib/libbsp/m68k/mcf5235/startup/init5235.c
@@ -9,9 +9,7 @@
#include <rtems.h>
#include <bsp.h>
-#define m68k_set_cacr(_cacr) __asm__ volatile ("movec %0,%%cacr" : : "d" (_cacr))
-#define m68k_set_acr0(_acr0) __asm__ volatile ("movec %0,%%acr0" : : "d" (_acr0))
-#define m68k_set_acr1(_acr1) __asm__ volatile ("movec %0,%%acr1" : : "d" (_acr1))
+
#define MM_SDRAM_BASE (0x00000000)
/*
@@ -26,6 +24,8 @@ extern uint32_t MCF5235_BSP_START_FROM_FLASH;
extern void CopyDataClearBSSAndStart (void);
extern void INTERRUPT_VECTOR(void);
+extern void CopyVectors(const uint32_t* old, uint32_t* new);
+
void Init5235 (void)
{
int x;
@@ -77,15 +77,7 @@ void Init5235 (void)
} /* we have finished setting up the sdram */
/* Copy the interrupt vector table to address 0x0 in SDRAM */
- {
- uint32_t *inttab = (uint32_t *)&INTERRUPT_VECTOR;
- uint32_t *intvec = (uint32_t *)0x0;
- register int i;
- for (i = 0; i < 256; i++)
- {
- *(intvec++) = *(inttab++);
- }
- }
+ CopyVectors((const uint32_t *)&INTERRUPT_VECTOR, (uint32_t*)0);
m68k_set_vbr(0);
@@ -93,4 +85,5 @@ void Init5235 (void)
* Copy data, clear BSS and call boot_card()
*/
CopyDataClearBSSAndStart ();
+
}