aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2006-02-01 06:06:12 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-01 11:53:21 -0500
commit9a5e7339908d7d718ebc4149b77eee06291bdb95 (patch)
treec4de6c51b7e9783fb32948539f6b6b09139bc8f5
parent975b3d3d5b983eb60706d35f0d24cd19f6badabf (diff)
[PATCH] alpha: Fix getxpid on alpha so it works for threads
While looking in the code I discovered that alpha has fallen behind because it doesn't use sys_getppid. The problem is that it doesn't follow the task struct to the task_group_leader. Acked-by: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/alpha/kernel/asm-offsets.c1
-rw-r--r--arch/alpha/kernel/entry.S16
2 files changed, 10 insertions, 7 deletions
diff --git a/arch/alpha/kernel/asm-offsets.c b/arch/alpha/kernel/asm-offsets.c
index 8f2e5c718b50..6c56c754a0b5 100644
--- a/arch/alpha/kernel/asm-offsets.c
+++ b/arch/alpha/kernel/asm-offsets.c
@@ -28,6 +28,7 @@ void foo(void)
28 DEFINE(TASK_GID, offsetof(struct task_struct, gid)); 28 DEFINE(TASK_GID, offsetof(struct task_struct, gid));
29 DEFINE(TASK_EGID, offsetof(struct task_struct, egid)); 29 DEFINE(TASK_EGID, offsetof(struct task_struct, egid));
30 DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent)); 30 DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent));
31 DEFINE(TASK_GROUP_LEADER, offsetof(struct task_struct, group_leader));
31 DEFINE(TASK_TGID, offsetof(struct task_struct, tgid)); 32 DEFINE(TASK_TGID, offsetof(struct task_struct, tgid));
32 BLANK(); 33 BLANK();
33 34
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index e38671c922bc..7af15bf7e5ab 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -879,17 +879,19 @@ sys_getxpid:
879 879
880 /* See linux/kernel/timer.c sys_getppid for discussion 880 /* See linux/kernel/timer.c sys_getppid for discussion
881 about this loop. */ 881 about this loop. */
882 ldq $3, TASK_REAL_PARENT($2) 882 ldq $3, TASK_GROUP_LEADER($2)
8831: ldl $1, TASK_TGID($3) 883 ldq $4, TASK_REAL_PARENT($3)
884 ldl $0, TASK_TGID($2)
8851: ldl $1, TASK_TGID($4)
884#ifdef CONFIG_SMP 886#ifdef CONFIG_SMP
885 mov $3, $4 887 mov $4, $5
886 mb 888 mb
887 ldq $3, TASK_REAL_PARENT($2) 889 ldq $3, TASK_GROUP_LEADER($2)
888 cmpeq $3, $4, $4 890 ldq $4, TASK_REAL_PARENT($3)
889 beq $4, 1b 891 cmpeq $4, $5, $5
892 beq $5, 1b
890#endif 893#endif
891 stq $1, 80($sp) 894 stq $1, 80($sp)
892 ldl $0, TASK_TGID($2)
893 ret 895 ret
894.end sys_getxpid 896.end sys_getxpid
895 897