fix sgx compile and link error, preserve space for locals before set/tee opcode (#214)

Co-authored-by: Xu Jun <jun1.xu@intel.com>
This commit is contained in:
Xu Jun
2020-03-27 09:28:30 +08:00
committed by GitHub
parent 01e85144f4
commit 75009a2421
5 changed files with 196 additions and 136 deletions

View File

@ -24,21 +24,26 @@ int os_mutex_destroy(korp_mutex *mutex)
return BHT_OK;
}
/* Returned error (EINVAL, EAGAIN and EDEADLK) from
locking the mutex indicates some logic error present in
the program somewhere.
Don't try to recover error for an existing unknown error.*/
void os_mutex_lock(korp_mutex *mutex)
{
sgx_thread_mutex_lock(mutex);
}
/* Returned error (EINVAL, EAGAIN and EPERM) from
unlocking the mutex indicates some logic error present
in the program somewhere.
Don't try to recover error for an existing unknown error.*/
void os_mutex_unlock(korp_mutex *mutex)
{
sgx_thread_mutex_unlock(mutex);
}
int os_cond_init(korp_cond *cond)
{
sgx_thread_cond_t c = SGX_THREAD_COND_INITIALIZER;
*cond = c;
return BHT_OK;
}
int os_cond_destroy(korp_cond *cond)
{
sgx_thread_cond_destroy(cond);
return BHT_OK;
}

View File

@ -71,8 +71,8 @@ bh_print_time(const char *prompt)
total_time_ms += curr_time_ms - last_time_ms;
printf("%-48s time of last stage: %u ms, total time: %u ms\n",
prompt, curr_time_ms - last_time_ms, total_time_ms);
os_printf("%-48s time of last stage: %u ms, total time: %u ms\n",
prompt, curr_time_ms - last_time_ms, total_time_ms);
last_time_ms = curr_time_ms;
}

View File

@ -230,7 +230,7 @@ timer_ctx_t create_timer_ctx(timer_callback_f timer_handler,
return ctx;
cleanup:
cleanup:
if (ctx) {
release_timer_list(&ctx->free_timers);