flush-cache.S revision 18acb9253071fe5a643013e825b6b9a7f8dec8db
1#if defined(__ia64__)
2
3	.global flush_cache
4
5	.proc flush_cache
6flush_cache:
7	.prologue
8        alloc r2=ar.pfs,2,0,0,0
9	add r8=31,in1			// round up to 32 byte-boundary
10        ;;
11        shr.u r8=r8,5                   // we flush 32 bytes per iteration
12	;;
13	add r8=-1,r8
14        .save ar.lc, r3
15        mov r3=ar.lc                    // save ar.lc
16        ;;
17        .body
18
19        mov ar.lc=r8
20        ;;
21.loop:  fc in0                          // issuable on M0 only
22        add in0=32,in0
23        br.cloop.sptk.few .loop
24        ;;
25        sync.i
26        ;;
27        srlz.i
28        ;;
29        mov ar.lc=r3                    // restore ar.lc
30        br.ret.sptk.many rp
31	.endp flush_cache
32
33#elif defined(__i386__) || defined (__x86_64__)
34
35	.globl flush_cache
36flush_cache:
37	ret
38
39#else
40# error Need flush_cache code for this architecture.
41#endif
42