Commit 682f88ab authored by Paul Mundt's avatar Paul Mundt

sh: Cleanup whitespace damage in sh4_flush_icache_range().

There was quite a lot of tab->space damage done here from a former patch,
clean it up once and for all.
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 1043bf5c
...@@ -46,7 +46,6 @@ static void (*__flush_dcache_segment_fn)(unsigned long, unsigned long) = ...@@ -46,7 +46,6 @@ static void (*__flush_dcache_segment_fn)(unsigned long, unsigned long) =
static void sh4_flush_icache_range(void *args) static void sh4_flush_icache_range(void *args)
{ {
struct flusher_data *data = args; struct flusher_data *data = args;
int icacheaddr;
unsigned long start, end; unsigned long start, end;
unsigned long flags, v; unsigned long flags, v;
int i; int i;
...@@ -54,12 +53,16 @@ static void sh4_flush_icache_range(void *args) ...@@ -54,12 +53,16 @@ static void sh4_flush_icache_range(void *args)
start = data->addr1; start = data->addr1;
end = data->addr2; end = data->addr2;
/* If there are too many pages then just blow the caches */ /* If there are too many pages then just blow away the caches */
if (((end - start) >> PAGE_SHIFT) >= MAX_ICACHE_PAGES) { if (((end - start) >> PAGE_SHIFT) >= MAX_ICACHE_PAGES) {
local_flush_cache_all(args); local_flush_cache_all(NULL);
} else { return;
/* selectively flush d-cache then invalidate the i-cache */ }
/* this is inefficient, so only use for small ranges */
/*
* Selectively flush d-cache then invalidate the i-cache.
* This is inefficient, so only use this for small ranges.
*/
start &= ~(L1_CACHE_BYTES-1); start &= ~(L1_CACHE_BYTES-1);
end += L1_CACHE_BYTES-1; end += L1_CACHE_BYTES-1;
end &= ~(L1_CACHE_BYTES-1); end &= ~(L1_CACHE_BYTES-1);
...@@ -67,23 +70,23 @@ static void sh4_flush_icache_range(void *args) ...@@ -67,23 +70,23 @@ static void sh4_flush_icache_range(void *args)
local_irq_save(flags); local_irq_save(flags);
jump_to_uncached(); jump_to_uncached();
for (v = start; v < end; v+=L1_CACHE_BYTES) { for (v = start; v < end; v += L1_CACHE_BYTES) {
asm volatile("ocbwb %0" unsigned long icacheaddr;
: /* no output */
: "m" (__m(v))); __ocbwb(v);
icacheaddr = CACHE_IC_ADDRESS_ARRAY | ( icacheaddr = CACHE_IC_ADDRESS_ARRAY | (v &
v & cpu_data->icache.entry_mask); cpu_data->icache.entry_mask);
for (i = 0; i < cpu_data->icache.ways;
i++, icacheaddr += cpu_data->icache.way_incr)
/* Clear i-cache line valid-bit */ /* Clear i-cache line valid-bit */
ctrl_outl(0, icacheaddr); for (i = 0; i < cpu_data->icache.ways; i++) {
__raw_writel(0, icacheaddr);
icacheaddr += cpu_data->icache.way_incr;
}
} }
back_to_cached(); back_to_cached();
local_irq_restore(flags); local_irq_restore(flags);
}
} }
static inline void flush_cache_4096(unsigned long start, static inline void flush_cache_4096(unsigned long start,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment