Merge tag 'nfsd-4.15' of git://linux-nfs.org/~bfields/linux
[linux-2.6-microblaze.git] / arch / arm64 / include / asm / irqflags.h
index 8c58128..24692ed 100644 (file)
 
 #include <asm/ptrace.h>
 
+/*
+ * Aarch64 has flags for masking: Debug, Asynchronous (serror), Interrupts and
+ * FIQ exceptions, in the 'daif' register. We mask and unmask them in 'dai'
+ * order:
+ * Masking debug exceptions causes all other exceptions to be masked too/
+ * Masking SError masks irq, but not debug exceptions. Masking irqs has no
+ * side effects for other flags. Keeping to this order makes it easier for
+ * entry.S to know which exceptions should be unmasked.
+ *
+ * FIQ is never expected, but we mask it when we disable debug exceptions, and
+ * unmask it at all other times.
+ */
+
 /*
  * CPU interrupt mask handling.
  */
@@ -53,12 +66,6 @@ static inline void arch_local_irq_disable(void)
                : "memory");
 }
 
-#define local_fiq_enable()     asm("msr        daifclr, #1" : : : "memory")
-#define local_fiq_disable()    asm("msr        daifset, #1" : : : "memory")
-
-#define local_async_enable()   asm("msr        daifclr, #4" : : : "memory")
-#define local_async_disable()  asm("msr        daifset, #4" : : : "memory")
-
 /*
  * Save the current interrupt enable state.
  */
@@ -89,26 +96,5 @@ static inline int arch_irqs_disabled_flags(unsigned long flags)
 {
        return flags & PSR_I_BIT;
 }
-
-/*
- * save and restore debug state
- */
-#define local_dbg_save(flags)                                          \
-       do {                                                            \
-               typecheck(unsigned long, flags);                        \
-               asm volatile(                                           \
-               "mrs    %0, daif                // local_dbg_save\n"    \
-               "msr    daifset, #8"                                    \
-               : "=r" (flags) : : "memory");                           \
-       } while (0)
-
-#define local_dbg_restore(flags)                                       \
-       do {                                                            \
-               typecheck(unsigned long, flags);                        \
-               asm volatile(                                           \
-               "msr    daif, %0                // local_dbg_restore\n" \
-               : : "r" (flags) : "memory");                            \
-       } while (0)
-
 #endif
 #endif