diff --git a/arch/ppc64/include/asm/restore.h b/arch/ppc64/include/asm/restore.h index 3ca0c534d..a66046422 100644 --- a/arch/ppc64/include/asm/restore.h +++ b/arch/ppc64/include/asm/restore.h @@ -30,4 +30,7 @@ int restore_fpu(struct rt_sigframe *sigframe, CoreEntry *core); +#define arch_export_restore_task __export_restore_task_trampoline +#define arch_export_unmap __export_unmap_trampoline + #endif /* __CR_ASM_RESTORE_H__ */ diff --git a/cr-restore.c b/cr-restore.c index e100164d4..73bb9ca2d 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -90,6 +90,18 @@ #include "cr-errno.h" +#ifndef arch_export_restore_thread +#define arch_export_restore_thread __export_restore_thread +#endif + +#ifndef arch_export_restore_task +#define arch_export_restore_task __export_restore_task +#endif + +#ifndef arch_export_unmap +#define arch_export_unmap __export_unmap +#endif + static struct pstree_item *current; static int restore_task_with_children(void *); @@ -2750,14 +2762,9 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core) * Prepare a memory map for restorer. Note a thread space * might be completely unused so it's here just for convenience. */ - restore_thread_exec_start = restorer_sym(exec_mem_hint, __export_restore_thread); -#ifdef CONFIG_PPC64 - restore_task_exec_start = restorer_sym(exec_mem_hint, __export_restore_task_trampoline); - rsti(current)->munmap_restorer = restorer_sym(exec_mem_hint, __export_unmap_trampoline); -#else - restore_task_exec_start = restorer_sym(exec_mem_hint, __export_restore_task); - rsti(current)->munmap_restorer = restorer_sym(exec_mem_hint, __export_unmap); -#endif + restore_thread_exec_start = restorer_sym(exec_mem_hint, arch_export_restore_thread); + restore_task_exec_start = restorer_sym(exec_mem_hint, arch_export_restore_task); + rsti(current)->munmap_restorer = restorer_sym(exec_mem_hint, arch_export_unmap); exec_mem_hint += restorer_len; diff --git a/include/restorer.h b/include/restorer.h index ded084a52..8b63a95fc 100644 --- a/include/restorer.h +++ b/include/restorer.h @@ -195,6 +195,8 @@ enum { /* the restorer_blob_offset__ prefix is added by gen_offsets.sh */ -#define restorer_sym(rblob, name) ((void *)(rblob) + restorer_blob_offset__##name) +#define __blob_offset(name) restorer_blob_offset__ ## name +#define _blob_offset(name) __blob_offset(name) +#define restorer_sym(rblob, name) (void*)(rblob + _blob_offset(name)) #endif /* __CR_RESTORER_H__ */