summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2003-02-15 20:21:12 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-02-15 20:21:12 -0800
commit6ed4b2d7048ca448c2a5941442cf60625905b55f (patch)
treef4bf3e964d95bf3bb56eb013403e05dcae84aa98 /include/linux
parentb9327242c0b7977c64cc49e03178c5e8db9729cd (diff)
parentd946b9ee265d41ea5015fd85028b202605836f9b (diff)
Merge bk://ptrace.bkbits.net/for-linus-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ptrace.h31
-rw-r--r--include/linux/sched.h15
2 files changed, 26 insertions, 20 deletions
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 706b420fb5c9..5d44a953f423 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -3,8 +3,6 @@
/* ptrace.h */
/* structs and defines to help the user use the ptrace system call. */
-#include <linux/compiler.h>
-
/* has the defines to get at the registers. */
#define PTRACE_TRACEME 0
@@ -38,6 +36,8 @@
#define PTRACE_O_TRACEVFORKDONE 0x00000020
#define PTRACE_O_TRACEEXIT 0x00000040
+#define PTRACE_O_MASK 0x0000007f
+
/* Wait extended result codes for the above trace options. */
#define PTRACE_EVENT_FORK 1
#define PTRACE_EVENT_VFORK 2
@@ -47,7 +47,27 @@
#define PTRACE_EVENT_EXIT 6
#include <asm/ptrace.h>
-#include <linux/sched.h>
+
+#ifdef __KERNEL__
+/*
+ * Ptrace flags
+ */
+
+#define PT_PTRACED 0x00000001
+#define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */
+#define PT_TRACESYSGOOD 0x00000004
+#define PT_PTRACE_CAP 0x00000008 /* ptracer can follow suid-exec */
+#define PT_TRACE_FORK 0x00000010
+#define PT_TRACE_VFORK 0x00000020
+#define PT_TRACE_CLONE 0x00000040
+#define PT_TRACE_EXEC 0x00000080
+#define PT_TRACE_VFORK_DONE 0x00000100
+#define PT_TRACE_EXIT 0x00000200
+
+#define PT_TRACE_MASK 0x000003f4
+
+#include <linux/compiler.h> /* For unlikely. */
+#include <linux/sched.h> /* For struct task_struct. */
extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int len);
extern int ptrace_writedata(struct task_struct *tsk, char * src, unsigned long dst, int len);
@@ -58,11 +78,11 @@ extern int ptrace_check_attach(struct task_struct *task, int kill);
extern int ptrace_request(struct task_struct *child, long request, long addr, long data);
extern void ptrace_notify(int exit_code);
extern void __ptrace_link(struct task_struct *child,
- struct task_struct *new_parent);
+ struct task_struct *new_parent);
extern void __ptrace_unlink(struct task_struct *child);
static inline void ptrace_link(struct task_struct *child,
- struct task_struct *new_parent)
+ struct task_struct *new_parent)
{
if (unlikely(child->ptrace))
__ptrace_link(child, new_parent);
@@ -72,5 +92,6 @@ static inline void ptrace_unlink(struct task_struct *child)
if (unlikely(child->ptrace))
__ptrace_unlink(child);
}
+#endif
#endif
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d3cd5e31e8f9..cfa6fd4d86da 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -446,21 +446,6 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
#define PF_KSWAPD 0x00040000 /* I am kswapd */
-/*
- * Ptrace flags
- */
-
-#define PT_PTRACED 0x00000001
-#define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */
-#define PT_TRACESYSGOOD 0x00000004
-#define PT_PTRACE_CAP 0x00000008 /* ptracer can follow suid-exec */
-#define PT_TRACE_FORK 0x00000010
-#define PT_TRACE_VFORK 0x00000020
-#define PT_TRACE_CLONE 0x00000040
-#define PT_TRACE_EXEC 0x00000080
-#define PT_TRACE_VFORK_DONE 0x00000100
-#define PT_TRACE_EXIT 0x00000200
-
#if CONFIG_SMP
extern void set_cpus_allowed(task_t *p, unsigned long new_mask);
#else