Commit 1d783419 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] Convert m68k cache macros to inline functions

Convert m68k cache macros to inline functions
parent 668c242d
...@@ -371,46 +371,51 @@ unsigned long mm_ptov (unsigned long paddr) ...@@ -371,46 +371,51 @@ unsigned long mm_ptov (unsigned long paddr)
#endif #endif
/* invalidate page in both caches */ /* invalidate page in both caches */
#define clear040(paddr) \ static inline void clear040(unsigned long paddr)
__asm__ __volatile__ ("nop\n\t" \ {
".chip 68040\n\t" \ asm volatile (
"cinvp %%bc,(%0)\n\t" \ "nop\n\t"
".chip 68k" \ ".chip 68040\n\t"
: : "a" (paddr)) "cinvp %%bc,(%0)\n\t"
".chip 68k"
: : "a" (paddr));
}
/* invalidate page in i-cache */ /* invalidate page in i-cache */
#define cleari040(paddr) \ static inline void cleari040(unsigned long paddr)
__asm__ __volatile__ ("nop\n\t" \ {
".chip 68040\n\t" \ asm volatile (
"cinvp %%ic,(%0)\n\t" \ "nop\n\t"
".chip 68k" \ ".chip 68040\n\t"
: : "a" (paddr)) "cinvp %%ic,(%0)\n\t"
".chip 68k"
: : "a" (paddr));
}
/* push page in both caches */ /* push page in both caches */
#define push040(paddr) \ /* RZ: cpush %bc DOES invalidate %ic, regardless of DPI */
__asm__ __volatile__ ("nop\n\t" \ static inline void push040(unsigned long paddr)
".chip 68040\n\t" \ {
"cpushp %%bc,(%0)\n\t" \ asm volatile (
".chip 68k" \ "nop\n\t"
: : "a" (paddr)) ".chip 68040\n\t"
"cpushp %%bc,(%0)\n\t"
".chip 68k"
: : "a" (paddr));
}
/* push and invalidate page in both caches, must disable ints /* push and invalidate page in both caches, must disable ints
* to avoid invalidating valid data */ * to avoid invalidating valid data */
#define pushcl040(paddr) \ static inline void pushcl040(unsigned long paddr)
do { unsigned long flags; \ {
save_flags(flags); \ unsigned long flags;
cli(); \
push040(paddr); \
if (CPU_IS_060) clear040(paddr); \
restore_flags(flags); \
} while(0)
/* push page in both caches, invalidate in i-cache */
/* RZ: cpush %bc DOES invalidate %ic, regardless of DPI */
#define pushcli040(paddr) \
do { push040(paddr); \
} while(0)
local_irq_save(flags);
push040(paddr);
if (CPU_IS_060)
clear040(paddr);
local_irq_restore(flags);
}
/* /*
* 040: Hit every page containing an address in the range paddr..paddr+len-1. * 040: Hit every page containing an address in the range paddr..paddr+len-1.
...@@ -504,7 +509,7 @@ void cache_push (unsigned long paddr, int len) ...@@ -504,7 +509,7 @@ void cache_push (unsigned long paddr, int len)
paddr &= PAGE_MASK; paddr &= PAGE_MASK;
do { do {
pushcli040(paddr); push040(paddr);
paddr += tmp; paddr += tmp;
} while ((len -= tmp) > 0); } while ((len -= tmp) > 0);
} }
...@@ -530,12 +535,6 @@ void cache_push (unsigned long paddr, int len) ...@@ -530,12 +535,6 @@ void cache_push (unsigned long paddr, int len)
} }
#undef clear040
#undef cleari040
#undef push040
#undef pushcl040
#undef pushcli040
#ifndef CONFIG_SINGLE_MEMORY_CHUNK #ifndef CONFIG_SINGLE_MEMORY_CHUNK
int mm_end_of_chunk (unsigned long addr, int len) int mm_end_of_chunk (unsigned long addr, int len)
{ {
......
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