aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-05-19 08:08:04 -0400
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 14:31:16 -0400
commitf8280c8d3d51667015c2363eeaa76b4e28e002a5 (patch)
tree91a73a265ea48ef44c7ddbd89c595f9891fd1e17 /arch/mips
parentfdb551a4c59945f868b8855e5baf161c9f1c0518 (diff)
Fix tasteless #ifdef mess in audit_arch(), minor cleanups.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/kernel/ptrace.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 649c90dee38e..49821ee18984 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -28,6 +28,7 @@
28#include <linux/security.h> 28#include <linux/security.h>
29#include <linux/signal.h> 29#include <linux/signal.h>
30 30
31#include <asm/byteorder.h>
31#include <asm/cpu.h> 32#include <asm/cpu.h>
32#include <asm/fpu.h> 33#include <asm/fpu.h>
33#include <asm/mipsregs.h> 34#include <asm/mipsregs.h>
@@ -308,21 +309,14 @@ out:
308 309
309static inline int audit_arch(void) 310static inline int audit_arch(void)
310{ 311{
311#ifdef CONFIG_CPU_LITTLE_ENDIAN 312 int arch = EM_MIPS;
312#ifdef CONFIG_64BIT 313#ifdef CONFIG_64BIT
313 if (!(current->thread.mflags & MF_32BIT_REGS)) 314 arch |= __AUDIT_ARCH_64BIT;
314 return AUDIT_ARCH_MIPSEL64; 315#endif
315#endif /* MIPS64 */ 316#if defined(__LITTLE_ENDIAN)
316 return AUDIT_ARCH_MIPSEL; 317 arch |= __AUDIT_ARCH_LE;
317 318#endif
318#else /* big endian... */ 319 return arch;
319#ifdef CONFIG_64BIT
320 if (!(current->thread.mflags & MF_32BIT_REGS))
321 return AUDIT_ARCH_MIPS64;
322#endif /* MIPS64 */
323 return AUDIT_ARCH_MIPS;
324
325#endif /* endian */
326} 320}
327 321
328/* 322/*
@@ -332,12 +326,13 @@ static inline int audit_arch(void)
332asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) 326asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
333{ 327{
334 if (unlikely(current->audit_context) && entryexit) 328 if (unlikely(current->audit_context) && entryexit)
335 audit_syscall_exit(current, AUDITSC_RESULT(regs->regs[2]), regs->regs[2]); 329 audit_syscall_exit(current, AUDITSC_RESULT(regs->regs[2]),
330 regs->regs[2]);
336 331
337 if (!test_thread_flag(TIF_SYSCALL_TRACE))
338 goto out;
339 if (!(current->ptrace & PT_PTRACED)) 332 if (!(current->ptrace & PT_PTRACED))
340 goto out; 333 goto out;
334 if (!test_thread_flag(TIF_SYSCALL_TRACE))
335 goto out;
341 336
342 /* The 0x80 provides a way for the tracing parent to distinguish 337 /* The 0x80 provides a way for the tracing parent to distinguish
343 between a syscall stop and SIGTRAP delivery */ 338 between a syscall stop and SIGTRAP delivery */