mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +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:
@@ -123,16 +123,8 @@ struct parasite_tty_args {
|
|||||||
int st_excl;
|
int st_excl;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/* the parasite prefix is added by gen_offsets.sh */
|
||||||
* Some useful offsets
|
#define parasite_sym(pblob, name) ((void *)(pblob) + parasite_blob_offset__##name)
|
||||||
*/
|
|
||||||
|
|
||||||
#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)
|
|
||||||
|
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLY__ */
|
||||||
#endif /* CR_PARASITE_H_ */
|
#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));
|
memcpy(ctl->local_map, parasite_blob, sizeof(parasite_blob));
|
||||||
|
|
||||||
/* Setup the rest of a control block */
|
/* Setup the rest of a control block */
|
||||||
ctl->parasite_ip = PARASITE_HEAD_ADDR((unsigned long)ctl->remote_map);
|
ctl->parasite_ip = (unsigned long)parasite_sym(ctl->remote_map, __export_parasite_head_start);
|
||||||
ctl->addr_cmd = (unsigned int *)PARASITE_CMD_ADDR((unsigned long)ctl->local_map);
|
ctl->addr_cmd = parasite_sym(ctl->local_map, __export_parasite_cmd);
|
||||||
ctl->addr_args = (void *)PARASITE_ARGS_ADDR((unsigned long)ctl->local_map);
|
ctl->addr_args = parasite_sym(ctl->local_map, __export_parasite_args);
|
||||||
|
|
||||||
ret = parasite_init(ctl, pid, item->nr_threads);
|
ret = parasite_init(ctl, pid, item->nr_threads);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
Reference in New Issue
Block a user