aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/mm/sc-ip22.c')
-rw-r--r--arch/mips/mm/sc-ip22.c54
1 files changed, 34 insertions, 20 deletions
diff --git a/arch/mips/mm/sc-ip22.c b/arch/mips/mm/sc-ip22.c
index dc7c5a5214a9..efaf364fe581 100644
--- a/arch/mips/mm/sc-ip22.c
+++ b/arch/mips/mm/sc-ip22.c
@@ -31,26 +31,40 @@ static inline void indy_sc_wipe(unsigned long first, unsigned long last)
31 unsigned long tmp; 31 unsigned long tmp;
32 32
33 __asm__ __volatile__( 33 __asm__ __volatile__(
34 ".set\tpush\t\t\t# indy_sc_wipe\n\t" 34 " .set push # indy_sc_wipe \n"
35 ".set\tnoreorder\n\t" 35 " .set noreorder \n"
36 ".set\tmips3\n\t" 36 " .set mips3 \n"
37 ".set\tnoat\n\t" 37 " .set noat \n"
38 "mfc0\t%2, $12\n\t" 38 " mfc0 %2, $12 \n"
39 "li\t$1, 0x80\t\t\t# Go 64 bit\n\t" 39 " li $1, 0x80 # Go 64 bit \n"
40 "mtc0\t$1, $12\n\t" 40 " mtc0 $1, $12 \n"
41 41 " \n"
42 "dli\t$1, 0x9000000080000000\n\t" 42 " # \n"
43 "or\t%0, $1\t\t\t# first line to flush\n\t" 43 " # Open code a dli $1, 0x9000000080000000 \n"
44 "or\t%1, $1\t\t\t# last line to flush\n\t" 44 " # \n"
45 ".set\tat\n\t" 45 " # Required because binutils 2.25 will happily accept \n"
46 46 " # 64 bit instructions in .set mips3 mode but puke on \n"
47 "1:\tsw\t$0, 0(%0)\n\t" 47 " # 64 bit constants when generating 32 bit ELF \n"
48 "bne\t%0, %1, 1b\n\t" 48 " # \n"
49 " daddu\t%0, 32\n\t" 49 " lui $1,0x9000 \n"
50 50 " dsll $1,$1,0x10 \n"
51 "mtc0\t%2, $12\t\t\t# Back to 32 bit\n\t" 51 " ori $1,$1,0x8000 \n"
52 "nop; nop; nop; nop;\n\t" 52 " dsll $1,$1,0x10 \n"
53 ".set\tpop" 53 " \n"
54 " or %0, $1 # first line to flush \n"
55 " or %1, $1 # last line to flush \n"
56 " .set at \n"
57 " \n"
58 "1: sw $0, 0(%0) \n"
59 " bne %0, %1, 1b \n"
60 " daddu %0, 32 \n"
61 " \n"
62 " mtc0 %2, $12 # Back to 32 bit \n"
63 " nop # pipeline hazard \n"
64 " nop \n"
65 " nop \n"
66 " nop \n"
67 " .set pop \n"
54 : "=r" (first), "=r" (last), "=&r" (tmp) 68 : "=r" (first), "=r" (last), "=&r" (tmp)
55 : "0" (first), "1" (last)); 69 : "0" (first), "1" (last));
56} 70}