Lines Matching refs:res

48 	TEEC_Result res;  in prepare_tee_session()  local
51 res = TEEC_InitializeContext(NULL, &ctx->ctx); in prepare_tee_session()
52 if (res != TEEC_SUCCESS) in prepare_tee_session()
53 errx(1, "TEEC_InitializeContext failed with code 0x%x", res); in prepare_tee_session()
56 res = TEEC_OpenSession(&ctx->ctx, &ctx->sess, &uuid, in prepare_tee_session()
58 if (res != TEEC_SUCCESS) in prepare_tee_session()
60 res, origin); in prepare_tee_session()
74 TEEC_Result res; in read_secure_object() local
88 res = TEEC_InvokeCommand(&ctx->sess, in read_secure_object()
91 switch (res) { in read_secure_object()
97 printf("Command READ_RAW failed: 0x%x / %u\n", res, origin); in read_secure_object()
100 return res; in read_secure_object()
108 TEEC_Result res; in write_secure_object() local
122 res = TEEC_InvokeCommand(&ctx->sess, in write_secure_object()
125 if (res != TEEC_SUCCESS) in write_secure_object()
126 printf("Command WRITE_RAW failed: 0x%x / %u\n", res, origin); in write_secure_object()
128 switch (res) { in write_secure_object()
132 printf("Command WRITE_RAW failed: 0x%x / %u\n", res, origin); in write_secure_object()
135 return res; in write_secure_object()
142 TEEC_Result res; in delete_secure_object() local
152 res = TEEC_InvokeCommand(&ctx->sess, in delete_secure_object()
156 switch (res) { in delete_secure_object()
161 printf("Command DELETE failed: 0x%x / %u\n", res, origin); in delete_secure_object()
164 return res; in delete_secure_object()
176 TEEC_Result res; in main() local
190 res = write_secure_object(&ctx, obj1_id, in main()
192 if (res != TEEC_SUCCESS) in main()
197 res = read_secure_object(&ctx, obj1_id, in main()
199 if (res != TEEC_SUCCESS) in main()
206 res = delete_secure_object(&ctx, obj1_id); in main()
207 if (res != TEEC_SUCCESS) in main()
208 errx(1, "Failed to delete the object: 0x%x", res); in main()
215 res = read_secure_object(&ctx, obj2_id, in main()
217 if (res != TEEC_SUCCESS && res != TEEC_ERROR_ITEM_NOT_FOUND) in main()
218 errx(1, "Unexpected status when reading an object : 0x%x", res); in main()
220 if (res == TEEC_ERROR_ITEM_NOT_FOUND) { in main()
225 res = write_secure_object(&ctx, obj2_id, in main()
227 if (res != TEEC_SUCCESS) in main()
230 } else if (res == TEEC_SUCCESS) { in main()
233 res = delete_secure_object(&ctx, obj2_id); in main()
234 if (res != TEEC_SUCCESS) in main()