git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
arch
/
mips
/
kernel
/
ptrace.c
diff --git
a/arch/mips/kernel/ptrace.c
b/arch/mips/kernel/ptrace.c
index
1c74235
..
0d533ef
100644
(file)
--- a/
arch/mips/kernel/ptrace.c
+++ b/
arch/mips/kernel/ptrace.c
@@
-14,6
+14,7
@@
* At this time Linux/MIPS64 only supports syscall tracing, even for 32-bit
* binaries.
*/
* At this time Linux/MIPS64 only supports syscall tracing, even for 32-bit
* binaries.
*/
+#include <linux/config.h>
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <linux/sched.h>
@@
-119,11
+120,11
@@
int ptrace_getfpregs (struct task_struct *child, __u32 __user *data)
__put_user ((__u64) -1, i + (__u64 __user *) data);
}
__put_user ((__u64) -1, i + (__u64 __user *) data);
}
- __put_user (child->thread.fpu.fcr31, data + 64);
-
if (cpu_has_fpu) {
unsigned int flags, tmp;
if (cpu_has_fpu) {
unsigned int flags, tmp;
+ __put_user (child->thread.fpu.hard.fcr31, data + 64);
+
preempt_disable();
if (cpu_has_mipsmt) {
unsigned int vpflags = dvpe();
preempt_disable();
if (cpu_has_mipsmt) {
unsigned int vpflags = dvpe();
@@
-141,6
+142,7
@@
int ptrace_getfpregs (struct task_struct *child, __u32 __user *data)
preempt_enable();
__put_user (tmp, data + 65);
} else {
preempt_enable();
__put_user (tmp, data + 65);
} else {
+ __put_user (child->thread.fpu.soft.fcr31, data + 64);
__put_user ((__u32) 0, data + 65);
}
__put_user ((__u32) 0, data + 65);
}
@@
-160,7
+162,10
@@
int ptrace_setfpregs (struct task_struct *child, __u32 __user *data)
for (i = 0; i < 32; i++)
__get_user (fregs[i], i + (__u64 __user *) data);
for (i = 0; i < 32; i++)
__get_user (fregs[i], i + (__u64 __user *) data);
- __get_user (child->thread.fpu.fcr31, data + 64);
+ if (cpu_has_fpu)
+ __get_user (child->thread.fpu.hard.fcr31, data + 64);
+ else
+ __get_user (child->thread.fpu.soft.fcr31, data + 64);
/* FIR may not be written. */
/* FIR may not be written. */
@@
-171,9
+176,6
@@
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
{
int ret;
{
int ret;
- if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT))
- goto out;
-
switch (request) {
/* when I and D space are separate, these will need to be fixed. */
case PTRACE_PEEKTEXT: /* read word at location addr. */
switch (request) {
/* when I and D space are separate, these will need to be fixed. */
case PTRACE_PEEKTEXT: /* read word at location addr. */
@@
-239,24
+241,17
@@
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
tmp = regs->lo;
break;
case FPC_CSR:
tmp = regs->lo;
break;
case FPC_CSR:
- tmp = child->thread.fpu.fcr31;
+ if (cpu_has_fpu)
+ tmp = child->thread.fpu.hard.fcr31;
+ else
+ tmp = child->thread.fpu.soft.fcr31;
break;
case FPC_EIR: { /* implementation / version register */
unsigned int flags;
break;
case FPC_EIR: { /* implementation / version register */
unsigned int flags;
-#ifdef CONFIG_MIPS_MT_SMTC
- unsigned int irqflags;
- unsigned int mtflags;
-#endif /* CONFIG_MIPS_MT_SMTC */
if (!cpu_has_fpu)
break;
if (!cpu_has_fpu)
break;
-#ifdef CONFIG_MIPS_MT_SMTC
- /* Read-modify-write of Status must be atomic */
- local_irq_save(irqflags);
- mtflags = dmt();
-#endif /* CONFIG_MIPS_MT_SMTC */
-
preempt_disable();
if (cpu_has_mipsmt) {
unsigned int vpflags = dvpe();
preempt_disable();
if (cpu_has_mipsmt) {
unsigned int vpflags = dvpe();
@@
-271,10
+266,6
@@
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
__asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
write_c0_status(flags);
}
__asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
write_c0_status(flags);
}
-#ifdef CONFIG_MIPS_MT_SMTC
- emt(mtflags);
- local_irq_restore(irqflags);
-#endif /* CONFIG_MIPS_MT_SMTC */
preempt_enable();
break;
}
preempt_enable();
break;
}
@@
-331,9
+322,9
@@
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
if (!tsk_used_math(child)) {
/* FP not yet used */
if (!tsk_used_math(child)) {
/* FP not yet used */
- memset(&child->thread.fpu, ~0,
- sizeof(child->thread.fpu));
- child->thread.fpu.fcr31 = 0;
+ memset(&child->thread.fpu
.hard
, ~0,
+ sizeof(child->thread.fpu
.hard
));
+ child->thread.fpu.
hard.
fcr31 = 0;
}
#ifdef CONFIG_32BIT
/*
}
#ifdef CONFIG_32BIT
/*
@@
-364,7
+355,10
@@
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
regs->lo = data;
break;
case FPC_CSR:
regs->lo = data;
break;
case FPC_CSR:
- child->thread.fpu.fcr31 = data;
+ if (cpu_has_fpu)
+ child->thread.fpu.hard.fcr31 = data;
+ else
+ child->thread.fpu.soft.fcr31 = data;
break;
case DSP_BASE ... DSP_BASE + 5: {
dspreg_t *dregs;
break;
case DSP_BASE ... DSP_BASE + 5: {
dspreg_t *dregs;
@@
-475,13
+469,15
@@
static inline int audit_arch(void)
asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
{
if (unlikely(current->audit_context) && entryexit)
asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
{
if (unlikely(current->audit_context) && entryexit)
- audit_syscall_exit(AUDITSC_RESULT(regs->regs[2]),
+ audit_syscall_exit(
current,
AUDITSC_RESULT(regs->regs[2]),
regs->regs[2]);
if (!(current->ptrace & PT_PTRACED))
goto out;
if (!test_thread_flag(TIF_SYSCALL_TRACE))
goto out;
regs->regs[2]);
if (!(current->ptrace & PT_PTRACED))
goto out;
if (!test_thread_flag(TIF_SYSCALL_TRACE))
goto out;
+ if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT))
+ goto out_tsk;
/* The 0x80 provides a way for the tracing parent to distinguish
between a syscall stop and SIGTRAP delivery */
/* The 0x80 provides a way for the tracing parent to distinguish
between a syscall stop and SIGTRAP delivery */
@@
-499,7
+495,7
@@
asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
}
out:
if (unlikely(current->audit_context) && !entryexit)
}
out:
if (unlikely(current->audit_context) && !entryexit)
- audit_syscall_entry(audit_arch(), regs->regs[2],
+ audit_syscall_entry(
current,
audit_arch(), regs->regs[2],
regs->regs[4], regs->regs[5],
regs->regs[6], regs->regs[7]);
}
regs->regs[4], regs->regs[5],
regs->regs[6], regs->regs[7]);
}