提交 84b6d820 编写于 作者: Y YiLin.Li 提交者: jia zhang

rune/libenclave/skeleton: Support OOT driver in PAL API V2

Signed-off-by: NYilin Li <YiLin.Li@linux.alibaba.com>
上级 1ee1ae94
......@@ -13,11 +13,6 @@ int pal_get_version(void)
int pal_init(pal_attr_t *attr)
{
if (is_oot_driver) {
fprintf(stderr, "Skeleton PAL API v2 doesn't support SGX OOT driver!\n");
return -1;
}
return __pal_init(attr);
}
......
......@@ -35,6 +35,7 @@
static struct sgx_secs secs;
static pal_stdio_fds pal_stdio;
static bool initialized = false;
static int exit_code;
static char *sgx_dev_path;
static bool no_sgx_flc = false;
static bool enclave_debug = true;
......@@ -486,6 +487,13 @@ int __pal_create_process(pal_create_process_args *args)
return -1;
}
/* SGX out-of-tree driver disallows the creation of shared enclave mapping
* between parent and child process, so simply launching __pal_exec() directly here.
*/
if (is_oot_driver) {
return __pal_exec(args->path, args->argv, args->stdio, &exit_code);
}
FILE *fp = fdopen(args->stdio->stderr, "w");
if (!fp)
return -1;
......@@ -524,6 +532,11 @@ int wait4child(pal_exec_args *attr)
return -1;
}
if (is_oot_driver) {
*attr->exit_value = exit_code;
return exit_code;
}
waitpid(attr->pid, &status, 0);
if (WIFEXITED(status) || WIFSIGNALED(status))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册