kernels/linux-2.4.0/arch/mips64/kernel/traps.c
/*
 * This routine abuses get_user()/put_user() to reference pointers
 * with at least a bit of error checking ...
 */
This routine abuses get_user()/put_user() to reference pointers
with at least a bit of error checking
This routine abuses get_user () / put_user () to reference pointers with at least a bit of error checking
void show_stack(unsigned long *sp)
{
	int i;
	unsigned long *stack;
	stack = sp;
	i = 0;
	printk("Stack:");
	while ((unsigned long) stack & (PAGE_SIZE - 1)) {
		unsigned long stackdata;
		if (__get_user(stackdata, stack++)) {
			printk(" (Bad stack address)");
			break;
		}
		printk(" %016lx", stackdata);
		if (++i > 40) {
			printk(" ...");
			break;
		}
		if (i % 4 == 0)
			printk("\n      ");
	}
}
void show_stack ( unsigned long * sp ) { int i ; unsigned long * stack ; stack = sp ; i = 0 ; printk ( " " ) ; while ( ( unsigned long ) stack & ( PAGE_SIZE - 1 ) ) { unsigned long stackdata ; if ( __get_user ( stackdata , stack ++ ) ) { printk ( " " ) ; break ; } printk ( " " , stackdata ) ; if ( ++ i > 40 ) { printk ( " " ) ; break ; } if ( i % 4 == 0 ) printk ( " \n " ) ; } }
This routine abuses get_user()/put_user() to reference pointers
 with at least a bit of error checking ...
This routine abuses get_user () / put_user () to reference pointers with at least a bit of error checking ...