Skip to content

Commit 3921ee2

Browse files
Roman ZippelLinus Torvalds
authored andcommitted
[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>
1 parent a7b1a1a commit 3921ee2

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

‎include/asm-m68k/cacheflush.h‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,30 @@
33

44
#include <linux/mm.h>
55

6+
/* cache code */
7+
#define FLUSH_I_AND_D (0x00000808)
8+
#define FLUSH_I (0x00000008)
9+
610
/*
711
* Cache handling functions
812
*/
913

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+
}
2630

2731
/*
2832
* invalidate the cache for the specified memory range.
@@ -43,10 +47,6 @@ extern void cache_push(unsigned long paddr, int len);
4347
*/
4448
extern void cache_push_v(unsigned long vaddr, int len);
4549

46-
/* cache code */
47-
#define FLUSH_I_AND_D (0x00000808)
48-
#define FLUSH_I (0x00000008)
49-
5050
/* This is needed whenever the virtual mapping of the current
5151
process changes. */
5252
#define __flush_cache_all() \

0 commit comments

Comments
 (0)