dcc.h 623 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved.
  3. */
  4. #include <asm/barrier.h>
  5. static inline u32 __dcc_getstatus(void)
  6. {
  7. u32 __ret;
  8. asm volatile("mrc p14, 0, %0, c0, c1, 0 @ read comms ctrl reg"
  9. : "=r" (__ret) : : "cc");
  10. return __ret;
  11. }
  12. static inline char __dcc_getchar(void)
  13. {
  14. char __c;
  15. asm volatile("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg"
  16. : "=r" (__c));
  17. isb();
  18. return __c;
  19. }
  20. static inline void __dcc_putchar(char c)
  21. {
  22. asm volatile("mcr p14, 0, %0, c0, c5, 0 @ write a char"
  23. : /* no output register */
  24. : "r" (c));
  25. isb();
  26. }