Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] m68k: small flush_icache() cleanup

Make flush_icache() an inline function and clean it up a litte.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Roman Zippel and committed by
Linus Torvalds
3921ee21 a7b1a1a3

+20 -20
+20 -20
include/asm-m68k/cacheflush.h
··· 3 3 4 4 #include <linux/mm.h> 5 5 6 + /* cache code */ 7 + #define FLUSH_I_AND_D (0x00000808) 8 + #define FLUSH_I (0x00000008) 9 + 6 10 /* 7 11 * Cache handling functions 8 12 */ 9 13 10 - #define flush_icache() \ 11 - ({ \ 12 - if (CPU_IS_040_OR_060) \ 13 - __asm__ __volatile__("nop\n\t" \ 14 - ".chip 68040\n\t" \ 15 - "cinva %%ic\n\t" \ 16 - ".chip 68k" : ); \ 17 - else { \ 18 - unsigned long _tmp; \ 19 - __asm__ __volatile__("movec %%cacr,%0\n\t" \ 20 - "orw %1,%0\n\t" \ 21 - "movec %0,%%cacr" \ 22 - : "=&d" (_tmp) \ 23 - : "id" (FLUSH_I)); \ 24 - } \ 25 - }) 14 + static inline void flush_icache(void) 15 + { 16 + if (CPU_IS_040_OR_060) 17 + asm volatile ( "nop\n" 18 + " .chip 68040\n" 19 + " cpusha %bc\n" 20 + " .chip 68k"); 21 + else { 22 + unsigned long tmp; 23 + asm volatile ( "movec %%cacr,%0\n" 24 + " or.w %1,%0\n" 25 + " movec %0,%%cacr" 26 + : "=&d" (tmp) 27 + : "id" (FLUSH_I)); 28 + } 29 + } 26 30 27 31 /* 28 32 * invalidate the cache for the specified memory range. ··· 46 42 * memory range. 47 43 */ 48 44 extern void cache_push_v(unsigned long vaddr, int len); 49 - 50 - /* cache code */ 51 - #define FLUSH_I_AND_D (0x00000808) 52 - #define FLUSH_I (0x00000008) 53 45 54 46 /* This is needed whenever the virtual mapping of the current 55 47 process changes. */