From c186491dbdfb14bbdf346cf92fbd5b8b1de64a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Rivi=C3=A8re?= Date: Wed, 7 Nov 2012 21:54:21 +0000 Subject: [PATCH] Use __STRAM_END. --- BaS_GNU/sources/BaS.c | 4 +++- BaS_GNU/sources/exceptions.S | 2 +- BaS_GNU/sources/sysinit.c | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/BaS_GNU/sources/BaS.c b/BaS_GNU/sources/BaS.c index f2edb53..5eba248 100644 --- a/BaS_GNU/sources/BaS.c +++ b/BaS_GNU/sources/BaS.c @@ -24,6 +24,8 @@ extern void wait_10ms(); extern void wait_1ms(); /* Symbols from the linker script */ +extern uint8_t _STRAM_END[]; +#define STRAM_END ((uint32_t)_STRAM_END) extern uint8_t _TOS[]; #define TOS ((uint32_t)_TOS) /* final TOS location */ extern uint8_t _EMUTOS[]; @@ -162,7 +164,7 @@ void BaS(void) /* ST RAM */ - * (uint32_t *) 0x42e = 0xe00000; /* phystop TOS system variable */ + * (uint32_t *) 0x42e = STRAM_END; /* phystop TOS system variable */ * (uint32_t *) 0x420 = 0x752019f3; /* memvalid TOS system variable */ * (uint32_t *) 0x43a = 0x237698aa; /* memval2 TOS system variable */ * (uint32_t *) 0x51a = 0x5555aaaa; /* memval3 TOS system variable */ diff --git a/BaS_GNU/sources/exceptions.S b/BaS_GNU/sources/exceptions.S index 9589eea..801feed 100644 --- a/BaS_GNU/sources/exceptions.S +++ b/BaS_GNU/sources/exceptions.S @@ -817,7 +817,7 @@ video_chg_2page: sub.l d1,d2 // differenz = anzahl zeilen mulu d2,d4 // maximal 480 zeilen add.l d4,d0 // video gr�sse - cmp.l #0xe00000,d0 // maximale addresse + cmp.l #__STRAM_END,d0 // maximale addresse bge video_chg_end // wenn gleich oder gr�sser -> fertig moveq #20,d4 move.l d0,d2 diff --git a/BaS_GNU/sources/sysinit.c b/BaS_GNU/sources/sysinit.c index ef6c2a0..4ad22e9 100644 --- a/BaS_GNU/sources/sysinit.c +++ b/BaS_GNU/sources/sysinit.c @@ -747,6 +747,9 @@ livo: /* Symbols from the linker script */ +extern uint8_t _STRAM_END[]; +#define STRAM_END ((uint32_t)_STRAM_END) + extern uint8_t _FIRETOS[]; #define FIRETOS ((uint32_t)_FIRETOS) /* where FireTOS is stored in flash */ @@ -776,7 +779,7 @@ void initialize_hardware(void) { /* FireTOS seems to have trouble to initialize the ST-RAM by itself, so... */ /* Validate ST RAM */ - * (volatile uint32_t *) 0x42e = 0x00e00000; /* phystop TOS system variable */ + * (volatile uint32_t *) 0x42e = STRAM_END; /* phystop TOS system variable */ * (volatile uint32_t *) 0x420 = 0x752019f3; /* memvalid TOS system variable */ * (volatile uint32_t *) 0x43a = 0x237698aa; /* memval2 TOS system variable */ * (volatile uint32_t *) 0x51a = 0x5555aaaa; /* memval3 TOS system variable */