• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#ifndef HAVE__BUILTIN___CLEAR_CACHE
6
7#if defined(__ia64__)
8
9	.global flush_cache
10
11	.proc flush_cache
12flush_cache:
13	.prologue
14        alloc r2=ar.pfs,2,0,0,0
15	add r8=31,in1			// round up to 32 byte-boundary
16        ;;
17        shr.u r8=r8,5                   // we flush 32 bytes per iteration
18	;;
19	add r8=-1,r8
20        .save ar.lc, r3
21        mov r3=ar.lc                    // save ar.lc
22        ;;
23        .body
24
25        mov ar.lc=r8
26        ;;
27.loop:  fc in0                          // issuable on M0 only
28        add in0=32,in0
29        br.cloop.sptk.few .loop
30        ;;
31        sync.i
32        ;;
33        srlz.i
34        ;;
35        mov ar.lc=r3                    // restore ar.lc
36        br.ret.sptk.many rp
37	.endp flush_cache
38
39#elif defined(__i386__) || defined (__x86_64__)
40
41	.globl flush_cache
42flush_cache:
43	ret
44
45#elif defined(__hppa__)
46
47# warning FIX ME!!
48
49        .globl flush_cache
50flush_cache:
51        .proc
52        .callinfo
53        bv      %r0(%rp)
54        .procend
55#elif defined(__powerpc64__)
56# warning IMPLEMENT ME FOR PPC64!!
57	.globl flush_cache
58flush_cache:
59	lwz    11,  0(1)  ;
60	lwz     0,  4(11) ;
61	mtlr    0         ;
62	lwz    31, -4(11) ;
63	mr      1, 11     ;
64	blr
65#elif defined(__powerpc__)
66# warning IMPLEMENT ME FOR PPC32!!
67	.globl flush_cache
68flush_cache:
69	lwz    11,  0(1)  ;
70	lwz     0,  4(11) ;
71	mtlr    0         ;
72	lwz    31, -4(11) ;
73	mr      1, 11     ;
74	blr
75#elif defined(__arm__)
76	.text
77	.globl flush_cache
78flush_cache:
79	bx    lr
80#elif defined(__tilegx__)
81        .text
82        .globl flush_cache
83flush_cache:
84
85        andi r0, r0, -64
861:      {
87         flush r0 ;
88         addi  r0, r0, 64
89        }
90        {
91         bgtz r1, 1b ;
92         addi r1, r1, -64
93        }
94        jrp   lr
95#else
96# error Need flush_cache code for this architecture.
97#endif
98
99#if defined ( __linux__) && !defined (__arm__)
100        /* We do not need executable stack.  */
101        .section        .note.GNU-stack,"",@progbits
102#endif
103
104#endif
105