reg_ops.h 548 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
  3. #ifndef __ABI_REG_OPS_H
  4. #define __ABI_REG_OPS_H
  5. #include <asm/reg_ops.h>
  6. #define cprcr(reg) \
  7. ({ \
  8. unsigned int tmp; \
  9. asm volatile("cprcr %0, "reg"\n":"=b"(tmp)); \
  10. tmp; \
  11. })
  12. #define cpwcr(reg, val) \
  13. ({ \
  14. asm volatile("cpwcr %0, "reg"\n"::"b"(val)); \
  15. })
  16. static inline unsigned int mfcr_hint(void)
  17. {
  18. return mfcr("cr30");
  19. }
  20. static inline unsigned int mfcr_ccr2(void) { return 0; }
  21. #endif /* __ABI_REG_OPS_H */