~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sh/include/asm/fpu.h

Version: ~ [ linux-6.2-rc3 ] ~ [ linux-6.1.5 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.87 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.162 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.228 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.269 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.302 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef __ASM_SH_FPU_H
  2 #define __ASM_SH_FPU_H
  3 
  4 #ifndef __ASSEMBLY__
  5 
  6 struct task_struct;
  7 
  8 #ifdef CONFIG_SH_FPU
  9 static inline void release_fpu(struct pt_regs *regs)
 10 {
 11         regs->sr |= SR_FD;
 12 }
 13 
 14 static inline void grab_fpu(struct pt_regs *regs)
 15 {
 16         regs->sr &= ~SR_FD;
 17 }
 18 
 19 extern void save_fpu(struct task_struct *__tsk);
 20 extern void restore_fpu(struct task_struct *__tsk);
 21 extern void fpu_state_restore(struct pt_regs *regs);
 22 extern void __fpu_state_restore(void);
 23 #else
 24 #define save_fpu(tsk)                   do { } while (0)
 25 #define restore_fpu(tsk)                do { } while (0)
 26 #define release_fpu(regs)               do { } while (0)
 27 #define grab_fpu(regs)                  do { } while (0)
 28 #define fpu_state_restore(regs)         do { } while (0)
 29 #define __fpu_state_restore(regs)       do { } while (0)
 30 #endif
 31 
 32 struct user_regset;
 33 
 34 extern int do_fpu_inst(unsigned short, struct pt_regs *);
 35 extern int init_fpu(struct task_struct *);
 36 
 37 extern int fpregs_get(struct task_struct *target,
 38                       const struct user_regset *regset,
 39                       unsigned int pos, unsigned int count,
 40                       void *kbuf, void __user *ubuf);
 41 
 42 static inline void __unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
 43 {
 44         if (task_thread_info(tsk)->status & TS_USEDFPU) {
 45                 task_thread_info(tsk)->status &= ~TS_USEDFPU;
 46                 save_fpu(tsk);
 47                 release_fpu(regs);
 48         } else
 49                 tsk->thread.fpu_counter = 0;
 50 }
 51 
 52 static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
 53 {
 54         preempt_disable();
 55         __unlazy_fpu(tsk, regs);
 56         preempt_enable();
 57 }
 58 
 59 static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
 60 {
 61         preempt_disable();
 62         if (task_thread_info(tsk)->status & TS_USEDFPU) {
 63                 task_thread_info(tsk)->status &= ~TS_USEDFPU;
 64                 release_fpu(regs);
 65         }
 66         preempt_enable();
 67 }
 68 
 69 #endif /* __ASSEMBLY__ */
 70 
 71 #endif /* __ASM_SH_FPU_H */
 72 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp