1 /* MN10300 FPU definitions
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 * Derived from include/asm-i386/i387.h: Copyright (C) 1994 Linus Torvalds
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public Licence
9 * as published by the Free Software Foundation; either version
10 * 2 of the Licence, or (at your option) any later version.
15 #include <asm/processor.h>
16 #include <asm/sigcontext.h>
21 /* the task that owns the FPU state */
22 extern struct task_struct *fpu_state_owner;
24 #define set_using_fpu(tsk) \
26 (tsk)->thread.fpu_flags |= THREAD_USING_FPU; \
29 #define clear_using_fpu(tsk) \
31 (tsk)->thread.fpu_flags &= ~THREAD_USING_FPU; \
34 #define is_using_fpu(tsk) ((tsk)->thread.fpu_flags & THREAD_USING_FPU)
36 #define unlazy_fpu(tsk) \
39 if (fpu_state_owner == (tsk)) \
40 fpu_save(&tsk->thread.fpu_state); \
46 struct task_struct *__tsk = current; \
48 if (fpu_state_owner == __tsk) \
49 fpu_state_owner = NULL; \
55 struct task_struct *__tsk = current; \
57 if (fpu_state_owner == __tsk) { \
58 fpu_state_owner = NULL; \
59 __tsk->thread.uregs->epsw &= ~EPSW_FE; \
62 clear_using_fpu(__tsk); \
65 extern asmlinkage void fpu_init_state(void);
66 extern asmlinkage void fpu_kill_state(struct task_struct *);
67 extern asmlinkage void fpu_disabled(struct pt_regs *, enum exception_code);
68 extern asmlinkage void fpu_exception(struct pt_regs *, enum exception_code);
71 extern asmlinkage void fpu_save(struct fpu_state_struct *);
72 extern asmlinkage void fpu_restore(struct fpu_state_struct *);
75 #define fpu_restore(a)
76 #endif /* CONFIG_FPU */
79 * signal frame handlers
81 extern int fpu_setup_sigcontext(struct fpucontext *buf);
82 extern int fpu_restore_sigcontext(struct fpucontext *buf);
84 #endif /* __KERNEL__ */
85 #endif /* _ASM_FPU_H */