/* Synchronize (i.e, write) the RSE backing store living in kernel space to the VM of the CHILD task. SW and PT are the pointers to the switch_stack and pt_regs structures, respectively. USER_RBS_END is the user-level address at which the backing store ends.  */
long ia64_sync_user_rbs(struct task_struct *child, struct switch_stack *sw, unsigned long user_rbs_start, unsigned long user_rbs_end)
/* Synchronize (i.e, write) the RSE backing store living in kernel space to the VM of the CHILD task. SW and PT are the pointers to the switch_stack and pt_regs structures, respectively. USER_RBS_END is the user-level address at which the backing store ends.  */
long ia64_sync_user_rbs(struct task_struct *child, struct switch_stack *sw, unsigned long user_rbs_start, unsigned long user_rbs_end)
{
	unsigned long addr, val;
	long ret;
	for (addr = user_rbs_start; addr < user_rbs_end; addr += 8) {
		ret = ia64_peek(child, sw, user_rbs_end, addr, &val);
		if (ret < 0)
			return ret;
		if (access_process_vm(child, addr, &val, sizeof(val), 1)
		    != sizeof(val))
			return -EIO;
	}
	return 0;
}