From: wolfgang Date: Wed, 8 Oct 2003 10:37:25 +0000 (+0000) Subject: [project @ 2003-10-08 10:37:25 by wolfgang] X-Git-Tag: Approx_11550_changesets_converted~387 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=79c93a8a30aaaa6bd940c0677d6f3c57eb727fa2 [project @ 2003-10-08 10:37:25 by wolfgang] Remove apostrophe from #error directive text, as gcc doesn't like that, even if the #error is ifdef'd out. All other C compilers I know claim that this is correct C :-(. merge to stable --- diff --git a/ghc/rts/Linker.c b/ghc/rts/Linker.c index 093a791..7a9e363 100644 --- a/ghc/rts/Linker.c +++ b/ghc/rts/Linker.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Linker.c,v 1.136 2003/10/08 09:42:34 wolfgang Exp $ + * $Id: Linker.c,v 1.137 2003/10/08 10:37:25 wolfgang Exp $ * * (c) The GHC Team, 2000-2003 * @@ -3049,7 +3049,7 @@ static int ocAllocateJumpIslands_MachO(ObjectCode* oc) if(nundefsym > 0) { #ifdef USE_MMAP - #error ocAllocateJumpIslands_MachO doesn't want USE_MMAP to be defined + #error ocAllocateJumpIslands_MachO doesnt want USE_MMAP to be defined #else oc->image = stgReallocBytes( image, oc->fileSize + islandSize * nundefsym, @@ -3467,6 +3467,23 @@ static int ocResolve_MachO(ObjectCode* oc) /* Free the local symbol table; we won't need it again. */ freeHashTable(oc->lochash, NULL); oc->lochash = NULL; + + /* + Flush the data & instruction caches. + Because the PPC has split data/instruction caches, we have to + do that whenever we modify code at runtime. + */ + { + int n = (oc->fileSize + islandSize * oc->n_islands) / 4; + unsigned long *p = (unsigned long*)oc->image; + while(n--) + { + __asm__ volatile ("dcbf 0,%0\n\tsync\n\ticbi 0,%0" + : : "r" (p)); + p++; + } + __asm__ volatile ("sync\n\tisync"); + } return 1; }