Commit 67730900 authored by Pavel Emelyanov's avatar Pavel Emelyanov

core: introduced the macro CORE_THREAD_INFO to access the machine-specific part of CoreEntry

This is the merge and a slight rework (no TI_SP macro) of Alexander's patches
about the subj.
Signed-off-by: 's avatarAlexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 80180639
...@@ -274,4 +274,6 @@ typedef struct { ...@@ -274,4 +274,6 @@ typedef struct {
# define AT_VECTOR_SIZE 22 /* Not needed at moment */ # define AT_VECTOR_SIZE 22 /* Not needed at moment */
#endif #endif
#define CORE_THREAD_ARCH_INFO(core) core->thread_info
#endif /* __CR_ASM_TYPES_H__ */ #endif /* __CR_ASM_TYPES_H__ */
...@@ -818,7 +818,7 @@ static int dump_task_core_all(pid_t pid, const struct proc_pid_stat *stat, ...@@ -818,7 +818,7 @@ static int dump_task_core_all(pid_t pid, const struct proc_pid_stat *stat,
if (ret) if (ret)
goto err_free; goto err_free;
mark_stack_vma(core->thread_info->gpregs->sp, vma_area_list); mark_stack_vma(CORE_THREAD_ARCH_INFO(core)->gpregs->sp, vma_area_list);
ret = get_task_futex_robust_list(pid, core->thread_core); ret = get_task_futex_robust_list(pid, core->thread_core);
if (ret) if (ret)
......
...@@ -722,7 +722,7 @@ static int check_core(CoreEntry *core) ...@@ -722,7 +722,7 @@ static int check_core(CoreEntry *core)
goto out; goto out;
} }
if (!core->thread_info) { if (!CORE_THREAD_ARCH_INFO(core)) {
pr_err("Core info data missed for non-zombie\n"); pr_err("Core info data missed for non-zombie\n");
goto out; goto out;
} }
...@@ -1838,8 +1838,8 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core) ...@@ -1838,8 +1838,8 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
} }
thread_args[i].ta = task_args; thread_args[i].ta = task_args;
thread_args[i].gpregs = *tcore->thread_info->gpregs; thread_args[i].gpregs = *CORE_THREAD_ARCH_INFO(tcore)->gpregs;
thread_args[i].clear_tid_addr = tcore->thread_info->clear_tid_addr; thread_args[i].clear_tid_addr = CORE_THREAD_ARCH_INFO(tcore)->clear_tid_addr;
core_get_tls(tcore, &thread_args[i].tls); core_get_tls(tcore, &thread_args[i].tls);
if (tcore->thread_core) { if (tcore->thread_core) {
......
...@@ -361,7 +361,7 @@ int parasite_dump_thread_seized(struct parasite_ctl *ctl, struct pid *tid, ...@@ -361,7 +361,7 @@ int parasite_dump_thread_seized(struct parasite_ctl *ctl, struct pid *tid,
ret = parasite_execute_by_pid(PARASITE_CMD_DUMP_THREAD, ctl, tid->real); ret = parasite_execute_by_pid(PARASITE_CMD_DUMP_THREAD, ctl, tid->real);
memcpy(&core->thread_core->blk_sigset, &args->blocked, sizeof(args->blocked)); memcpy(&core->thread_core->blk_sigset, &args->blocked, sizeof(args->blocked));
core->thread_info->clear_tid_addr = (u64)args->tid_addr; CORE_THREAD_ARCH_INFO(core)->clear_tid_addr = (u64)args->tid_addr;
tid->virt = args->tid; tid->virt = args->tid;
core_put_tls(core, args->tls); core_put_tls(core, args->tls);
......
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