18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
38c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
48c2ecf20Sopenharmony_ci * for more details.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (C) 1991, 1992  Linus Torvalds
78c2ecf20Sopenharmony_ci * Copyright (C) 1994 - 2000  Ralf Baechle
88c2ecf20Sopenharmony_ci * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef __SIGNAL_COMMON_H
128c2ecf20Sopenharmony_ci#define __SIGNAL_COMMON_H
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/* #define DEBUG_SIG */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#ifdef DEBUG_SIG
178c2ecf20Sopenharmony_ci#  define DEBUGP(fmt, args...) printk("%s: " fmt, __func__, ##args)
188c2ecf20Sopenharmony_ci#else
198c2ecf20Sopenharmony_ci#  define DEBUGP(fmt, args...)
208c2ecf20Sopenharmony_ci#endif
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci/*
238c2ecf20Sopenharmony_ci * Determine which stack to use..
248c2ecf20Sopenharmony_ci */
258c2ecf20Sopenharmony_ciextern void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs,
268c2ecf20Sopenharmony_ci				 size_t frame_size);
278c2ecf20Sopenharmony_ci/* Check and clear pending FPU exceptions in saved CSR */
288c2ecf20Sopenharmony_ciextern int fpcsr_pending(unsigned int __user *fpcsr);
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci/* Make sure we will not lose FPU ownership */
318c2ecf20Sopenharmony_ci#define lock_fpu_owner()	({ preempt_disable(); pagefault_disable(); })
328c2ecf20Sopenharmony_ci#define unlock_fpu_owner()	({ pagefault_enable(); preempt_enable(); })
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci/* Assembly functions to move context to/from the FPU */
358c2ecf20Sopenharmony_ciextern asmlinkage int
368c2ecf20Sopenharmony_ci_save_fp_context(void __user *fpregs, void __user *csr);
378c2ecf20Sopenharmony_ciextern asmlinkage int
388c2ecf20Sopenharmony_ci_restore_fp_context(void __user *fpregs, void __user *csr);
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciextern asmlinkage int _save_msa_all_upper(void __user *buf);
418c2ecf20Sopenharmony_ciextern asmlinkage int _restore_msa_all_upper(void __user *buf);
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#endif	/* __SIGNAL_COMMON_H */
44