Artifact d3ad9f04207d8d3a437469c7c9bd9d6853edc280:


0000: 2f 2a 20 49 6e 73 74 72 75 63 74 69 6f 6e 20 63  /* Instruction c
0010: 61 63 68 65 20 66 6c 75 73 68 69 6e 67 20 66 6f  ache flushing fo
0020: 72 20 61 72 6d 20 2a 2f 0a 0a 2f 2a 0a 20 2a 20  r arm */../*. * 
0030: 43 6f 70 79 72 69 67 68 74 20 31 39 39 37 20 42  Copyright 1997 B
0040: 72 75 6e 6f 20 48 61 69 62 6c 65 2c 20 3c 62 72  runo Haible, <br
0050: 75 6e 6f 40 63 6c 69 73 70 2e 6f 72 67 3e 0a 20  uno@clisp.org>. 
0060: 2a 0a 20 2a 20 54 68 69 73 20 69 73 20 66 72 65  *. * This is fre
0070: 65 20 73 6f 66 74 77 61 72 65 20 64 69 73 74 72  e software distr
0080: 69 62 75 74 65 64 20 75 6e 64 65 72 20 74 68 65  ibuted under the
0090: 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62   GNU General Pub
00a0: 6c 69 63 20 4c 69 63 65 6e 63 65 0a 20 2a 20 64  lic Licence. * d
00b0: 65 73 63 72 69 62 65 64 20 69 6e 20 74 68 65 20  escribed in the 
00c0: 66 69 6c 65 20 43 4f 50 59 49 4e 47 2e 20 43 6f  file COPYING. Co
00d0: 6e 74 61 63 74 20 74 68 65 20 61 75 74 68 6f 72  ntact the author
00e0: 20 69 66 20 79 6f 75 20 64 6f 6e 27 74 20 68 61   if you don't ha
00f0: 76 65 20 74 68 69 73 0a 20 2a 20 6f 72 20 63 61  ve this. * or ca
0100: 6e 27 74 20 6c 69 76 65 20 77 69 74 68 20 69 74  n't live with it
0110: 2e 20 54 68 65 72 65 20 69 73 20 41 42 53 4f 4c  . There is ABSOL
0120: 55 54 45 4c 59 20 4e 4f 20 57 41 52 52 41 4e 54  UTELY NO WARRANT
0130: 59 2c 20 65 78 70 6c 69 63 69 74 20 6f 72 20 69  Y, explicit or i
0140: 6d 70 6c 69 65 64 2c 0a 20 2a 20 6f 6e 20 74 68  mplied,. * on th
0150: 69 73 20 73 6f 66 74 77 61 72 65 2e 0a 20 2a 2f  is software.. */
0160: 0a 23 69 6e 63 6c 75 64 65 20 3c 6c 69 6e 75 78  .#include <linux
0170: 2f 75 6e 69 73 74 64 2e 68 3e 0a 0a 76 6f 69 64  /unistd.h>..void
0180: 20 5f 5f 54 52 5f 63 6c 65 61 72 5f 63 61 63 68   __TR_clear_cach
0190: 65 20 28 63 68 61 72 20 2a 66 69 72 73 74 5f 61  e (char *first_a
01a0: 64 64 72 2c 20 63 68 61 72 20 2a 6c 61 73 74 5f  ddr, char *last_
01b0: 61 64 64 72 29 0a 7b 0a 20 20 20 20 72 65 67 69  addr).{.    regi
01c0: 73 74 65 72 20 75 6e 73 69 67 6e 65 64 20 6c 6f  ster unsigned lo
01d0: 6e 67 20 5f 62 65 67 20 5f 5f 61 73 6d 20 28 22  ng _beg __asm ("
01e0: 61 31 22 29 20 3d 20 66 69 72 73 74 5f 61 64 64  a1") = first_add
01f0: 72 3b 0a 20 20 20 20 72 65 67 69 73 74 65 72 20  r;.    register 
0200: 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 5f 65  unsigned long _e
0210: 6e 64 20 5f 5f 61 73 6d 20 28 22 61 32 22 29 20  nd __asm ("a2") 
0220: 3d 20 6c 61 73 74 5f 61 64 64 72 3b 0a 20 20 20  = last_addr;.   
0230: 20 72 65 67 69 73 74 65 72 20 75 6e 73 69 67 6e   register unsign
0240: 65 64 20 6c 6f 6e 67 20 5f 66 6c 67 20 5f 5f 61  ed long _flg __a
0250: 73 6d 20 28 22 61 33 22 29 20 3d 20 30 3b 20 0a  sm ("a3") = 0; .
0260: 20 20 20 20 5f 5f 61 73 6d 20 5f 5f 76 6f 6c 61      __asm __vola
0270: 74 69 6c 65 5f 5f 20 28 22 73 77 69 20 30 78 39  tile__ ("swi 0x9
0280: 66 30 30 30 32 22 20 3a 20 3a 20 22 72 22 20 28  f0002" : : "r" (
0290: 5f 62 65 67 29 2c 20 22 72 22 20 28 5f 65 6e 64  _beg), "r" (_end
02a0: 29 2c 20 22 72 22 20 28 5f 66 6c 67 29 29 3b 0a  ), "r" (_flg));.
02b0: 7d 0a                                            }.