Skip to content

Commit f436ab4

Browse files
author
Linus Torvalds
committed
Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm: [ARM] 4449/1: more entries in arch/arm/boot/.gitignore [ARM] 4452/1: Force the literal pool dump before reloc_end [ARM] Update show_regs/oops register format [ARM] Add support for pause_on_oops and display preempt/smp options
2 parents 6cd236e + 0c07f61 commit f436ab4

File tree

5 files changed

+58
-32
lines changed

5 files changed

+58
-32
lines changed

arch/arm/boot/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
Image
22
zImage
3+
xipImage
4+
bootpImage
5+
uImage

arch/arm/boot/compressed/head.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@ memdump: mov r12, r0
836836
mov pc, r10
837837
#endif
838838

839+
.ltorg
839840
reloc_end:
840841

841842
.align

arch/arm/kernel/process.c

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/elfcore.h>
2929
#include <linux/pm.h>
3030
#include <linux/tick.h>
31+
#include <linux/utsname.h>
3132

3233
#include <asm/leds.h>
3334
#include <asm/processor.h>
@@ -199,16 +200,19 @@ void machine_restart(char * __unused)
199200

200201
void __show_regs(struct pt_regs *regs)
201202
{
202-
unsigned long flags = condition_codes(regs);
203+
unsigned long flags;
204+
char buf[64];
203205

204-
printk("CPU: %d\n", smp_processor_id());
206+
printk("CPU: %d %s (%s %.*s)\n",
207+
smp_processor_id(), print_tainted(), init_utsname()->release,
208+
(int)strcspn(init_utsname()->version, " "),
209+
init_utsname()->version);
205210
print_symbol("PC is at %s\n", instruction_pointer(regs));
206211
print_symbol("LR is at %s\n", regs->ARM_lr);
207-
printk("pc : [<%08lx>] lr : [<%08lx>] %s\n"
212+
printk("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n"
208213
"sp : %08lx ip : %08lx fp : %08lx\n",
209-
instruction_pointer(regs),
210-
regs->ARM_lr, print_tainted(), regs->ARM_sp,
211-
regs->ARM_ip, regs->ARM_fp);
214+
regs->ARM_pc, regs->ARM_lr, regs->ARM_cpsr,
215+
regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
212216
printk("r10: %08lx r9 : %08lx r8 : %08lx\n",
213217
regs->ARM_r10, regs->ARM_r9,
214218
regs->ARM_r8);
@@ -218,36 +222,39 @@ void __show_regs(struct pt_regs *regs)
218222
printk("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n",
219223
regs->ARM_r3, regs->ARM_r2,
220224
regs->ARM_r1, regs->ARM_r0);
221-
printk("Flags: %c%c%c%c",
222-
flags & PSR_N_BIT ? 'N' : 'n',
223-
flags & PSR_Z_BIT ? 'Z' : 'z',
224-
flags & PSR_C_BIT ? 'C' : 'c',
225-
flags & PSR_V_BIT ? 'V' : 'v');
226-
printk(" IRQs o%s FIQs o%s Mode %s%s Segment %s\n",
227-
interrupts_enabled(regs) ? "n" : "ff",
225+
226+
flags = regs->ARM_cpsr;
227+
buf[0] = flags & PSR_N_BIT ? 'N' : 'n';
228+
buf[1] = flags & PSR_Z_BIT ? 'Z' : 'z';
229+
buf[2] = flags & PSR_C_BIT ? 'C' : 'c';
230+
buf[3] = flags & PSR_V_BIT ? 'V' : 'v';
231+
buf[4] = '\0';
232+
233+
printk("Flags: %s IRQs o%s FIQs o%s Mode %s%s Segment %s\n",
234+
buf, interrupts_enabled(regs) ? "n" : "ff",
228235
fast_interrupts_enabled(regs) ? "n" : "ff",
229236
processor_modes[processor_mode(regs)],
230237
thumb_mode(regs) ? " (T)" : "",
231238
get_fs() == get_ds() ? "kernel" : "user");
232-
#if CONFIG_CPU_CP15
239+
#ifdef CONFIG_CPU_CP15
233240
{
234241
unsigned int ctrl;
235-
__asm__ (
236-
" mrc p15, 0, %0, c1, c0\n"
237-
: "=r" (ctrl));
238-
printk("Control: %04X\n", ctrl);
239-
}
242+
243+
buf[0] = '\0';
240244
#ifdef CONFIG_CPU_CP15_MMU
241-
{
242-
unsigned int transbase, dac;
243-
__asm__ (
244-
" mrc p15, 0, %0, c2, c0\n"
245-
" mrc p15, 0, %1, c3, c0\n"
246-
: "=r" (transbase), "=r" (dac));
247-
printk("Table: %08X DAC: %08X\n",
248-
transbase, dac);
249-
}
245+
{
246+
unsigned int transbase, dac;
247+
asm("mrc p15, 0, %0, c2, c0\n\t"
248+
"mrc p15, 0, %1, c3, c0\n"
249+
: "=r" (transbase), "=r" (dac));
250+
snprintf(buf, sizeof(buf), " Table: %08x DAC: %08x",
251+
transbase, dac);
252+
}
250253
#endif
254+
asm("mrc p15, 0, %0, c1, c0\n" : "=r" (ctrl));
255+
256+
printk("Control: %08x%s\n", ctrl, buf);
257+
}
251258
#endif
252259
}
253260

arch/arm/kernel/traps.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,24 @@ void show_stack(struct task_struct *tsk, unsigned long *sp)
204204
barrier();
205205
}
206206

207+
#ifdef CONFIG_PREEMPT
208+
#define S_PREEMPT " PREEMPT"
209+
#else
210+
#define S_PREEMPT ""
211+
#endif
212+
#ifdef CONFIG_SMP
213+
#define S_SMP " SMP"
214+
#else
215+
#define S_SMP ""
216+
#endif
217+
207218
static void __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs)
208219
{
209220
struct task_struct *tsk = thread->task;
210221
static int die_counter;
211222

212-
printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter);
223+
printk("Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n",
224+
str, err, ++die_counter);
213225
print_modules();
214226
__show_regs(regs);
215227
printk("Process %s (pid: %d, stack limit = 0x%p)\n",
@@ -232,16 +244,22 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
232244
{
233245
struct thread_info *thread = current_thread_info();
234246

247+
oops_enter();
248+
235249
console_verbose();
236250
spin_lock_irq(&die_lock);
237251
bust_spinlocks(1);
238252
__die(str, err, thread, regs);
239253
bust_spinlocks(0);
240254
spin_unlock_irq(&die_lock);
241255

256+
if (in_interrupt())
257+
panic("Fatal exception in interrupt");
258+
242259
if (panic_on_oops)
243260
panic("Fatal exception");
244261

262+
oops_exit();
245263
do_exit(SIGSEGV);
246264
}
247265

include/asm-arm/ptrace.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ struct pt_regs {
112112
#define fast_interrupts_enabled(regs) \
113113
(!((regs)->ARM_cpsr & PSR_F_BIT))
114114

115-
#define condition_codes(regs) \
116-
((regs)->ARM_cpsr & (PSR_V_BIT|PSR_C_BIT|PSR_Z_BIT|PSR_N_BIT))
117-
118115
/* Are the current registers suitable for user mode?
119116
* (used to maintain security in signal handlers)
120117
*/

0 commit comments

Comments
 (0)