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>
This commit is contained in:
parent
040f340134
commit
f05692919b
@ -36,11 +36,8 @@ static inline unsigned long local_daif_save(void)
|
|||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
asm volatile(
|
flags = arch_local_save_flags();
|
||||||
"mrs %0, daif // local_daif_save\n"
|
|
||||||
: "=r" (flags)
|
|
||||||
:
|
|
||||||
: "memory");
|
|
||||||
local_daif_mask();
|
local_daif_mask();
|
||||||
|
|
||||||
return flags;
|
return flags;
|
||||||
@ -60,11 +57,9 @@ static inline void local_daif_restore(unsigned long flags)
|
|||||||
{
|
{
|
||||||
if (!arch_irqs_disabled_flags(flags))
|
if (!arch_irqs_disabled_flags(flags))
|
||||||
trace_hardirqs_on();
|
trace_hardirqs_on();
|
||||||
asm volatile(
|
|
||||||
"msr daif, %0 // local_daif_restore"
|
arch_local_irq_restore(flags);
|
||||||
:
|
|
||||||
: "r" (flags)
|
|
||||||
: "memory");
|
|
||||||
if (arch_irqs_disabled_flags(flags))
|
if (arch_irqs_disabled_flags(flags))
|
||||||
trace_hardirqs_off();
|
trace_hardirqs_off();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user