diff options
Diffstat (limited to 'arch/mips/mm')
-rw-r--r-- | arch/mips/mm/c-r4k.c | 16 | ||||
-rw-r--r-- | arch/mips/mm/tlbex.c | 34 |
2 files changed, 28 insertions, 22 deletions
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 1b71d91e8268..0668e9bfce41 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -235,7 +235,9 @@ static inline void r4k_blast_scache_page_setup(void) | |||
235 | { | 235 | { |
236 | unsigned long sc_lsize = cpu_scache_line_size(); | 236 | unsigned long sc_lsize = cpu_scache_line_size(); |
237 | 237 | ||
238 | if (sc_lsize == 16) | 238 | if (scache_size == 0) |
239 | r4k_blast_scache_page = (void *)no_sc_noop; | ||
240 | else if (sc_lsize == 16) | ||
239 | r4k_blast_scache_page = blast_scache16_page; | 241 | r4k_blast_scache_page = blast_scache16_page; |
240 | else if (sc_lsize == 32) | 242 | else if (sc_lsize == 32) |
241 | r4k_blast_scache_page = blast_scache32_page; | 243 | r4k_blast_scache_page = blast_scache32_page; |
@@ -251,7 +253,9 @@ static inline void r4k_blast_scache_page_indexed_setup(void) | |||
251 | { | 253 | { |
252 | unsigned long sc_lsize = cpu_scache_line_size(); | 254 | unsigned long sc_lsize = cpu_scache_line_size(); |
253 | 255 | ||
254 | if (sc_lsize == 16) | 256 | if (scache_size == 0) |
257 | r4k_blast_scache_page_indexed = (void *)no_sc_noop; | ||
258 | else if (sc_lsize == 16) | ||
255 | r4k_blast_scache_page_indexed = blast_scache16_page_indexed; | 259 | r4k_blast_scache_page_indexed = blast_scache16_page_indexed; |
256 | else if (sc_lsize == 32) | 260 | else if (sc_lsize == 32) |
257 | r4k_blast_scache_page_indexed = blast_scache32_page_indexed; | 261 | r4k_blast_scache_page_indexed = blast_scache32_page_indexed; |
@@ -267,7 +271,9 @@ static inline void r4k_blast_scache_setup(void) | |||
267 | { | 271 | { |
268 | unsigned long sc_lsize = cpu_scache_line_size(); | 272 | unsigned long sc_lsize = cpu_scache_line_size(); |
269 | 273 | ||
270 | if (sc_lsize == 16) | 274 | if (scache_size == 0) |
275 | r4k_blast_scache = (void *)no_sc_noop; | ||
276 | else if (sc_lsize == 16) | ||
271 | r4k_blast_scache = blast_scache16; | 277 | r4k_blast_scache = blast_scache16; |
272 | else if (sc_lsize == 32) | 278 | else if (sc_lsize == 32) |
273 | r4k_blast_scache = blast_scache32; | 279 | r4k_blast_scache = blast_scache32; |
@@ -482,7 +488,7 @@ static inline void local_r4k_flush_icache_range(void *args) | |||
482 | protected_blast_dcache_range(start, end); | 488 | protected_blast_dcache_range(start, end); |
483 | } | 489 | } |
484 | 490 | ||
485 | if (!cpu_icache_snoops_remote_store) { | 491 | if (!cpu_icache_snoops_remote_store && scache_size) { |
486 | if (end - start > scache_size) | 492 | if (end - start > scache_size) |
487 | r4k_blast_scache(); | 493 | r4k_blast_scache(); |
488 | else | 494 | else |
@@ -651,7 +657,7 @@ static void local_r4k_flush_cache_sigtramp(void * arg) | |||
651 | 657 | ||
652 | R4600_HIT_CACHEOP_WAR_IMPL; | 658 | R4600_HIT_CACHEOP_WAR_IMPL; |
653 | protected_writeback_dcache_line(addr & ~(dc_lsize - 1)); | 659 | protected_writeback_dcache_line(addr & ~(dc_lsize - 1)); |
654 | if (!cpu_icache_snoops_remote_store) | 660 | if (!cpu_icache_snoops_remote_store && scache_size) |
655 | protected_writeback_scache_line(addr & ~(sc_lsize - 1)); | 661 | protected_writeback_scache_line(addr & ~(sc_lsize - 1)); |
656 | protected_flush_icache_line(addr & ~(ic_lsize - 1)); | 662 | protected_flush_icache_line(addr & ~(ic_lsize - 1)); |
657 | if (MIPS4K_ICACHE_REFILL_WAR) { | 663 | if (MIPS4K_ICACHE_REFILL_WAR) { |
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 0f9485806bac..ac4f4bfaae50 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -280,69 +280,69 @@ static void __init build_insn(u32 **buf, enum opcode opc, ...) | |||
280 | } | 280 | } |
281 | 281 | ||
282 | #define I_u1u2u3(op) \ | 282 | #define I_u1u2u3(op) \ |
283 | static inline void i##op(u32 **buf, unsigned int a, \ | 283 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
284 | unsigned int b, unsigned int c) \ | 284 | unsigned int b, unsigned int c) \ |
285 | { \ | 285 | { \ |
286 | build_insn(buf, insn##op, a, b, c); \ | 286 | build_insn(buf, insn##op, a, b, c); \ |
287 | } | 287 | } |
288 | 288 | ||
289 | #define I_u2u1u3(op) \ | 289 | #define I_u2u1u3(op) \ |
290 | static inline void i##op(u32 **buf, unsigned int a, \ | 290 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
291 | unsigned int b, unsigned int c) \ | 291 | unsigned int b, unsigned int c) \ |
292 | { \ | 292 | { \ |
293 | build_insn(buf, insn##op, b, a, c); \ | 293 | build_insn(buf, insn##op, b, a, c); \ |
294 | } | 294 | } |
295 | 295 | ||
296 | #define I_u3u1u2(op) \ | 296 | #define I_u3u1u2(op) \ |
297 | static inline void i##op(u32 **buf, unsigned int a, \ | 297 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
298 | unsigned int b, unsigned int c) \ | 298 | unsigned int b, unsigned int c) \ |
299 | { \ | 299 | { \ |
300 | build_insn(buf, insn##op, b, c, a); \ | 300 | build_insn(buf, insn##op, b, c, a); \ |
301 | } | 301 | } |
302 | 302 | ||
303 | #define I_u1u2s3(op) \ | 303 | #define I_u1u2s3(op) \ |
304 | static inline void i##op(u32 **buf, unsigned int a, \ | 304 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
305 | unsigned int b, signed int c) \ | 305 | unsigned int b, signed int c) \ |
306 | { \ | 306 | { \ |
307 | build_insn(buf, insn##op, a, b, c); \ | 307 | build_insn(buf, insn##op, a, b, c); \ |
308 | } | 308 | } |
309 | 309 | ||
310 | #define I_u2s3u1(op) \ | 310 | #define I_u2s3u1(op) \ |
311 | static inline void i##op(u32 **buf, unsigned int a, \ | 311 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
312 | signed int b, unsigned int c) \ | 312 | signed int b, unsigned int c) \ |
313 | { \ | 313 | { \ |
314 | build_insn(buf, insn##op, c, a, b); \ | 314 | build_insn(buf, insn##op, c, a, b); \ |
315 | } | 315 | } |
316 | 316 | ||
317 | #define I_u2u1s3(op) \ | 317 | #define I_u2u1s3(op) \ |
318 | static inline void i##op(u32 **buf, unsigned int a, \ | 318 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
319 | unsigned int b, signed int c) \ | 319 | unsigned int b, signed int c) \ |
320 | { \ | 320 | { \ |
321 | build_insn(buf, insn##op, b, a, c); \ | 321 | build_insn(buf, insn##op, b, a, c); \ |
322 | } | 322 | } |
323 | 323 | ||
324 | #define I_u1u2(op) \ | 324 | #define I_u1u2(op) \ |
325 | static inline void i##op(u32 **buf, unsigned int a, \ | 325 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
326 | unsigned int b) \ | 326 | unsigned int b) \ |
327 | { \ | 327 | { \ |
328 | build_insn(buf, insn##op, a, b); \ | 328 | build_insn(buf, insn##op, a, b); \ |
329 | } | 329 | } |
330 | 330 | ||
331 | #define I_u1s2(op) \ | 331 | #define I_u1s2(op) \ |
332 | static inline void i##op(u32 **buf, unsigned int a, \ | 332 | static inline void __init i##op(u32 **buf, unsigned int a, \ |
333 | signed int b) \ | 333 | signed int b) \ |
334 | { \ | 334 | { \ |
335 | build_insn(buf, insn##op, a, b); \ | 335 | build_insn(buf, insn##op, a, b); \ |
336 | } | 336 | } |
337 | 337 | ||
338 | #define I_u1(op) \ | 338 | #define I_u1(op) \ |
339 | static inline void i##op(u32 **buf, unsigned int a) \ | 339 | static inline void __init i##op(u32 **buf, unsigned int a) \ |
340 | { \ | 340 | { \ |
341 | build_insn(buf, insn##op, a); \ | 341 | build_insn(buf, insn##op, a); \ |
342 | } | 342 | } |
343 | 343 | ||
344 | #define I_0(op) \ | 344 | #define I_0(op) \ |
345 | static inline void i##op(u32 **buf) \ | 345 | static inline void __init i##op(u32 **buf) \ |
346 | { \ | 346 | { \ |
347 | build_insn(buf, insn##op); \ | 347 | build_insn(buf, insn##op); \ |
348 | } | 348 | } |
@@ -623,42 +623,42 @@ static __init int __attribute__((unused)) insn_has_bdelay(struct reloc *rel, | |||
623 | } | 623 | } |
624 | 624 | ||
625 | /* convenience functions for labeled branches */ | 625 | /* convenience functions for labeled branches */ |
626 | static void __attribute__((unused)) il_bltz(u32 **p, struct reloc **r, | 626 | static void __init __attribute__((unused)) |
627 | unsigned int reg, enum label_id l) | 627 | il_bltz(u32 **p, struct reloc **r, unsigned int reg, enum label_id l) |
628 | { | 628 | { |
629 | r_mips_pc16(r, *p, l); | 629 | r_mips_pc16(r, *p, l); |
630 | i_bltz(p, reg, 0); | 630 | i_bltz(p, reg, 0); |
631 | } | 631 | } |
632 | 632 | ||
633 | static void __attribute__((unused)) il_b(u32 **p, struct reloc **r, | 633 | static void __init __attribute__((unused)) il_b(u32 **p, struct reloc **r, |
634 | enum label_id l) | 634 | enum label_id l) |
635 | { | 635 | { |
636 | r_mips_pc16(r, *p, l); | 636 | r_mips_pc16(r, *p, l); |
637 | i_b(p, 0); | 637 | i_b(p, 0); |
638 | } | 638 | } |
639 | 639 | ||
640 | static void il_beqz(u32 **p, struct reloc **r, unsigned int reg, | 640 | static void __init il_beqz(u32 **p, struct reloc **r, unsigned int reg, |
641 | enum label_id l) | 641 | enum label_id l) |
642 | { | 642 | { |
643 | r_mips_pc16(r, *p, l); | 643 | r_mips_pc16(r, *p, l); |
644 | i_beqz(p, reg, 0); | 644 | i_beqz(p, reg, 0); |
645 | } | 645 | } |
646 | 646 | ||
647 | static void __attribute__((unused)) | 647 | static void __init __attribute__((unused)) |
648 | il_beqzl(u32 **p, struct reloc **r, unsigned int reg, enum label_id l) | 648 | il_beqzl(u32 **p, struct reloc **r, unsigned int reg, enum label_id l) |
649 | { | 649 | { |
650 | r_mips_pc16(r, *p, l); | 650 | r_mips_pc16(r, *p, l); |
651 | i_beqzl(p, reg, 0); | 651 | i_beqzl(p, reg, 0); |
652 | } | 652 | } |
653 | 653 | ||
654 | static void il_bnez(u32 **p, struct reloc **r, unsigned int reg, | 654 | static void __init il_bnez(u32 **p, struct reloc **r, unsigned int reg, |
655 | enum label_id l) | 655 | enum label_id l) |
656 | { | 656 | { |
657 | r_mips_pc16(r, *p, l); | 657 | r_mips_pc16(r, *p, l); |
658 | i_bnez(p, reg, 0); | 658 | i_bnez(p, reg, 0); |
659 | } | 659 | } |
660 | 660 | ||
661 | static void il_bgezl(u32 **p, struct reloc **r, unsigned int reg, | 661 | static void __init il_bgezl(u32 **p, struct reloc **r, unsigned int reg, |
662 | enum label_id l) | 662 | enum label_id l) |
663 | { | 663 | { |
664 | r_mips_pc16(r, *p, l); | 664 | r_mips_pc16(r, *p, l); |