From 6dd778f9528c1acc17dbfca685f51bd5c3750d45 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 22 Mar 1998 23:27:12 +0000 Subject: 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. --- include/asm-mips/processor.h | 10 +++------ include/asm-mips/softirq.h | 13 +++++++++++- include/asm-mips/stackframe.h | 14 +++---------- include/asm-mips/string.h | 23 +++++++-------------- include/asm-mips/uaccess.h | 48 ++++++++++++++----------------------------- 5 files changed, 40 insertions(+), 68 deletions(-) (limited to 'include/asm-mips') 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 #include -#include /* 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); \ }) -- cgit v1.2.3