mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-28 12:36:47 +00:00
parasite: pass parameter regs as pointer
CID 163751 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE) pass_by_value: Passing parameter regs of type user_regs_struct_t (size 224 bytes) by value. Signed-off-by: Andrew Vagin <avagin@virtuozzo.com> Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
c36515ad41
commit
cd073d3e88
1 changed files with 7 additions and 7 deletions
|
|
@ -1025,17 +1025,17 @@ static bool task_is_trapped(int status, pid_t pid)
|
|||
return false;
|
||||
}
|
||||
|
||||
static inline int is_required_syscall(user_regs_struct_t regs, pid_t pid,
|
||||
static inline int is_required_syscall(user_regs_struct_t *regs, pid_t pid,
|
||||
const int sys_nr, const int sys_nr_compat)
|
||||
{
|
||||
const char *mode = user_regs_native(®s) ? "native" : "compat";
|
||||
int req_sysnr = user_regs_native(®s) ? sys_nr : sys_nr_compat;
|
||||
const char *mode = user_regs_native(regs) ? "native" : "compat";
|
||||
int req_sysnr = user_regs_native(regs) ? sys_nr : sys_nr_compat;
|
||||
|
||||
pr_debug("%d (%s) is going to execute the syscall %lu, required is %d\n",
|
||||
pid, mode, REG_SYSCALL_NR(regs), req_sysnr);
|
||||
if (user_regs_native(®s) && (REG_SYSCALL_NR(regs) == sys_nr))
|
||||
pid, mode, REG_SYSCALL_NR(*regs), req_sysnr);
|
||||
if (user_regs_native(regs) && (REG_SYSCALL_NR(*regs) == sys_nr))
|
||||
return true;
|
||||
if (!user_regs_native(®s) && (REG_SYSCALL_NR(regs) == sys_nr_compat))
|
||||
if (!user_regs_native(regs) && (REG_SYSCALL_NR(*regs) == sys_nr_compat))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
@ -1085,7 +1085,7 @@ int parasite_stop_on_syscall(int tasks,
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (is_required_syscall(regs, pid, sys_nr, sys_nr_compat)) {
|
||||
if (is_required_syscall(®s, pid, sys_nr, sys_nr_compat)) {
|
||||
/*
|
||||
* The process is going to execute the required syscall,
|
||||
* the next stop will be on the exit from this syscall
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue