mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
dump: Move assign_reg/assign_array closer to place where they are used
And don't forget to undef them once they are not needed. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
1256c390b6
commit
8b93676d90
@@ -536,9 +536,6 @@ static int dump_task_creds(struct parasite_ctl *ctl, const struct cr_fdset *fds)
|
||||
return pb_write_one(fdset_fd(fds, CR_FD_CREDS), &ce, PB_CREDS);
|
||||
}
|
||||
|
||||
#define assign_reg(dst, src, e) do { dst->e = (__typeof__(dst->e))src.e; } while (0)
|
||||
#define assign_array(dst, src, e) memcpy(dst->e, &src.e, sizeof(src.e))
|
||||
|
||||
static int get_task_auxv(pid_t pid, MmEntry *mm, size_t *size)
|
||||
{
|
||||
int fd, ret, i;
|
||||
@@ -690,6 +687,9 @@ static int get_task_regs(pid_t pid, CoreEntry *core, const struct parasite_ctl *
|
||||
}
|
||||
}
|
||||
|
||||
#define assign_reg(dst, src, e) do { dst->e = (__typeof__(dst->e))src.e; } while (0)
|
||||
#define assign_array(dst, src, e) memcpy(dst->e, &src.e, sizeof(src.e))
|
||||
|
||||
assign_reg(core->thread_info->gpregs, regs, r15);
|
||||
assign_reg(core->thread_info->gpregs, regs, r14);
|
||||
assign_reg(core->thread_info->gpregs, regs, r13);
|
||||
@@ -734,6 +734,9 @@ static int get_task_regs(pid_t pid, CoreEntry *core, const struct parasite_ctl *
|
||||
assign_array(core->thread_info->fpregs, fpregs, st_space);
|
||||
assign_array(core->thread_info->fpregs, fpregs, xmm_space);
|
||||
|
||||
#undef assign_reg
|
||||
#undef assign_array
|
||||
|
||||
ret = 0;
|
||||
|
||||
err:
|
||||
|
Reference in New Issue
Block a user