2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

restore: Preliminary scheme for restore

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov
2011-10-24 23:56:36 +04:00
parent 20ff379ee4
commit 57b45ea5eb
2 changed files with 37 additions and 1 deletions

View File

@@ -4,7 +4,7 @@
#include "image.h"
#define RESTORER_ARGS_SIZE 512
#define RESTORER_SIZE 4096
#define RESTORER_SIZE 8192
long restorer(long cmd);
@@ -14,6 +14,7 @@ enum {
RESTORER_CMD__NONE,
RESTORER_CMD__GET_ARG_OFFSET,
RESTORER_CMD__PR_ARG_STRING,
RESTORER_CMD__RESTORE_CORE,
RESTORER_CMD__MAX,
};

View File

@@ -56,6 +56,41 @@ long restorer(long cmd)
: "memory");
break;
/*
* This one is very special, we never return there
* but use sigreturn facility to restore core registers
* and jump execution to some predefined ip read from
* core file.
*/
case RESTORER_CMD__RESTORE_CORE:
{
/*
* Unmap all but self, note that we reply on
* caller that it has placed this execution
* code at the VMA which we can keep mapped.
*/
/*
* Map VMAs we will need.
*/
/*
* Threads here with registers and pids
* we need.
*/
/*
* Setup a sigreturn frame.
*/
/* Finally call for sigreturn */
sys_rt_sigreturn();
}
break;
default:
ret = -1;
break;
}
asm volatile(".align "__stringify(RESTORER_SIZE));