Skip to content

Commit

Permalink
Remove unneeded init_clock_res
Browse files Browse the repository at this point in the history
Closes #816
  • Loading branch information
Sean T. Allen committed Sep 24, 2020
1 parent f8f09a3 commit 95d1467
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion sgx-lkl-musl
6 changes: 2 additions & 4 deletions src/enclave/enclave_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ static void _enter_user_space(
args.num_ethreads = num_ethreads;
args.sw_debug_mode = sgxlkl_in_sw_debug_mode();
args.__gdb_load_debug_symbols_alive_ptr = &__gdb_load_debug_symbols_alive;
memcpy(args.clock_res, clock_res, sizeof(args.clock_res));

(*proc)(&args, sizeof(args));
}
Expand Down Expand Up @@ -245,14 +244,13 @@ int __libc_init_enclave(int argc, char** argv)
tmp[i].tv_sec = hex_to_int(cfg->clock_res[i].resolution, 8);
tmp[i].tv_nsec = hex_to_int(cfg->clock_res[i].resolution + 8, 8);
}
init_clock_res(tmp);

size_t max_lthreads =
cfg->max_user_threads * sizeof(*__scheduler_queue.buffer);
max_lthreads = next_power_of_2(max_lthreads);

newmpmcq(&__scheduler_queue, max_lthreads, 0);

init_ethread_tp();

size_t espins = cfg->espins;
Expand All @@ -262,7 +260,7 @@ int __libc_init_enclave(int argc, char** argv)
SGXLKL_VERBOSE("calling _lthread_sched_init()\n");
_lthread_sched_init(cfg->stacksize);


/* Run startmain() in a new lthread */
{
static startmain_args_t args;
Expand Down
2 changes: 0 additions & 2 deletions user/enter.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ void sgxlkl_user_enter(sgxlkl_userargs_t* args, size_t args_size)

init_sysconf(args->num_ethreads, args->num_ethreads);

init_clock_res((struct timespec*)args->clock_res);

__init_libc(args->argv + args->argc + 1, args->argv[0]);
__libc_start_init();
_barrier();
Expand Down
3 changes: 0 additions & 3 deletions user/userargs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ typedef struct sgxlkl_userargs
const void* elf64_hdr;
size_t num_ethreads;

/* to be passed to init_clock_res() */
struct sgxlkl_user_timespec clock_res[8];

/* where in debug mode or not */
bool sw_debug_mode;

Expand Down

0 comments on commit 95d1467

Please sign in to comment.