[PATCH 9/9] powerpc/traps: Use SRR1 defines for program check reasons
Currently we open code the reason codes for program checks. Instead use the existing SRR1 defines. Signed-off-by: Michael Ellerman--- arch/powerpc/include/asm/reg.h | 1 + arch/powerpc/kernel/traps.c| 10 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 73be2f71dbbb..c0600e9e0ff5 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -724,6 +724,7 @@ * may not be recoverable */ #define SRR1_WS_DEEPER0x0002 /* Some resources not maintained */ #define SRR1_WS_DEEP 0x0001 /* All resources maintained */ +#define SRR1_PROGTM 0x0020 /* TM Bad Thing */ #define SRR1_PROGFPE 0x0010 /* Floating Point Enabled */ #define SRR1_PROGILL 0x0008 /* Illegal instruction */ #define SRR1_PROGPRIV0x0004 /* Privileged instruction */ diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 4d584f08c8ea..9107f7f86058 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -377,11 +377,11 @@ static inline int check_io_access(struct pt_regs *regs) /* On non-4xx, the reason for the machine check or program exception is in the MSR. */ #define get_reason(regs) ((regs)->msr) -#define REASON_TM 0x20 -#define REASON_FP 0x10 -#define REASON_ILLEGAL 0x8 -#define REASON_PRIVILEGED 0x4 -#define REASON_TRAP0x2 +#define REASON_TM SRR1_PROGTM +#define REASON_FP SRR1_PROGFPE +#define REASON_ILLEGAL SRR1_PROGILL +#define REASON_PRIVILEGED SRR1_PROGPRIV +#define REASON_TRAPSRR1_PROGTRAP #define single_stepping(regs) ((regs)->msr & MSR_SE) #define clear_single_step(regs)((regs)->msr &= ~MSR_SE) -- 2.7.4
[RFC PATCH 9/9] powerpc/traps: Use SRR1 defines for program check reasons
Currently we open code the reason codes for program checks. Instead use the existing SRR1 defines. Signed-off-by: Michael Ellerman--- arch/powerpc/include/asm/reg.h | 1 + arch/powerpc/kernel/traps.c| 10 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index dff79798903d..07342572adca 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -665,6 +665,7 @@ * may not be recoverable */ #define SRR1_WS_DEEPER0x0002 /* Some resources not maintained */ #define SRR1_WS_DEEP 0x0001 /* All resources maintained */ +#define SRR1_PROGTM 0x0020 /* TM Bad Thing */ #define SRR1_PROGFPE 0x0010 /* Floating Point Enabled */ #define SRR1_PROGILL 0x0008 /* Illegal instruction */ #define SRR1_PROGPRIV0x0004 /* Privileged instruction */ diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index fb753cc81bc0..315fc9921467 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -358,11 +358,11 @@ static inline int check_io_access(struct pt_regs *regs) /* On non-4xx, the reason for the machine check or program exception is in the MSR. */ #define get_reason(regs) ((regs)->msr) -#define REASON_TM 0x20 -#define REASON_FP 0x10 -#define REASON_ILLEGAL 0x8 -#define REASON_PRIVILEGED 0x4 -#define REASON_TRAP0x2 +#define REASON_TM SRR1_PROGTM +#define REASON_FP SRR1_PROGFPE +#define REASON_ILLEGAL SRR1_PROGILL +#define REASON_PRIVILEGED SRR1_PROGPRIV +#define REASON_TRAPSRR1_PROGTRAP #define single_stepping(regs) ((regs)->msr & MSR_SE) #define clear_single_step(regs)((regs)->msr &= ~MSR_SE) -- 2.7.4