Artifact
29c5590eb57775830f2c3588f426543bdb054e21:
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 73 70 61 72 63 20 2a 2f 0a 0a 2f 2a 0a 20 r sparc */../*.
0030: 2a 20 43 6f 70 79 72 69 67 68 74 20 31 39 39 36 * Copyright 1996
0040: 2d 31 39 39 39 20 42 72 75 6e 6f 20 48 61 69 62 -1999 Bruno Haib
0050: 6c 65 2c 20 3c 62 72 75 6e 6f 40 63 6c 69 73 70 le, <bruno@clisp
0060: 2e 6f 72 67 3e 0a 20 2a 0a 20 2a 20 54 68 69 73 .org>. *. * This
0070: 20 69 73 20 66 72 65 65 20 73 6f 66 74 77 61 72 is free softwar
0080: 65 20 64 69 73 74 72 69 62 75 74 65 64 20 75 6e e distributed un
0090: 64 65 72 20 74 68 65 20 47 4e 55 20 47 65 6e 65 der the GNU Gene
00a0: 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e ral Public Licen
00b0: 63 65 0a 20 2a 20 64 65 73 63 72 69 62 65 64 20 ce. * described
00c0: 69 6e 20 74 68 65 20 66 69 6c 65 20 43 4f 50 59 in the file COPY
00d0: 49 4e 47 2e 20 43 6f 6e 74 61 63 74 20 74 68 65 ING. Contact the
00e0: 20 61 75 74 68 6f 72 20 69 66 20 79 6f 75 20 64 author if you d
00f0: 6f 6e 27 74 20 68 61 76 65 20 74 68 69 73 0a 20 on't have this.
0100: 2a 20 6f 72 20 63 61 6e 27 74 20 6c 69 76 65 20 * or can't live
0110: 77 69 74 68 20 69 74 2e 20 54 68 65 72 65 20 69 with it. There i
0120: 73 20 41 42 53 4f 4c 55 54 45 4c 59 20 4e 4f 20 s ABSOLUTELY NO
0130: 57 41 52 52 41 4e 54 59 2c 20 65 78 70 6c 69 63 WARRANTY, explic
0140: 69 74 20 6f 72 20 69 6d 70 6c 69 65 64 2c 0a 20 it or implied,.
0150: 2a 20 6f 6e 20 74 68 69 73 20 73 6f 66 74 77 61 * on this softwa
0160: 72 65 2e 0a 20 2a 2f 0a 0a 2f 2a 0a 20 2a 20 54 re.. */../*. * T
0170: 68 69 73 20 61 73 73 75 6d 65 73 20 74 68 61 74 his assumes that
0180: 20 74 68 65 20 72 61 6e 67 65 20 5b 66 69 72 73 the range [firs
0190: 74 5f 61 64 64 72 2e 2e 6c 61 73 74 5f 61 64 64 t_addr..last_add
01a0: 72 5d 20 6c 69 65 73 20 69 6e 20 61 74 20 6d 6f r] lies in at mo
01b0: 73 74 20 74 77 6f 0a 20 2a 20 63 61 63 68 65 20 st two. * cache
01c0: 6c 69 6e 65 73 2e 0a 20 2a 2f 0a 76 6f 69 64 20 lines.. */.void
01d0: 5f 5f 54 52 5f 63 6c 65 61 72 5f 63 61 63 68 65 __TR_clear_cache
01e0: 5f 32 20 28 63 68 61 72 2a 20 66 69 72 73 74 5f _2 (char* first_
01f0: 61 64 64 72 2c 20 63 68 61 72 2a 20 6c 61 73 74 addr, char* last
0200: 5f 61 64 64 72 29 0a 7b 0a 20 20 61 73 6d 20 76 _addr).{. asm v
0210: 6f 6c 61 74 69 6c 65 20 28 22 69 66 6c 75 73 68 olatile ("iflush
0220: 20 25 30 2b 30 3b 22 20 2f 2a 20 74 68 65 20 2b %0+0;" /* the +
0230: 30 20 69 73 20 6e 65 65 64 65 64 20 62 79 20 67 0 is needed by g
0240: 61 73 2c 20 73 61 79 73 20 67 66 6f 72 74 68 2d as, says gforth-
0250: 30 2e 33 2e 30 20 2a 2f 0a 20 20 20 20 20 20 20 0.3.0 */.
0260: 20 20 20 20 20 20 20 20 20 22 69 66 6c 75 73 68 "iflush
0270: 20 25 30 2b 38 22 0a 20 20 20 20 20 20 20 20 20 %0+8".
0280: 20 20 20 20 20 20 20 3a 20 3a 20 22 72 22 20 28 : : "r" (
0290: 66 69 72 73 74 5f 61 64 64 72 29 29 3b 0a 7d 0a first_addr));.}.