|
@@ -27,9 +27,13 @@ struct pt_regs {
|
|
|
#define thumb_mode(regs) (0)
|
|
|
#endif
|
|
|
|
|
|
+#ifndef CONFIG_CPU_V7M
|
|
|
#define isa_mode(regs) \
|
|
|
- ((((regs)->ARM_cpsr & PSR_J_BIT) >> 23) | \
|
|
|
- (((regs)->ARM_cpsr & PSR_T_BIT) >> 5))
|
|
|
+ ((((regs)->ARM_cpsr & PSR_J_BIT) >> (__ffs(PSR_J_BIT) - 1)) | \
|
|
|
+ (((regs)->ARM_cpsr & PSR_T_BIT) >> (__ffs(PSR_T_BIT))))
|
|
|
+#else
|
|
|
+#define isa_mode(regs) 1 /* Thumb */
|
|
|
+#endif
|
|
|
|
|
|
#define processor_mode(regs) \
|
|
|
((regs)->ARM_cpsr & MODE_MASK)
|