/* Get contents of register REGNO in task TASK.  */
static long get_reg(struct task_struct *task, int regno)
/* Get contents of register REGNO in task TASK.  */
static long get_reg(struct task_struct *task, int regno)
{
	unsigned 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_USP:
		return task->thread.usp;
	default:
		if (regno <= 216)
			return *(long *)(reg_ptr + regno);
	}
	printk(KERN_WARNING "Request to get for unknown register %d\n", regno);
	return 0;
}