WIP FPC-III support
[linux/fpc-iii.git] / arch / powerpc / kernel / ptrace / ptrace-novsx.c
blobb3b36835658afc9ebebb7bccecd3579e3805b6a4
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 #include <linux/regset.h>
5 #include <asm/switch_to.h>
7 #include "ptrace-decl.h"
9 /*
10 * Regardless of transactions, 'fp_state' holds the current running
11 * value of all FPR registers and 'ckfp_state' holds the last checkpointed
12 * value of all FPR registers for the current transaction.
14 * Userspace interface buffer layout:
16 * struct data {
17 * u64 fpr[32];
18 * u64 fpscr;
19 * };
21 int fpr_get(struct task_struct *target, const struct user_regset *regset,
22 struct membuf to)
24 BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) !=
25 offsetof(struct thread_fp_state, fpr[32]));
27 flush_fp_to_thread(target);
29 return membuf_write(&to, &target->thread.fp_state, 33 * sizeof(u64));
33 * Regardless of transactions, 'fp_state' holds the current running
34 * value of all FPR registers and 'ckfp_state' holds the last checkpointed
35 * value of all FPR registers for the current transaction.
37 * Userspace interface buffer layout:
39 * struct data {
40 * u64 fpr[32];
41 * u64 fpscr;
42 * };
45 int fpr_set(struct task_struct *target, const struct user_regset *regset,
46 unsigned int pos, unsigned int count,
47 const void *kbuf, const void __user *ubuf)
49 BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) !=
50 offsetof(struct thread_fp_state, fpr[32]));
52 flush_fp_to_thread(target);
54 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
55 &target->thread.fp_state, 0, -1);