diff options
author | Julien Thierry <julien.thierry@arm.com> | 2018-08-28 18:51:14 +0300 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2018-10-03 18:08:52 +0300 |
commit | f05692919bdd44ad2a1a1fe85222dec16fec7e80 (patch) | |
tree | 0990fb1e9e573b022ac69b0bb71d7f47636729e4 /arch/arm64/include/asm/daifflags.h | |
parent | 040f340134751d73bd03ee92fabb992946c55b3d (diff) | |
download | linux-f05692919bdd44ad2a1a1fe85222dec16fec7e80.tar.xz |
arm64: daifflags: Use irqflags functions for daifflags
Some of the work done in daifflags save/restore is already provided
by irqflags functions. Daifflags should always be a superset of irqflags
(it handles irq status + status of other flags). Modifying behaviour of
irqflags should alter the behaviour of daifflags.
Use irqflags_save/restore functions for the corresponding daifflags
operation.
Reviewed-by: James Morse <james.morse@arm.com>
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/daifflags.h')
-rw-r--r-- | arch/arm64/include/asm/daifflags.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/arm64/include/asm/daifflags.h b/arch/arm64/include/asm/daifflags.h index 22e4c83de5a5..8d91f2233135 100644 --- a/arch/arm64/include/asm/daifflags.h +++ b/arch/arm64/include/asm/daifflags.h @@ -36,11 +36,8 @@ static inline unsigned long local_daif_save(void) { unsigned long flags; - asm volatile( - "mrs %0, daif // local_daif_save\n" - : "=r" (flags) - : - : "memory"); + flags = arch_local_save_flags(); + local_daif_mask(); return flags; @@ -60,11 +57,9 @@ static inline void local_daif_restore(unsigned long flags) { if (!arch_irqs_disabled_flags(flags)) trace_hardirqs_on(); - asm volatile( - "msr daif, %0 // local_daif_restore" - : - : "r" (flags) - : "memory"); + + arch_local_irq_restore(flags); + if (arch_irqs_disabled_flags(flags)) trace_hardirqs_off(); } |