From f969d69ba9f952e5bdd38278e25e26a3e4a61a70 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 29 Jan 2000 01:41:54 +0000 Subject: Merge with 2.3.27. --- arch/mips64/kernel/mips64_ksyms.c | 4 +- arch/mips64/kernel/process.c | 36 +++++++++- arch/mips64/kernel/r4k_tlb_debug.c | 5 +- arch/mips64/kernel/scall_o32.S | 5 +- arch/mips64/kernel/syscall.c | 133 ++++++++++++++++--------------------- 5 files changed, 104 insertions(+), 79 deletions(-) (limited to 'arch/mips64/kernel') diff --git a/arch/mips64/kernel/mips64_ksyms.c b/arch/mips64/kernel/mips64_ksyms.c index cc077a486..d0647e4c5 100644 --- a/arch/mips64/kernel/mips64_ksyms.c +++ b/arch/mips64/kernel/mips64_ksyms.c @@ -1,4 +1,4 @@ -/* $Id: mips64_ksyms.c,v 1.4 1999/11/19 20:35:22 ralf Exp $ +/* $Id: mips64_ksyms.c,v 1.5 2000/01/17 23:32:46 ralf Exp $ * * Export MIPS64-specific functions needed for loadable modules. * @@ -111,3 +111,5 @@ EXPORT_SYMBOL(unregister_fpe); #ifdef CONFIG_VT EXPORT_SYMBOL(screen_info); #endif + +EXPORT_SYMBOL(get_wchan); diff --git a/arch/mips64/kernel/process.c b/arch/mips64/kernel/process.c index fa10427e7..f6998a6bb 100644 --- a/arch/mips64/kernel/process.c +++ b/arch/mips64/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.7 1999/12/21 12:40:52 ralf Exp $ +/* $Id: process.c,v 1.4 2000/01/16 01:34:01 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 @@ -177,3 +177,37 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) return retval; } + +/* + * These bracket the sleeping functions.. + */ +extern void scheduling_functions_start_here(void); +extern void scheduling_functions_end_here(void); +#define first_sched ((unsigned long) scheduling_functions_start_here) +#define last_sched ((unsigned long) scheduling_functions_end_here) + +unsigned long get_wchan(struct task_struct *p) +{ + unsigned long schedule_frame; + unsigned long pc; + + if (!p || p == current || p->state == TASK_RUNNING) + return 0; + + pc = thread_saved_pc(&p->thread); + if (pc == (unsigned long) interruptible_sleep_on + || pc == (unsigned long) sleep_on) { + schedule_frame = ((unsigned long *)p->thread.reg30)[9]; + return ((unsigned long *)schedule_frame)[15]; + } + if (pc == (unsigned long) interruptible_sleep_on_timeout + || pc == (unsigned long) sleep_on_timeout) { + schedule_frame = ((unsigned long *)p->thread.reg30)[9]; + return ((unsigned long *)schedule_frame)[16]; + } + if (pc >= first_sched && pc < last_sched) { + printk(KERN_DEBUG "Bug in %s\n", __FUNCTION__); + } + + return pc; +} diff --git a/arch/mips64/kernel/r4k_tlb_debug.c b/arch/mips64/kernel/r4k_tlb_debug.c index a9d41cb46..e9ae2d604 100644 --- a/arch/mips64/kernel/r4k_tlb_debug.c +++ b/arch/mips64/kernel/r4k_tlb_debug.c @@ -1,4 +1,4 @@ -/* $Id: r4k_tlb_debug.c,v 1.6 1999/11/23 17:12:49 ralf Exp $ +/* $Id: r4k_tlb_debug.c,v 1.2 2000/01/17 23:32:46 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 @@ -19,6 +19,9 @@ #include #include +asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write, + unsigned long address); + asmlinkage void tlb_refill_debug(struct pt_regs regs) { show_regs(®s); diff --git a/arch/mips64/kernel/scall_o32.S b/arch/mips64/kernel/scall_o32.S index 56b087a7b..f33a4afb2 100644 --- a/arch/mips64/kernel/scall_o32.S +++ b/arch/mips64/kernel/scall_o32.S @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: scall_o32.S,v 1.3 2000/01/17 23:32:46 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 @@ -267,7 +267,7 @@ illegal_syscall: sys sys32_sigpending 1 sys sys_sethostname 2 sys sys_setrlimit 2 /* 4075 */ - sys sys_getrlimit 2 + sys sys_old_getrlimit 2 sys sys_getrusage 2 sys sys_gettimeofday 2 sys sys_settimeofday 2 @@ -401,6 +401,7 @@ illegal_syscall: sys sys_sendfile 3 sys sys_ni_syscall 0 sys sys_ni_syscall 0 + sys sys_getrlimit 2 /* 4210 */ .endm .macro sys function, nargs diff --git a/arch/mips64/kernel/syscall.c b/arch/mips64/kernel/syscall.c index 31273522c..8273d5285 100644 --- a/arch/mips64/kernel/syscall.c +++ b/arch/mips64/kernel/syscall.c @@ -1,4 +1,4 @@ -/* $Id: syscall.c,v 1.3 1999/10/19 20:51:46 ralf Exp $ +/* $Id: syscall.c,v 1.1 1999/12/04 03:59:00 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 @@ -240,86 +240,71 @@ asmlinkage int sys_ipc (uint call, int first, int second, version = call >> 16; /* hack for backward compatibility */ call &= 0xffff; - if (call <= SEMCTL) - switch (call) { - case SEMOP: - return sys_semop (first, (struct sembuf *)ptr, second); - case SEMGET: - return sys_semget (first, second, third); - case SEMCTL: { - union semun fourth; + switch (call) { + case SEMOP: + return sys_semop (first, (struct sembuf *)ptr, second); + case SEMGET: + return sys_semget (first, second, third); + case SEMCTL: { + union semun fourth; + if (!ptr) + return -EINVAL; + if (get_user(fourth.__pad, (void **) ptr)) + return -EFAULT; + return sys_semctl (first, second, third, fourth); + } + + case MSGSND: + return sys_msgsnd (first, (struct msgbuf *) ptr, + second, third); + case MSGRCV: + switch (version) { + case 0: { + struct ipc_kludge tmp; if (!ptr) return -EINVAL; - if (get_user(fourth.__pad, (void **) ptr)) + + if (copy_from_user(&tmp, + (struct ipc_kludge *) ptr, + sizeof (tmp))) return -EFAULT; - return sys_semctl (first, second, third, fourth); - } - default: - return -EINVAL; + return sys_msgrcv (first, tmp.msgp, second, + tmp.msgtyp, third); } - - if (call <= MSGCTL) - switch (call) { - case MSGSND: - return sys_msgsnd (first, (struct msgbuf *) ptr, - second, third); - case MSGRCV: - switch (version) { - case 0: { - struct ipc_kludge tmp; - if (!ptr) - return -EINVAL; - - if (copy_from_user(&tmp, - (struct ipc_kludge *) ptr, - sizeof (tmp))) - return -EFAULT; - return sys_msgrcv (first, tmp.msgp, second, - tmp.msgtyp, third); - } - default: - return sys_msgrcv (first, - (struct msgbuf *) ptr, - second, fifth, third); - } - case MSGGET: - return sys_msgget ((key_t) first, second); - case MSGCTL: - return sys_msgctl (first, second, - (struct msqid_ds *) ptr); default: - return -EINVAL; + return sys_msgrcv (first, + (struct msgbuf *) ptr, + second, fifth, third); } - if (call <= SHMCTL) - switch (call) { - case SHMAT: - switch (version) { - default: { - ulong raddr; - ret = sys_shmat (first, (char *) ptr, - second, &raddr); - if (ret) - return ret; - return put_user (raddr, (ulong *) third); - } - case 1: /* iBCS2 emulator entry point */ - if (!segment_eq(get_fs(), get_ds())) - return -EINVAL; - return sys_shmat (first, (char *) ptr, - second, (ulong *) third); - } - case SHMDT: - return sys_shmdt ((char *)ptr); - case SHMGET: - return sys_shmget (first, second, third); - case SHMCTL: - return sys_shmctl (first, second, - (struct shmid_ds *) ptr); - default: - return -EINVAL; + case MSGGET: + return sys_msgget ((key_t) first, second); + case MSGCTL: + return sys_msgctl (first, second, (struct msqid_ds *) ptr); + + case SHMAT: + switch (version) { + default: { + ulong raddr; + ret = sys_shmat (first, (char *) ptr, second, &raddr); + if (ret) + return ret; + return put_user (raddr, (ulong *) third); } - - return -EINVAL; + case 1: /* iBCS2 emulator entry point */ + if (!segment_eq(get_fs(), get_ds())) + return -EINVAL; + return sys_shmat (first, (char *) ptr, second, (ulong *) third); + } + case SHMDT: + return sys_shmdt ((char *)ptr); + case SHMGET: + return sys_shmget (first, second, third); + case SHMCTL: + return sys_shmctl (first, second, + (struct shmid_ds *) ptr); + default: + return -EINVAL; + } } /* -- cgit v1.2.3