/* The show_stack is an external API which we do not use ourselves. The oops is printed in die_if_kernel.  */
void show_stack(struct task_struct *tsk, unsigned long *_ksp)
/* The show_stack is an external API which we do not use ourselves. The oops is printed in die_if_kernel.  */
void show_stack(struct task_struct *tsk, unsigned long *_ksp)
{
	unsigned long pc, fp;
	unsigned long task_base;
	struct reg_window32 *rw;
	int count = 0;
	if (tsk != NULL)
		task_base = (unsigned long) task_stack_page(tsk);
	else
		task_base = (unsigned long) current_thread_info();
	fp = (unsigned long) _ksp;
	do {
		if (fp < (task_base + sizeof(struct thread_info)) ||
		    fp >= (task_base + (PAGE_SIZE << 1)))
			break;
		rw = (struct reg_window32 *) fp;
		pc = rw->ins[7];
		printk("[%08lx : ", pc);
		printk("%pS ] ", (void *) pc);
		fp = rw->ins[6];
	} while (++count < 16);
	printk("\n");
}