fpu.h 468 B

12345678910111213141516171819202122
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_OPENRISC_FPU_H
  3. #define __ASM_OPENRISC_FPU_H
  4. struct task_struct;
  5. #ifdef CONFIG_FPU
  6. static inline void save_fpu(struct task_struct *task)
  7. {
  8. task->thread.fpcsr = mfspr(SPR_FPCSR);
  9. }
  10. static inline void restore_fpu(struct task_struct *task)
  11. {
  12. mtspr(SPR_FPCSR, task->thread.fpcsr);
  13. }
  14. #else
  15. #define save_fpu(tsk) do { } while (0)
  16. #define restore_fpu(tsk) do { } while (0)
  17. #endif
  18. #endif /* __ASM_OPENRISC_FPU_H */