summaryrefslogtreecommitdiffstats
path: root/include/asm-mips
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-12-04 03:58:56 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-12-04 03:58:56 +0000
commit1d67e90f19a7acfd9a05dc59678e7d0c5090bd0d (patch)
tree357efc7b93f8f5102110d20d293f41360ec212fc /include/asm-mips
parentaea27b2e18d69af87e673972246e66657b4fa274 (diff)
Merge with Linux 2.3.21.
Diffstat (limited to 'include/asm-mips')
-rw-r--r--include/asm-mips/mmu_context.h31
-rw-r--r--include/asm-mips/processor.h8
-rw-r--r--include/asm-mips/segment.h6
-rw-r--r--include/asm-mips/softirq.h9
-rw-r--r--include/asm-mips/stackframe.h10
-rw-r--r--include/asm-mips/system.h25
-rw-r--r--include/asm-mips/uaccess.h54
7 files changed, 90 insertions, 53 deletions
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h
index 1149bc03f..41ffde38d 100644
--- a/include/asm-mips/mmu_context.h
+++ b/include/asm-mips/mmu_context.h
@@ -1,4 +1,4 @@
-/* $Id: mmu_context.h,v 1.4 1999/08/09 19:43:17 harald Exp $
+/* $Id: mmu_context.h,v 1.5 1999/10/09 00:01:43 ralf Exp $
*
* Switch a MMU context.
*
@@ -16,6 +16,7 @@
/* Fuck. The f-word is here so you can grep for it :-) */
extern unsigned long asid_cache;
+extern pgd_t *current_pgd;
#if defined(CONFIG_CPU_R3000)
@@ -47,19 +48,6 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long asid)
mm->context = asid_cache = asid;
}
-extern inline void
-get_mmu_context(struct task_struct *p)
-{
- struct mm_struct *mm = p->mm;
-
- if (mm) {
- unsigned long asid = asid_cache;
- /* Check if our ASID is of an older version and thus invalid */
- if ((mm->context ^ asid) & ASID_VERSION_MASK)
- get_new_mmu_context(mm, asid);
- }
-}
-
/*
* Initialize the context related info for a new mm_struct
* instance.
@@ -73,13 +61,13 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk, unsigned cpu)
{
- if (next) {
- unsigned long asid = asid_cache;
- /* Check if our ASID is of an older version and thus invalid */
- if ((next->context ^ asid) & ASID_VERSION_MASK)
- get_new_mmu_context(next, asid);
- }
+ unsigned long asid = asid_cache;
+
+ /* Check if our ASID is of an older version and thus invalid */
+ if ((next->context ^ asid) & ASID_VERSION_MASK)
+ get_new_mmu_context(next, asid);
+ current_pgd = next->pgd;
set_entryhi(next->context);
}
@@ -99,9 +87,10 @@ extern inline void destroy_context(struct mm_struct *mm)
extern inline void
activate_mm(struct mm_struct *prev, struct mm_struct *next)
{
- /* Unconditionally get an new ASID. */
+ /* Unconditionally get a new ASID. */
get_new_mmu_context(next, asid_cache);
+ current_pgd = next->pgd;
set_entryhi(next->context);
}
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index ca561233e..b21f9d874 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.20 1999/10/09 00:01:43 ralf Exp $
+/* $Id: processor.h,v 1.21 1999/10/12 17:33:50 harald 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
@@ -196,13 +196,13 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
*/
extern inline unsigned long thread_saved_pc(struct thread_struct *t)
{
- extern void ret_from_sys_call(void);
+ extern void ret_from_fork(void);
/* New born processes are a special case */
- if (t->reg31 == (unsigned long) ret_from_sys_call)
+ if (t->reg31 == (unsigned long) ret_from_fork)
return t->reg31;
- return ((unsigned long*)t->reg29)[17];
+ return ((unsigned long *)t->reg29)[10];
}
/*
diff --git a/include/asm-mips/segment.h b/include/asm-mips/segment.h
index 0453d97da..92ac001fc 100644
--- a/include/asm-mips/segment.h
+++ b/include/asm-mips/segment.h
@@ -1,6 +1,6 @@
-#ifndef __ALPHA_SEGMENT_H
-#define __ALPHA_SEGMENT_H
+#ifndef _ASM_SEGMENT_H
+#define _ASM_SEGMENT_H
/* Only here because we have some old header files that expect it.. */
-#endif
+#endif /* _ASM_SEGMENT_H */
diff --git a/include/asm-mips/softirq.h b/include/asm-mips/softirq.h
index f225e87ba..a7e7a074a 100644
--- a/include/asm-mips/softirq.h
+++ b/include/asm-mips/softirq.h
@@ -1,13 +1,14 @@
-/* $Id: softirq.h,v 1.8 1999/08/13 17:07:27 harald Exp $
+/* $Id: softirq.h,v 1.9 1999/11/19 20:35:48 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) 1997, 1998, 1999 by Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
*/
-#ifndef __ASM_MIPS_SOFTIRQ_H
-#define __ASM_MIPS_SOFTIRQ_H
+#ifndef _ASM_SOFTIRQ_H
+#define _ASM_SOFTIRQ_H
#include <linux/config.h>
@@ -106,4 +107,4 @@ extern inline void end_bh_atomic(void)
#define softirq_endlock(cpu) (cpu_bh_endlock(cpu))
#define synchronize_bh() barrier()
-#endif /* __ASM_MIPS_SOFTIRQ_H */
+#endif /* _ASM_SOFTIRQ_H */
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index 1c02b93d9..490724b21 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -3,7 +3,7 @@
*
* Copyright (C) 1994, 1995, 1996 by Ralf Baechle and Paul M. Antoine.
*
- * $Id: stackframe.h,v 1.9 1999/07/26 19:42:44 harald Exp $
+ * $Id: stackframe.h,v 1.10 1999/08/13 17:07:27 harald Exp $
*/
#ifndef __ASM_MIPS_STACKFRAME_H
#define __ASM_MIPS_STACKFRAME_H
@@ -13,7 +13,10 @@
#include <linux/config.h>
#define SAVE_AT \
- sw $1, PT_R1(sp)
+ .set push; \
+ .set noat; \
+ sw $1, PT_R1(sp); \
+ .set pop
#define SAVE_TEMP \
mfhi v1; \
@@ -101,7 +104,10 @@
SAVE_STATIC
#define RESTORE_AT \
+ .set push; \
+ .set noat; \
lw $1, PT_R1(sp); \
+ .set pop;
#define RESTORE_TEMP \
lw $24, PT_LO(sp); \
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index fa0e78feb..1f8c2722a 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -1,14 +1,15 @@
-/* $Id: system.h,v 1.17 1999/10/12 17:33:50 harald Exp $
+/* $Id: system.h,v 1.18 1999/11/17 22:48:12 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) 1994, 1995, 1996, 1997, 1998 by Ralf Baechle
- * Modified further for R[236]000 by Paul M. Antoine, 1996
+ * Copyright (C) 1994 - 1999 by Ralf Baechle
+ * Copyright (C) 1996 by Paul M. Antoine
+ * Copyright (C) 1994 - 1999 by Ralf Baechle
*/
-#ifndef __ASM_MIPS_SYSTEM_H
-#define __ASM_MIPS_SYSTEM_H
+#ifndef _ASM_SYSTEM_H
+#define _ASM_SYSTEM_H
#include <linux/config.h>
#include <linux/kernel.h>
@@ -186,7 +187,7 @@ extern __inline__ unsigned long xchg_u32(volatile int * m, unsigned long val)
"1:\tmove\t$1,%2\n\t"
"sc\t$1,(%1)\n\t"
"beqzl\t$1,1b\n\t"
- "ll\t%0,(%1)\n\t"
+ "lld\t%0,(%1)\n\t"
".set\tat\n\t"
".set\treorder"
: "=r" (val), "=r" (m), "=r" (dummy)
@@ -260,4 +261,14 @@ static __inline__ unsigned long __xchg(unsigned long x, volatile void * ptr, int
extern void set_except_vector(int n, void *addr);
-#endif /* __ASM_MIPS_SYSTEM_H */
+extern void __die(const char *, struct pt_regs *, const char *where,
+ unsigned long line) __attribute__((noreturn));
+extern void __die_if_kernel(const char *, struct pt_regs *, const char *where,
+ unsigned long line);
+
+#define die(msg, regs) \
+ __die(msg, regs, __FILE__ ":"__FUNCTION__, __LINE__)
+#define die_if_kernel(msg, regs) do { \
+ __die_if_kernel(msg, regs, __FILE__ ":"__FUNCTION__, __LINE__)
+
+#endif /* _ASM_SYSTEM_H */
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
index a9b759313..62432d9b4 100644
--- a/include/asm-mips/uaccess.h
+++ b/include/asm-mips/uaccess.h
@@ -1,16 +1,14 @@
-/*
- * include/asm-mips/uaccess.h
+/* $Id: uaccess.h,v 1.9 1999/10/09 00:01: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, 1998 by Ralf Baechle
- *
- * $Id: uaccess.h,v 1.8 1999/01/04 16:09:27 ralf Exp $
+ * Copyright (C) 1996, 1997, 1998, 1999 by Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
*/
-#ifndef __ASM_MIPS_UACCESS_H
-#define __ASM_MIPS_UACCESS_H
+#ifndef _ASM_UACCESS_H
+#define _ASM_UACCESS_H
#include <linux/errno.h>
#include <linux/sched.h>
@@ -25,8 +23,8 @@
*
* For historical reasons, these macros are grossly misnamed.
*/
-#define KERNEL_DS ((mm_segment_t) { 0UL })
-#define USER_DS ((mm_segment_t) { 1UL })
+#define KERNEL_DS ((mm_segment_t) { (unsigned long) 0L })
+#define USER_DS ((mm_segment_t) { (unsigned long) -1L })
#define VERIFY_READ 0
#define VERIFY_WRITE 1
@@ -50,7 +48,7 @@
*/
#define __access_ok(addr,size,mask) \
(((__signed__ long)((mask)&(addr | size | (addr+size)))) >= 0)
-#define __access_mask (-(long)(get_fs().seg))
+#define __access_mask ((long)(get_fs().seg))
#define access_ok(type,addr,size) \
__access_ok(((unsigned long)(addr)),(size),__access_mask)
@@ -449,7 +447,6 @@ strncpy_from_user(char *__to, const char *__from, long __len)
return res;
}
-
/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
extern inline long __strlen_user(const char *s)
{
@@ -481,6 +478,39 @@ extern inline long strlen_user(const char *s)
return res;
}
+/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
+extern inline long __strnlen_user(const char *s, long n)
+{
+ long res;
+
+ __asm__ __volatile__(
+ "move\t$4, %1\n\t"
+ "move\t$5, %2\n\t"
+ __MODULE_JAL(__strnlen_user_nocheck_asm)
+ "move\t%0, $2"
+ : "=r" (res)
+ : "r" (s), "r" (n)
+ : "$2", "$4", "$5", "$8", "$31");
+
+ return res;
+}
+
+extern inline long strnlen_user(const char *s, long n)
+{
+ long res;
+
+ __asm__ __volatile__(
+ "move\t$4, %1\n\t"
+ "move\t$5, %2\n\t"
+ __MODULE_JAL(__strnlen_user_asm)
+ "move\t%0, $2"
+ : "=r" (res)
+ : "r" (s), "r" (n)
+ : "$2", "$4", "$5", "$8", "$31");
+
+ return res;
+}
+
struct exception_table_entry
{
unsigned long insn;
@@ -496,4 +526,4 @@ extern unsigned long search_exception_table(unsigned long addr);
fixup_unit; \
})
-#endif /* __ASM_MIPS_UACCESS_H */
+#endif /* _ASM_UACCESS_H */