diff -Nru linux-2.6.11-old/arch/ia64/lib/flush.S linux-2.6.11/arch/ia64/lib/flush.S --- linux-2.6.11-old/arch/ia64/lib/flush.S 2005-05-20 15:26:18.330498876 +0200 +++ linux-2.6.11/arch/ia64/lib/flush.S 2005-05-20 15:28:25.639091067 +0200 @@ -7,6 +7,23 @@ #include #include + +/* + * Note that "L1_CACHE_SHIFT" and "L1_CACHE_BYTES" defined in + * include/asm-ia64/cache.h are not what their names suggest. + * They actually defines the cache line size for L2. + * + * We have to flush the L1 i-cache, too. + */ +#if defined(CONFIG_ITANIUM) +#define L1_CACHE_SHIFT 5 +#else +#define L1_CACHE_SHIFT 6 +#endif + +#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) + + /* * flush_icache_range(start,end) * Must flush range from start to end-1 but nothing else (need to @@ -17,7 +34,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,L1_CACHE_SHIFT // we flush L1_CACHE_BYTES bytes per iteration .save ar.lc, r3 mov r3=ar.lc // save ar.lc ;; @@ -26,8 +43,12 @@ mov ar.lc=r8 ;; +#if defined(CONFIG_ITANIUM) .Loop: fc in0 // issuable on M0 only - add in0=32,in0 +#else +.Loop: fc.i in0 +#endif + add in0=L1_CACHE_BYTES,in0 br.cloop.sptk.few .Loop ;; sync.i