/* Write contents of register REGNO in task TASK.  */
static int put_reg(struct task_struct *task, int regno, unsigned long data)
/* Write contents of register REGNO in task TASK.  */
static int put_reg(struct task_struct *task, int regno, unsigned long data)
{
	struct user_context *user = task->thread.user;
	if (regno < 0 || regno >= PT__END)
		return -EIO;
	switch (regno) {
	case PT_GR(0):
		return 0;
	case PT_PSR:
	case PT__STATUS:
		return -EIO;
	default:
		((unsigned long *) user)[regno] = data;
		return 0;
	}
}