• 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
81#else
82# error Need flush_cache code for this architecture.
83#endif
84
85#if defined ( __linux__) && !defined (__arm__)
86        /* We do not need executable stack.  */
87        .section        .note.GNU-stack,"",@progbits
88#endif
89
90#endif
91