irqflags.h 1007 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef __PARISC_IRQFLAGS_H
  2. #define __PARISC_IRQFLAGS_H
  3. #include <linux/types.h>
  4. #include <asm/psw.h>
  5. static inline unsigned long arch_local_save_flags(void)
  6. {
  7. unsigned long flags;
  8. asm volatile("ssm 0, %0" : "=r" (flags) : : "memory");
  9. return flags;
  10. }
  11. static inline void arch_local_irq_disable(void)
  12. {
  13. asm volatile("rsm %0,%%r0\n" : : "i" (PSW_I) : "memory");
  14. }
  15. static inline void arch_local_irq_enable(void)
  16. {
  17. asm volatile("ssm %0,%%r0\n" : : "i" (PSW_I) : "memory");
  18. }
  19. static inline unsigned long arch_local_irq_save(void)
  20. {
  21. unsigned long flags;
  22. asm volatile("rsm %1,%0" : "=r" (flags) : "i" (PSW_I) : "memory");
  23. return flags;
  24. }
  25. static inline void arch_local_irq_restore(unsigned long flags)
  26. {
  27. asm volatile("mtsm %0" : : "r" (flags) : "memory");
  28. }
  29. static inline bool arch_irqs_disabled_flags(unsigned long flags)
  30. {
  31. return (flags & PSW_I) == 0;
  32. }
  33. static inline bool arch_irqs_disabled(void)
  34. {
  35. return arch_irqs_disabled_flags(arch_local_save_flags());
  36. }
  37. #endif /* __PARISC_IRQFLAGS_H */