diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-03-22 23:27:12 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-03-22 23:27:12 +0000 |
commit | 6dd778f9528c1acc17dbfca685f51bd5c3750d45 (patch) | |
tree | 45c8be9edc454b787dd06d3d4aee79dccea0a979 | |
parent | f1382dc4850bb459d24a81c6cb0ef93ea7bd4a79 (diff) |
o Fix handling of interrupted syscalls.
o Just count missed heartbeats on Indys but don't print a messages. This
was a bug by itself.
o Fix a crash in exit_mmap().
o Fix scanmem().
o Fix clear_active_bh(), a ~ was missing causing weak performance.
o Remove experimental cache instructions from stackframe.h. It wasn't
improving performance as I was hoping.
o Shrink the size of the exception handler routines in uaccess.h.
o Cleanup, remove dead code in various files.
-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 | ||||
-rw-r--r-- | arch/mips/mm/andes.c | 11 | ||||
-rw-r--r-- | arch/mips/mm/init.c | 59 | ||||
-rw-r--r-- | arch/mips/mm/loadmmu.c | 4 | ||||
-rw-r--r-- | arch/mips/mm/r2300.c | 8 | ||||
-rw-r--r-- | arch/mips/mm/r4xx0.c | 10 | ||||
-rw-r--r-- | arch/mips/mm/r6000.c | 9 | ||||
-rw-r--r-- | arch/mips/mm/tfp.c | 10 | ||||
-rw-r--r-- | arch/mips/sgi/kernel/indyIRQ.S | 4 | ||||
-rw-r--r-- | arch/mips/sgi/kernel/indy_timer.c | 8 | ||||
-rw-r--r-- | fs/binfmt_elf.c | 6 | ||||
-rw-r--r-- | include/asm-mips/processor.h | 10 | ||||
-rw-r--r-- | include/asm-mips/softirq.h | 13 | ||||
-rw-r--r-- | include/asm-mips/stackframe.h | 14 | ||||
-rw-r--r-- | include/asm-mips/string.h | 23 | ||||
-rw-r--r-- | include/asm-mips/uaccess.h | 48 |
19 files changed, 143 insertions, 181 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) diff --git a/arch/mips/mm/andes.c b/arch/mips/mm/andes.c index 4ef02dfa0..529c12465 100644 --- a/arch/mips/mm/andes.c +++ b/arch/mips/mm/andes.c @@ -1,7 +1,9 @@ -/* $Id: andes.c,v 1.1.1.1 1997/06/01 03:16:38 ralf Exp $ +/* * andes.c: MMU and cache operations for the R10000 (ANDES). * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) + * + * $Id: andes.c,v 1.3 1998/03/21 08:03:53 ralf Exp $ */ #include <linux/kernel.h> @@ -85,6 +87,11 @@ static void andes_add_wired_entry(unsigned long entrylo0, unsigned long entrylo1 /* XXX */ } +static void andes_user_mode(struct pt_regs *regs) +{ + return regs->cp0_status & ST0_KSU == KSU_USER; +} + void ld_mmu_andes(void) { flush_cache_all = andes_flush_cache_all; @@ -101,6 +108,8 @@ void ld_mmu_andes(void) add_wired_entry = andes_add_wired_entry; + user_mode = andes_user_mode; + load_pgd = andes_load_pgd; pgd_init = andes_pgd_init; diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 9cb47cefa..3e309e438 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -1,8 +1,11 @@ /* - * arch/mips/mm/init.c + * 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) 1991, 1992, 1993, 1994 Linus Torvalds - * Ported to MIPS by Ralf Baechle + * Copyright (C) 1994, 1995, 1996 by Ralf Baechle + * + * $Id: init.c,v 1.4 1998/03/21 08:01:45 ralf Exp $ */ #include <linux/config.h> #include <linux/signal.h> @@ -113,58 +116,12 @@ pte_t * __bad_pagetable(void) return (pte_t *)page; } -static inline void -__zeropage(unsigned long page) -{ - unsigned long dummy1, dummy2; - -#if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) - /* - * Use 64bit code even for Linux/MIPS 32bit on R4000 - */ - __asm__ __volatile__( - ".set\tnoreorder\n" - ".set\tnoat\n\t" - ".set\tmips3\n" - "1:\tsd\t$0,(%0)\n\t" - "subu\t%1,1\n\t" - "bnez\t%1,1b\n\t" - "addiu\t%0,8\n\t" - ".set\tmips0\n\t" - ".set\tat\n" - ".set\treorder" - :"=r" (dummy1), - "=r" (dummy2) - :"0" (page), - "1" (PAGE_SIZE/8)); -#else /* (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) */ - __asm__ __volatile__( - ".set\tnoreorder\n" - "1:\tsw\t$0,(%0)\n\t" - "subu\t%1,1\n\t" - "bnez\t%1,1b\n\t" - "addiu\t%0,4\n\t" - ".set\treorder" - :"=r" (dummy1), - "=r" (dummy2) - :"0" (page), - "1" (PAGE_SIZE/4)); -#endif -} - -static inline void -zeropage(unsigned long page) -{ - flush_page_to_ram(page); - __zeropage(page); -} - pte_t __bad_page(void) { extern char empty_bad_page[PAGE_SIZE]; unsigned long page = (unsigned long)empty_bad_page; - zeropage(page); + clear_page(page); return pte_mkdirty(mk_pte(page, PAGE_SHARED)); } @@ -221,7 +178,7 @@ void mem_init(unsigned long start_mem, unsigned long end_mem) high_memory = (void *)end_mem; /* clear the zero-page */ - memset(empty_zero_page, 0, PAGE_SIZE); + clear_page(empty_zero_page); /* mark usable pages in the mem_map[] */ start_mem = PAGE_ALIGN(start_mem); diff --git a/arch/mips/mm/loadmmu.c b/arch/mips/mm/loadmmu.c index 2f9312ab9..9f4624ba6 100644 --- a/arch/mips/mm/loadmmu.c +++ b/arch/mips/mm/loadmmu.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: loadmmu.c,v 1.5 1998/01/13 04:39:35 ralf Exp $ + * $Id: loadmmu.c,v 1.5 1998/03/03 16:57:25 ralf Exp $ */ #include <linux/kernel.h> @@ -51,6 +51,8 @@ void (*show_regs)(struct pt_regs *); void (*add_wired_entry)(unsigned long entrylo0, unsigned long entrylo1, unsigned long entryhi, unsigned long pagemask); +int (*user_mode)(struct pt_regs *); + asmlinkage void (*resume)(void *tsk); extern void ld_mmu_r2300(void); diff --git a/arch/mips/mm/r2300.c b/arch/mips/mm/r2300.c index 98dbaaf5c..822cb1a1a 100644 --- a/arch/mips/mm/r2300.c +++ b/arch/mips/mm/r2300.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: r2300.c,v 1.2 1997/07/01 09:00:49 ralf Exp $ + * $Id: r2300.c,v 1.3 1997/07/29 22:54:51 tsbogend Exp $ */ #include <linux/kernel.h> @@ -253,6 +253,11 @@ static void r2300_add_wired_entry(unsigned long entrylo0, unsigned long entrylo1 */ } +static int r2300_user_mode(struct pt_regs *regs) +{ + return !(regs->cp0_status & 0x4); +} + void ld_mmu_r2300(void) { clear_page = r2300_clear_page; @@ -278,5 +283,6 @@ void ld_mmu_r2300(void) add_wired_entry = r2300_add_wired_entry; + user_mode = r2300_user_mode; flush_tlb_all(); } diff --git a/arch/mips/mm/r4xx0.c b/arch/mips/mm/r4xx0.c index e86f3e4eb..2cd1c9236 100644 --- a/arch/mips/mm/r4xx0.c +++ b/arch/mips/mm/r4xx0.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: r4xx0.c,v 1.12 1998/03/03 16:57:26 ralf Exp $ + * $Id: r4xx0.c,v 1.13 1998/03/18 17:18:13 ralf Exp $ * * To do: * @@ -2631,6 +2631,12 @@ static inline void setup_scache(unsigned int config) setup_noscache_funcs(); } +static int r4k_user_mode(struct pt_regs *regs) +{ + return (regs->cp0_status & ST0_KSU) == KSU_USER; +} + + void ld_mmu_r4xx0(void) { unsigned long config = read_32bit_cp0_register(CP0_CONFIG); @@ -2669,6 +2675,8 @@ void ld_mmu_r4xx0(void) add_wired_entry = r4k_add_wired_entry; + user_mode = r4k_user_mode; + flush_cache_all(); write_32bit_cp0_register(CP0_WIRED, 0); diff --git a/arch/mips/mm/r6000.c b/arch/mips/mm/r6000.c index 4f792fcd6..d656c897c 100644 --- a/arch/mips/mm/r6000.c +++ b/arch/mips/mm/r6000.c @@ -1,4 +1,4 @@ -/* $Id: r6000.c,v 1.1.1.1 1997/06/01 03:16:38 ralf Exp $ +/* $Id: r6000.c,v 1.2 1997/07/29 22:54:52 tsbogend Exp $ * r6000.c: MMU and cache routines for the R6000 processors. * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) @@ -162,6 +162,11 @@ static void r6000_add_wired_entry(unsigned long entrylo0, unsigned long entrylo1 /* XXX */ } +static int r6000_user_mode(struct pt_regs *regs) +{ + return !(regs->cp0_status & 0x4); +} + void ld_mmu_r6000(void) { flush_cache_all = r6000_flush_cache_all; @@ -184,6 +189,8 @@ void ld_mmu_r6000(void) add_wired_entry = r6000_add_wired_entry; + user_mode = r6000_user_mode; + flush_cache_all(); flush_tlb_all(); } diff --git a/arch/mips/mm/tfp.c b/arch/mips/mm/tfp.c index 04db52b98..931661f82 100644 --- a/arch/mips/mm/tfp.c +++ b/arch/mips/mm/tfp.c @@ -1,4 +1,4 @@ -/* $Id: tfp.c,v 1.1.1.1 1997/06/01 03:16:38 ralf Exp $ +/* $Id: tfp.c,v 1.2 1997/07/29 22:54:53 tsbogend Exp $ * tfp.c: MMU and cache routines specific to the r8000 (TFP). * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) @@ -85,6 +85,11 @@ static void tfp_add_wired_entry(unsigned long entrylo0, unsigned long entrylo1, /* XXX */ } +static int tfp_user_mode(struct pt_regs *regs) +{ + return regs->cp0_status & ST0_KSU == KSU_USER; +} + void ld_mmu_tfp(void) { flush_cache_all = tfp_flush_cache_all; @@ -101,10 +106,11 @@ void ld_mmu_tfp(void) add_wired_entry = tfp_add_wired_entry; + user_mode = tfp_user_mode; + load_pgd = tfp_load_pgd; pgd_init = tfp_pgd_init; flush_cache_all(); flush_tlb_all(); } - diff --git a/arch/mips/sgi/kernel/indyIRQ.S b/arch/mips/sgi/kernel/indyIRQ.S index 3820a172d..d6b72dfcb 100644 --- a/arch/mips/sgi/kernel/indyIRQ.S +++ b/arch/mips/sgi/kernel/indyIRQ.S @@ -1,4 +1,4 @@ -/* $Id: indyIRQ.S,v 1.2 1997/09/20 19:20:14 root Exp $ +/* $Id: indyIRQ.S,v 1.2 1997/12/01 17:57:37 ralf Exp $ * indyIRQ.S: Interrupt exception dispatch code for FullHouse and * Guiness. * @@ -68,7 +68,6 @@ /* Wheee, a timer interrupt. */ move a0, sp - addiu t0, s7, 1 jal indy_timer_interrupt nop # delay slot @@ -117,7 +116,6 @@ */ andi a0, s0, (CAUSEF_IP4 | CAUSEF_IP5) beq a0, zero, 1f - addiu t0, s7, 1 /* Must be one of the 8254 timers... */ move a0, sp diff --git a/arch/mips/sgi/kernel/indy_timer.c b/arch/mips/sgi/kernel/indy_timer.c index 198851eed..7d9e041f3 100644 --- a/arch/mips/sgi/kernel/indy_timer.c +++ b/arch/mips/sgi/kernel/indy_timer.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: indy_timer.c,v 1.5 1998/03/11 15:21:44 ralf Exp $ + * $Id: indy_timer.c,v 1.6 1998/03/17 22:07:41 ralf Exp $ */ #include <linux/errno.h> @@ -98,6 +98,7 @@ static int set_rtc_mmss(unsigned long nowtime) } static long last_rtc_update = 0; +unsigned long missed_heart_beats = 0; void indy_timer_interrupt(struct pt_regs *regs) { @@ -106,9 +107,10 @@ void indy_timer_interrupt(struct pt_regs *regs) /* Ack timer and compute new compare. */ count = read_32bit_cp0_register(CP0_COUNT); + /* This has races. */ if ((count - r4k_cur) >= r4k_offset) { - printk("missed heartbeat: r4k_cur[0x%lx] count[0x%lx]\n", - r4k_cur, count); + /* If this happens to often we'll need to compensate. */ + missed_heart_beats++; r4k_cur = count + r4k_offset; } else diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index d03873a3b..e75692a3f 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -391,7 +391,7 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex, error = ((unsigned long) interp_elf_ex->e_entry) + load_addr; out_close: - fput(file); +// fput(file); sys_close(elf_exec_fileno); out_free: kfree(elf_phdata); @@ -731,7 +731,7 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) } } set_fs(old_fs); - fput(file); /* all done with the file */ +// fput(file); /* all done with the file */ elf_entry += load_bias; elf_bss += load_bias; @@ -850,7 +850,7 @@ out_free_interp: if (elf_interpreter) kfree(elf_interpreter); out_free_file: - fput(file); +// fput(file); sys_close(elf_exec_fileno); out_free_ph: kfree(elf_phdata); diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 617428b34..cd57a4d8a 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h @@ -5,7 +5,7 @@ * written by Ralf Baechle * Modified further for R[236]000 compatibility by Paul M. Antoine * - * $Id: processor.h,v 1.4 1997/12/16 05:36:43 ralf Exp $ + * $Id: processor.h,v 1.5 1998/03/17 22:16:15 ralf Exp $ */ #ifndef __ASM_MIPS_PROCESSOR_H #define __ASM_MIPS_PROCESSOR_H @@ -167,17 +167,13 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t) return ((unsigned long*)t->reg29)[17]; } +extern int (*user_mode)(struct pt_regs *); + /* * Do necessary setup to start up a newly executed thread. */ extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp); -/* - * Does the process account for user or for system time? - */ -extern int (*running_in_user_mode)(void); -#define USES_USER_TIME(regs) running_in_user_mode() - /* Allocation and freeing of basic task resources. */ /* * NOTE! The task struct and the stack go together diff --git a/include/asm-mips/softirq.h b/include/asm-mips/softirq.h index 7a47d780f..aea9e9528 100644 --- a/include/asm-mips/softirq.h +++ b/include/asm-mips/softirq.h @@ -1,3 +1,14 @@ +/* + * include/asm-mips/softirq.h + * + * 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) 1997, 1998 by Ralf Baechle + * + * $Id: softirq.h,v 1.4 1998/03/21 11:45:46 ralf Exp $ + */ #ifndef __ASM_MIPS_SOFTIRQ_H #define __ASM_MIPS_SOFTIRQ_H @@ -22,7 +33,7 @@ static inline void clear_active_bhs(unsigned long x) "beqz\t%0,1b" :"=&r" (temp), "=m" (bh_active) - :"Ir" (x), + :"Ir" (~x), "m" (bh_active)); } diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h index 0c9de1627..c23a05448 100644 --- a/include/asm-mips/stackframe.h +++ b/include/asm-mips/stackframe.h @@ -2,17 +2,17 @@ * include/asm-mips/stackframe.h * * Copyright (C) 1994, 1995, 1996 by Ralf Baechle and Paul M. Antoine. + * + * $Id: stackframe.h,v 1.4 1998/03/21 08:01:09 ralf Exp $ */ #ifndef __ASM_MIPS_STACKFRAME_H #define __ASM_MIPS_STACKFRAME_H #include <asm/asm.h> #include <asm/offset.h> -#include <asm/cacheops.h> /* XXX */ #define SAVE_ALL \ .set push; \ - .set mips3; \ .set reorder; \ mfc0 k0, CP0_STATUS; \ sll k0, 3; /* extract cu0 bit */ \ @@ -25,15 +25,7 @@ lw k1, %lo(kernelsp)(k1); \ 8: \ move k0, sp; \ - /* subu sp, k1, PT_SIZE; */ \ - subu sp, k1, ((PT_SIZE + 31) & ~31); \ - ori sp, 31; \ - xori sp, 31; \ - cache Create_Dirty_Excl_D, (sp); \ - cache Create_Dirty_Excl_D, 32(sp); \ - cache Create_Dirty_Excl_D, 64(sp); \ - cache Create_Dirty_Excl_D, 96(sp); \ - cache Create_Dirty_Excl_D, 128(sp); \ + subu sp, k1, PT_SIZE; \ sw k0, PT_R29(sp); \ sw $3, PT_R3(sp); \ sw $1, PT_R1(sp); \ diff --git a/include/asm-mips/string.h b/include/asm-mips/string.h index dc0ebed3f..39e6b445c 100644 --- a/include/asm-mips/string.h +++ b/include/asm-mips/string.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, 1995, 1996, 1997 by Ralf Baechle * - * $Id: string.h,v 1.3 1997/08/11 04:11:53 ralf Exp $ + * $Id: string.h,v 1.4 1998/03/21 19:31:09 ralf Exp $ */ #ifndef __ASM_MIPS_STRING_H #define __ASM_MIPS_STRING_H @@ -135,22 +135,13 @@ extern __inline__ void *memscan(void *__addr, int __c, size_t __size) { char *__end = (char *)__addr + __size; - if (!__size) - return __addr; - __asm__(".set\tnoreorder\n\t" - ".set\tnoat\n" - "1:\tlbu\t$1,(%0)\n\t" -#if _MIPS_ISA == _MIPS_ISA_MIPS1 - "nop\n\t" -#endif - "beq\t$1,%3,2f\n\t" + __asm__(".set\tnoat\n" + "1:\tbeq\t%0,%1,2f\n\t" "addiu\t%0,1\n\t" - "bne\t%0,%2,1b\n\t" - "nop\n\t" - ".set\tat\n\t" - ".set\treorder\n" - "2:" - : "=r" (__addr) + "lb\t$1,-1(%0)\n\t" + "bne\t$1,%4,1b\n" + "2:\t.set\tat" + : "=r" (__addr), "=r" (__end) : "0" (__addr), "1" (__end), "r" (__c) : "$1"); diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h index 6fb330fe0..42a7df686 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h @@ -7,7 +7,7 @@ * * Copyright (C) 1996, 1997 by Ralf Baechle * - * $Id: uaccess.h,v 1.4 1997/12/01 18:00:44 ralf Exp $ + * $Id: uaccess.h,v 1.7 1998/03/21 08:04:33 ralf Exp $ */ #ifndef __ASM_MIPS_UACCESS_H #define __ASM_MIPS_UACCESS_H @@ -173,18 +173,14 @@ __asm__ __volatile__( \ "move\t%0,$0\n" \ "2:\n\t" \ ".section\t.fixup,\"ax\"\n" \ - "3:\t.set\tnoat\n\t" \ - "la\t$1,2b\n\t" \ - "li\t%0,%3\n\t" \ - "jr\t$1\n\t" \ - ".set\tat\n\t" \ + "3:\tli\t%0,%3\n\t" \ + "j\t2b\n\t" \ ".previous\n\t" \ ".section\t__ex_table,\"a\"\n\t" \ STR(PTR)"\t1b,3b\n\t" \ ".previous" \ :"=r" (__gu_err), "=r" (__gu_val) \ - :"o" (__m(__gu_addr)), "i" (-EFAULT) \ - :"$1"); }) + :"o" (__m(__gu_addr)), "i" (-EFAULT)); }) /* * Get a long long 64 using 32 bit registers. @@ -196,11 +192,8 @@ __asm__ __volatile__( \ "2:\tlw\t%D1,%3\n\t" \ "move\t%0,$0\n" \ "3:\t.section\t.fixup,\"ax\"\n" \ - "4:\t.set\tnoat\n\t" \ - "la\t$1,3b\n\t" \ - "li\t%0,%4\n\t" \ - "jr\t$1\n\t" \ - ".set\tat\n\t" \ + "4:\tli\t%0,%4\n\t" \ + "j\t3b\n\t" \ ".previous\n\t" \ ".section\t__ex_table,\"a\"\n\t" \ STR(PTR)"\t1b,4b\n\t" \ @@ -208,8 +201,7 @@ __asm__ __volatile__( \ ".previous" \ :"=r" (__gu_err), "=&r" (__gu_val) \ :"o" (__m(__gu_addr)), "o" (__m(__gu_addr + 4)), \ - "i" (-EFAULT) \ - :"$1"); }) + "i" (-EFAULT)); }) extern void __get_user_unknown(void); @@ -261,18 +253,14 @@ __asm__ __volatile__( \ "move\t%0,$0\n" \ "2:\n\t" \ ".section\t.fixup,\"ax\"\n" \ - "3:\t.set\tnoat\n\t" \ - "la\t$1,2b\n\t" \ - "li\t%0,%3\n\t" \ - "jr\t$1\n\t" \ - ".set\tat\n\t" \ + "3:\tli\t%0,%3\n\t" \ + "j\t2b\n\t" \ ".previous\n\t" \ ".section\t__ex_table,\"a\"\n\t" \ STR(PTR)"\t1b,3b\n\t" \ ".previous" \ :"=r" (__pu_err) \ - :"r" (__pu_val), "o" (__m(__pu_addr)), "i" (-EFAULT) \ - :"$1"); }) + :"r" (__pu_val), "o" (__m(__pu_addr)), "i" (-EFAULT)); }) #define __put_user_asm_ll32 \ ({ \ @@ -282,11 +270,8 @@ __asm__ __volatile__( \ "move\t%0,$0\n" \ "3:\n\t" \ ".section\t.fixup,\"ax\"\n" \ - "4:\t.set\tnoat\n\t" \ - "la\t$1,3b\n\t" \ - "li\t%0,%4\n\t" \ - "jr\t$1\n\t" \ - ".set\tat\n\t" \ + "4:\tli\t%0,%4\n\t" \ + "j\t3b\n\t" \ ".previous\n\t" \ ".section\t__ex_table,\"a\"\n\t" \ STR(PTR)"\t1b,4b\n\t" \ @@ -294,8 +279,7 @@ __asm__ __volatile__( \ ".previous" \ :"=r" (__pu_err) \ :"r" (__pu_val), "o" (__m(__pu_addr)), "o" (__m(__pu_addr + 4)), \ - "i" (-EFAULT) \ - :"$1"); }) + "i" (-EFAULT)); }) extern void __put_user_unknown(void); @@ -325,17 +309,15 @@ if (copy_from_user(to,from,n)) \ "sb\t$0,-1(%0)\n\t" \ "2:\t.set\treorder\n\t" \ ".section\t.fixup,\"ax\"\n" \ - "3:\t.set\tnoat\n\t" \ - "subu\t%0,1\n\t" \ + "3:\tsubu\t%0,1\n\t" \ "j\t2b\n\t" \ - ".set\tat\n\t" \ ".previous\n\t" \ ".section\t__ex_table,\"a\"\n\t" \ STR(PTR)"\t1b,3b\n\t" \ ".previous" \ :"=r" (addr), "=r" (__cu_end) \ :"0" (addr), "1" (addr + size), "i" (-EFAULT) \ - :"$1","memory"); \ + :"memory"); \ size = __cu_end - (addr); \ }) |