From 1ad308bf6e474806c401e6ddcdb47f02af20df65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Tue, 19 Nov 2013 14:59:20 +0000 Subject: [PATCH] stack was misaligned --- BaS_gcc/sources/exceptions.S | 4 +++- BaS_gcc/sources/mmu.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BaS_gcc/sources/exceptions.S b/BaS_gcc/sources/exceptions.S index 8af1200..427004d 100644 --- a/BaS_gcc/sources/exceptions.S +++ b/BaS_gcc/sources/exceptions.S @@ -554,7 +554,9 @@ access_mmu: move.l MCF_MMU_MMUAR,d0 cmp.l #__FASTRAM_END,d0 // above max User RAM area? bge bus_error // -> bus error - bra _mmutr_miss // else we have an MMU TLB miss + bsr _mmutr_miss // else we have an MMU TLB miss + move.l (sp)+,d0 // restore register + rte bus_error: move.l (sp)+,d0 // restore register diff --git a/BaS_gcc/sources/mmu.c b/BaS_gcc/sources/mmu.c index a36a592..d40219c 100644 --- a/BaS_gcc/sources/mmu.c +++ b/BaS_gcc/sources/mmu.c @@ -345,7 +345,7 @@ void mmu_init(void) MCF_MMU_MMUOR_UAA; /* update allocation address field */ } -void __attribute__((interrupt)) mmutr_miss(void) +void mmutr_miss(void) { register uint32_t address asm("d0"); @@ -367,6 +367,7 @@ void __attribute__((interrupt)) mmutr_miss(void) MCF_MMU_MMUOR = MCF_MMU_MMUOR_ITLB | /* instruction */ MCF_MMU_MMUOR_ACC | /* access TLB */ MCF_MMU_MMUOR_UAA; /* update allocation address field */ + }