mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00

When switching from userspace to the kernel, all registers including the FP registers are copied into the kernel and restored later on. As such, the true source for the FP register state is actually already in the kernel and they should never be grabbed from the userspace process. Change the various places to simply copy the data from the internal FP register storage area. Note that on i386 the format of PTRACE_GETFPREGS and PTRACE_GETFPXREGS is different enough that conversion would be needed. With this patch, -EINVAL is returned if the non-native format is requested. The upside is, that this patchset fixes setting registers via ptrace (which simply did not work before) as well as fixing setting floating point registers using the mcontext on signal return on i386. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Link: https://patch.msgid.link/20240913133845.964292-1-benjamin@sipsolutions.net Signed-off-by: Johannes Berg <johannes.berg@intel.com>
17 lines
400 B
C
17 lines
400 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2004 PathScale, Inc
|
|
*/
|
|
|
|
#ifndef __REGISTERS_H
|
|
#define __REGISTERS_H
|
|
|
|
#include <sysdep/ptrace.h>
|
|
|
|
extern int init_pid_registers(int pid);
|
|
extern void get_safe_registers(unsigned long *regs, unsigned long *fp_regs);
|
|
extern int get_fp_registers(int pid, unsigned long *regs);
|
|
extern int put_fp_registers(int pid, unsigned long *regs);
|
|
|
|
#endif
|