|
From: James S. <jsi...@us...> - 2001-08-22 18:18:18
|
Update of /cvsroot/linux-mips/linux/arch/mips64/kernel In directory usw-pr-cvs1:/tmp/cvs-serv15361/arch/mips64/kernel Modified Files: binfmt_elf32.c entry.S scall_64.S scall_o32.S Log Message: Synced to Ralph's tree Index: binfmt_elf32.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips64/kernel/binfmt_elf32.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** binfmt_elf32.c 2001/06/22 02:29:32 1.1.1.1 --- binfmt_elf32.c 2001/08/22 18:18:14 1.2 *************** *** 33,37 **** #define TASK32_SIZE 0x80000000UL #undef ELF_ET_DYN_BASE ! #define ELF_ET_DYN_BASE (2 * TASK32_SIZE / 3) #include <asm/processor.h> --- 33,37 ---- #define TASK32_SIZE 0x80000000UL #undef ELF_ET_DYN_BASE ! #define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2) #include <asm/processor.h> Index: entry.S =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips64/kernel/entry.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** entry.S 2001/06/22 02:29:32 1.1.1.1 --- entry.S 2001/08/22 18:18:14 1.2 *************** *** 6,11 **** * Low level exception handling * ! * Copyright (C) 1994 - 2000 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics */ #include <linux/config.h> --- 6,12 ---- * Low level exception handling * ! * Copyright (C) 1994 - 2000, 2001 Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics + * Copyright (C) 2001 MIPS Technologies, Inc. */ #include <linux/config.h> *************** *** 16,66 **** #include <asm/stackframe.h> .text - .set noreorder .align 4 FEXPORT(ret_from_fork) jal schedule_tail ! move a0, v0 # prev j ret_from_sys_call - nop - FEXPORT(handle_softirq) - jal do_softirq - nop - b 9f - nop reschedule: jal schedule - nop FEXPORT(ret_from_sys_call) ! FEXPORT(ret_from_irq) ! la t1, irq_stat # softirq_active ! #ifdef CONFIG_SMP ! lwu t0, TASK_PROCESSOR($28) ! dsll t0, t0, 5 ! daddu t1, t0 ! #endif ! lw t0, 0 (t1) # softirq_active ! lw t1, 4 (t1) # softirq_mask. unused delay slot ! and t0, t1 ! bnez t0, handle_softirq ! 9: ld t0, PT_STATUS(sp) # returning to kernel mode? ! andi t1, t0, 0x10 ! beqz t1, return # -> yes ! ld t1, TASK_NEED_RESCHED($28) ! bnez t1, reschedule ! lw v0, TASK_SIGPENDING($28) ! move a0, zero ! beqz v0, return ! nop ! jal do_signal ! move a1, sp ! FEXPORT(return) .set noat RESTORE_ALL eret .set at /* * Common spurious interrupt handler. --- 17,75 ---- #include <asm/stackframe.h> + /* This duplicates the definition from <linux/sched.h> */ + #define PT_TRACESYS 0x00000002 /* tracing system calls */ + + #define KU_USER 0x10 + .text .align 4 FEXPORT(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 FEXPORT(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 ! ld v0, TASK_NEED_RESCHED($28) ! lw v1, TASK_SIGPENDING($28) ! bnez v0, reschedule ! bnez v1, signal_return ! restore_all: .set noat RESTORE_ALL eret .set at + 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. *************** *** 76,80 **** lw t0,%lo(spurious_count)(t1) addiu t0,1 j ret_from_irq - sw t0,%lo(spurious_count)(t1) END(spurious_interrupt) --- 85,89 ---- lw t0,%lo(spurious_count)(t1) addiu t0,1 + sw t0,%lo(spurious_count)(t1) j ret_from_irq END(spurious_interrupt) Index: scall_64.S =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips64/kernel/scall_64.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** scall_64.S 2001/06/22 02:29:32 1.1.1.1 --- scall_64.S 2001/08/22 18:18:14 1.2 *************** *** 4,9 **** * for more details. * ! * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. */ #include <linux/config.h> --- 4,10 ---- * for more details. * ! * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. + * Copyright (C) 2001 MIPS Technologies, Inc. */ #include <linux/config.h> *************** *** 63,104 **** 1: sd v0, PT_R2(sp) # result ! FEXPORT(ret_from_sys_call_64) ! la t1, irq_stat # softirq_active ! #ifdef CONFIG_SMP ! lwu t0, TASK_PROCESSOR($28) ! dsll t0, t0, 5 ! daddu t1, t0 ! #endif ! lw t0, 0(t1) # softirq_active ! lw t1, 4(t1) # softirq_mask. unused delay slot ! and t0, t1 ! bnez t0, handle_softirq_64 - 9: ld t0, PT_STATUS(sp) # returning to kernel mode? - andi t1, t0, 0x10 ld t2, TASK_NEED_RESCHED($28) ! beqz t1, return_64 # -> yes ! bnez t2, reschedule_64 lw v0, TASK_SIGPENDING($28) ! move a0, zero ! beqz v0, return_64 ! move a1, sp ! SAVE_STATIC ! jal do_signal ! return_64: RESTORE_SOME RESTORE_SP - .set mips3 eret - .set mips0 ! handle_softirq_64: ! jal do_softirq ! b 9b ! reschedule_64: SAVE_STATIC jal schedule ! b ret_from_sys_call_64 /* ------------------------------------------------------------------------ */ --- 64,100 ---- 1: sd v0, PT_R2(sp) # result ! ret_from_sys_call: ! mfc0 t0, CP0_STATUS ! xori t0, t0, 1 ! ori t0, t0, 1 ! mtc0 t0, CP0_STATUS ld t2, TASK_NEED_RESCHED($28) ! bnez t2, reschedule lw v0, TASK_SIGPENDING($28) ! bnez v0, signal_return ! restore_all: RESTORE_SOME RESTORE_SP eret ! /* 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 ! ! reschedule: SAVE_STATIC jal schedule ! b ret_from_sys_call /* ------------------------------------------------------------------------ */ Index: scall_o32.S =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips64/kernel/scall_o32.S,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** scall_o32.S 2001/08/10 16:00:00 1.4 --- scall_o32.S 2001/08/22 18:18:14 1.5 *************** *** 55,111 **** stack_done: ! ld t0, TASK_PTRACE($28) # syscall tracing enabled? ! andi t0, PT_TRACESYS ! bnez t0, trace_a_syscall ! jalr t2 # Do The Real Thing (TM) ! li t0, -EMAXERRNO - 1 # error? ! sltu t0, t0, v0 ! sd t0, PT_R7(sp) # set error flag ! beqz t0, 1f ! negu v0 # error ! sd v0, PT_R0(sp) # set flag for syscall restarting ! 1: sd v0, PT_R2(sp) # result ! FEXPORT(o32_ret_from_sys_call) ! la t1, irq_stat # softirq_active ! #ifdef CONFIG_SMP ! lwu t0, TASK_PROCESSOR($28) ! dsll t0, t0, 5 ! daddu t1, t0 ! #endif ! lw t0, 0(t1) # softirq_active ! lw t1, 4(t1) # softirq_mask. unused delay slot ! and t0, t1 ! bnez t0, o32_handle_softirq ! 9: ld t0,PT_STATUS(sp) # returning to kernel mode? ! andi t1, t0, 0x10 ! ld 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 ! .set mips3 ! eret ! .set mips0 ! o32_handle_softirq: ! jal do_softirq ! b 9b o32_reschedule: ! SAVE_STATIC ! jal schedule ! b o32_ret_from_sys_call /* ------------------------------------------------------------------------ */ --- 55,102 ---- stack_done: ! ld t0, TASK_PTRACE($28) # syscall tracing enabled? ! andi t0, PT_TRACESYS ! bnez t0, trace_a_syscall ! jalr t2 # Do The Real Thing (TM) ! li t0, -EMAXERRNO - 1 # error? ! sltu t0, t0, v0 ! sd t0, PT_R7(sp) # set error flag ! beqz t0, 1f ! negu v0 # error ! sd v0, PT_R0(sp) # flag for syscall restarting ! 1: sd v0, PT_R2(sp) # result ! FEXPORT(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 ! ld t2, TASK_NEED_RESCHED($28) ! bnez t2, o32_reschedule ! lw v0, TASK_SIGPENDING($28) ! bnez v0, signal_return ! restore_all: RESTORE_SOME ! RESTORE_SP ! .set mips3 ! eret ! .set mips0 ! signal_return: mfc0 t0, CP0_STATUS # need_resched and signals atomic test ! ori t0, t0, 1 ! mtc0 t0, CP0_STATUS ! move a0, zero ! move a1, sp ! SAVE_STATIC ! jal do_signal ! o32_reschedule: ! SAVE_STATIC ! jal schedule ! b o32_ret_from_sys_call /* ------------------------------------------------------------------------ */ |