首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >什么是SGX_CDECL宏?

什么是SGX_CDECL宏?
EN

Stack Overflow用户
提问于 2019-04-06 12:43:56
回答 1查看 307关注 0票数 0

我试图了解如何创建自己的sgx应用程序,因此我正在仔细研究SDK示例。我想知道SGX_CDECL的用法是什么?

在下面的示例中,以及在一般情况下

代码语言:javascript
复制
/* Application entry */
int SGX_CDECL main(int argc, char *argv[])
{
    (void)(argc);
    (void)(argv);


    /* Initialize the enclave */
    if(initialize_enclave() < 0){
        printf("Enter a character before exit ...\n");
        getchar();
        return -1;
    }

    /* Utilize edger8r attributes */
    edger8r_array_attributes();
    edger8r_pointer_attributes();
    edger8r_type_attributes();
    edger8r_function_attributes();

    /* Utilize trusted libraries */
    ecall_libc_functions();
    ecall_libcxx_functions();
    ecall_thread_functions();

    /* Destroy the enclave */
    sgx_destroy_enclave(global_eid);

    printf("Info: SampleEnclave successfully returned.\n");

    printf("Enter a character before exit ...\n");
    getchar();
    return 0;
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-04-06 23:24:26

看看conventions#cdecl

在堆栈上传递子例程参数。整数值和内存地址在EAX寄存器中返回,浮点值在ST0 x87寄存器中返回。寄存器EAX、ECX和EDX被调用保存,其余的被调用保存.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55549182

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档