From 553cf4cd391dab580fef7b103851fd89ef983843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Mon, 15 Oct 2012 06:14:43 +0000 Subject: [PATCH] (Hopefully) fixed wrong calculation of BaS copy adresses --- BaS_GNU/sources/sysinit.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/BaS_GNU/sources/sysinit.c b/BaS_GNU/sources/sysinit.c index 03ed772..51c5adb 100644 --- a/BaS_GNU/sources/sysinit.c +++ b/BaS_GNU/sources/sysinit.c @@ -794,26 +794,26 @@ asm( } /* copy the BaS code contained in flash to its final location */ - src = copy_start; - dst = Bas_base; - jmp = (uint8_t *) BaS - copy_start + Bas_base; + src = ©_start; + dst = &Bas_base; + jmp = (uint8_t *) &BaS - (uint32_t) ©_start + (uint32_t) &Bas_base; do { *src++ = *dst++; *src++ = *dst++; *src++ = *dst++; *src++ = *dst++; - } while (src < (uint8_t *) copy_end); + } while (src < (uint8_t *) ©_end); - flushDataCacheRegion(Bas_base, (uint8_t *) copy_end - copy_start); - flushInstructionCacheRegion(Bas_base, (uint8_t *) copy_end - copy_start); + flushDataCacheRegion(Bas_base, (uint8_t *) ©_end - copy_start); + flushInstructionCacheRegion(Bas_base, (uint8_t *) ©_end - copy_start); - asm volatile( + __asm__ __volatile__( " .global _copy_start | \n\t" " move.l %0,a3 | calculated start address\n\t" " jmp (a3) | go! \n\t" "_copy_start: | \n\t" /* output */ : /* input */ : "g" (jmp) - /* clobber */: "a3" + /* clobber */: "a3", "memory" ); }