Commit 46dfd9a0 authored by Alexander Kartashov's avatar Alexander Kartashov Committed by Pavel Emelyanov

parasite-syscall.c: introduced the macros REG_RES and REG_IP

The macro REG_RES is to be used to access the syscall return value register
in the struct user_regs_struct_t.

The macro REG_IP is to be used to access the program counter register
in the struct user_regs_struct_t.
Signed-off-by: 's avatarAlexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 928f1dee
...@@ -263,4 +263,7 @@ typedef struct { ...@@ -263,4 +263,7 @@ typedef struct {
}; };
} fpu_state_t; } fpu_state_t;
#define REG_RES(regs) ((regs).ax)
#define REG_IP(regs) ((regs).ip)
#endif /* __CR_ASM_TYPES_H__ */ #endif /* __CR_ASM_TYPES_H__ */
...@@ -213,7 +213,7 @@ static int parasite_execute_by_pid(unsigned int cmd, struct parasite_ctl *ctl, p ...@@ -213,7 +213,7 @@ static int parasite_execute_by_pid(unsigned int cmd, struct parasite_ctl *ctl, p
ret = __parasite_execute(ctl, pid, &regs); ret = __parasite_execute(ctl, pid, &regs);
if (ret == 0) if (ret == 0)
ret = (int)regs.ax; ret = (int)REG_RES(regs);
if (ret) if (ret)
pr_err("Parasite exited with %d\n", ret); pr_err("Parasite exited with %d\n", ret);
...@@ -743,7 +743,7 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, struct list_head *vma_area_lis ...@@ -743,7 +743,7 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, struct list_head *vma_area_lis
goto err; goto err;
} }
vma_area = get_vma_by_ip(vma_area_list, ctl->regs_orig.ip); vma_area = get_vma_by_ip(vma_area_list, REG_IP(ctl->regs_orig));
if (!vma_area) { if (!vma_area) {
pr_err("No suitable VMA found to run parasite " pr_err("No suitable VMA found to run parasite "
"bootstrap code (pid: %d)\n", pid); "bootstrap code (pid: %d)\n", pid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment