Home
last modified time | relevance | path

Searched refs:idx (Results 1 – 25 of 69) sorted by relevance

123

/trusted-firmware-m-3.6.0/interface/src/multi_core/
Dtfm_ns_mailbox.c18 static int32_t mailbox_wait_reply(uint8_t idx);
20 static inline void set_queue_slot_empty(uint8_t idx) in set_queue_slot_empty() argument
22 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in set_queue_slot_empty()
23 mailbox_queue_ptr->empty_slots |= (1UL << idx); in set_queue_slot_empty()
27 static inline void set_queue_slot_woken(uint8_t idx) in set_queue_slot_woken() argument
29 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in set_queue_slot_woken()
30 mailbox_queue_ptr->queue[idx].reply.is_woken = true; in set_queue_slot_woken()
34 static inline bool is_queue_slot_woken(uint8_t idx) in is_queue_slot_woken() argument
36 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in is_queue_slot_woken()
37 return mailbox_queue_ptr->queue[idx].reply.is_woken; in is_queue_slot_woken()
[all …]
Dtfm_ns_mailbox_thread.c58 static inline void set_queue_slot_woken(uint8_t idx) in set_queue_slot_woken() argument
60 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in set_queue_slot_woken()
61 *mailbox_queue_ptr->queue[idx].reply.woken_flag = WOKEN_UP; in set_queue_slot_woken()
67 uint8_t idx; in acquire_empty_slot() local
89 for (idx = 0; idx < NUM_MAILBOX_QUEUE_SLOT; idx++) { in acquire_empty_slot()
90 if (status & (1 << idx)) { in acquire_empty_slot()
96 clear_queue_slot_empty(queue, idx); in acquire_empty_slot()
99 return idx; in acquire_empty_slot()
107 uint8_t idx = NUM_MAILBOX_QUEUE_SLOT; in mailbox_tx_client_call_msg() local
109 idx = acquire_empty_slot(mailbox_queue_ptr); in mailbox_tx_client_call_msg()
[all …]
/trusted-firmware-m-3.6.0/secure_fw/spm/core/
Dtfm_spe_mailbox.c44 __STATIC_INLINE void set_spe_queue_empty_status(uint8_t idx) in set_spe_queue_empty_status() argument
46 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in set_spe_queue_empty_status()
47 spe_mailbox_queue.empty_slots |= (1 << idx); in set_spe_queue_empty_status()
51 __STATIC_INLINE void clear_spe_queue_empty_status(uint8_t idx) in clear_spe_queue_empty_status() argument
53 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in clear_spe_queue_empty_status()
54 spe_mailbox_queue.empty_slots &= ~(1 << idx); in clear_spe_queue_empty_status()
58 __STATIC_INLINE bool get_spe_queue_empty_status(uint8_t idx) in get_spe_queue_empty_status() argument
60 if ((idx < NUM_MAILBOX_QUEUE_SLOT) && in get_spe_queue_empty_status()
61 (spe_mailbox_queue.empty_slots & (1 << idx))) { in get_spe_queue_empty_status()
88 __STATIC_INLINE int32_t get_spe_mailbox_msg_handle(uint8_t idx, in get_spe_mailbox_msg_handle() argument
[all …]
/trusted-firmware-m-3.6.0/secure_fw/spm/ns_client_ext/
Dtfm_ns_ctx.c35 bool acquire_ns_ctx(uint8_t gid, uint8_t *idx) in acquire_ns_ctx() argument
56 *idx = i; in acquire_ns_ctx()
81 *idx = empty_ctx_idx; in acquire_ns_ctx()
90 bool release_ns_ctx(uint8_t gid, uint8_t tid, uint8_t idx) in release_ns_ctx() argument
93 if (idx >= TFM_NS_CONTEXT_MAX) { in release_ns_ctx()
100 if (ns_ctx_data[idx].gid != gid) { in release_ns_ctx()
110 if (idx == active_ns_ctx_index) { in release_ns_ctx()
111 if (ns_ctx_data[idx].tid == tid) { in release_ns_ctx()
113 if (ns_ctx_data[idx].ref_cnt > 0) { in release_ns_ctx()
114 ns_ctx_data[idx].ref_cnt--; in release_ns_ctx()
[all …]
/trusted-firmware-m-3.6.0/platform/ext/accelerator/cc312/cc312-rom/
Dcc3xx_stdlib.c89 uint32_t idx; in fisher_yates_shuffle() local
97 for (idx = 0; idx <= len - 1; idx++) { in fisher_yates_shuffle()
98 swap_idx = xorshift_get_random_uint(len - idx); in fisher_yates_shuffle()
100 swap_idx += idx; in fisher_yates_shuffle()
101 temp_elem = permutation_buf[idx]; in fisher_yates_shuffle()
102 permutation_buf[idx] = permutation_buf[swap_idx]; in fisher_yates_shuffle()
109 size_t idx; in cc3xx_secure_erase_buffer() local
114 for (idx = 0; idx < word_count; idx++) { in cc3xx_secure_erase_buffer()
115 buf[idx] = random_val; in cc3xx_secure_erase_buffer()
124 size_t idx; in cc3xx_dpa_hardened_word_copy() local
[all …]
Dcc3xx_pka.c132 uint32_t idx; in pka_init_from_state() local
161 for (idx = 0; idx < PKA_PHYS_REG_FIRST_MAPPABLE; idx++) { in pka_init_from_state()
162 virt_regs[idx].is_mapped = true; in pka_init_from_state()
163 virt_regs[idx].phys_reg = idx; in pka_init_from_state()
164 phys_reg_mapping[idx] = idx; in pka_init_from_state()
165 P_CC3XX->pka.memory_map[idx] = in pka_init_from_state()
166 pka_addr_from_byte_addr(pka_state.reg_size * idx); in pka_init_from_state()
170 for (; idx < pka_reg_am_max - 2; idx++) { in pka_init_from_state()
171 virt_regs[idx].sram_addr = in pka_init_from_state()
172 pka_addr_from_byte_addr(pka_state.reg_size * idx); in pka_init_from_state()
[all …]
Dcc3xx_hmac.c24 size_t idx; in cc3xx_hmac_set_key() local
48 for (idx = 0; idx < key_length; idx++) { in cc3xx_hmac_set_key()
49 state->key[idx] = p_key[idx] ^ ipad; in cc3xx_hmac_set_key()
98 size_t idx; in cc3xx_hmac_finish() local
108 for (idx = 0; idx < CC3XX_HMAC_BLOCK_SIZE; idx++) { in cc3xx_hmac_finish()
109 state->key[idx] ^= ixopad; in cc3xx_hmac_finish()
Dcc3xx_hash.c42 int32_t idx; in set_hash_h() local
45 for (idx = (length / 4) - 1; idx >= 0; idx--) { in set_hash_h()
46 P_CC3XX->hash.hash_h[idx] = bswap_32(buf[idx]); in set_hash_h()
52 size_t idx; in get_hash_h() local
54 for (idx = 0; idx < (length / 4); idx++) { in get_hash_h()
55 buf[idx] = bswap_32(P_CC3XX->hash.hash_h[idx]); in get_hash_h()
Dcc3xx_drbg_hmac.c33 size_t idx; in cc3xx_drbg_hmac_update() local
50 for (idx = 0; idx < hmac_inputs_num && hmac_inputs_len[idx] != 0; idx++) { in cc3xx_drbg_hmac_update()
51 err = cc3xx_hmac_update(&state->h, hmac_inputs[idx], hmac_inputs_len[idx]); in cc3xx_drbg_hmac_update()
94 for (idx = 0; idx < hmac_inputs_num && hmac_inputs_len[idx] != 0; idx++) { in cc3xx_drbg_hmac_update()
95 err = cc3xx_hmac_update(&state->h, hmac_inputs[idx], hmac_inputs_len[idx]); in cc3xx_drbg_hmac_update()
153 size_t idx; in cc3xx_drbg_hmac_generate() local
204 for (idx = 0; idx < len_bits % 8; idx++) { in cc3xx_drbg_hmac_generate()
205 mask |= 1UL << (8 - idx - 1); in cc3xx_drbg_hmac_generate()
Dcc3xx_drbg_ctr.c117 size_t idx; in cc3xx_drbg_ctr_init() local
144 for (idx = 0; idx < personalization_len; idx++) { in cc3xx_drbg_ctr_init()
145 ((uint8_t *)personalized_entropy)[idx] ^= personalization[idx]; in cc3xx_drbg_ctr_init()
179 size_t idx; in cc3xx_drbg_ctr_generate() local
216 for (idx = 0; idx < num_whole_blocks; idx++) { in cc3xx_drbg_ctr_generate()
272 size_t idx; in cc3xx_drbg_ctr_reseed() local
285 for (idx = 0; idx < additional_input_len; idx++) { in cc3xx_drbg_ctr_reseed()
286 ((uint8_t *)personalized_entropy)[idx] ^= additional_input[idx]; in cc3xx_drbg_ctr_reseed()
/trusted-firmware-m-3.6.0/platform/ext/target/arm/rss/common/rss_comms/
Drss_comms_protocol_pointer_access.c18 uint32_t idx; in rss_protocol_pointer_access_deserialize_msg() local
37 for (idx = 0; idx < req->in_len; idx++) { in rss_protocol_pointer_access_deserialize_msg()
38 err = comms_permissions_memory_check(msg->host_ptrs[idx], in rss_protocol_pointer_access_deserialize_msg()
39 msg->io_sizes[idx], false); in rss_protocol_pointer_access_deserialize_msg()
44 err = comms_atu_alloc_region(msg->host_ptrs[idx], in rss_protocol_pointer_access_deserialize_msg()
45 msg->io_sizes[idx], in rss_protocol_pointer_access_deserialize_msg()
57 msg->host_ptrs[idx], in rss_protocol_pointer_access_deserialize_msg()
63 req->in_vec[idx].base = mapped_host_ptr; in rss_protocol_pointer_access_deserialize_msg()
64 req->in_vec[idx].len = msg->io_sizes[idx]; in rss_protocol_pointer_access_deserialize_msg()
68 for (idx = 0; idx < req->out_len; idx++) { in rss_protocol_pointer_access_deserialize_msg()
[all …]
Drss_comms_atu.c46 uint32_t idx; in get_region_idx_from_host_buf() local
49 for (idx = 0; idx < RSS_COMMS_ATU_REGION_AM; idx++) { in get_region_idx_from_host_buf()
50 region = &atu_regions[idx]; in get_region_idx_from_host_buf()
52 if (atu_regions[idx].ref_count > 0 && in get_region_idx_from_host_buf()
55 *region_idx = idx; in get_region_idx_from_host_buf()
82 uint32_t idx; in get_free_region_idx() local
84 for (idx = 0; idx <= RSS_COMMS_ATU_REGION_AM; idx++) { in get_free_region_idx()
85 if (atu_regions[idx].ref_count == 0) { in get_free_region_idx()
86 *region_idx = idx; in get_free_region_idx()
/trusted-firmware-m-3.6.0/platform/ext/target/arm/rss/common/
Ddpa_hardened_word_copy.c85 uint32_t idx; in fisher_yates_shuffle() local
93 for (idx = 0; idx <= len - 1; idx++) { in fisher_yates_shuffle()
94 swap_idx = xorshift_get_random_uint(len - idx); in fisher_yates_shuffle()
96 swap_idx += idx; in fisher_yates_shuffle()
97 temp_elem = permutation_buf[idx]; in fisher_yates_shuffle()
98 permutation_buf[idx] = permutation_buf[swap_idx]; in fisher_yates_shuffle()
107 size_t idx; in dpa_hardened_word_copy() local
113 for (idx = 0; idx < word_count; idx++) { in dpa_hardened_word_copy()
114 permutation_buf[idx] = idx; in dpa_hardened_word_copy()
118 for(idx = 0; idx < word_count; idx++) { in dpa_hardened_word_copy()
[all …]
Dnv_counters.c38 size_t idx; in read_nv_counter_otp() local
56 for (idx = 0; idx < counter_size / sizeof(uint32_t); idx++) { in read_nv_counter_otp()
57 if (counter_value[idx] == OTP_COUNTER_MAGIC) { in read_nv_counter_otp()
59 } else if (counter_value[idx] == 0) { in read_nv_counter_otp()
115 size_t idx; in set_nv_counter_otp() local
130 for (idx = 0; idx < value; idx++) { in set_nv_counter_otp()
131 counter_value[idx] = OTP_COUNTER_MAGIC; in set_nv_counter_otp()
/trusted-firmware-m-3.6.0/platform/ext/target/arm/rss/common/native_drivers/
Dlcm_drv.c302 uint32_t idx; in count_otp_zero_bits() local
308 for (idx = 0; idx < len; idx += sizeof(uint32_t)) { in count_otp_zero_bits()
309 err = lcm_otp_read(dev, offset + idx, sizeof(uint32_t), (uint8_t *)&word); in count_otp_zero_bits()
480 uint32_t idx; in se_to_rma() local
483 for (idx = 0; idx < offsetof(struct lcm_otp_layout_t, tp_mode_config); in se_to_rma()
484 idx += sizeof(uint32_t)) { in se_to_rma()
485 err = lcm_otp_write(dev, idx, sizeof(otp_overwrite_val), in se_to_rma()
604 uint32_t idx; in lcm_otp_write() local
628 for (idx = 0; idx < len / sizeof(uint32_t); idx++) { in lcm_otp_write()
629 if (p_buf_word[idx] != in lcm_otp_write()
[all …]
Dsic_drv.c346 size_t idx; in sic_auth_table_set() local
357 for (idx = 0; idx < data_len_bytes / 4; idx++) { in sic_auth_table_set()
358 p_sic->htr[(table_offset / 4) + idx] = data[idx]; in sic_auth_table_set()
396 size_t idx; in check_region_overlap() local
398 for (idx = 0; idx < get_dr_am(dev); idx++) { in check_region_overlap()
401 if (idx == region_idx) { in check_region_overlap()
405 region_base = (p_sic->dr[idx].drr & 0xFFFFFu) << 12; in check_region_overlap()
406 region_size = ((p_sic->dr[idx].drr >> 20) & 0x7FF) << 12; in check_region_overlap()
430 uint32_t idx; in sic_decrypt_region_enable() local
468 for (idx = 0; idx < 2; idx++) { in sic_decrypt_region_enable()
[all …]
/trusted-firmware-m-3.6.0/bl1/bl1_1/shared_lib/
Dutil.c16 size_t idx; in bl_fih_memeql() local
18 for (idx = 0; idx < num; idx++) { in bl_fih_memeql()
19 if (((uint8_t *)ptr1)[idx] != ((uint8_t *)ptr2)[idx]) { in bl_fih_memeql()
25 if (((uint8_t *)ptr1)[idx] != ((uint8_t *)ptr2)[idx]) { in bl_fih_memeql()
30 if (idx != num) { in bl_fih_memeql()
/trusted-firmware-m-3.6.0/secure_fw/partitions/lib/runtime/
Dcrt_strnlen.c12 size_t idx; in tfm_strnlen() local
14 for (idx = 0; idx < maxlen; idx++) { in tfm_strnlen()
15 if (s[idx] == '\0') { in tfm_strnlen()
16 return idx; in tfm_strnlen()
20 return idx; in tfm_strnlen()
/trusted-firmware-m-3.6.0/platform/ext/target/nordic_nrf/common/core/cmsis_drivers/
DDriver_USART.c351 #define DRIVER_USART(idx) \ argument
352 static const uint32_t UART##idx##_pins[] = RTE_USART##idx##_PINS; \
353 static UARTx_Resources UART##idx##_Resources = { \
354 .uarte = NRFX_UARTE_INSTANCE(idx), \
355 .uart_pins = UART##idx##_pins, \
356 .uart_pins_count = ARRAY_SIZE(UART##idx##_pins) \
358 static int32_t ARM_USART##idx##_Initialize( \
361 return ARM_USARTx_Initialize(cb_event, &UART##idx##_Resources); \
363 static int32_t ARM_USART##idx##_Uninitialize(void) \
365 return ARM_USARTx_Uninitialize(&UART##idx##_Resources); \
[all …]
/trusted-firmware-m-3.6.0/platform/ext/target/arm/rss/common/fip_parser/
Dgpt.c24 size_t idx; in gpt_strncmp() local
30 for (idx = 0; idx < str_len; idx++) { in gpt_strncmp()
31 if (str[idx] != gpt_str[idx]) { in gpt_strncmp()
83 uint64_t idx; in gpt_get_list_entry_by_name() local
99 for (idx = list_base; in gpt_get_list_entry_by_name()
100 idx < list_base + list_num_entries * list_entry_size; in gpt_get_list_entry_by_name()
101 idx += list_entry_size) { in gpt_get_list_entry_by_name()
102 rc = FLASH_DEV_NAME.ReadData(idx - FLASH_BASE_ADDRESS, entry, in gpt_get_list_entry_by_name()
/trusted-firmware-m-3.6.0/platform/ext/common/template/
Dflash_otp_nv_counters_backend.c240 size_t idx; in erase_flash_region() local
246 for (idx = round_down(start, TFM_OTP_NV_COUNTERS_SECTOR_SIZE); in erase_flash_region()
247 idx < start + size; in erase_flash_region()
248 idx += TFM_OTP_NV_COUNTERS_SECTOR_SIZE) { in erase_flash_region()
249 err = (enum tfm_plat_err_t)OTP_NV_COUNTERS_FLASH_DEV.EraseSector(idx); in erase_flash_region()
262 size_t idx; in copy_flash_region() local
272 for(idx = 0; idx < end; idx += copy_size) { in copy_flash_region()
273 copy_size = (idx + sizeof(block)) <= end ? sizeof(block) : end - idx; in copy_flash_region()
275 err = OTP_NV_COUNTERS_FLASH_DEV.ReadData(from + idx, block, copy_size / data_width); in copy_flash_region()
280 err = OTP_NV_COUNTERS_FLASH_DEV.ProgramData(to + idx, block, copy_size / data_width); in copy_flash_region()
[all …]
/trusted-firmware-m-3.6.0/bl2/ext/mcuboot/
Dflash_map_legacy.c38 int flash_area_get_sectors(int idx, uint32_t *cnt, struct flash_sector *ret) in flash_area_get_sectors() argument
45 if (flash_area_open(idx, &fa)) { in flash_area_get_sectors()
49 BOOT_LOG_DBG("area %d: offset=0x%x, length=0x%x", idx, fa->fa_off, in flash_area_get_sectors()
61 idx, fa->fa_size, FLASH_AREA_IMAGE_SECTOR_SIZE); in flash_area_get_sectors()
72 BOOT_LOG_ERR("flash area %d sector count overflow", idx); in flash_area_get_sectors()
/trusted-firmware-m-3.6.0/interface/include/multi_core/
Dtfm_ns_mailbox.h291 uint8_t idx) in clear_queue_slot_empty() argument
293 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in clear_queue_slot_empty()
294 queue_ptr->empty_slots &= ~(1UL << idx); in clear_queue_slot_empty()
299 uint8_t idx) in set_queue_slot_pend() argument
301 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in set_queue_slot_pend()
302 queue_ptr->pend_slots |= (1UL << idx); in set_queue_slot_pend()
/trusted-firmware-m-3.6.0/secure_fw/partitions/internal_trusted_storage/flash_fs/
Dits_flash_fs.c170 uint32_t idx; in its_flash_fs_prepare() local
182 ITS_FLASH_FS_FLAG_DELETE, &idx); in its_flash_fs_prepare()
184 return its_flash_fs_delete_idx(fs_ctx, idx); in its_flash_fs_prepare()
203 uint32_t idx; in its_flash_fs_file_get_info() local
207 err = its_flash_fs_mblock_get_file_idx_meta(fs_ctx, fid, &idx, &tmp_metadata); in its_flash_fs_file_get_info()
234 uint32_t idx; in its_flash_fs_file_write() local
366 idx = ITS_UTILS_MIN(new_idx, old_idx); in its_flash_fs_file_write()
367 err = its_flash_fs_mblock_cp_file_meta(fs_ctx, 0, idx); in its_flash_fs_file_write()
374 err = its_flash_fs_mblock_cp_file_meta(fs_ctx, idx + 1, in its_flash_fs_file_write()
380 idx = ITS_UTILS_MAX(new_idx, old_idx); in its_flash_fs_file_write()
[all …]
/trusted-firmware-m-3.6.0/secure_fw/partitions/internal_trusted_storage/flash/
Dits_flash_ram.c38 uint32_t idx = get_phys_address(cfg, block_id, offset); in its_flash_ram_read() local
40 (void)memcpy(buff, (uint8_t *)cfg->flash_dev + idx, size); in its_flash_ram_read()
49 uint32_t idx = get_phys_address(cfg, block_id, offset); in its_flash_ram_write() local
51 (void)memcpy((uint8_t *)cfg->flash_dev + idx, buff, size); in its_flash_ram_write()
71 uint32_t idx = get_phys_address(cfg, block_id, 0); in its_flash_ram_erase() local
73 (void)memset((uint8_t *)cfg->flash_dev + idx, cfg->erase_val, in its_flash_ram_erase()

123