--- linux-2.6.11-orig/arch/ia64/lib/flush.S 2005-04-26 15:59:49.000000000 +0200 +++ linux-2.6.11/arch/ia64/lib/flush.S 2005-05-23 15:30:24.891935385 +0200 @@ -7,6 +7,22 @@ #include #include + +#if defined(CONFIG_ITANIUM) +#define CACHE_SHIFT 5 +#else +/* + * In Itanium 2 processor, each fc.i instruction will ensure that 128 bytes + * (corresponding to the L3 cache line size) of the I-cache(s) be coherent with + * the data caches. Since the L1I cache has line sizes of 64 bytes, a single + * fc.i instruction can make coherent two lines. + */ +#define CACHE_SHIFT 7 +#endif + +#define CACHE_BYTES (1 << CACHE_SHIFT) + + /* * flush_icache_range(start,end) * Must flush range from start to end-1 but nothing else (need to @@ -17,7 +33,7 @@ alloc r2=ar.pfs,2,0,0,0 sub r8=in1,in0,1 ;; - shr.u r8=r8,5 // we flush 32 bytes per iteration + shr.u r8=r8,CACHE_SHIFT // we flush CACHE_BYTES bytes per iteration .save ar.lc, r3 mov r3=ar.lc // save ar.lc ;; @@ -26,8 +42,8 @@ mov ar.lc=r8 ;; -.Loop: fc in0 // issuable on M0 only - add in0=32,in0 +.Loop: fc.i in0 // issuable on M0 only + add in0=CACHE_BYTES,in0 br.cloop.sptk.few .Loop ;; sync.i