0001
0002
0003 #include <linux/regset.h>
0004
0005 #include <asm/switch_to.h>
0006
0007 #include "ptrace-decl.h"
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 int fpr_get(struct task_struct *target, const struct user_regset *regset,
0022 struct membuf to)
0023 {
0024 #ifdef CONFIG_PPC_FPU_REGS
0025 BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) !=
0026 offsetof(struct thread_fp_state, fpr[32]));
0027
0028 flush_fp_to_thread(target);
0029
0030 return membuf_write(&to, &target->thread.fp_state, 33 * sizeof(u64));
0031 #else
0032 return membuf_write(&to, &empty_zero_page, 33 * sizeof(u64));
0033 #endif
0034 }
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 int fpr_set(struct task_struct *target, const struct user_regset *regset,
0050 unsigned int pos, unsigned int count,
0051 const void *kbuf, const void __user *ubuf)
0052 {
0053 #ifdef CONFIG_PPC_FPU_REGS
0054 BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) !=
0055 offsetof(struct thread_fp_state, fpr[32]));
0056
0057 flush_fp_to_thread(target);
0058
0059 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
0060 &target->thread.fp_state, 0, -1);
0061 #else
0062 return 0;
0063 #endif
0064 }