Skip to content

Commit

Permalink
resurrect checkpoint/migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Chia-Che Tsai committed Jul 2, 2015
1 parent 0885fd8 commit 11e27a9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 27 deletions.
3 changes: 1 addition & 2 deletions LibOS/shim/src/shim_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ DEFINE_PROFILE_INTERVAL(init_signal, init);

extern PAL_HANDLE thread_start_event;

int shim_init (int argc, void * args, void ** return_stack)
int shim_init (int argc, void * args)
{
debug_handle = PAL_CB(debug_stream);
cur_process.vmid = (IDTYPE) PAL_CB(process_id);
Expand Down Expand Up @@ -730,7 +730,6 @@ int shim_init (int argc, void * args, void ** return_stack)
execute_elf_object(cur_thread->exec,
argc, argp, nauxv, auxp);

*return_stack = initial_stack;
return 0;
}

Expand Down
9 changes: 1 addition & 8 deletions LibOS/shim/src/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ shim_start:
The arguments are passed via registers and on the stack:
argc: %rdi
argv: %rsi
stack: %rdx
*/

/* Align the stack to a 16 byte boundary to follow the ABI. */
Expand All @@ -47,16 +46,10 @@ shim_start:
movq 0(%rbp), %rdi /* Pop the argument count. */
leaq 8(%rbp), %rsi /* argv starts just at the current stack top. */

/* Provide the highest stack address to the user code (for stacks
which grow downwards). */

pushq %rbp
movq %rsp, %rdx
pushq %rdx

movq shim_init@GOTPCREL(%rip), %r11
call *%r11

popq %rbp
leaveq
retq
.cfi_endproc
2 changes: 1 addition & 1 deletion LibOS/shim/test/native/manifest.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ net.rules.1 = 127.0.0.1:8000:0.0.0.0:0-65535
# allow to connect to port 8000
net.rules.2 = 0.0.0.0:0-65535:127.0.0.1:8000

# sys.ask_for_checkpoint = 1
sys.ask_for_checkpoint = 1
34 changes: 18 additions & 16 deletions Pal/src/db_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,6 @@ void pal_main (PAL_NUM pal_token, void * pal_addr,

init_slab_mgr(pal_state.alloc_align);

if (is_parent && !exec_handle && !manifest_handle) {
printf("USAGE: %s [executable|manifest] args ...\n", pal_name);
_DkProcessExit(0);
return;
}

char * exec = NULL, * manifest = NULL;

if (exec_handle) {
Expand All @@ -265,15 +259,17 @@ void pal_main (PAL_NUM pal_token, void * pal_addr,
unsigned long before_find_manifest = _DkSystemTimeQuery();
#endif
do {
assert(!!exec);
/* try open "<exec>.manifest" */
manifest = __alloca(URI_MAX);
snprintf(manifest, URI_MAX, "%s.manifest", exec);
ret = _DkStreamOpen(&manifest_handle,
manifest,
PAL_ACCESS_RDONLY, 0, 0, 0);
if (!ret)
break;
if (exec_handle) {
assert(!!exec);
/* try open "<exec>.manifest" */
manifest = __alloca(URI_MAX);
snprintf(manifest, URI_MAX, "%s.manifest", exec);
ret = _DkStreamOpen(&manifest_handle,
manifest,
PAL_ACCESS_RDONLY, 0, 0, 0);
if (!ret)
break;
}

/* try open "file:manifest" */
manifest = "file:manifest";
Expand Down Expand Up @@ -353,6 +349,12 @@ void pal_main (PAL_NUM pal_token, void * pal_addr,
}
}

if (is_parent && !exec_handle && !manifest_handle) {
printf("USAGE: %s [executable|manifest] args ...\n", pal_name);
_DkProcessExit(0);
return;
}

pal_state.manifest = manifest;
pal_state.manifest_handle = manifest_handle;
pal_state.exec = exec;
Expand All @@ -362,7 +364,7 @@ void pal_main (PAL_NUM pal_token, void * pal_addr,
argc--;
argv++;

if (is_parent && exec) {
if (is_parent && exec_handle) {
first_argv = exec;
if (pal_state.root_config) {
char cfgbuf[CONFIG_MAX];
Expand Down

0 comments on commit 11e27a9

Please sign in to comment.