system.h 602 B

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