From 809e93715ee6c6754fbfd5567269ad6d454cba4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Sat, 3 Nov 2012 22:35:47 +0000 Subject: [PATCH] compile cache.c -mpcrel --- BaS_GNU/BaS_GNU/Makefile | 2 ++ BaS_GNU/BaS_GNU/bas.lk.in | 3 ++- BaS_GNU/BaS_GNU/sources/sysinit.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/BaS_GNU/BaS_GNU/Makefile b/BaS_GNU/BaS_GNU/Makefile index b384b3e..dd2202e 100644 --- a/BaS_GNU/BaS_GNU/Makefile +++ b/BaS_GNU/BaS_GNU/Makefile @@ -99,6 +99,8 @@ $(OBJDIR)/init_fpga.o: CFLAGS += -mbitfield # compile printf pc-relative so it can be used as well before and after copy of BaS $(OBJDIR)/printf.o: CFLAGS += -mpcrel +# the same for flush_and_invalidate_cache() +$(OBJDIR)/cache.c: CFLAGS += -mpcrel $(OBJDIR)/%.o:$(SRCDIR)/%.c $(CC) -c $(CFLAGS) $(INCLUDE) $< -o $@ diff --git a/BaS_GNU/BaS_GNU/bas.lk.in b/BaS_GNU/BaS_GNU/bas.lk.in index 7e7a5a3..0ad968e 100644 --- a/BaS_GNU/BaS_GNU/bas.lk.in +++ b/BaS_GNU/BaS_GNU/bas.lk.in @@ -68,7 +68,6 @@ SECTIONS { objs/startcf.o(.text) /* this one is the entry point so it must be the first */ objs/sysinit.o(.text) objs/init_fpga.o(.text) - objs/cache.o(.text) #if (FORMAT == elf32-m68k) *(.rodata) *(.rodata.*) @@ -85,6 +84,8 @@ SECTIONS { objs/printf_helper.o(.text) _xprintf_before_copy = _xprintf - (_BaS - LOADADDR(.bas)); _display_progress_before_copy = _display_progress - (_BaS - LOADADDR(.bas)); + objs/cache.o(.text) + _flush_and_invalidate_caches_before_copy = _flush_and_invalidate_caches - (_BaS - LOADADDR(.bas)); objs/sd_card.o(.text) objs/mmu.o(.text) objs/exceptions.o(.text) diff --git a/BaS_GNU/BaS_GNU/sources/sysinit.c b/BaS_GNU/BaS_GNU/sources/sysinit.c index 4d59483..673360a 100644 --- a/BaS_GNU/BaS_GNU/sources/sysinit.c +++ b/BaS_GNU/BaS_GNU/sources/sysinit.c @@ -14,6 +14,8 @@ extern void xprintf_before_copy(const char *fmt, ...); #define xprintf xprintf_before_copy +extern void flush_and_invalidate_caches_before_copy(void); +#define flush_and_invalidate_caches flush_and_invalidate_caches_before_copy #define UNUSED(x) (void)(x) /* Unused variable */