fpumacro.h 671 B

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