diff options
author | Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com> | 2014-01-28 06:20:17 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2014-02-26 06:16:25 -0500 |
commit | c7db4ff5d2b459a579d348532a92fd5885520ce6 (patch) | |
tree | 9fefbee341d75961e42aecf97267e450c3b46e6e /arch/arm64/include/asm/irqflags.h | |
parent | cfbf8d4857c26a8a307fb7cd258074c9dcd8c691 (diff) |
arm64: Add macros to manage processor debug state
Add macros to enable and disable to manage PSTATE.D
for debugging. The macros local_dbg_save and local_dbg_restore
are moved to irqflags.h file
KGDB boot tests fail because of PSTATE.D is masked.
unmask it for debugging support
Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/irqflags.h')
-rw-r--r-- | arch/arm64/include/asm/irqflags.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/irqflags.h b/arch/arm64/include/asm/irqflags.h index b2fcfbc51ecc..11cc941bd107 100644 --- a/arch/arm64/include/asm/irqflags.h +++ b/arch/arm64/include/asm/irqflags.h | |||
@@ -90,5 +90,28 @@ static inline int arch_irqs_disabled_flags(unsigned long flags) | |||
90 | return flags & PSR_I_BIT; | 90 | return flags & PSR_I_BIT; |
91 | } | 91 | } |
92 | 92 | ||
93 | /* | ||
94 | * save and restore debug state | ||
95 | */ | ||
96 | #define local_dbg_save(flags) \ | ||
97 | do { \ | ||
98 | typecheck(unsigned long, flags); \ | ||
99 | asm volatile( \ | ||
100 | "mrs %0, daif // local_dbg_save\n" \ | ||
101 | "msr daifset, #8" \ | ||
102 | : "=r" (flags) : : "memory"); \ | ||
103 | } while (0) | ||
104 | |||
105 | #define local_dbg_restore(flags) \ | ||
106 | do { \ | ||
107 | typecheck(unsigned long, flags); \ | ||
108 | asm volatile( \ | ||
109 | "msr daif, %0 // local_dbg_restore\n" \ | ||
110 | : : "r" (flags) : "memory"); \ | ||
111 | } while (0) | ||
112 | |||
113 | #define local_dbg_enable() asm("msr daifclr, #8" : : : "memory") | ||
114 | #define local_dbg_disable() asm("msr daifset, #8" : : : "memory") | ||
115 | |||
93 | #endif | 116 | #endif |
94 | #endif | 117 | #endif |