mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 14:55:39 +00:00
restore: Preliminary scheme for restore
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
#include "image.h"
|
#include "image.h"
|
||||||
|
|
||||||
#define RESTORER_ARGS_SIZE 512
|
#define RESTORER_ARGS_SIZE 512
|
||||||
#define RESTORER_SIZE 4096
|
#define RESTORER_SIZE 8192
|
||||||
|
|
||||||
long restorer(long cmd);
|
long restorer(long cmd);
|
||||||
|
|
||||||
@@ -14,6 +14,7 @@ enum {
|
|||||||
RESTORER_CMD__NONE,
|
RESTORER_CMD__NONE,
|
||||||
RESTORER_CMD__GET_ARG_OFFSET,
|
RESTORER_CMD__GET_ARG_OFFSET,
|
||||||
RESTORER_CMD__PR_ARG_STRING,
|
RESTORER_CMD__PR_ARG_STRING,
|
||||||
|
RESTORER_CMD__RESTORE_CORE,
|
||||||
RESTORER_CMD__MAX,
|
RESTORER_CMD__MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
35
restorer.c
35
restorer.c
@@ -56,6 +56,41 @@ long restorer(long cmd)
|
|||||||
: "memory");
|
: "memory");
|
||||||
break;
|
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));
|
asm volatile(".align "__stringify(RESTORER_SIZE));
|
||||||
|
Reference in New Issue
Block a user