22 #ifndef __ARCH_ICACHE_H__
23 #define __ARCH_ICACHE_H__
42 const unsigned long cache_way_size =
44 unsigned long max_useful_size;
48 if (__builtin_expect(size == 0, 0))
53 max_useful_size = (page_size < cache_way_size) ? page_size : cache_way_size;
59 max_useful_size = cache_way_size;
65 num_passes = cache_way_size >> __builtin_ctzl(page_size);
68 if (__builtin_expect(size > max_useful_size, 0))
69 size = max_useful_size;
73 end = (
const char*)addr + size - 1;
87 while (--num_passes > 0);