summaryrefslogtreecommitdiffstats
path: root/arch/mips/mips2
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-03-25 23:40:36 +0000
committer <ralf@linux-mips.org>1997-03-25 23:40:36 +0000
commit7206675c40394c78a90e74812bbdbf8cf3cca1be (patch)
tree251895cf5a0008e2b4ce438cb01ad4d55fb5b97b /arch/mips/mips2
parentbeb116954b9b7f3bb56412b2494b562f02b864b1 (diff)
Import of Linux/MIPS 2.1.14.2
Diffstat (limited to 'arch/mips/mips2')
-rw-r--r--arch/mips/mips2/Makefile21
-rw-r--r--arch/mips/mips2/README3
-rw-r--r--arch/mips/mips2/cpu.c91
-rw-r--r--arch/mips/mips2/fp-context.S124
-rw-r--r--arch/mips/mips2/pagetables.c99
-rw-r--r--arch/mips/mips2/showregs.c32
6 files changed, 0 insertions, 370 deletions
diff --git a/arch/mips/mips2/Makefile b/arch/mips/mips2/Makefile
deleted file mode 100644
index 1d53d027c..000000000
--- a/arch/mips/mips2/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Makefile for the MIPS II specific parts of the Linux/MIPS kernel.
-#
-# Note! Dependencies are done automagically by 'make dep', which also
-# removes any old dependencies. DON'T put your own dependencies here
-# unless it's something special (ie not a .c file).
-#
-
-.S.s:
- $(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
- $(CC) $(CFLAGS) -c $< -o $*.o
-
-all: mips.o
-EXTRA_ASFLAGS = -mips2 -mcpu=r6000
-O_TARGET := mips.o
-O_OBJS := cpu.o pagetables.o showregs.o
-
-clean:
-
-include $(TOPDIR)/Rules.make
diff --git a/arch/mips/mips2/README b/arch/mips/mips2/README
deleted file mode 100644
index c64808874..000000000
--- a/arch/mips/mips2/README
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory contains the R6000 specific part. I (Ralf) tried to support
-this CPU as good as possible without a machine and without detailed
-documentation. So don't look to close on this part ...
diff --git a/arch/mips/mips2/cpu.c b/arch/mips/mips2/cpu.c
deleted file mode 100644
index bcc021ee7..000000000
--- a/arch/mips/mips2/cpu.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * 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 Ralf Baechle
- */
-#include <linux/sched.h>
-
-#include <asm/cache.h>
-#include <asm/mipsregs.h>
-#include <asm/page.h>
-#include <asm/processor.h>
-
-extern asmlinkage void mips2_cacheflush(void *addr, int nbytes, unsigned int flags);
-
-void (*mips_cache_init)(void);
-
-static void
-mips2_cache_init(void)
-{
- cacheflush = mips2_cacheflush;
-}
-
-void (*switch_to_user_mode)(struct pt_regs *regs);
-
-static void
-mips2_switch_to_user_mode(struct pt_regs *regs)
-{
- regs->cp0_status = regs->cp0_status | ST0_KUC;
-}
-
-unsigned long (*thread_saved_pc)(struct thread_struct *t);
-
-/*
- * Return saved PC of a blocked thread.
- */
-static unsigned long mips2_thread_saved_pc(struct thread_struct *t)
-{
- return ((unsigned long *)(unsigned long)t->reg29)[13];
-}
-
-unsigned long (*get_wchan)(struct task_struct *p);
-
-static unsigned long mips2_get_wchan(struct task_struct *p)
-{
- /*
- * This one depends on the frame size of schedule(). Do a
- * "disass schedule" in gdb to find the frame size. Also, the
- * code assumes that sleep_on() follows immediately after
- * interruptible_sleep_on() and that add_timer() follows
- * immediately after interruptible_sleep(). Ugly, isn't it?
- * Maybe adding a wchan field to task_struct would be better,
- * after all...
- */
- unsigned long schedule_frame;
- unsigned long pc;
-
- pc = thread_saved_pc(&p->tss);
- if (pc >= (unsigned long) interruptible_sleep_on && pc < (unsigned long) add_timer) {
- schedule_frame = ((unsigned long *)(long)p->tss.reg30)[13];
- return ((unsigned long *)schedule_frame)[11];
- }
- return pc;
-}
-
-void (*pgd_init)(unsigned long page);
-void (*copy_page)(unsigned long to, unsigned long from);
-asmlinkage void (*restore_fp_context)(struct sigcontext *sc);
-asmlinkage void (*save_fp_context)(struct sigcontext *sc);
-
-void
-mips2_cpu_init(void)
-{
- extern void mips2_cache_init(void);
- extern void mips2_pgd_init(unsigned long page);
- extern void mips2_clear_page(unsigned long page);
- extern void mips2_copy_page(unsigned long to, unsigned long from);
- extern asmlinkage void mips2_restore_fp_context(struct sigcontext *sc);
- extern asmlinkage void mips2_save_fp_context(struct sigcontext *sc);
-
- mips_cache_init = mips2_cache_init;
- pgd_init = mips2_pgd_init;
- switch_to_user_mode = mips2_switch_to_user_mode;
- thread_saved_pc = mips2_thread_saved_pc;
- get_wchan = mips2_get_wchan;
- clear_page = mips2_clear_page;
- copy_page = mips2_copy_page;
- restore_fp_context = mips2_restore_fp_context;
- save_fp_context = mips2_save_fp_context;
-}
diff --git a/arch/mips/mips2/fp-context.S b/arch/mips/mips2/fp-context.S
deleted file mode 100644
index fc11a7fed..000000000
--- a/arch/mips/mips2/fp-context.S
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Save/restore floating point context for signal handlers.
- *
- * 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 by Ralf Baechle
- */
-#include <asm/asm.h>
-#include <asm/fpregdef.h>
-#include <asm/mipsregs.h>
-#include <asm/regdef.h>
-#include <asm/sigcontext.h>
-
-#define SDC1(r,m) \
-7: sdc1 r,m; \
- .section __ex_table,"a"; \
- PTR 7b,bad_stack; \
- .text
-
-#define SW(r,m) \
-7: sw r,m; \
- .section __ex_table,"a"; \
- PTR 7b,bad_stack; \
- .text
-
-#define LDC1(r,m) \
-7: ldc1 r,m; \
- .section __ex_table,"a"; \
- PTR 7b,bad_stack; \
- .text
-
-#define LW(r,m) \
-7: lw r,m; \
- .section __ex_table,"a"; \
- PTR 7b,bad_stack; \
- .text
-
- .set noreorder
-/*
- * Save floating point context
- */
-LEAF(mips2_save_fp_context)
- mfc0 t0,CP0_STATUS
- sll t0,t0,2
- bgez t0,1f
- nop # delay slot
- cfc1 t1,fcr31
- /*
- * Store the 16 double precision registers
- */
- SDC1 ($f0,(SC_FPREGS+0)(a0))
- SDC1 ($f2,(SC_FPREGS+16)(a0))
- SDC1 ($f4,(SC_FPREGS+32)(a0))
- SDC1 ($f6,(SC_FPREGS+48)(a0))
- SDC1 ($f8,(SC_FPREGS+64)(a0))
- SDC1 ($f10,(SC_FPREGS+80)(a0))
- SDC1 ($f12,(SC_FPREGS+96)(a0))
- SDC1 ($f14,(SC_FPREGS+112)(a0))
- SDC1 ($f16,(SC_FPREGS+128)(a0))
- SDC1 ($f18,(SC_FPREGS+144)(a0))
- SDC1 ($f20,(SC_FPREGS+160)(a0))
- SDC1 ($f22,(SC_FPREGS+176)(a0))
- SDC1 ($f24,(SC_FPREGS+192)(a0))
- SDC1 ($f26,(SC_FPREGS+208)(a0))
- SDC1 ($f28,(SC_FPREGS+224)(a0))
- SDC1 ($f30,(SC_FPREGS+240)(a0))
- SW (t0,SC_FPC_CSR(a0))
- cfc1 t0,$0 # implementation/version
- jr ra
- .set nomacro
- SW (t0,SC_FPC_EIR(a0)) # delay slot
- .set macro
-
-1: jr ra
- .set nomacro
- nop # delay slot
- .set macro
- END(mips2_save_fp_context)
-
-/*
- * Restore fpu state:
- * - fp gp registers
- * - cp1 status/control register
- *
- * We base the decission which registers to restore from the signal stack
- * frame on the current content of c0_status, not on the content of the
- * stack frame which might have been changed by the user.
- */
-LEAF(mips2_restore_fp_context)
- mfc0 t0,CP0_STATUS
- sll t0,t0,2
- bgez t0,1f
- LW t0,SC_FPC_CSR(a0) # delay slot
- /*
- * Restore the 16 double precision registers
- */
- LDC1 ($f0,(SC_FPREGS+0)(a0))
- LDC1 ($f2,(SC_FPREGS+16)(a0))
- LDC1 ($f4,(SC_FPREGS+32)(a0))
- LDC1 ($f6,(SC_FPREGS+48)(a0))
- LDC1 ($f8,(SC_FPREGS+64)(a0))
- LDC1 ($f10,(SC_FPREGS+80)(a0))
- LDC1 ($f12,(SC_FPREGS+96)(a0))
- LDC1 ($f14,(SC_FPREGS+112)(a0))
- LDC1 ($f16,(SC_FPREGS+128)(a0))
- LDC1 ($f18,(SC_FPREGS+144)(a0))
- LDC1 ($f20,(SC_FPREGS+160)(a0))
- LDC1 ($f22,(SC_FPREGS+176)(a0))
- LDC1 ($f24,(SC_FPREGS+192)(a0))
- LDC1 ($f26,(SC_FPREGS+208)(a0))
- LDC1 ($f28,(SC_FPREGS+224)(a0))
- LDC1 ($f30,(SC_FPREGS+240)(a0))
- jr ra
- .set nomacro
- ctc1 t0,fcr31 # delay slot
- .set macro
-
-1: jr ra
- .set nomacro
- nop # delay slot
- .set macro
- END(mips2_restore_fp_context)
diff --git a/arch/mips/mips2/pagetables.c b/arch/mips/mips2/pagetables.c
deleted file mode 100644
index 2c0061d39..000000000
--- a/arch/mips/mips2/pagetables.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 32 bit MIPS specific page handling.
- *
- * 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 Ralf Baechle
- */
-#include <linux/mm.h>
-#include <asm/cache.h>
-#include <asm/mipsconfig.h>
-#include <asm/page.h>
-#include <asm/pgtable.h>
-
-void (*pgd_init)(unsigned long page);
-
-/*
- * Initialize new page directory with pointers to invalid ptes
- */
-void mips2_pgd_init(unsigned long page)
-{
- unsigned long dummy1, dummy2;
-
- /*
- * This version is optimized for the R6000. We generate dirty lines
- * in the datacache, overwrite these lines with zeros and then flush
- * the cache. Sounds horribly complicated but is just a trick to
- * avoid unnecessary loads of from memory and uncached stores which
- * are very expensive. Not tested yet as the R6000 is a rare CPU only
- * available in SGI machines and I don't have one.
- */
- __asm__ __volatile__(
- ".set\tnoreorder\n"
- "1:\t"
- "cache\t%5,(%0)\n\t"
- "sw\t%2,(%0)\n\t"
- "sw\t%2,4(%0)\n\t"
- "sw\t%2,8(%0)\n\t"
- "sw\t%2,12(%0)\n\t"
- "cache\t%5,16(%0)\n\t"
- "sw\t%2,16(%0)\n\t"
- "sw\t%2,20(%0)\n\t"
- "sw\t%2,24(%0)\n\t"
- "sw\t%2,28(%0)\n\t"
- "subu\t%1,1\n\t"
- "bnez\t%1,1b\n\t"
- "addiu\t%0,32\n\t"
- ".set\treorder"
- :"=r" (dummy1),
- "=r" (dummy2)
- :"r" (((unsigned long) invalid_pte_table - PAGE_OFFSET) |
- _PAGE_TABLE),
- "0" (page),
- "1" (PAGE_SIZE/(sizeof(pmd_t)*8)),
- "i" (Create_Dirty_Excl_D));
-#endif
- /*
- * Now force writeback to ashure values are in the RAM.
- */
- cacheflush(page, PAGE_SIZE, CF_DCACHE|CF_PHYSICAL);
-}
-
-void (*clear_page)(unsigned long page);
-
-/*
- * To do: cache magic, maybe FPU for 64 accesses when clearing cache pages.
- */
-void mips2_clear_page(unsigned long page)
-{
- __asm__ __volatile__(
- ".set\tnoreorder\n\t"
- ".set\tnoat\n\t"
- "addiu\t$1,%0,%2\n"
- "1:\tsw\t$0,(%0)\n\t"
- "sw\t$0,4(%0)\n\t"
- "sw\t$0,8(%0)\n\t"
- "sw\t$0,12(%0)\n\t"
- "addiu\t%0,32\n\t"
- "sw\t$0,-16(%0)\n\t"
- "sw\t$0,-12(%0)\n\t"
- "sw\t$0,-8(%0)\n\t"
- "bne\t$1,%0,1b\n\t"
- "sw\t$0,-4(%0)\n\t"
- ".set\tat\n\t"
- ".set\treorder"
- :"=r" (page)
- :"0" (page),
- "I" (PAGE_SIZE)
- :"$1","memory");
-}
-
-void (*copy_page)(unsigned long to, unsigned long from);
-
-void mips2_copy_page(unsigned long to, unsigned long from)
-{
- memcpy((void *) to,
- (void *) (from + (PT_OFFSET - PAGE_OFFSET)), PAGE_SIZE);
-}
diff --git a/arch/mips/mips2/showregs.c b/arch/mips/mips2/showregs.c
deleted file mode 100644
index d207d231b..000000000
--- a/arch/mips/mips2/showregs.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * linux/arch/mips/mips1/showregs.c
- *
- * Copyright (C) 1995, 1996 Ralf Baechle, Paul M. Antoine.
- */
-#include <linux/kernel.h>
-#include <linux/ptrace.h>
-
-void show_regs(struct pt_regs * regs)
-{
- /*
- * Saved main processor registers
- */
- printk("$0 : %08x %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- 0, regs->regs[1], regs->regs[2], regs->regs[3],
- regs->regs[4], regs->regs[5], regs->regs[6], regs->regs[7]);
- printk("$8 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- regs->regs[8], regs->regs[9], regs->regs[10], regs->regs[11],
- regs->regs[12], regs->regs[13], regs->regs[14], regs->regs[15]);
- printk("$16: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- regs->regs[16], regs->regs[17], regs->regs[18], regs->regs[19],
- regs->regs[20], regs->regs[21], regs->regs[22], regs->regs[23]);
- printk("$24: %08lx %08lx %08lx %08lx %08lx %08lx\n",
- regs->regs[24], regs->regs[25], regs->regs[28], regs->regs[29],
- regs->regs[30], regs->regs[31]);
-
- /*
- * Saved cp0 registers
- */
- printk("epc : %08lx\nStatus: %08x\nCause : %08x\n",
- regs->cp0_epc, regs->cp0_status, regs->cp0_cause);
-}