Moved FireTOS and EmuTOS symbols to the linker script.

This commit is contained in:
Vincent Rivière
2012-10-22 19:01:03 +00:00
parent 9b9c08133b
commit fcdcacc33d
3 changed files with 17 additions and 3 deletions

View File

@@ -14,6 +14,11 @@ SECTIONS {
___SDRAM = ABSOLUTE(0x00000000);
___SDRAM_SIZE = ABSOLUTE(0x20000000);
/* Flash components */
__FIRETOS = ABSOLUTE(0xe0400000);
__EMUTOS = ABSOLUTE(0xe0600000);
__EMUTOS_SIZE = ABSOLUTE(0x00100000);
/* VIDEO RAM BASIS */
__VRAM = ABSOLUTE(0x60000000);

View File

@@ -23,6 +23,12 @@ extern int sd_card_init();
extern void wait_10ms();
extern void wait_1ms();
/* Symbols from the linker script */
extern uint8_t _EMUTOS[];
#define EMUTOS ((uint32_t)_EMUTOS) /* where EmuTOS is stored in flash */
extern uint8_t _EMUTOS_SIZE[];
#define EMUTOS_SIZE ((uint32_t)_EMUTOS_SIZE) /* size of EmuTOS, in bytes */
/********************************************************************/
void BaS(void)
{
@@ -61,8 +67,8 @@ void BaS(void)
}
/* copy EMUTOS */
src = (uint8_t *) 0xe0600000L;
while (src < (uint8_t *) 0xe0700000L)
src = (uint8_t *)EMUTOS;
while (src < (uint8_t *)(EMUTOS + EMUTOS_SIZE))
{
*dst++ = *src++;
}

View File

@@ -667,6 +667,9 @@ livo:
/* Symbols from the linker script */
extern uint8_t _FIRETOS[];
#define FIRETOS ((uint32_t)_FIRETOS) /* where FireTOS is stored in flash */
extern uint8_t _BAS_LMA[];
#define BAS_LMA ((uint32_t)_BAS_LMA) /* where the BaS is stored in flash */
@@ -700,7 +703,7 @@ void initialize_hardware(void) {
/* Jump into FireTOS */
typedef void void_func(void);
void_func* FireTOS = (void_func*)0xe0400000;
void_func* FireTOS = (void_func*)FIRETOS;
FireTOS(); // Should never return
return;
}