[patch] ac17: alpha ptrace fix

From: Ivan Kokshaysky (ink@jurassic.park.msu.ru)
Date: Tue Jun 13 2000 - 05:52:02 EST


Just an obvious 'search & replace' changes.

Ivan.

diff -ur 2.4.0t1ac17/arch/alpha/kernel/entry.S linux/arch/alpha/kernel/entry.S
--- 2.4.0t1ac17/arch/alpha/kernel/entry.S Tue Apr 25 00:39:34 2000
+++ linux/arch/alpha/kernel/entry.S Tue Jun 13 13:49:18 2000
@@ -34,11 +34,12 @@
 #define TASK_EXEC_DOMAIN 32
 #define TASK_NEED_RESCHED 40
 #define TASK_PROCESSOR 100
+#define TASK_PTRACE 104
 
 /*
  * task flags (must match include/linux/sched.h):
  */
-#define PF_PTRACED 0x00000010
+#define PT_PTRACED 0x00000001
 
 #define CLONE_VM 0x00000100
 
@@ -557,10 +558,10 @@
         lda $5,sys_call_table
         lda $27,sys_ni_syscall
         cmpult $0,$4,$4
- ldq $3,TASK_FLAGS($8)
+ ldq $3,TASK_PTRACE($8)
         stq $17,SP_OFF+32($30)
         s8addq $0,$5,$5
- and $3,PF_PTRACED,$3
+ and $3,PT_PTRACED,$3
         stq $18,SP_OFF+40($30)
         bne $3,strace
         beq $4,1f
diff -ur 2.4.0t1ac17/arch/alpha/kernel/ptrace.c linux/arch/alpha/kernel/ptrace.c
--- 2.4.0t1ac17/arch/alpha/kernel/ptrace.c Tue Mar 21 21:47:06 2000
+++ linux/arch/alpha/kernel/ptrace.c Tue Jun 13 13:55:48 2000
@@ -246,10 +246,10 @@
         ret = -EPERM;
         if (request == PTRACE_TRACEME) {
                 /* are we already being traced? */
- if (current->flags & PF_PTRACED)
+ if (current->ptrace & PT_PTRACED)
                         goto out;
- /* set the ptrace bit in the process flags. */
- current->flags |= PF_PTRACED;
+ /* set the ptrace bit in the process ptrace flags. */
+ current->ptrace |= PT_PTRACED;
                 ret = 0;
                 goto out;
         }
@@ -273,9 +273,9 @@
                     && !capable(CAP_SYS_PTRACE))
                         goto out;
                 /* the same process cannot be attached many times */
- if (child->flags & PF_PTRACED)
+ if (child->ptrace & PT_PTRACED)
                         goto out;
- child->flags |= PF_PTRACED;
+ child->ptrace |= PT_PTRACED;
                 if (child->p_pptr != current) {
                         REMOVE_LINKS(child);
                         child->p_pptr = current;
@@ -286,7 +286,7 @@
                 goto out;
         }
         ret = -ESRCH;
- if (!(child->flags & PF_PTRACED)) {
+ if (!(child->ptrace & PT_PTRACED)) {
                 DBG(DBG_MEM, ("child not traced\n"));
                 goto out;
         }
@@ -343,9 +343,9 @@
                 if ((unsigned long) data > _NSIG)
                         goto out;
                 if (request == PTRACE_SYSCALL)
- child->flags |= PF_TRACESYS;
+ child->ptrace |= PT_TRACESYS;
                 else
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
                 child->exit_code = data;
                 wake_up_process(child);
                 /* make sure single-step breakpoint is gone. */
@@ -373,7 +373,7 @@
                 if ((unsigned long) data > _NSIG)
                         goto out;
                 child->thread.bpt_nsaved = -1; /* mark single-stepping */
- child->flags &= ~PF_TRACESYS;
+ child->ptrace &= ~PT_TRACESYS;
                 wake_up_process(child);
                 child->exit_code = data;
                 /* give it a chance to run. */
@@ -384,7 +384,7 @@
                 ret = -EIO;
                 if ((unsigned long) data > _NSIG)
                         goto out;
- child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
                 wake_up_process(child);
                 child->exit_code = data;
                 REMOVE_LINKS(child);
@@ -407,8 +407,8 @@
 asmlinkage void
 syscall_trace(void)
 {
- if ((current->flags & (PF_PTRACED|PF_TRACESYS))
- != (PF_PTRACED|PF_TRACESYS))
+ if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
+ != (PT_PTRACED|PT_TRACESYS))
                 return;
         current->exit_code = SIGTRAP;
         current->state = TASK_STOPPED;
diff -ur 2.4.0t1ac17/arch/alpha/kernel/signal.c linux/arch/alpha/kernel/signal.c
--- 2.4.0t1ac17/arch/alpha/kernel/signal.c Thu May 25 05:38:26 2000
+++ linux/arch/alpha/kernel/signal.c Tue Jun 13 13:53:10 2000
@@ -651,7 +651,7 @@
                 if (!signr)
                         break;
 
- if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
+ if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
                         /* Let the debugger run. */
                         current->exit_code = signr;
                         current->state = TASK_STOPPED;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:27 EST