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

Commit 2271db20 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Michael Ellerman
Browse files

powerpc: Use the TRAP macro whenever comparing a trap number



Trap numbers can have extra bits at the bottom that need to
be filtered out. There are a few cases where we don't do that.

It's possible that we got lucky but better safe than sorry.

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 872e2ae4
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1409,7 +1409,7 @@ void show_regs(struct pt_regs * regs)
	print_msr_bits(regs->msr);
	print_msr_bits(regs->msr);
	pr_cont("  CR: %08lx  XER: %08lx\n", regs->ccr, regs->xer);
	pr_cont("  CR: %08lx  XER: %08lx\n", regs->ccr, regs->xer);
	trap = TRAP(regs);
	trap = TRAP(regs);
	if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
	if ((TRAP(regs) != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
		pr_cont("CFAR: "REG" ", regs->orig_gpr3);
		pr_cont("CFAR: "REG" ", regs->orig_gpr3);
	if (trap == 0x200 || trap == 0x300 || trap == 0x600)
	if (trap == 0x200 || trap == 0x300 || trap == 0x600)
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
+1 −1
Original line number Original line Diff line number Diff line
@@ -1564,7 +1564,7 @@ void facility_unavailable_exception(struct pt_regs *regs)
	u8 status;
	u8 status;
	bool hv;
	bool hv;


	hv = (regs->trap == 0xf80);
	hv = (TRAP(regs) == 0xf80);
	if (hv)
	if (hv)
		value = mfspr(SPRN_HFSCR);
		value = mfspr(SPRN_HFSCR);
	else
	else
+1 −1
Original line number Original line Diff line number Diff line
@@ -571,7 +571,7 @@ void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)


	/* kernel has accessed a bad area */
	/* kernel has accessed a bad area */


	switch (regs->trap) {
	switch (TRAP(regs)) {
	case 0x300:
	case 0x300:
	case 0x380:
	case 0x380:
		printk(KERN_ALERT "Unable to handle kernel paging request for "
		printk(KERN_ALERT "Unable to handle kernel paging request for "