Instruction Cache Flush in createAdjustor on SPARC

Sven Panne Sven.Panne at informatik.uni-muenchen.de
Thu Apr 25 14:06:24 EDT 2002


Simon Marlow wrote:

> I'm not a sparc expert, would anyone like to suggest a patch?


 From the top of my head (sorry, I forgot my SUN Enterprise Server at work :-):


/* the flush instruction works on double words */
inline void flushCacheOnSPARC(int64_t* from, int64_t* to) {
   while (from < to) {
     asm("flush %0" : : "r" (from++));
   }

   /* it could take up to 5 instructions until the flush is visible */
   asm("nop" : : );
   asm("nop" : : );
   asm("nop" : : );
   asm("nop" : : );
   asm("nop" : : );
}


Cheers,
    S.




More information about the Glasgow-haskell-bugs mailing list