diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-27 23:02:57 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-27 23:02:57 +0000 |
commit | fe7ff1706e323d0e5ed83972960a1ecc1ee538b3 (patch) | |
tree | ea981c326df87ea42e09628e63ac53fdc4c0f9d0 /arch | |
parent | bf78a0c2204c5db7d03f193abdae9128a96d8e61 (diff) |
More random merges.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/sgi/kernel/indy_sc.c | 34 | ||||
-rw-r--r-- | arch/mips64/sgi-ip22/ip22-sc.c | 18 |
2 files changed, 23 insertions, 29 deletions
diff --git a/arch/mips/sgi/kernel/indy_sc.c b/arch/mips/sgi/kernel/indy_sc.c index 2c06a5c53..b41620c93 100644 --- a/arch/mips/sgi/kernel/indy_sc.c +++ b/arch/mips/sgi/kernel/indy_sc.c @@ -1,4 +1,4 @@ -/* $Id: indy_sc.c,v 1.13 1999/12/04 03:59:00 ralf Exp $ +/* $Id: indy_sc.c,v 1.14 2000/03/25 22:35:07 ralf Exp $ * * indy_sc.c: Indy cache managment functions. * @@ -28,7 +28,6 @@ static unsigned long scache_size; #define SC_SIZE 0x00080000 #define SC_LINE 32 #define CI_MASK (SC_SIZE - SC_LINE) -#define SC_ROUND(n) ((n) + SC_LINE - 1) #define SC_INDEX(n) ((n) & CI_MASK) static inline void indy_sc_wipe(unsigned long first, unsigned long last) @@ -69,12 +68,13 @@ static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size) #ifdef DEBUG_CACHE printk("indy_sc_wback_invalidate[%08lx,%08lx]", addr, size); #endif + + if (!size) + return; + /* Which lines to flush? */ first_line = SC_INDEX(addr); - if (size <= SC_LINE) - last_line = SC_INDEX(addr); - else - last_line = SC_INDEX(addr + size - 1); + last_line = SC_INDEX(addr + size - 1); __save_and_cli(flags); if (first_line <= last_line) { @@ -82,9 +82,6 @@ static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size) goto out; } - /* Cache index wrap around. Due to the way the buddy system works - this case should not happen. We're prepared to handle it, - though. */ indy_sc_wipe(first_line, SC_SIZE - SC_LINE); indy_sc_wipe(0, last_line); out: @@ -100,8 +97,9 @@ static void indy_sc_enable(void) printk("Enabling R4600 SCACHE\n"); #endif __asm__ __volatile__(" - .set noreorder - .set mips3 + .set push + .set noreorder + .set mips3 mfc0 %2, $12 nop; nop; nop; nop; li %1, 0x80 @@ -117,8 +115,7 @@ static void indy_sc_enable(void) nop; nop; nop; nop; mtc0 %2, $12 nop; nop; nop; nop; - .set mips0 - .set reorder" + .set pop" : "=r" (tmp1), "=r" (tmp2), "=r" (addr)); } @@ -130,8 +127,9 @@ static void indy_sc_disable(void) printk("Disabling R4600 SCACHE\n"); #endif __asm__ __volatile__(" - .set noreorder - .set mips3 + .set push + .set noreorder + .set mips3 li %0, 0x1 dsll %0, 31 lui %1, 0x9000 @@ -147,9 +145,8 @@ static void indy_sc_disable(void) nop; nop; nop; nop; mtc0 %2, $12 nop; nop; nop; nop; - .set mips2 - .set reorder - " : "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)); + .set pop" + : "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)); } static inline int __init indy_sc_probe(void) @@ -223,7 +220,6 @@ struct bcache_ops indy_sc_ops = { void __init indy_sc_init(void) { -return; if (indy_sc_probe()) { indy_sc_enable(); bcops = &indy_sc_ops; diff --git a/arch/mips64/sgi-ip22/ip22-sc.c b/arch/mips64/sgi-ip22/ip22-sc.c index 92e6bf4d3..21736bf0a 100644 --- a/arch/mips64/sgi-ip22/ip22-sc.c +++ b/arch/mips64/sgi-ip22/ip22-sc.c @@ -1,4 +1,4 @@ -/* $Id: ip22-sc.c,v 1.3 1999/10/20 18:10:24 ralf Exp $ +/* $Id: ip22-sc.c,v 1.2 1999/12/04 03:59:01 ralf Exp $ * * indy_sc.c: Indy cache managment functions. * @@ -9,7 +9,6 @@ #include <linux/kernel.h> #include <linux/sched.h> #include <linux/mm.h> -#include <linux/autoconf.h> #include <asm/bcache.h> #include <asm/sgi/sgimc.h> @@ -28,7 +27,6 @@ static unsigned long scache_size; #define SC_SIZE 0x00080000 #define SC_LINE 32 #define CI_MASK (SC_SIZE - SC_LINE) -#define SC_ROUND(n) ((n) + SC_LINE - 1) #define SC_INDEX(n) ((n) & CI_MASK) static inline void indy_sc_wipe(unsigned long first, unsigned long last) @@ -54,9 +52,13 @@ static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size) #ifdef DEBUG_CACHE printk("indy_sc_wback_invalidate[%08lx,%08lx]", addr, size); #endif + + if (!size) + return; + /* Which lines to flush? */ first_line = SC_INDEX(addr); - last_line = SC_INDEX(SC_ROUND(addr + size)); + last_line = SC_INDEX(addr + size - 1); __save_and_cli(flags); if (first_line <= last_line) { @@ -64,11 +66,8 @@ static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size) goto out; } - /* Cache index wrap around. Due to the way the buddy system works - this case should not happen. We're prepared to handle it, - though. */ - indy_sc_wipe(last_line, SC_SIZE); - indy_sc_wipe(0, first_line); + indy_sc_wipe(first_line, SC_SIZE - SC_LINE); + indy_sc_wipe(0, last_line); out: __restore_flags(flags); } @@ -160,7 +159,6 @@ static struct bcache_ops indy_sc_ops = { void __init indy_sc_init(void) { -return; /* Not for now, debugging ... */ if (indy_sc_probe()) { indy_sc_enable(); bcops = &indy_sc_ops; |