Commit e3fdfa37 authored by Al Viro's avatar Al Viro

[ia64] access_uarea(): don't bother with fpregs_[gs]et()

similar to previous commit...
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 6bc4f16c
...@@ -1811,7 +1811,6 @@ access_uarea(struct task_struct *child, unsigned long addr, ...@@ -1811,7 +1811,6 @@ access_uarea(struct task_struct *child, unsigned long addr,
unsigned long *data, int write_access) unsigned long *data, int write_access)
{ {
unsigned int pos = -1; /* an invalid value */ unsigned int pos = -1; /* an invalid value */
int ret;
unsigned long *ptr, regnum; unsigned long *ptr, regnum;
if ((addr & 0x7) != 0) { if ((addr & 0x7) != 0) {
...@@ -1843,14 +1842,39 @@ access_uarea(struct task_struct *child, unsigned long addr, ...@@ -1843,14 +1842,39 @@ access_uarea(struct task_struct *child, unsigned long addr,
} }
if (pos != -1) { if (pos != -1) {
if (write_access) unsigned reg = pos / sizeof(elf_fpreg_t);
ret = fpregs_set(child, NULL, pos, int which_half = (pos / sizeof(unsigned long)) & 1;
sizeof(unsigned long), data, NULL);
else if (reg < 32) { /* fr2-fr31 */
ret = fpregs_get(child, NULL, pos, struct unw_frame_info info;
sizeof(unsigned long), data, NULL); elf_fpreg_t fpreg;
if (ret != 0)
return -1; memset(&info, 0, sizeof(info));
unw_init_from_blocked_task(&info, child);
if (unw_unwind_to_user(&info) < 0)
return 0;
if (unw_get_fr(&info, reg, &fpreg))
return -1;
if (write_access) {
fpreg.u.bits[which_half] = *data;
if (unw_set_fr(&info, reg, fpreg))
return -1;
} else {
*data = fpreg.u.bits[which_half];
}
} else { /* fph */
elf_fpreg_t *p = &child->thread.fph[reg - 32];
unsigned long *bits = &p->u.bits[which_half];
ia64_sync_fph(child);
if (write_access)
*bits = *data;
else if (child->thread.flags & IA64_THREAD_FPH_VALID)
*data = *bits;
else
*data = 0;
}
return 0; return 0;
} }
......
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