summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2203c0c)
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
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $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
*
*
* (c) The GHC Team, 2000-2003
*
if(nundefsym > 0)
{
#ifdef USE_MMAP
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,
#else
oc->image = stgReallocBytes(
image, oc->fileSize + islandSize * nundefsym,
/* Free the local symbol table; we won't need it again. */
freeHashTable(oc->lochash, NULL);
oc->lochash = NULL;
/* 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");
+ }