system.h 821 B

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2017 Andes Technology Corporation
  4. * Rick Chen, Andes Technology Corporation <rick@andestech.com>
  5. */
  6. #ifndef __ASM_RISCV_SYSTEM_H
  7. #define __ASM_RISCV_SYSTEM_H
  8. #include <asm/csr.h>
  9. struct event;
  10. /*
  11. * Interupt configuration macros
  12. */
  13. #define local_irq_save(__flags) \
  14. do { \
  15. __flags = csr_read_clear(CSR_SSTATUS, SR_SIE) & SR_SIE; \
  16. } while (0)
  17. #define local_irq_restore(__flags) \
  18. do { \
  19. csr_set(CSR_SSTATUS, __flags & SR_SIE); \
  20. } while (0)
  21. /* Hook to set up the CPU (called from SPL too) */
  22. int riscv_cpu_setup(void *ctx, struct event *event);
  23. #endif /* __ASM_RISCV_SYSTEM_H */