Commit 9a5e7339 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Linus Torvalds

[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: default avatarRichard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 975b3d3d
...@@ -28,6 +28,7 @@ void foo(void) ...@@ -28,6 +28,7 @@ void foo(void)
DEFINE(TASK_GID, offsetof(struct task_struct, gid)); DEFINE(TASK_GID, offsetof(struct task_struct, gid));
DEFINE(TASK_EGID, offsetof(struct task_struct, egid)); DEFINE(TASK_EGID, offsetof(struct task_struct, egid));
DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent)); DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent));
DEFINE(TASK_GROUP_LEADER, offsetof(struct task_struct, group_leader));
DEFINE(TASK_TGID, offsetof(struct task_struct, tgid)); DEFINE(TASK_TGID, offsetof(struct task_struct, tgid));
BLANK(); BLANK();
......
...@@ -879,17 +879,19 @@ sys_getxpid: ...@@ -879,17 +879,19 @@ sys_getxpid:
/* See linux/kernel/timer.c sys_getppid for discussion /* See linux/kernel/timer.c sys_getppid for discussion
about this loop. */ about this loop. */
ldq $3, TASK_REAL_PARENT($2) ldq $3, TASK_GROUP_LEADER($2)
1: ldl $1, TASK_TGID($3) ldq $4, TASK_REAL_PARENT($3)
ldl $0, TASK_TGID($2)
1: ldl $1, TASK_TGID($4)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
mov $3, $4 mov $4, $5
mb mb
ldq $3, TASK_REAL_PARENT($2) ldq $3, TASK_GROUP_LEADER($2)
cmpeq $3, $4, $4 ldq $4, TASK_REAL_PARENT($3)
beq $4, 1b cmpeq $4, $5, $5
beq $5, 1b
#endif #endif
stq $1, 80($sp) stq $1, 80($sp)
ldl $0, TASK_TGID($2)
ret ret
.end sys_getxpid .end sys_getxpid
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment