[BACK]Return to sysrq.c CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / arch / um / kernel

File: [Development] / linux-2.6-xfs / arch / um / kernel / sysrq.c (download)

Revision 1.5, Wed Jan 5 14:17:31 2005 UTC (12 years, 9 months ago) by nathans.longdrop.melbourne.sgi.com
Branch: MAIN
Changes since 1.4: +7 -18 lines

Merge up to 2.6.10.
Merge of 2.6.x-xfs-melb:linux:21010a by kenmcd.

/* 
 * Copyright (C) 2001 Jeff Dike (jdike@karaya.com)
 * Licensed under the GPL
 */

#include "linux/sched.h"
#include "linux/kernel.h"
#include "linux/module.h"
#include "linux/kallsyms.h"
#include "asm/page.h"
#include "asm/processor.h"
#include "sysrq.h"
#include "user_util.h"

void show_trace(unsigned long * stack)
{
	/* XXX: Copy the CONFIG_FRAME_POINTER stack-walking backtrace from
	 * arch/i386/kernel/traps.c. */
        unsigned long addr;

        if (!stack)
                stack = (unsigned long*) &stack;

        printk("Call Trace: \n");
        while (((long) stack & (THREAD_SIZE-1)) != 0) {
                addr = *stack++;
		if (__kernel_text_address(addr)) {
			printk(" [<%08lx>]", addr);
			print_symbol(" %s", addr);
			printk("\n");
                }
        }
        printk("\n");
}

/*
 * The architecture-independent dump_stack generator
 */
void dump_stack(void)
{
	unsigned long stack;

	show_trace(&stack);
}
EXPORT_SYMBOL(dump_stack);

void show_stack(struct task_struct *task, unsigned long *sp)
{
	show_trace(sp);
}