mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
parasite: Macro for getting parasite symbols
Same as previous patch -- easier to read and possible to use tags. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
f86bbe6a9c
commit
e6617b5e2e
@ -123,16 +123,8 @@ struct parasite_tty_args {
|
||||
int st_excl;
|
||||
};
|
||||
|
||||
/*
|
||||
* Some useful offsets
|
||||
*/
|
||||
|
||||
#define PARASITE_ARGS_ADDR(start) \
|
||||
((start) + parasite_blob_offset____export_parasite_args)
|
||||
#define PARASITE_CMD_ADDR(start) \
|
||||
((start) + parasite_blob_offset____export_parasite_cmd)
|
||||
#define PARASITE_HEAD_ADDR(start) \
|
||||
((start) + parasite_blob_offset____export_parasite_head_start)
|
||||
/* the parasite prefix is added by gen_offsets.sh */
|
||||
#define parasite_sym(pblob, name) ((void *)(pblob) + parasite_blob_offset__##name)
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
#endif /* CR_PARASITE_H_ */
|
||||
|
@ -850,9 +850,9 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct pstree_item *item,
|
||||
memcpy(ctl->local_map, parasite_blob, sizeof(parasite_blob));
|
||||
|
||||
/* Setup the rest of a control block */
|
||||
ctl->parasite_ip = PARASITE_HEAD_ADDR((unsigned long)ctl->remote_map);
|
||||
ctl->addr_cmd = (unsigned int *)PARASITE_CMD_ADDR((unsigned long)ctl->local_map);
|
||||
ctl->addr_args = (void *)PARASITE_ARGS_ADDR((unsigned long)ctl->local_map);
|
||||
ctl->parasite_ip = (unsigned long)parasite_sym(ctl->remote_map, __export_parasite_head_start);
|
||||
ctl->addr_cmd = parasite_sym(ctl->local_map, __export_parasite_cmd);
|
||||
ctl->addr_args = parasite_sym(ctl->local_map, __export_parasite_args);
|
||||
|
||||
ret = parasite_init(ctl, pid, item->nr_threads);
|
||||
if (ret) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user