diff options
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/irq.c | 4 | ||||
-rw-r--r-- | arch/mips/kernel/process.c | 15 | ||||
-rw-r--r-- | arch/mips/kernel/signal.c | 23 | ||||
-rw-r--r-- | arch/mips/kernel/traps.c | 45 |
4 files changed, 41 insertions, 46 deletions
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index 55e7227e0..728af4cc9 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c @@ -4,7 +4,7 @@ * Copyright (C) 1992 Linus Torvalds * Copyright (C) 1994, 1995, 1996, 1997 Ralf Baechle * - * $Id: irq.c,v 1.7 1997/12/29 11:29:33 tsbogend Exp $ + * $Id: irq.c,v 1.8 1998/03/17 22:07:35 ralf Exp $ */ #include <linux/errno.h> #include <linux/init.h> @@ -163,7 +163,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs) } while (action); if (do_random & SA_SAMPLE_RANDOM) add_interrupt_randomness(irq); - unmask_irq (irq); + unmask_irq (irq); __cli(); } irq_exit(cpu, irq); diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 941abec8f..14e896c51 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -1,13 +1,13 @@ /* - * linux/arch/mips/kernel/process.c + * linux/arch/mips/kernel/process.c * - * Copyright (C) 1995 Ralf Baechle + * 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. * - * Modified for R3000/DECStation support by Paul M. Antoine 1995, 1996 + * Copyright (C) 1994 - 1998 by Ralf Baechle and others. * - * This file handles the architecture-dependent parts of initialization, - * though it does not yet currently fully support the DECStation, - * or R3000 - PMA. + * $Id: process.c,v 1.6 1998/03/21 22:37:05 ralf Exp $ */ #include <linux/config.h> #include <linux/errno.h> @@ -32,9 +32,6 @@ #include <asm/uaccess.h> #include <asm/io.h> #include <asm/elf.h> -#ifdef CONFIG_SGI -#include <asm/sgialib.h> -#endif mm_segment_t active_ds = USER_DS; diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 390c3ef2b..0e7a24766 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c @@ -4,7 +4,7 @@ * Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1994, 1995, 1996 Ralf Baechle * - * $Id: signal.c,v 1.8 1997/12/16 05:34:37 ralf Exp $ + * $Id: signal.c,v 1.9 1998/03/17 22:07:36 ralf Exp $ */ #include <linux/config.h> #include <linux/sched.h> @@ -347,11 +347,10 @@ static inline void handle_signal(unsigned long sig, struct k_sigaction *ka, } } -static inline void syscall_restart(unsigned long r0, unsigned long or2, - unsigned long or7, struct pt_regs *regs, - struct sigaction *sa) +static inline void syscall_restart(unsigned long or2, unsigned long or7, + struct pt_regs *regs, struct sigaction *sa) { - switch(r0) { + switch(regs->regs[0]) { case ERESTARTNOHAND: no_system_call_restart: regs->regs[0] = regs->regs[2] = EINTR; @@ -371,7 +370,6 @@ extern int do_irix_signal(sigset_t *oldset, struct pt_regs *regs); asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) { - unsigned long r0 = regs->regs[0]; unsigned long r7 = regs->orig_reg7; struct k_sigaction *ka; siginfo_t info; @@ -479,8 +477,8 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) } } - if (r0) - syscall_restart(r0, regs->orig_reg2, r7, regs, &ka->sa); + if (regs->regs[0]) + syscall_restart(regs->orig_reg2, r7, regs, &ka->sa); /* Whee! Actually deliver the signal. */ handle_signal(signr, ka, &info, oldset, regs); return 1; @@ -491,13 +489,14 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) * dies here!!! The li instruction, a single machine instruction, * must directly be followed by the syscall instruction. */ - if (r0 && - (regs->regs[2] == ERESTARTNOHAND || - regs->regs[2] == ERESTARTSYS || - regs->regs[2] == ERESTARTNOINTR)) { + if (regs->regs[0]) { + if (regs->regs[2] == ERESTARTNOHAND || + regs->regs[2] == ERESTARTSYS || + regs->regs[2] == ERESTARTNOINTR) { regs->regs[0] = regs->regs[2] = regs->orig_reg2; regs->regs[7] = r7; regs->cp0_epc -= 8; + } } return 0; } diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 2632e4d2d..f2ad107fa 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -8,7 +8,7 @@ * Copyright 1994, 1995, 1996, 1997 by Ralf Baechle * Modified for R3000 by Paul M. Antoine, 1995, 1996 * - * $Id: traps.c,v 1.6 1997/12/16 05:34:39 ralf Exp $ + * $Id: traps.c,v 1.7 1998/03/17 22:07:38 ralf Exp $ */ #include <linux/config.h> #include <linux/init.h> @@ -27,10 +27,6 @@ #include <asm/system.h> #include <asm/uaccess.h> -#ifdef CONFIG_SGI -#include <asm/sgialib.h> -#endif - #undef CONF_DEBUG_EXCEPTIONS static inline void console_verbose(void) @@ -167,18 +163,9 @@ void show_registers(char * str, struct pt_regs * regs, long err) void die_if_kernel(const char * str, struct pt_regs * regs, long err) { - /* - * Just return if in user mode. - * XXX - */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) - if (!((regs)->cp0_status & 0x4)) + if (user_mode(regs)) /* Just return if in user mode. */ return; -#endif -#if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) - if (regs->cp0_status & ST0_KSU == KSU_USER) - return; -#endif + console_verbose(); printk("%s: %04lx\n", str, err & 0xffff); show_regs(regs); @@ -240,7 +227,7 @@ int unregister_fpe(void (*handler)(struct pt_regs *regs, unsigned int fcr31)) } #endif -void do_fpe(struct pt_regs *regs, unsigned int fcr31) +void do_fpe(struct pt_regs *regs, unsigned long fcr31) { #ifdef CONFIG_MIPS_FPE_MODULE if (fpe_handler != NULL) { @@ -252,8 +239,20 @@ void do_fpe(struct pt_regs *regs, unsigned int fcr31) #ifdef CONF_DEBUG_EXCEPTIONS show_regs(regs); #endif - printk("Caught floating exception at epc == %08lx, fcr31 == %08x\n", - regs->cp0_epc, fcr31); + if (fcr31 & 0x20000) { + printk("Unimplemented exception at 0x%08lx in %s.\n", + regs->cp0_epc, current->comm); + /* Retry instruction with flush to zero ... */ + if (!(fcr31 & (1<<24))) { + printk("Setting flush to zero ...\n"); + fcr31 |= (1<<24); + __asm__ __volatile__( + "ctc1\t%0,$31" + : /* No outputs */ + : "r" (fcr31)); + goto out; + } + } if (compute_return_epc(regs)) goto out; force_sig(SIGFPE, current); @@ -350,16 +349,16 @@ void do_cpu(struct pt_regs *regs) { unsigned int cpid; - lock_kernel(); cpid = (regs->cp0_cause >> CAUSEB_CE) & 3; - if (cpid == 1) - { + if (cpid == 1) { regs->cp0_status |= ST0_CU1; goto out; } + + lock_kernel(); force_sig(SIGILL, current); -out: unlock_kernel(); +out: } void do_vcei(struct pt_regs *regs) |