Commit 57b45ea5 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

restore: Preliminary scheme for restore

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 20ff379e
......@@ -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,
};
......
......@@ -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));
......
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