summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-27 23:02:57 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-27 23:02:57 +0000
commitfe7ff1706e323d0e5ed83972960a1ecc1ee538b3 (patch)
treeea981c326df87ea42e09628e63ac53fdc4c0f9d0
parentbf78a0c2204c5db7d03f193abdae9128a96d8e61 (diff)
More random merges.
-rw-r--r--arch/mips/sgi/kernel/indy_sc.c34
-rw-r--r--arch/mips64/sgi-ip22/ip22-sc.c18
-rw-r--r--drivers/net/sgiseeq.c3
-rw-r--r--include/asm-mips/sigcontext.h13
4 files changed, 29 insertions, 39 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;
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c
index f63ca1b45..213905c3a 100644
--- a/drivers/net/sgiseeq.c
+++ b/drivers/net/sgiseeq.c
@@ -1,4 +1,4 @@
-/* $Id: sgiseeq.c,v 1.15 2000/02/24 00:13:01 ralf Exp $
+/* $Id: sgiseeq.c,v 1.16 2000/03/26 22:57:54 ralf Exp $
*
* sgiseeq.c: Seeq8003 ethernet driver for SGI machines.
*
@@ -32,7 +32,6 @@
#include <linux/skbuff.h>
#include <asm/sgi/sgihpc.h>
-#include <asm/sgi/sgint23.h>
#include <asm/sgialib.h>
#include "sgiseeq.h"
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h
index 913dc1c95..748e3d542 100644
--- a/include/asm-mips/sigcontext.h
+++ b/include/asm-mips/sigcontext.h
@@ -1,16 +1,13 @@
-/*
- * include/asm-mips/sigcontext.h
+/* $Id: sigcontext.h,v 1.5 1997/12/16 05:36:43 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1996, 1997 by Ralf Baechle
- *
- * $Id: sigcontext.h,v 1.4 1997/12/01 18:00:42 ralf Exp $
+ * Copyright (C) 1996, 1997, 2000 by Ralf Baechle
*/
-#ifndef __ASM_MIPS_SIGCONTEXT_H
-#define __ASM_MIPS_SIGCONTEXT_H
+#ifndef _ASM_SIGCONTEXT_H
+#define _ASM_SIGCONTEXT_H
/*
* Keep this struct definition in sync with the sigcontext fragment
@@ -35,4 +32,4 @@ struct sigcontext {
unsigned long sc_sigset[4]; /* kernel's sigset_t */
};
-#endif /* __ASM_MIPS_SIGCONTEXT_H */
+#endif /* _ASM_SIGCONTEXT_H */