Add macro to exclude sgx wasi/pthread ocalls if not needed (#384)

This commit is contained in:
Xu Jun
2020-09-15 15:49:09 +08:00
committed by GitHub
parent 2499e1ec4b
commit 547298d4e7
14 changed files with 412 additions and 4 deletions

View File

@ -300,6 +300,7 @@ handle_cmd_set_log_level(uint64 *args, uint32 argc)
#endif
}
#ifndef SGX_DISABLE_WASI
static void
handle_cmd_set_wasi_args(uint64 *args, int32 argc)
{
@ -391,6 +392,13 @@ handle_cmd_set_wasi_args(uint64 *args, int32 argc)
*args_org = true;
}
#else
static void
handle_cmd_set_wasi_args(uint64 *args, int32 argc)
{
*args = true;
}
#endif /* end of SGX_DISABLE_WASI */
void
ecall_handle_command(unsigned cmd,

View File

@ -15,7 +15,6 @@ enclave {
unsigned cmd_buf_size);
public void ecall_iwasm_main([user_check]uint8_t *wasm_file_buf,
uint32_t wasm_file_size);
public void ecall_iwasm_test();
};
untrusted {

View File

@ -0,0 +1,22 @@
/*
* Copyright (C) 2019 Intel Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/
enclave {
from "sgx_tstdc.edl" import *;
trusted {
/* define ECALLs here. */
public void ecall_handle_command(unsigned cmd,
[in, out, size=cmd_buf_size]uint8_t *cmd_buf,
unsigned cmd_buf_size);
public void ecall_iwasm_main([user_check]uint8_t *wasm_file_buf,
uint32_t wasm_file_size);
};
untrusted {
/* define OCALLs here. */
void ocall_print([in, string]const char* str);
};
};