xref: /linux/arch/mips/kernel/signal-common.h (revision 2894a8c4)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds  * This file is subject to the terms and conditions of the GNU General Public
31da177e4SLinus Torvalds  * License.  See the file "COPYING" in the main directory of this archive
41da177e4SLinus Torvalds  * for more details.
51da177e4SLinus Torvalds  *
61da177e4SLinus Torvalds  * Copyright (C) 1991, 1992  Linus Torvalds
71da177e4SLinus Torvalds  * Copyright (C) 1994 - 2000  Ralf Baechle
81da177e4SLinus Torvalds  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
91da177e4SLinus Torvalds  */
101da177e4SLinus Torvalds 
11c3fc4ab3SFranck Bui-Huu #ifndef __SIGNAL_COMMON_H
12c3fc4ab3SFranck Bui-Huu #define __SIGNAL_COMMON_H
13e50c0a8fSRalf Baechle 
14722bb63dSFranck Bui-Huu /* #define DEBUG_SIG */
15722bb63dSFranck Bui-Huu 
16722bb63dSFranck Bui-Huu #ifdef DEBUG_SIG
17bb09a954SHarvey Harrison #  define DEBUGP(fmt, args...) printk("%s: " fmt, __func__, ##args)
18722bb63dSFranck Bui-Huu #else
19722bb63dSFranck Bui-Huu #  define DEBUGP(fmt, args...)
20722bb63dSFranck Bui-Huu #endif
21722bb63dSFranck Bui-Huu 
221da177e4SLinus Torvalds /*
231da177e4SLinus Torvalds  * Determine which stack to use..
241da177e4SLinus Torvalds  */
2581d103bfSRichard Weinberger extern void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs,
26c3fc4ab3SFranck Bui-Huu 				 size_t frame_size);
27c6a2f467SAtsushi Nemoto /* Check and clear pending FPU exceptions in saved CSR */
28c6a2f467SAtsushi Nemoto extern int fpcsr_pending(unsigned int __user *fpcsr);
29c6a2f467SAtsushi Nemoto 
30faea6234SAtsushi Nemoto /* Make sure we will not lose FPU ownership */
3176deabd1SDavid Hildenbrand #define lock_fpu_owner()	({ preempt_disable(); pagefault_disable(); })
3276deabd1SDavid Hildenbrand #define unlock_fpu_owner()	({ pagefault_enable(); preempt_enable(); })
33faea6234SAtsushi Nemoto 
342db9ca0aSPaul Burton /* Assembly functions to move context to/from the FPU */
352db9ca0aSPaul Burton extern asmlinkage int
362db9ca0aSPaul Burton _save_fp_context(void __user *fpregs, void __user *csr);
372db9ca0aSPaul Burton extern asmlinkage int
382db9ca0aSPaul Burton _restore_fp_context(void __user *fpregs, void __user *csr);
392db9ca0aSPaul Burton 
40bf82cb30SPaul Burton extern asmlinkage int _save_msa_all_upper(void __user *buf);
41bf82cb30SPaul Burton extern asmlinkage int _restore_msa_all_upper(void __user *buf);
42bf82cb30SPaul Burton 
43*2894a8c4SArnd Bergmann extern int setup_sigcontext(struct pt_regs *, struct sigcontext __user *);
44*2894a8c4SArnd Bergmann extern int restore_sigcontext(struct pt_regs *, struct sigcontext __user *);
45*2894a8c4SArnd Bergmann 
46c3fc4ab3SFranck Bui-Huu #endif	/* __SIGNAL_COMMON_H */
47