Skip to content

Commit 6bc4f16

Browse files
author
Al Viro
committed
[ia64] access_uarea(): stop bothering with gpregs_[gs]et()
We know this won't be called for child == current, so we don't need to bother with callbacks, etc. - just do unw_init_from_blocked_task(), unw_unwind_to_user() and do the payload of gpregs_[gs]et(). For one register. Which is to say, access_elf_reg(). Signed-off-by: Al Viro <[email protected]>
1 parent a79ca8e commit 6bc4f16

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

arch/ia64/kernel/ptrace.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,15 +1936,14 @@ access_uarea(struct task_struct *child, unsigned long addr,
19361936
}
19371937

19381938
if (pos != -1) {
1939-
if (write_access)
1940-
ret = gpregs_set(child, NULL, pos,
1941-
sizeof(unsigned long), data, NULL);
1942-
else
1943-
ret = gpregs_get(child, NULL, pos,
1944-
sizeof(unsigned long), data, NULL);
1945-
if (ret != 0)
1946-
return -1;
1947-
return 0;
1939+
struct unw_frame_info info;
1940+
1941+
memset(&info, 0, sizeof(info));
1942+
unw_init_from_blocked_task(&info, child);
1943+
if (unw_unwind_to_user(&info) < 0)
1944+
return 0;
1945+
1946+
return access_elf_reg(child, &info, pos, data, write_access);
19481947
}
19491948

19501949
/* access debug registers */

0 commit comments

Comments
 (0)