/* 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)
{
	char *reg_ptr;
	struct pt_regs *regs =
	    (struct pt_regs *)((unsigned long)task_stack_page(task) +
			       (THREAD_SIZE - sizeof(struct pt_regs)));
	reg_ptr = (char *)regs;
	switch (regno) {
	case PT_PC:
		regs->retx = data;
		regs->pc = data;
		break;
	case PT_RETX:
		break;
	case PT_USP:
		regs->usp = data;
		task->thread.usp = data;
		break;
	default:
		if (regno <= 216)
			*(long *)(reg_ptr + regno) = data;
	}
	return 0;
}