mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
restorer: moved the routine restore_fpu() to the file arch/x86/crtools.c.
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
ea6ab14d13
commit
abc622b360
@@ -73,4 +73,6 @@ struct rt_sigframe {
|
||||
|
||||
int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r);
|
||||
|
||||
int restore_fpu(struct rt_sigframe *sigframe, struct thread_restore_args *args);
|
||||
|
||||
#endif
|
||||
|
@@ -5,6 +5,8 @@
|
||||
|
||||
#include "syscall.h"
|
||||
#include "log.h"
|
||||
#include "fpu.h"
|
||||
#include "cpu.h"
|
||||
|
||||
int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
|
||||
{
|
||||
@@ -52,3 +54,19 @@ int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int restore_fpu(struct rt_sigframe *sigframe, struct thread_restore_args *args)
|
||||
{
|
||||
if (args->has_fpu) {
|
||||
unsigned long addr = (unsigned long)(void *)&args->xsave;
|
||||
|
||||
if ((addr % 64ul) == 0ul) {
|
||||
sigframe->uc.uc_mcontext.fpstate = &args->xsave;
|
||||
} else {
|
||||
pr_err("Unaligned address passed: %lx\n", addr);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -143,22 +143,6 @@ static void restore_sched_info(struct rst_sched_param *p)
|
||||
sys_sched_setscheduler(0, p->policy, &parm);
|
||||
}
|
||||
|
||||
static int restore_fpu(struct rt_sigframe *sigframe, struct thread_restore_args *args)
|
||||
{
|
||||
if (args->has_fpu) {
|
||||
unsigned long addr = (unsigned long)(void *)&args->xsave;
|
||||
|
||||
if ((addr % 64ul) == 0ul) {
|
||||
sigframe->uc.uc_mcontext.fpstate = &args->xsave;
|
||||
} else {
|
||||
pr_err("Unaligned address passed: %lx\n", addr);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int restore_thread_common(struct rt_sigframe *sigframe,
|
||||
struct thread_restore_args *args)
|
||||
{
|
||||
|
Reference in New Issue
Block a user