fpumacro.h 710 B

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* fpumacro.h: FPU related macros.
  3. *
  4. * Copyright (C) 1997 Jakub Jelinek ([email protected])
  5. * Copyright (C) 1997 David S. Miller ([email protected])
  6. */
  7. #ifndef _SPARC64_FPUMACRO_H
  8. #define _SPARC64_FPUMACRO_H
  9. #include <asm/asi.h>
  10. #include <asm/visasm.h>
  11. struct fpustate {
  12. u32 regs[64];
  13. };
  14. #define FPUSTATE (struct fpustate *)(current_thread_info()->fpregs)
  15. static inline unsigned long fprs_read(void)
  16. {
  17. unsigned long retval;
  18. __asm__ __volatile__("rd %%fprs, %0" : "=r" (retval));
  19. return retval;
  20. }
  21. static inline void fprs_write(unsigned long val)
  22. {
  23. __asm__ __volatile__("wr %0, 0x0, %%fprs" : : "r" (val));
  24. }
  25. #endif /* !(_SPARC64_FPUMACRO_H) */