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"
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:
21 int fpr_get(struct task_struct
*target
, const struct user_regset
*regset
,
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:
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);