summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-01-18 18:22:27 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-01-18 18:22:27 -0800
commitd4c6e4e119d3cd89b80321c7abb4914d33b594d1 (patch)
treed506891ca348238669b141c29512189ba5349ff3 /include
parent820880f327cc7b168368800f6d0c4f60a731053a (diff)
[PATCH] ppc64: fix POWER3 boot
From: Anton Blanchard <anton@samba.org> Binutils uses the recent mtcrf optimisation when compiling for a POWER4 target. Unfortunately this causes a program check on POWER3. We required compiling for POWER4 so the tlbiel instruction would be recognised. For the moment we hardwire the tlbiel instruction, longer term we can use the binutils -many flag.
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc64/mmu.h44
1 files changed, 32 insertions, 12 deletions
diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h
index 0a6b77e3d725..e7ac473b5162 100644
--- a/include/asm-ppc64/mmu.h
+++ b/include/asm-ppc64/mmu.h
@@ -202,26 +202,46 @@ static inline unsigned long hpt_hash(unsigned long vpn, int large)
return (vsid & 0x7fffffffff) ^ page;
}
-static inline void _tlbie(unsigned long va, int large)
+static inline void __tlbie(unsigned long va, int large)
{
- asm volatile("ptesync": : :"memory");
+ /* clear top 16 bits, non SLS segment */
+ va &= ~(0xffffULL << 48);
- if (large) {
- asm volatile("clrldi %0,%0,16\n\
- tlbie %0,1" : : "r"(va) : "memory");
- } else {
- asm volatile("clrldi %0,%0,16\n\
- tlbie %0,0" : : "r"(va) : "memory");
- }
+ if (large)
+ asm volatile("tlbie %0,1" : : "r"(va) : "memory");
+ else
+ asm volatile("tlbie %0,0" : : "r"(va) : "memory");
+}
+static inline void tlbie(unsigned long va, int large)
+{
+ asm volatile("ptesync": : :"memory");
+ __tlbie(va, large);
asm volatile("eieio; tlbsync; ptesync": : :"memory");
}
-static inline void _tlbiel(unsigned long va)
+static inline void __tlbiel(unsigned long va)
+{
+ /* clear top 16 bits, non SLS segment */
+ va &= ~(0xffffULL << 48);
+
+ /*
+ * Thanks to Alan Modra we are now able to use machine specific
+ * assembly instructions (like tlbiel) by using the gas -many flag.
+ * However we have to support older toolchains so for the moment
+ * we hardwire it.
+ */
+#if 0
+ asm volatile("tlbiel %0" : : "r"(va) : "memory");
+#else
+ asm volatile(".long 0x7c000224 | (%0 << 11)" : : "r"(va) : "memory");
+#endif
+}
+
+static inline void tlbiel(unsigned long va)
{
asm volatile("ptesync": : :"memory");
- asm volatile("clrldi %0,%0,16\n\
- tlbiel %0" : : "r"(va) : "memory");
+ __tlbiel(va);
asm volatile("ptesync": : :"memory");
}