diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-01-30 07:33:25 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:25 -0500 |
commit | a5ff677c2fb10567d1e750fb9e4417d95081071b (patch) | |
tree | db7be4151a8aefcb4078843046f44a11df2e0746 /arch/x86/kernel/traps_32.c | |
parent | 625d6cffcac1c96faa18d629f1271d63af0e05f2 (diff) |
x86: make printk_address available on X86_32
Small fomatting fixes to 64-bit as well, trailing whitespace
and extra semicolon, also move the ifdefs for CONFIG_KALLSYMS
into the function itself.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/traps_32.c')
-rw-r--r-- | arch/x86/kernel/traps_32.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index 270cfd483160..8534cb53ff60 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c | |||
@@ -102,6 +102,34 @@ asmlinkage void machine_check(void); | |||
102 | int kstack_depth_to_print = 24; | 102 | int kstack_depth_to_print = 24; |
103 | static unsigned int code_bytes = 64; | 103 | static unsigned int code_bytes = 64; |
104 | 104 | ||
105 | void printk_address(unsigned long address, int reliable) | ||
106 | { | ||
107 | #ifdef CONFIG_KALLSYMS | ||
108 | unsigned long offset = 0, symsize; | ||
109 | const char *symname; | ||
110 | char *modname; | ||
111 | char *delim = ":"; | ||
112 | char namebuf[128]; | ||
113 | char reliab[4] = ""; | ||
114 | |||
115 | symname = kallsyms_lookup(address, &symsize, &offset, | ||
116 | &modname, namebuf); | ||
117 | if (!symname) { | ||
118 | printk(" [<%08lx>]\n", address); | ||
119 | return; | ||
120 | } | ||
121 | if (!reliable) | ||
122 | strcpy(reliab, "? "); | ||
123 | |||
124 | if (!modname) | ||
125 | modname = delim = ""; | ||
126 | printk(" [<%08lx>] %s%s%s%s%s+0x%lx/0x%lx\n", | ||
127 | address, reliab, delim, modname, delim, symname, offset, symsize); | ||
128 | #else | ||
129 | printk(" [<%08lx>]\n", address); | ||
130 | #endif | ||
131 | } | ||
132 | |||
105 | static inline int valid_stack_ptr(struct thread_info *tinfo, void *p, unsigned size) | 133 | static inline int valid_stack_ptr(struct thread_info *tinfo, void *p, unsigned size) |
106 | { | 134 | { |
107 | return p > (void *)tinfo && | 135 | return p > (void *)tinfo && |