From 97099dc58159cffec0218c09a6536195ab4c3a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Rivi=C3=A8re?= Date: Wed, 7 Nov 2012 21:53:01 +0000 Subject: [PATCH] Renamed _tos_base to __TOS. --- bas.lk.in | 4 ++-- sources/BaS.c | 7 ++++--- sources/mmu.S | 7 ++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bas.lk.in b/bas.lk.in index 4e2084f..5defd63 100644 --- a/bas.lk.in +++ b/bas.lk.in @@ -14,10 +14,10 @@ SECTIONS { /* ST-RAM */ __STRAM = ___SDRAM; - __STRAM_END = _tos_base; + __STRAM_END = __TOS; /* TOS */ - _tos_base = 0x00e00000; + __TOS = 0x00e00000; /* FastRAM */ __FASTRAM = 0x10000000; diff --git a/sources/BaS.c b/sources/BaS.c index 51ab119..f2edb53 100644 --- a/sources/BaS.c +++ b/sources/BaS.c @@ -11,7 +11,6 @@ #include "bas_printf.h" extern uint32_t Bas_base[]; -extern uint8_t tos_base[]; /* imported routines */ extern int mmu_init(); @@ -25,6 +24,8 @@ extern void wait_10ms(); extern void wait_1ms(); /* Symbols from the linker script */ +extern uint8_t _TOS[]; +#define TOS ((uint32_t)_TOS) /* final TOS location */ extern uint8_t _EMUTOS[]; #define EMUTOS ((uint32_t)_EMUTOS) /* where EmuTOS is stored in flash */ extern uint8_t _EMUTOS_SIZE[]; @@ -36,7 +37,7 @@ void BaS(void) int az_sectors; int i; uint8_t *src; - uint8_t *dst = tos_base; + uint8_t *dst = (uint8_t *)TOS; uint32_t *adr; /* az_sectors = sd_card_init(); @@ -202,6 +203,6 @@ void BaS(void) xprintf("Call OS. BaS finished...\r\n"); - ROM_HEADER* os_header = (ROM_HEADER*)tos_base; + ROM_HEADER* os_header = (ROM_HEADER*)TOS; os_header->initial_pc(); } diff --git a/sources/mmu.S b/sources/mmu.S index 7b9d53d..6e0765c 100644 --- a/sources/mmu.S +++ b/sources/mmu.S @@ -16,6 +16,7 @@ .extern cpusha .extern _video_tlb .extern _video_sbt + .extern __TOS /* Register read/write macros */ #define MCF_MMU_MMUCR __MMUBAR @@ -136,9 +137,9 @@ _mmu_init: move.l d0,_video_tlb // set page as video page clr.l _video_sbt // clear time //------------------------------------------------------------------------------------- -// 00e0'0000 locked - move.l #0x00e00000|std_mmutr,d0 - move.l #0x00e00000|cb_mmudr|MCF_MMU_MMUDR_LK,d1 +// Make the TOS (in SDRAM) read-only + move.l #__TOS+std_mmutr,d0 + move.l #__TOS+cb_mmudr+MCF_MMU_MMUDR_LK,d1 move.l d0,MCF_MMU_MMUTR move.l d1,MCF_MMU_MMUDR move.l d2,MCF_MMU_MMUOR // setzen read only ?????? noch nicht