Beispiel #1
0
void
show_stack(struct task_struct *task, unsigned long *sp)
{
	unsigned long *stack, addr;
	int i;


	if (sp == NULL) {
		if (task)
			sp = (unsigned long*)task->thread.ksp;
		else
			sp = (unsigned long*)rdsp();
	}

	stack = sp;

	printk("\nStack from %08lx:\n       ", (unsigned long)stack);
	for (i = 0; i < kstack_depth_to_print; i++) {
		if (((long)stack & (THREAD_SIZE-1)) == 0)
			break;
		if (i && ((i % 8) == 0))
			printk("\n       ");
		if (__get_user(addr, stack)) {
			printk("Failing address 0x%lx\n", (unsigned long)stack);
			break;
		}
		stack++;
		printk("%08lx ", addr);
	}
	show_trace(sp);
}
Beispiel #2
0
asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
{
	unsigned long sp;
	struct pt_regs *old_regs = set_irq_regs(regs);
	irq_enter();
	sp = rdsp();
	if (unlikely((sp & (PAGE_SIZE - 1)) < (PAGE_SIZE/8))) {
		printk("do_IRQ: stack overflow: %lX\n", sp);
		show_stack(NULL, (unsigned long *)sp);
	}
	generic_handle_irq(irq);
	irq_exit();
	set_irq_regs(old_regs);
}
void 
show_stack(struct task_struct *task, unsigned long *sp)
{
        unsigned long *stack, addr;
        int i;

	/*
	 * debugging aid: "show_stack(NULL);" prints a
	 * back trace.
	 */

        if(sp == NULL) {
		if (task)
			sp = (unsigned long*)task->thread.ksp;
		else
			sp = (unsigned long*)rdsp();
	}

        stack = sp;

	raw_printk("\nStack from %08lx:\n       ", (unsigned long)stack);
        for(i = 0; i < kstack_depth_to_print; i++) {
                if (((long) stack & (THREAD_SIZE-1)) == 0)
                        break;
                if (i && ((i % 8) == 0))
                        raw_printk("\n       ");
		if (__get_user (addr, stack)) {
			/* This message matches "failing address" marked
			   s390 in ksymoops, so lines containing it will
			   not be filtered out by ksymoops.  */
			raw_printk ("Failing address 0x%lx\n", (unsigned long)stack);
			break;
		}
		stack++;
		raw_printk("%08lx ", addr);
        }
	show_trace(sp);
}