home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / CLISP-2.LHA / CLISP960530-ki.lha / ffcall / trampoline / cache-hppa.c next >
Encoding:
Text File  |  1996-04-15  |  988 b   |  32 lines

  1. /* Instruction cache flushing for hppa */
  2.  
  3. /*
  4.  * Copyright 1995 Bruno Haible, <haible@ma2s2.mathematik.uni-karlsruhe.de>
  5.  *
  6.  * This is free software distributed under the GNU General Public Licence
  7.  * described in the file COPYING. Contact the author if you don't have this
  8.  * or can't live with it. There is ABSOLUTELY NO WARRANTY, explicit or implied,
  9.  * on this software.
  10.  */
  11.  
  12. /*
  13.  * This assumes that the range [first_addr..last_addr] lies in at most two
  14.  * cache lines.
  15.  */
  16. void __TR_clear_cache (char* first_addr, char* last_addr)
  17. {
  18.   register int tmp1;
  19.   register int tmp2;
  20.   asm volatile ("mfsp %%sr0,%1;"
  21.                 "ldsid (0,%4),%0;"
  22.                 "mtsp %0,%%sr0;"
  23.                 "fic 0(%%sr0,%2);"
  24.                 "fic 0(%%sr0,%3);"
  25.                 "sync;"
  26.                 "mtsp %1,%%sr0;"
  27.                 "nop; nop; nop; nop; nop; nop"
  28.                 : "=r" (tmp1), "=r" (tmp2)
  29.                 : "r" (first_addr), "r" (last_addr), "r" (first_addr)
  30.                );
  31. }
  32.