fpu.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2020 Synopsys, Inc. (www.synopsys.com)
  4. *
  5. */
  6. #ifndef _ASM_ARC_FPU_H
  7. #define _ASM_ARC_FPU_H
  8. #ifdef CONFIG_ARC_FPU_SAVE_RESTORE
  9. #include <asm/ptrace.h>
  10. #ifdef CONFIG_ISA_ARCOMPACT
  11. /* These DPFP regs need to be saved/restored across ctx-sw */
  12. struct arc_fpu {
  13. struct {
  14. unsigned int l, h;
  15. } aux_dpfp[2];
  16. };
  17. #define fpu_init_task(regs)
  18. #else
  19. /*
  20. * ARCv2 FPU Control aux register
  21. * - bits to enable Traps on Exceptions
  22. * - Rounding mode
  23. *
  24. * ARCv2 FPU Status aux register
  25. * - FPU exceptions flags (Inv, Div-by-Zero, overflow, underflow, inexact)
  26. * - Flag Write Enable to clear flags explicitly (vs. by fpu instructions
  27. * only
  28. */
  29. struct arc_fpu {
  30. unsigned int ctrl, status;
  31. };
  32. extern void fpu_init_task(struct pt_regs *regs);
  33. #endif /* !CONFIG_ISA_ARCOMPACT */
  34. struct task_struct;
  35. extern void fpu_save_restore(struct task_struct *p, struct task_struct *n);
  36. #else /* !CONFIG_ARC_FPU_SAVE_RESTORE */
  37. #define fpu_save_restore(p, n)
  38. #define fpu_init_task(regs)
  39. #endif /* CONFIG_ARC_FPU_SAVE_RESTORE */
  40. #endif /* _ASM_ARC_FPU_H */