irqflags.h 751 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __UM_IRQFLAGS_H
  2. #define __UM_IRQFLAGS_H
  3. extern int get_signals(void);
  4. extern int set_signals(int enable);
  5. extern void block_signals(void);
  6. extern void unblock_signals(void);
  7. static inline unsigned long arch_local_save_flags(void)
  8. {
  9. return get_signals();
  10. }
  11. static inline void arch_local_irq_restore(unsigned long flags)
  12. {
  13. set_signals(flags);
  14. }
  15. static inline void arch_local_irq_enable(void)
  16. {
  17. unblock_signals();
  18. }
  19. static inline void arch_local_irq_disable(void)
  20. {
  21. block_signals();
  22. }
  23. static inline unsigned long arch_local_irq_save(void)
  24. {
  25. unsigned long flags;
  26. flags = arch_local_save_flags();
  27. arch_local_irq_disable();
  28. return flags;
  29. }
  30. static inline bool arch_irqs_disabled(void)
  31. {
  32. return arch_local_save_flags() == 0;
  33. }
  34. #endif