irqflags.h 860 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * IRQ support for the Hexagon architecture
  4. *
  5. * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  6. */
  7. #ifndef _ASM_IRQFLAGS_H
  8. #define _ASM_IRQFLAGS_H
  9. #include <asm/hexagon_vm.h>
  10. #include <linux/types.h>
  11. static inline unsigned long arch_local_save_flags(void)
  12. {
  13. return __vmgetie();
  14. }
  15. static inline unsigned long arch_local_irq_save(void)
  16. {
  17. return __vmsetie(VM_INT_DISABLE);
  18. }
  19. static inline bool arch_irqs_disabled_flags(unsigned long flags)
  20. {
  21. return !flags;
  22. }
  23. static inline bool arch_irqs_disabled(void)
  24. {
  25. return !__vmgetie();
  26. }
  27. static inline void arch_local_irq_enable(void)
  28. {
  29. __vmsetie(VM_INT_ENABLE);
  30. }
  31. static inline void arch_local_irq_disable(void)
  32. {
  33. __vmsetie(VM_INT_DISABLE);
  34. }
  35. static inline void arch_local_irq_restore(unsigned long flags)
  36. {
  37. __vmsetie(flags);
  38. }
  39. #endif