{"action":"created","issue":{"url":"https://api.github.com/repos/OP-TEE/optee_os/issues/967","repository_url":"https://api.github.com/repos/OP-TEE/optee_os","labels_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/967/labels{/name}","comments_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/967/comments","events_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/967/events","html_url":"https://github.com/OP-TEE/optee_os/issues/967","id":169586817,"number":967,"title":"How do I call a static TA from my secure TA component?","user":{"login":"toddkuhreng","id":20192842,"avatar_url":"https://avatars.githubusercontent.com/u/20192842?v=3","gravatar_id":"","url":"https://api.github.com/users/toddkuhreng","html_url":"https://github.com/toddkuhreng","followers_url":"https://api.github.com/users/toddkuhreng/followers","following_url":"https://api.github.com/users/toddkuhreng/following{/other_user}","gists_url":"https://api.github.com/users/toddkuhreng/gists{/gist_id}","starred_url":"https://api.github.com/users/toddkuhreng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toddkuhreng/subscriptions","organizations_url":"https://api.github.com/users/toddkuhreng/orgs","repos_url":"https://api.github.com/users/toddkuhreng/repos","events_url":"https://api.github.com/users/toddkuhreng/events{/privacy}","received_events_url":"https://api.github.com/users/toddkuhreng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2016-08-05T11:24:52Z","updated_at":"2016-08-12T12:18:18Z","closed_at":null,"body":"Hi,\r\n\r\nI am want to call the function \"test_trace\" which is defined in static TA https://github.com/OP-TEE/optee_os/blob/master/core/arch/arm/sta/sta_self_tests.c from my secure TA. I am confused how to do that? Any pointers?  Thank you so much.\r\n\r\nI tried to the following, but it didn't work. It threw me the error, \"fatal error: tee_client_api.h: No such file or directory\". I am not sure whether this is the way to invoke the static TA from secure TA.\r\nIs there a different set of internal APIs to call a static TA from secure TA? \r\n\r\n```\r\n#include <string.h>\r\n#include <tee_internal_api.h>\r\n#include <tee_internal_api_extensions.h>\r\n#include <template_ta.h>\r\n\r\n#include <tee_client_api.h>\r\n\r\n\r\n#define STA_SELF_TEST_UUID \\\r\n       { 0xd96a5b40, 0xc3e5, 0x21e3, \\\r\n            { 0x87, 0x94, 0x10, 0x02, 0xa5, 0xd5, 0xc6, 0x1b } }\r\n\r\n\r\nstatic TEE_Result call_static_ta(uint32_t param_types,\r\n    TEE_Param params[4])\r\n{\r\n   **// How do I call  static TA 'test_trace' function here? (https://github.com/OP-TEE/optee_os/blob/master/core/arch/arm/sta/sta_self_tests.c)Is it possible to do so?**\r\n\r\n    TEEC_Context ctx;\r\n    TEEC_Result res;\r\n    TEEC_Session sess;\r\n\r\n     TEEC_UUID uuid = STA_SELF_TEST_UUID;\r\n      uint32_t err_origin;\r\n\r\n     res = TEEC_InitializeContext(NULL, &ctx);\r\n    if (res != TEEC_SUCCESS)\r\n           errx(1, \"NW: TEEC_InitializeContext failed with code 0x%x\", res);\r\n\r\n    res = TEEC_OpenSession(&ctx, &sess, &uuid,\r\n                   TEEC_LOGIN_PUBLIC, NULL, NULL, &err_origin);\r\n    if (res != TEEC_SUCCESS)\r\n          errx(1, \"NW: TEEC_Opensession failed with code 0x%x origin 0x%x\",           res, err_origin);\r\n\r\n     TEEC_InvokeCommand( &session, CMD_TRACE, NULL, &ret_orig);\r\n     TEEC_CloseSession(&session); \r\n   return TEE_SUCCESS;\r\n}\r\n\r\nTEE_Result TA_InvokeCommandEntryPoint(void __unused *sess_ctx, uint32_t cmd_id,\r\n    uint32_t param_types, TEE_Param params[4])\r\n{\r\n  switch (cmd_id) {\r\n  \r\n  case CALL_STATIC_TA:\r\n      return call_static_ta(param_types, params);\r\n      break;\r\n  \r\n    default:\r\n        return TEE_ERROR_BAD_PARAMETERS;\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/OP-TEE/optee_os/issues/comments/239431421","html_url":"https://github.com/OP-TEE/optee_os/issues/967#issuecomment-239431421","issue_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/967","id":239431421,"user":{"login":"toddkuhreng","id":20192842,"avatar_url":"https://avatars.githubusercontent.com/u/20192842?v=3","gravatar_id":"","url":"https://api.github.com/users/toddkuhreng","html_url":"https://github.com/toddkuhreng","followers_url":"https://api.github.com/users/toddkuhreng/followers","following_url":"https://api.github.com/users/toddkuhreng/following{/other_user}","gists_url":"https://api.github.com/users/toddkuhreng/gists{/gist_id}","starred_url":"https://api.github.com/users/toddkuhreng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toddkuhreng/subscriptions","organizations_url":"https://api.github.com/users/toddkuhreng/orgs","repos_url":"https://api.github.com/users/toddkuhreng/repos","events_url":"https://api.github.com/users/toddkuhreng/events{/privacy}","received_events_url":"https://api.github.com/users/toddkuhreng/received_events","type":"User","site_admin":false},"created_at":"2016-08-12T12:18:18Z","updated_at":"2016-08-12T12:18:18Z","body":"@jforissier ,\r\n\r\nI am now trying to check out the hikey build again. However, stuck with the following error:\r\n```\r\n\r\nFetching projects:  76% (13/17)  Fetching project grub\r\nfatal: unable to connect to git.savannah.gnu.org:\r\ngit.savannah.gnu.org[0: 208.118.235.72]: errno=Connection timed out\r\n```\r\n\r\nI tried to check out this Hikey repo couple of times nows.  Looks like \"http://git.savannah.gnu.org/\" is down."}}
{"actor":{"display_login":"toddkuhreng"}}