/trusty/user/app/sample/hwrng-unittest/ |
D | main.c | 33 for (unsigned int i = 0; i < cnt; i++) { in hwrng_update_hist() local 34 _hist[data[i]]++; in hwrng_update_hist() 41 size_t i; in hwrng_show_data() local 44 for (i = 0; i < MIN(len - count, 16); i++) { in hwrng_show_data() 45 fprintf(stderr, "0x%02hhx ", *(const uint8_t*)(address + i)); in hwrng_show_data() 63 unsigned int i; in TEST() local 66 for (i = 0; i < 100; i++) { in TEST() 108 size_t i, j, k; in cumulative_sums_forward_test_helper() local 113 for (i = 0; i < NB_RNG_QUERIES; i++) { in cumulative_sums_forward_test_helper() 167 unsigned int i; in TEST() local [all …]
|
/trusty/kernel/app/fptest/ |
D | fptest.c | 35 int i = (uintptr_t)arg; in fptest() local 38 fptest_arch_init(i); in fptest() 40 thread_sleep((1 + i) * 10 * 1000); in fptest() 41 corrupted_regs = fptest_arch_check_state(i); in fptest() 44 __func__, i, corrupted_regs); in fptest() 46 printf("%s(%d): register state OK\n", __func__, i); in fptest() 53 int i; in fptest_init() local 58 for (i = 0; i < FPTEST_THREAD_COUNT; i++) { in fptest_init() 59 snprintf(thread_name, sizeof(thread_name), "fptest-%d-%d", cpu, i); in fptest_init() 60 thread = thread_create(thread_name, fptest, (void*)(uintptr_t)i, in fptest_init()
|
/trusty/kernel/app/memorytest/ |
D | memorytest.c | 54 int i; in memorytest_alloc_thread() local 66 for (i = 0; i < arg->count; i++) { in memorytest_alloc_thread() 67 ptrs[i] = malloc(arg->alloc_size); in memorytest_alloc_thread() 68 if (!ptrs[i]) { in memorytest_alloc_thread() 83 while (i-- > 0) { in memorytest_alloc_thread() 84 free(ptrs[i]); in memorytest_alloc_thread() 105 for (size_t i = 0; i < countof(thread); i++) { in TEST() local 106 thread[i] = thread_create("memorytest", memorytest_alloc_thread, in TEST() 109 ASSERT_NE(0, thread[i]); in TEST() 111 for (size_t i = 0; i < countof(thread); i++) { in TEST() local [all …]
|
/trusty/kernel/app/smptest/ |
D | smptest.c | 51 const uint i = (uintptr_t)arg; in smptest_thread_func() local 52 const uint expected_cpu = i; in smptest_thread_func() 53 struct smptest_thread* const smpt = &smptest_thread[i]; in smptest_thread_func() 61 printf("%s: thread %d started on wrong cpu: %d\n", __func__, i, cpu); in smptest_thread_func() 73 printf("%s: thread %d ran on wrong cpu: %d\n", __func__, i, cpu); in smptest_thread_func() 91 for (uint next_cpu = i + 1; next_cpu < SMP_MAX_CPUS; next_cpu++) { in smptest_thread_func() 99 printf("%s: thread %d not blocked\n", __func__, i + 1); in smptest_thread_func() 120 for (uint i = 0; i < SMP_MAX_CPUS; i++) { in TEST() local 121 if (!thread_is_blocked(smptest_thread[i].thread)) { in TEST() 122 unittest_printf("[ INFO ] thread %d not ready\n", i); in TEST() [all …]
|
/trusty/user/app/storage/storage_mock/ |
D | storage_mock.c | 53 for (int i = 0; i < TEST_HANDLER_MAX; i++) { in get_file_handler() local 54 if (storage_mock_handlers[i] == NULL) { in get_file_handler() 57 if (storage_mock_handlers[i]->file_handler == fh) { in get_file_handler() 58 return storage_mock_handlers[i]; in get_file_handler() 75 size_t i; in is_valid_name() local 80 for (i = 0; i < name_len; i++) { in is_valid_name() 81 if ((name[i] >= 'a') && (name[i] <= 'z')) in is_valid_name() 83 if ((name[i] >= 'A') && (name[i] <= 'Z')) in is_valid_name() 85 if ((name[i] >= '0') && (name[i] <= '9')) in is_valid_name() 87 if ((name[i] == '.') || (name[i] == '-') || (name[i] == '_')) in is_valid_name() [all …]
|
/trusty/kernel/app/pacbench/ |
D | pacbench.c | 56 for (uint64_t i = 0; i < LOOPS; i++) { in BENCH_ALL_CPU() local 60 : "r"(i)); in BENCH_ALL_CPU() 88 for (uint64_t i = 0; i < LOOPS; i++) { in BENCH_ALL_CPU() local 92 : "r"(i)); in BENCH_ALL_CPU() 119 for (uint64_t i = 0; i < LOOPS; i++) { in BENCH_ALL_CPU() local 123 : "r"(i)); in BENCH_ALL_CPU() 149 for (uint64_t i = 0; i < LOOPS; i++) { in BENCH_ALL_CPU() local 153 : "r"(i)); in BENCH_ALL_CPU() 178 for (uint64_t i = 0; i < EXTRA_LOOPS; i++) { in BENCH_ALL_CPU() local 181 : "r"(i)); in BENCH_ALL_CPU() [all …]
|
/trusty/user/app/sample/hwcrypto/keybox/ |
D | keybox_fake_provider.c | 57 for (size_t i = 0; i < wrapped_keybox_len - 1; i++) { in keybox_unwrap() local 58 checksum ^= wrapped_keybox[i]; in keybox_unwrap() 67 for (size_t i = 0; i < wrapped_keybox_len - 1; i++) { in keybox_unwrap() local 68 keybox_plaintext[i] = wrapped_keybox[i] ^ 0x42; in keybox_unwrap()
|
/trusty/user/app/sample/timer/ |
D | timer_app.c | 31 __UNUSED static int i; in nop() local 32 i++; in nop() 65 int i; in TEST() local 69 for (i = 0; i < TIMER_TEST_NOP_LOOP_COUNT; i++) in TEST() 76 int i; in TEST() local 80 for (i = 0; i < TIMER_TEST_MS_SLEEP_LOOP_COUNT; i++) in TEST() 109 int i, remaining, last_remaining = 0; in TEST() local 121 for (i = 0; i < 8192; i++) { in TEST() 171 for (size_t i = 0; i < countof(timer_unittests); i++) { in main() local 172 unittests[i] = &timer_unittests[i].unittest; in main()
|
/trusty/user/app/storage/ |
D | rpmb.c | 66 size_t i, j; in rpmb_dprint_buf() local 69 for (i = 0; i < size; i++) { in rpmb_dprint_buf() 70 if (i && i % 32 == 0) { in rpmb_dprint_buf() 78 rpmb_dprintf(" %02x", buf[i]); in rpmb_dprint_buf() 116 size_t i; in rpmb_mac() local 127 for (i = 0; i < packet_count; i++) { in rpmb_mac() 130 hmac_ret = HMAC_Update(&hmac_ctx, packet[i].data, 284); in rpmb_mac() 159 int i; in rpmb_check_response() local 160 for (i = 0; i < res_count; i++) { in rpmb_check_response() 161 if (rpmb_get_u16(res[i].req_resp) != response_type) { in rpmb_check_response() [all …]
|
D | rpmb_protocol.h | 109 size_t i; in rpmb_get_u16() local 113 for (i = 0; i < sizeof(u16.byte); i++) in rpmb_get_u16() 114 val = val << 8 | u16.byte[i]; in rpmb_get_u16() 120 size_t i; in rpmb_get_u32() local 124 for (i = 0; i < sizeof(u32.byte); i++) in rpmb_get_u32() 125 val = val << 8 | u32.byte[i]; in rpmb_get_u32()
|
/trusty/hardware/nxp/platform/imx/ |
D | tzasc.c | 40 for (uint i = 0; i < num; i++, r++) { in initial_tzasc() local 41 TZ_REG(TZ_GET_REGION_ADDR(i)) = r->addr_l; in initial_tzasc() 42 TZ_REG(TZ_GET_REGION_ADDR(i) + 0x4) = r->addr_h; in initial_tzasc() 43 TZ_REG(TZ_GET_REGION_ADDR(i) + 0x8) = r->attr; in initial_tzasc()
|
/trusty/user/app/cast-auth/app/test-app/ |
D | main.cc | 213 for (size_t i = 0; i < keybox_plaintext_len; i++) { in keybox_wrap_for_test() local 214 checksum ^= keybox_plaintext[i]; in keybox_wrap_for_test() 218 for (size_t i = 0; i < keybox_plaintext_len; i++) { in keybox_wrap_for_test() local 219 wrapped_keybox[i] = keybox_plaintext[i] ^ 0x42; in keybox_wrap_for_test() 286 for (unsigned int i = 0; i < signature.size(); ++i) { in TEST_F() local 287 EXPECT_EQ(signature[i], test_signature[i], "signature diff"); in TEST_F() 305 for (unsigned int i = 0; i < signature.size(); ++i) { in TEST_F() local 306 EXPECT_EQ(signature[i], test_signature[i], "signature diff"); in TEST_F()
|
/trusty/user/app/storage/test/block_host_test/ |
D | block_test.c | 138 int i; in block_test_clear_reinit_etc() local 147 for (i = start; i < BLOCK_COUNT; ++i) { in block_test_clear_reinit_etc() 148 tmp = blocks[i]; in block_test_clear_reinit_etc() 149 blocks[i] = blocks_backup[i]; in block_test_clear_reinit_etc() 150 blocks_backup[i] = tmp; in block_test_clear_reinit_etc() 267 unsigned int i; in mark_block_tree_in_use() local 276 for (i = 0; i < path.count; i++) { in mark_block_tree_in_use() 278 block_mac_to_block(tr, &path.entry[i].block_mac), in mark_block_tree_in_use() 393 size_t i; in check_fs_allocated() local 397 for (i = 0; i < allocated_count; i++) { in check_fs_allocated() [all …]
|
/trusty/user/base/lib/tipc/ |
D | tipc_srv.c | 69 uint32_t i; in set_ports_event_mask() local 73 for (i = 0, p = srv->ports; i < srv->port_cnt; i++, p++) { in set_ports_event_mask() 192 uint32_t i; in client_is_allowed() local 197 for (i = 0; i < acl->uuid_num; i++) { in client_is_allowed() 198 if (memcmp(peer, acl->uuids[i], sizeof(*peer)) == 0) { in client_is_allowed() 314 uint32_t i; in tipc_add_service() local 343 for (i = 0; i < num_ports; i++) { in tipc_add_service() 344 srv->ports[i].handle = INVALID_IPC_HANDLE; in tipc_add_service() 348 for (i = 0; i < num_ports; i++) { in tipc_add_service() 349 TLOGD("Initialize port: %s\n", ports[i].name); in tipc_add_service() [all …]
|
/trusty/kernel/lib/trusty/ |
D | ipc_msg.c | 133 for (uint i = 0; i < num_items; i++) { in ipc_msg_queue_create() local 134 tmp_mq->items[i].id = i; in ipc_msg_queue_create() 135 list_add_tail(&tmp_mq->free_list, &tmp_mq->items[i].node); in ipc_msg_queue_create() 147 for (uint i = 0; i < mq->num_items; i++) { in ipc_msg_queue_destroy() local 148 struct msg_item* item = &mq->items[i]; in ipc_msg_queue_destroy() 218 for (uint i = 0; i < msg->num_handles; i++) { in kern_msg_write_locked() local 219 if (!msg->handles[i]) { in kern_msg_write_locked() 224 if (!handle_is_sendable(msg->handles[i])) { in kern_msg_write_locked() 230 handle_incref(msg->handles[i]); in kern_msg_write_locked() 231 item->handles[i] = msg->handles[i]; in kern_msg_write_locked() [all …]
|
D | vqueue.c | 282 uint i; in vqueue_map_iovs() local 292 for (i = 0; i < vqiovs->used; i++) { in vqueue_map_iovs() 295 obj = vqueue_mem_lookup(&mapped_list->list, vqiovs->shared_mem_id[i]); in vqueue_map_iovs() 299 vqiovs->iovs[i].iov_len <= obj->size) { in vqueue_map_iovs() 302 (unsigned long)vqiovs->shared_mem_id[i], obj->iov_base, in vqueue_map_iovs() 304 vqiovs->iovs[i].iov_base = obj->iov_base; in vqueue_map_iovs() 309 (unsigned long)vqiovs->shared_mem_id[i]); in vqueue_map_iovs() 325 vqiovs->iovs[i].iov_base = NULL; in vqueue_map_iovs() 326 size = round_up(vqiovs->iovs[i].iov_len, PAGE_SIZE); in vqueue_map_iovs() 328 client_id, vqiovs->shared_mem_id[i], 0, 0, in vqueue_map_iovs() [all …]
|
/trusty/user/app/confirmationui/src/ |
D | trusty_confirmation_ui.cpp | 128 for (int i = 0; i < displayCount; ++i) { in start() local 129 if (auto rc = secure_fb_open(&secure_fb_handle_[i], &fb_info_[i], i)) { in start() 135 if (fb_info_[i].pixel_format != TTUI_PF_RGBA8) { in start() 136 TLOGE("Unknown pixel format %u\n", fb_info_[i].pixel_format); in start() 142 devices::getDisplayContext(fb_info_[i].display_index, magnified); in start() 144 TLOGE("Failed to get device context: %d\n", i); in start() 152 if (fb_info_[i].rotation == TTUI_DRAW_ROTATION_90 || in start() 153 fb_info_[i].rotation == TTUI_DRAW_ROTATION_270) { in start() 154 rwidth = fb_info_[i].height; in start() 155 rheight = fb_info_[i].width; in start() [all …]
|
/trusty/user/app/sample/spi/swspi-srv/driver/ |
D | swspi.c | 85 for (size_t i = 0; i < sz; i++) { in digest() local 88 digest ^= buf[i]; in digest() 98 for (size_t i = 0; i < sz; i++) { in rand_buf() local 99 buf[i] = rand() % 0xff; in rand_buf() 196 for (size_t i = 0; i < dev->num_cmds; i++) { in spi_seq_free() local 197 void* priv = dev->cmds[i].priv; in spi_seq_free() 210 size_t i; in spi_seq_commit() local 216 for (i = 0; i < dev->num_cmds; i++) { in spi_seq_commit() 217 priv = dev->cmds[i].priv; in spi_seq_commit() 218 dev->cmds[i].exec(dev, priv); in spi_seq_commit()
|
/trusty/user/base/lib/secure_fb/test/ |
D | main.c | 86 for (uint8_t i = 0; i < 3; i++) { in set_pixel() local 87 float v = (rgb_left[i] * (1.0f - blend)) + (rgb_right[i] * blend); in set_pixel() 123 int i, rc; in TEST() local 125 for (i = 0; i < 256; i++) { in TEST() 130 memset(fb_info.buffer, i, fb_info.size); in TEST() 142 trusty_unittest_printf("[ INFO ] failed after %d iterations\n", i); in TEST()
|
/trusty/user/base/lib/secure_fb/ |
D | secure_fb.c | 50 for (size_t i = 0; i < SECURE_FB_MAX_FBS; ++i) { in free_secure_fb_session() local 51 uint8_t** buffer = &s->fbs[i].fb_info.buffer; in free_secure_fb_session() 53 munmap(*buffer, s->fbs[i].fb_info.size); in free_secure_fb_session() 128 for (size_t i = 0; i < num_fbs; i++) { in mmap_fbs() local 129 fb = &fbs[i]; in mmap_fbs() 140 for (size_t i = 0; i < num_fbs; i++) { in mmap_fbs() local 141 fb = &fbs[i]; in mmap_fbs() 208 for (size_t i = 0; i < SECURE_FB_MAX_FBS; ++i) { in handle_get_fbs_resp() local 209 if (handles[i] != INVALID_IPC_HANDLE) { in handle_get_fbs_resp() 210 close(handles[i]); in handle_get_fbs_resp() [all …]
|
/trusty/user/app/keymaster/host_unittest/ |
D | main.cpp | 70 for (uint8_t* i = buf; in NewRandBuf() local 71 reinterpret_cast<size_t>(i) < reinterpret_cast<size_t>(buf) + size; in NewRandBuf() 72 i++) { in NewRandBuf() 73 *i = static_cast<uint8_t>(rand() % UINT8_MAX); in NewRandBuf() 109 unsigned int i = 0; in TestCertChainStorage() local 116 for (i = 0; i < CHAIN_LENGTH; ++i) { in TestCertChainStorage() 117 write_cert[i].reset(NewRandBuf(DATA_SIZE)); in TestCertChainStorage() 118 ASSERT_NE(nullptr, write_cert[i].get()); in TestCertChainStorage() 120 error = ss_manager->WriteCertToStorage(key_slot, write_cert[i].get(), in TestCertChainStorage() 121 DATA_SIZE, i); in TestCertChainStorage() [all …]
|
/trusty/user/app/storage/rpmb_dev/ |
D | rpmb_dev.c | 56 size_t i; in rpmb_mac() local 67 for (i = 0; i < packet_count; i++) { in rpmb_mac() 68 hmac_ret = HMAC_Update(hmac_ctx, packet[i].data, 284); in rpmb_mac() 180 for (int i = 0; i < block_count; i++) { in rpmb_dev_data_write() local 181 ret = write(s->data_fd, s->cmd[i].data, RPMB_PACKET_DATA_SIZE); in rpmb_dev_data_write() 240 for (int i = 0; i < block_count; i++) { in rpmb_dev_data_read() local 241 ret = read(s->data_fd, s->res[i].data, RPMB_PACKET_DATA_SIZE); in rpmb_dev_data_read() 374 for (int i = 1; i < s->cmd_count; i++) { in rpmb_dev_process_cmd() local 375 sub_req = rpmb_get_u16(s->cmd[i].req_resp); in rpmb_dev_process_cmd() 380 req_resp, i, sub_req); in rpmb_dev_process_cmd() [all …]
|
/trusty/kernel/app/stdcalltest/ |
D | stdcalltest.c | 88 for (size_t i = 0; i < size / sizeof(*va64); i++) { in stdcalltest_sharedmem_rw() local 89 if (va64[i] != i) { in stdcalltest_sharedmem_rw() 92 i, va64[i], i); in stdcalltest_sharedmem_rw() 96 va64[i] = size - i; in stdcalltest_sharedmem_rw()
|
/trusty/vendor/google/aosp/scripts/ |
D | trusty_build_config_self_test_include1 | 18 "self_test.build_yes.tests_none.1m.build_false.2i.build_true", 19 "self_test.build_yes.tests_none.1m.build_none.2i.build_true", 20 "self_test.build_no.tests_none.1m.build_false.2i.build_true.3ii.build_false", 26 "self_test.build_no.tests_none.1m.2i.build_false", 27 "self_test.build_yes.tests_none.1m.2i.build_false.3ii.build_true", 28 "self_test.build_no.tests_none.1m.build_true.2i.build_false", 34 "self_test.build_yes.tests_host.1m.2i.test_host", 35 "self_test.build_no.tests_host.1i.test_host", 45 "self_test.build_yes.tests_unit.1m.2i.test_unit", 65 "self_test.build_yes.tests_both.1m.2i.test_both",
|
/trusty/user/app/storage/test/storage-unittest-aidl/unittests/ |
D | helpers.rs | 89 for i in 0..U32_SIZE { in fill_pattern32() 90 chunk[i] = bytes[i]; in fill_pattern32() 112 for i in 0..chunks { in write_pattern() 113 let chunk_offset = offset + i * chunk_len; in write_pattern() 117 .map_err(|e| format!("Encountered error calling write (chunk {}): {}", i, e))?; in write_pattern() 121 written, i, chunk_len, in write_pattern() 137 for i in 0..chunks { in read_pattern() 138 let chunk_offset = offset + i * chunk_len; in read_pattern() 141 .map_err(|e| format!("Encountered error calling read (chunk {}): {}", i, e))?; in read_pattern() 146 i, in read_pattern() [all …]
|