Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 058c78f4 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt
Browse files

powerpc: Use new printk extension %pS to print symbols on oops



This changes the oops and backtrace code to use the new %pS
printk extension to print out symbols rather than manually
calling print_symbol.

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 3a4c6f0b
Loading
Loading
Loading
Loading
+5 −9
Original line number Original line Diff line number Diff line
@@ -485,10 +485,8 @@ void show_regs(struct pt_regs * regs)
	 * Lookup NIP late so we have the best change of getting the
	 * Lookup NIP late so we have the best change of getting the
	 * above info out without failing
	 * above info out without failing
	 */
	 */
	printk("NIP ["REG"] ", regs->nip);
	printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip);
	print_symbol("%s\n", regs->nip);
	printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link);
	printk("LR ["REG"] ", regs->link);
	print_symbol("%s\n", regs->link);
#endif
#endif
	show_stack(current, (unsigned long *) regs->gpr[1]);
	show_stack(current, (unsigned long *) regs->gpr[1]);
	if (!user_mode(regs))
	if (!user_mode(regs))
@@ -976,8 +974,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
		newsp = stack[0];
		newsp = stack[0];
		ip = stack[STACK_FRAME_LR_SAVE];
		ip = stack[STACK_FRAME_LR_SAVE];
		if (!firstframe || ip != lr) {
		if (!firstframe || ip != lr) {
			printk("["REG"] ["REG"] ", sp, ip);
			printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip);
			print_symbol("%s", ip);
			if (firstframe)
			if (firstframe)
				printk(" (unreliable)");
				printk(" (unreliable)");
			printk("\n");
			printk("\n");
@@ -992,10 +989,9 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
		    && stack[STACK_FRAME_MARKER] == STACK_FRAME_REGS_MARKER) {
		    && stack[STACK_FRAME_MARKER] == STACK_FRAME_REGS_MARKER) {
			struct pt_regs *regs = (struct pt_regs *)
			struct pt_regs *regs = (struct pt_regs *)
				(sp + STACK_FRAME_OVERHEAD);
				(sp + STACK_FRAME_OVERHEAD);
			printk("--- Exception: %lx", regs->trap);
			print_symbol(" at %s\n", regs->nip);
			lr = regs->link;
			lr = regs->link;
			print_symbol("    LR = %s\n", lr);
			printk("--- Exception: %lx at %pS\n    LR = %pS\n",
			       regs->trap, (void *)regs->nip, (void *)lr);
			firstframe = 1;
			firstframe = 1;
		}
		}