fixed a typo in linker script

avoid copy of BaS if linked to RAM
This commit is contained in:
Markus Fröschle
2013-08-06 10:39:46 +00:00
parent 34d5c358cd
commit feeabc3eb7
4 changed files with 74 additions and 26 deletions

View File

@@ -961,14 +961,22 @@ void initialize_hardware(void) {
//video_1280_1024();
init_ac97();
xprintf("copying BaS (%p - %p) to RAM (%p - %p)\r\n", BAS_LMA, BAS_LMA + BAS_SIZE, BAS_IN_RAM, BAS_IN_RAM + BAS_SIZE);
memcpy((void *) BAS_IN_RAM, BAS_LMA, BAS_SIZE);
xprintf("finished.\r\n");
if (BAS_LMA != BAS_IN_RAM)
{
xprintf("copying BaS (%p - %p) to RAM (%p - %p)\r\n", BAS_LMA, BAS_LMA + BAS_SIZE, BAS_IN_RAM, BAS_IN_RAM + BAS_SIZE);
memcpy((void *) BAS_IN_RAM, BAS_LMA, BAS_SIZE);
xprintf("finished.\r\n");
/* we have copied a code area, so flush the caches */
flush_and_invalidate_caches();
/* we have copied a code area, so flush the caches */
flush_and_invalidate_caches();
/* jump into the BaS in RAM */
}
else
{
xprintf("no BaS copy necessary - running from RAM already\r\n");
}
/* jump into the BaS */
extern void BaS(void);
BaS();
}