(Hopefully) fixed wrong calculation of BaS copy adresses
This commit is contained in:
@@ -794,26 +794,26 @@ asm(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* copy the BaS code contained in flash to its final location */
|
/* copy the BaS code contained in flash to its final location */
|
||||||
src = copy_start;
|
src = ©_start;
|
||||||
dst = Bas_base;
|
dst = &Bas_base;
|
||||||
jmp = (uint8_t *) BaS - copy_start + Bas_base;
|
jmp = (uint8_t *) &BaS - (uint32_t) ©_start + (uint32_t) &Bas_base;
|
||||||
do {
|
do {
|
||||||
*src++ = *dst++;
|
*src++ = *dst++;
|
||||||
*src++ = *dst++;
|
*src++ = *dst++;
|
||||||
*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);
|
flushDataCacheRegion(Bas_base, (uint8_t *) ©_end - copy_start);
|
||||||
flushInstructionCacheRegion(Bas_base, (uint8_t *) copy_end - copy_start);
|
flushInstructionCacheRegion(Bas_base, (uint8_t *) ©_end - copy_start);
|
||||||
|
|
||||||
asm volatile(
|
__asm__ __volatile__(
|
||||||
" .global _copy_start | \n\t"
|
" .global _copy_start | \n\t"
|
||||||
" move.l %0,a3 | calculated start address\n\t"
|
" move.l %0,a3 | calculated start address\n\t"
|
||||||
" jmp (a3) | go! \n\t"
|
" jmp (a3) | go! \n\t"
|
||||||
"_copy_start: | \n\t"
|
"_copy_start: | \n\t"
|
||||||
/* output */ :
|
/* output */ :
|
||||||
/* input */ : "g" (jmp)
|
/* input */ : "g" (jmp)
|
||||||
/* clobber */: "a3"
|
/* clobber */: "a3", "memory"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user