system.h 602 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (C) 2016 Cadence Design Systems Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef _XTENSA_SYSTEM_H
  7. #define _XTENSA_SYSTEM_H
  8. #include <asm/arch/core.h>
  9. #if XCHAL_HAVE_INTERRUPTS
  10. #define local_irq_save(flags) \
  11. __asm__ __volatile__ ("rsil %0, %1" \
  12. : "=a"(flags) \
  13. : "I"(XCHAL_EXCM_LEVEL) \
  14. : "memory")
  15. #define local_irq_restore(flags) \
  16. __asm__ __volatile__ ("wsr %0, ps\n\t" \
  17. "rsync" \
  18. :: "a"(flags) : "memory")
  19. #else
  20. #define local_irq_save(flags) ((void)(flags))
  21. #define local_irq_restore(flags) ((void)(flags))
  22. #endif
  23. #endif