|
From: James S. <jsi...@us...> - 2001-08-22 18:18:18
|
Update of /cvsroot/linux-mips/linux/arch/mips/kernel In directory usw-pr-cvs1:/tmp/cvs-serv15361/arch/mips/kernel Modified Files: entry.S scall_o32.S time.c Log Message: Synced to Ralph's tree Index: entry.S =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/entry.S,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** entry.S 2001/08/13 16:42:50 1.4 --- entry.S 2001/08/22 18:18:13 1.5 *************** *** 1,12 **** ! /* $Id$ ! * ! * Low level exception handling ! * * 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 - 2000 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. */ #include <linux/config.h> --- 1,11 ---- ! /* ! /* * 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 - 2000, 2001 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. + * Copyright (C) 2001 MIPS Technologies, Inc. */ #include <linux/config.h> *************** *** 27,30 **** --- 26,33 ---- #include <asm/isadep.h> + /* This duplicates the definition from <linux/sched.h> */ + #define PT_TRACESYS 0x00000002 /* tracing system calls */ + + .text .align 4 *************** *** 32,72 **** .set reorder EXPORT(ret_from_fork) ! move a0, v0 # prev jal schedule_tail j ret_from_sys_call ! EXPORT(handle_softirq) ! jal do_softirq ! b 9f reschedule: jal schedule EXPORT(ret_from_sys_call) - EXPORT(ret_from_irq) .type ret_from_irq,@function - la t1, irq_stat # softirq_pending - #ifdef CONFIG_SMP - lw t0, TASK_PROCESSOR($28) - sll t0, t0, 5 - addu t1, t0 - #endif - lw t0, 0(t1) # softirq_pending - bnez t0, handle_softirq ! 9: lw t0,PT_STATUS(sp) # returning to kernel mode? ! lw t2, TASK_NEED_RESCHED($28) ! andi t1, t0, KU_USER ! beqz t1, return # -> yes ! bnez t2, reschedule ! lw v0, TASK_SIGPENDING($28) ! move a0, zero ! beqz v0, return ! move a1, sp ! jal do_signal ! EXPORT(return) .set noat RESTORE_ALL_AND_RET .set at /* * Common spurious interrupt handler. --- 35,87 ---- .set reorder EXPORT(ret_from_fork) ! move a0, v0 # prev jal schedule_tail + lw t0, TASK_PTRACE($28) # syscall tracing enabled? + andi t0, PT_TRACESYS + bnez t0, tracesys_exit j ret_from_sys_call ! tracesys_exit: jal syscall_trace ! b ret_from_sys_call ! ! EXPORT(ret_from_irq) ! EXPORT(ret_from_exception) ! lw t0, PT_STATUS(sp) # returning to kernel mode? ! andi t0, t0, KU_USER ! bnez t0, ret_from_sys_call ! j restore_all reschedule: jal schedule EXPORT(ret_from_sys_call) .type ret_from_irq,@function ! mfc0 t0, CP0_STATUS # need_resched and signals atomic test ! ori t0, t0, 1 ! xori t0, t0, 1 ! mtc0 t0, CP0_STATUS ! nop; nop; nop ! lw v0, TASK_NEED_RESCHED($28) ! lw v1, TASK_SIGPENDING($28) ! bnez v0, reschedule ! bnez v1, signal_return ! restore_all: .set noat RESTORE_ALL_AND_RET .set at + /* Put this behind restore_all for the sake of the branch prediction. */ + signal_return: + .type signal_return, @function + + mfc0 t0, CP0_STATUS + ori t0, t0, 1 + mtc0 t0, CP0_STATUS + + move a0, zero + move a1, sp + jal do_signal + b restore_all + /* * Common spurious interrupt handler. *************** *** 84,89 **** .set noreorder addiu t0,1 j ret_from_irq - sw t0,%lo(spurious_count)(t1) END(spurious_interrupt) --- 99,104 ---- .set noreorder addiu t0,1 + sw t0,%lo(spurious_count)(t1) j ret_from_irq END(spurious_interrupt) *************** *** 105,109 **** STI #define __BUILD_clear_ade(exception) \ ! .set reorder; \ MFC0 t0,CP0_BADVADDR; \ .set noreorder; \ --- 120,124 ---- STI #define __BUILD_clear_ade(exception) \ ! .set reorder; \ MFC0 t0,CP0_BADVADDR; \ .set noreorder; \ *************** *** 138,143 **** __BUILD_##verbose(exception); \ jal do_##handler; \ ! move a0,sp; \ ! j ret_from_sys_call; \ nop; \ END(handle_##exception) --- 153,158 ---- __BUILD_##verbose(exception); \ jal do_##handler; \ ! move a0, sp; \ ! j ret_from_exception; \ nop; \ END(handle_##exception) Index: scall_o32.S =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/scall_o32.S,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scall_o32.S 2001/08/13 22:07:46 1.3 --- scall_o32.S 2001/08/22 18:18:14 1.4 *************** *** 66,97 **** EXPORT(o32_ret_from_sys_call) ! la t1, irq_stat # softirq_pending ! #ifdef CONFIG_SMP ! lw t0, TASK_PROCESSOR($28) ! sll t0, t0, 5 ! addu t1, t0 ! #endif ! lw t0, 0(t1) # softirq_pending ! bnez t0, o32_handle_softirq - 9: lw t0, PT_STATUS(sp) # returning to kernel mode? - andi t1, t0, KU_USER lw t2, TASK_NEED_RESCHED($28) - beqz t1, o32_return # -> yes bnez t2, o32_reschedule lw v0, TASK_SIGPENDING($28) move a0, zero - beqz v0, o32_return move a1, sp - SAVE_STATIC jal do_signal - o32_return: - RESTORE_SOME - RESTORE_SP_AND_RET - - o32_handle_softirq: - jal do_softirq - b 9b o32_reschedule: SAVE_STATIC --- 66,95 ---- EXPORT(o32_ret_from_sys_call) ! mfc0 t0, CP0_STATUS # need_resched and signals atomic test ! ori t0, t0, 1 ! xori t0, t0, 1 ! mtc0 t0, CP0_STATUS lw t2, TASK_NEED_RESCHED($28) bnez t2, o32_reschedule lw v0, TASK_SIGPENDING($28) + bnez v0, signal_return + restore_all: + RESTORE_SOME + RESTORE_SP_AND_RET + + /* Put this behind restore_all for the sake of the branch prediction. */ + signal_return: + .type signal_return, @function + + mfc0 t0, CP0_STATUS + ori t0, t0, 1 + mtc0 t0, CP0_STATUS + move a0, zero move a1, sp jal do_signal + b restore_all o32_reschedule: SAVE_STATIC Index: time.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/time.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** time.c 2001/08/10 21:53:38 1.4 --- time.c 2001/08/22 18:18:14 1.5 *************** *** 374,378 **** irq_exit(cpu, irq); - /* check for bottom half */ if (softirq_pending(cpu)) do_softirq(); --- 374,377 ---- |