Commit 4872cbd0 authored by Xiongwei Song's avatar Xiongwei Song Committed by Michael Ellerman
Browse files

powerpc: Add dear as a synonym for pt_regs.dar register



Create an anonymous union for dar and dear regsiters, we can reference
dear to get the effective address when CONFIG_4xx=y or CONFIG_BOOKE=y.
Otherwise, reference dar. This makes code more clear.

Signed-off-by: default avatarXiongwei Song <sxwjean@gmail.com>
[mpe: Reword commit title]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210807010239.416055-4-sxwjean@me.com
parent cfa47772
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -43,7 +43,10 @@ struct pt_regs
			unsigned long mq;
#endif
			unsigned long trap;
			union {
				unsigned long dar;
				unsigned long dear;
			};
			union {
				unsigned long dsisr;
				unsigned long esr;
+1 −1
Original line number Diff line number Diff line
@@ -1499,7 +1499,7 @@ static void __show_regs(struct pt_regs *regs)
	    trap == INTERRUPT_DATA_STORAGE ||
	    trap == INTERRUPT_ALIGNMENT) {
		if (IS_ENABLED(CONFIG_4xx) || IS_ENABLED(CONFIG_BOOKE))
			pr_cont("DEAR: "REG" ESR: "REG" ", regs->dar, regs->esr);
			pr_cont("DEAR: "REG" ESR: "REG" ", regs->dear, regs->esr);
		else
			pr_cont("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr);
	}
+2 −0
Original line number Diff line number Diff line
@@ -373,6 +373,8 @@ void __init pt_regs_check(void)
		     offsetof(struct user_pt_regs, trap));
	BUILD_BUG_ON(offsetof(struct pt_regs, dar) !=
		     offsetof(struct user_pt_regs, dar));
	BUILD_BUG_ON(offsetof(struct pt_regs, dear) !=
		     offsetof(struct user_pt_regs, dar));
	BUILD_BUG_ON(offsetof(struct pt_regs, dsisr) !=
		     offsetof(struct user_pt_regs, dsisr));
	BUILD_BUG_ON(offsetof(struct pt_regs, esr) !=