/trusted-firmware-m-3.7.0/interface/src/multi_core/ |
D | tfm_ns_mailbox.c | 20 static int32_t mailbox_wait_reply(uint8_t idx); 22 static inline void set_queue_slot_empty(uint8_t idx) in set_queue_slot_empty() argument 24 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in set_queue_slot_empty() 25 mailbox_queue_ptr->empty_slots |= (1UL << idx); in set_queue_slot_empty() 29 static inline void set_queue_slot_woken(uint8_t idx) in set_queue_slot_woken() argument 31 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in set_queue_slot_woken() 32 mailbox_queue_ptr->slots_ns[idx].is_woken = true; in set_queue_slot_woken() 36 static inline bool is_queue_slot_woken(uint8_t idx) in is_queue_slot_woken() argument 38 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in is_queue_slot_woken() 39 return mailbox_queue_ptr->slots_ns[idx].is_woken; in is_queue_slot_woken() [all …]
|
D | tfm_ns_mailbox_thread.c | 60 static inline void set_queue_slot_woken(uint8_t idx) in set_queue_slot_woken() argument 62 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in set_queue_slot_woken() 63 *mailbox_queue_ptr->slots_ns[idx].woken_flag = WOKEN_UP; in set_queue_slot_woken() 69 uint8_t idx; in acquire_empty_slot() local 91 for (idx = 0; idx < NUM_MAILBOX_QUEUE_SLOT; idx++) { in acquire_empty_slot() 92 if (status & (1 << idx)) { in acquire_empty_slot() 98 clear_queue_slot_empty(queue, idx); in acquire_empty_slot() 101 return idx; in acquire_empty_slot() 109 uint8_t idx = NUM_MAILBOX_QUEUE_SLOT; in mailbox_tx_client_call_msg() local 111 idx = acquire_empty_slot(mailbox_queue_ptr); in mailbox_tx_client_call_msg() [all …]
|
/trusted-firmware-m-3.7.0/secure_fw/partitions/ns_agent_mailbox/ |
D | tfm_spe_mailbox.c | 46 __STATIC_INLINE void set_spe_queue_empty_status(uint8_t idx) in set_spe_queue_empty_status() argument 48 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in set_spe_queue_empty_status() 49 spe_mailbox_queue.empty_slots |= (1 << idx); in set_spe_queue_empty_status() 53 __STATIC_INLINE void clear_spe_queue_empty_status(uint8_t idx) in clear_spe_queue_empty_status() argument 55 if (idx < NUM_MAILBOX_QUEUE_SLOT) { in clear_spe_queue_empty_status() 56 spe_mailbox_queue.empty_slots &= ~(1 << idx); in clear_spe_queue_empty_status() 60 __STATIC_INLINE bool get_spe_queue_empty_status(uint8_t idx) in get_spe_queue_empty_status() argument 62 if ((idx < NUM_MAILBOX_QUEUE_SLOT) && in get_spe_queue_empty_status() 63 (spe_mailbox_queue.empty_slots & (1 << idx))) { in get_spe_queue_empty_status() 90 __STATIC_INLINE int32_t get_spe_mailbox_msg_handle(uint8_t idx, in get_spe_mailbox_msg_handle() argument [all …]
|
/trusted-firmware-m-3.7.0/secure_fw/spm/ns_client_ext/ |
D | tfm_ns_ctx.c | 35 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.7.0/platform/ext/accelerator/cc312/cc312-rom/ |
D | cc3xx_stdlib.c | 81 uint32_t idx; in fisher_yates_shuffle() local 89 for (idx = 0; idx <= len - 1; idx++) { in fisher_yates_shuffle() 90 swap_idx = xorshift_get_random_uint(len - idx); in fisher_yates_shuffle() 92 swap_idx += idx; in fisher_yates_shuffle() 93 temp_elem = permutation_buf[idx]; in fisher_yates_shuffle() 94 permutation_buf[idx] = permutation_buf[swap_idx]; in fisher_yates_shuffle() 102 uint32_t idx; in cc3xx_random_permutation_generate() local 105 for (idx = 0; idx < len; idx++) { in cc3xx_random_permutation_generate() 106 permutation_buf[idx] = idx; in cc3xx_random_permutation_generate() 116 size_t idx; in cc3xx_secure_erase_buffer() local [all …]
|
D | cc3xx_hmac.c | 27 size_t idx; in cc3xx_lowlevel_hmac_compute() local 58 for (idx = 0; idx < key_length; idx++) { in cc3xx_lowlevel_hmac_compute() 59 block[idx] ^= p_key[idx]; in cc3xx_lowlevel_hmac_compute() 85 for (idx = 0; idx < CC3XX_HMAC_BLOCK_SIZE; idx++) { in cc3xx_lowlevel_hmac_compute() 86 block[idx] ^= ixopad; in cc3xx_lowlevel_hmac_compute() 125 size_t idx; in cc3xx_lowlevel_hmac_set_key() local 149 for (idx = 0; idx < key_length; idx++) { in cc3xx_lowlevel_hmac_set_key() 150 state->key[idx] = p_key[idx] ^ ipad; in cc3xx_lowlevel_hmac_set_key() 208 size_t idx; in cc3xx_lowlevel_hmac_finish() local 218 for (idx = 0; idx < CC3XX_HMAC_BLOCK_SIZE; idx++) { in cc3xx_lowlevel_hmac_finish() [all …]
|
D | cc3xx_pka.c | 133 uint32_t idx; in cc3xx_lowlevel_pka_unmap_physical_registers() local 139 for (idx = PKA_PHYS_REG_FIRST_MAPPABLE; idx <= PKA_PHYS_REG_LAST_MAPPABLE; idx++) { in cc3xx_lowlevel_pka_unmap_physical_registers() 140 virt_reg = phys_reg_mapping_list[idx]; in cc3xx_lowlevel_pka_unmap_physical_registers() 142 virt_reg_sram_addr[virt_reg] = P_CC3XX->pka.memory_map[idx]; in cc3xx_lowlevel_pka_unmap_physical_registers() 151 for (idx = 0; idx < PKA_PHYS_REG_FIRST_MAPPABLE; idx++) { in cc3xx_lowlevel_pka_unmap_physical_registers() 152 phys_reg_mapping_list[idx] = idx; in cc3xx_lowlevel_pka_unmap_physical_registers() 160 uint32_t idx; in pka_init_from_state() local 189 for (idx = 0; idx < PKA_PHYS_REG_FIRST_MAPPABLE; idx++) { in pka_init_from_state() 190 virt_reg_is_mapped[idx] = true; in pka_init_from_state() 191 virt_reg_phys_reg[idx] = idx; in pka_init_from_state() [all …]
|
D | cc3xx_hash.c | 45 int32_t idx; in set_hash_h() local 48 for (idx = (length / 4) - 1; idx >= 0; idx--) { in set_hash_h() 49 P_CC3XX->hash.hash_h[idx] = bswap_32(buf[idx]); in set_hash_h() 55 size_t idx; in get_hash_h() local 57 for (idx = 0; idx < (length / 4); idx++) { in get_hash_h() 58 buf[idx] = bswap_32(P_CC3XX->hash.hash_h[idx]); in get_hash_h()
|
D | cc3xx_drbg_hmac.c | 33 size_t idx; in hmac_update() local 50 for (idx = 0; idx < hmac_inputs_num && hmac_inputs_len[idx] != 0; idx++) { in hmac_update() 51 err = cc3xx_lowlevel_hmac_update(&state->h, hmac_inputs[idx], hmac_inputs_len[idx]); in hmac_update() 94 for (idx = 0; idx < hmac_inputs_num && hmac_inputs_len[idx] != 0; idx++) { in hmac_update() 95 err = cc3xx_lowlevel_hmac_update(&state->h, hmac_inputs[idx], hmac_inputs_len[idx]); in hmac_update() 153 size_t idx; in cc3xx_lowlevel_drbg_hmac_generate() local 204 for (idx = 0; idx < len_bits % 8; idx++) { in cc3xx_lowlevel_drbg_hmac_generate() 205 mask |= 1UL << (8 - idx - 1); in cc3xx_lowlevel_drbg_hmac_generate()
|
D | cc3xx_chacha.c | 61 size_t idx; in set_key() local 64 (void)idx; in set_key() 69 for (idx = 0; idx < 8; idx++) { in set_key() 70 P_CC3XX->chacha.chacha_key[idx] = key[idx]; in set_key() 117 uint32_t idx; in cc3xx_lowlevel_chacha20_init() local 138 (void)idx; in cc3xx_lowlevel_chacha20_init() 142 for (idx = 0; idx < 8; idx++) { in cc3xx_lowlevel_chacha20_init() 143 chacha_state.key[idx] = key[idx]; in cc3xx_lowlevel_chacha20_init() 306 uint32_t idx; in tag_cmp_or_copy() local 314 for (idx = 0; idx < tag_word_size; idx++) { in tag_cmp_or_copy() [all …]
|
D | cc3xx_drbg_ctr.c | 115 size_t idx; in cc3xx_lowlevel_drbg_ctr_init() local 142 for (idx = 0; idx < personalization_len; idx++) { in cc3xx_lowlevel_drbg_ctr_init() 143 ((uint8_t *)personalized_entropy)[idx] ^= personalization[idx]; in cc3xx_lowlevel_drbg_ctr_init() 177 size_t idx; in cc3xx_lowlevel_drbg_ctr_generate() local 214 for (idx = 0; idx < num_whole_blocks; idx++) { in cc3xx_lowlevel_drbg_ctr_generate() 270 size_t idx; in cc3xx_lowlevel_drbg_ctr_reseed() local 283 for (idx = 0; idx < additional_input_len; idx++) { in cc3xx_lowlevel_drbg_ctr_reseed() 284 ((uint8_t *)personalized_entropy)[idx] ^= additional_input[idx]; in cc3xx_lowlevel_drbg_ctr_reseed()
|
/trusted-firmware-m-3.7.0/platform/ext/target/arm/rse/common/rse_comms/ |
D | rse_comms_protocol_pointer_access.c | 18 uint32_t idx; in rse_protocol_pointer_access_deserialize_msg() local 37 for (idx = 0; idx < req->in_len; idx++) { in rse_protocol_pointer_access_deserialize_msg() 39 msg->host_ptrs[idx], in rse_protocol_pointer_access_deserialize_msg() 40 msg->io_sizes[idx], in rse_protocol_pointer_access_deserialize_msg() 46 err = comms_atu_alloc_region(msg->host_ptrs[idx], in rse_protocol_pointer_access_deserialize_msg() 47 msg->io_sizes[idx], in rse_protocol_pointer_access_deserialize_msg() 59 msg->host_ptrs[idx], in rse_protocol_pointer_access_deserialize_msg() 65 req->in_vec[idx].base = mapped_host_ptr; in rse_protocol_pointer_access_deserialize_msg() 66 req->in_vec[idx].len = msg->io_sizes[idx]; in rse_protocol_pointer_access_deserialize_msg() 70 for (idx = 0; idx < req->out_len; idx++) { in rse_protocol_pointer_access_deserialize_msg() [all …]
|
D | rse_comms_atu.c | 46 uint32_t idx; in get_region_idx_from_host_buf() local 49 for (idx = 0; idx < RSE_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 <= RSE_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.7.0/platform/ext/target/arm/rse/common/ |
D | dpa_hardened_word_copy.c | 85 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 …]
|
D | nv_counters.c | 55 uint32_t idx; in count_zero_bits() local 61 for (idx = 0; idx < len / sizeof(uint32_t); idx ++) { in count_zero_bits() 62 word = addr[idx]; in count_zero_bits() 112 size_t idx; in read_otp_counter() local 130 for (idx = 0; idx < counter_size / sizeof(uint32_t); idx++) { in read_otp_counter() 131 if (counter_value[idx] == OTP_COUNTER_MAGIC) { in read_otp_counter() 133 } else if (counter_value[idx] == 0) { in read_otp_counter() 192 size_t idx; in set_otp_counter() local 207 for (idx = 0; idx < val / 32; idx++) { in set_otp_counter() 208 counter_value[idx] = 0xFFFFFFFFu; in set_otp_counter() [all …]
|
/trusted-firmware-m-3.7.0/platform/ext/target/arm/drivers/lcm/ |
D | lcm_drv.c | 119 uint32_t idx; in rma_erase_all_keys() local 123 for (idx = 0; idx < offsetof(struct lcm_otp_layout_t, tp_mode_config); in rma_erase_all_keys() 124 idx += sizeof(uint32_t)) { in rma_erase_all_keys() 125 err = lcm_otp_write(dev, idx, sizeof(otp_overwrite_val), in rma_erase_all_keys() 257 size_t idx; in mask_dcus_for_sp_enable() local 263 for (idx = 0; idx < LCM_DCU_WIDTH_IN_BYTES / sizeof(uint32_t); idx++) { in mask_dcus_for_sp_enable() 264 mask_val = p_lcm->dcu_sp_disable_mask[idx]; in mask_dcus_for_sp_enable() 269 dcu_val = p_lcm->dcu_en[idx]; in mask_dcus_for_sp_enable() 274 p_lcm->dcu_en[idx] = dcu_val; in mask_dcus_for_sp_enable() 285 uint32_t idx; in lcm_set_sp_enabled() local [all …]
|
/trusted-firmware-m-3.7.0/bl1/bl1_1/shared_lib/ |
D | util.c | 16 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.7.0/secure_fw/partitions/lib/runtime/ |
D | crt_strnlen.c | 12 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.7.0/platform/ext/target/nordic_nrf/common/core/cmsis_drivers/ |
D | Driver_USART.c | 351 #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.7.0/platform/ext/target/arm/rse/common/fip_parser/ |
D | gpt.c | 24 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.7.0/platform/ext/target/arm/rse/common/native_drivers/ |
D | sic_drv.c | 346 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.7.0/platform/ext/target/arm/mps4/corstone315/ |
D | nv_counters.c | 38 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.7.0/platform/ext/common/template/ |
D | flash_otp_nv_counters_backend.c | 240 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.7.0/platform/ext/target/arm/rse/common/rse_handshake/ |
D | rse_handshake.c | 371 uint32_t idx; in calculate_session_key_server() local 383 for (idx = 0; idx < RSE_AMOUNT; idx++) { in calculate_session_key_server() 384 if (idx == RSE_SERVER_ID) { in calculate_session_key_server() 389 err = rse_handshake_msg_receive(&MHU_RSE_TO_RSE_RECEIVER_DEVS[receiving_mhu[idx]], in calculate_session_key_server() 399 dpa_hardened_word_copy(session_key_ivs + (SESSION_KEY_IV_WORD_SIZE * idx), in calculate_session_key_server() 412 for (idx = 0; idx < RSE_AMOUNT; idx++) { in calculate_session_key_server() 413 if (idx == RSE_SERVER_ID) { in calculate_session_key_server() 417 err = rse_handshake_msg_send(&MHU_RSE_TO_RSE_SENDER_DEVS[sending_mhu[idx]], in calculate_session_key_server() 432 uint32_t idx; in exchange_vhuk_seeds_server() local 437 for (idx = 0; idx < RSE_AMOUNT; idx++) { in exchange_vhuk_seeds_server() [all …]
|
/trusted-firmware-m-3.7.0/secure_fw/partitions/crypto/ |
D | crypto_library.c | 119 for (size_t idx = 0; idx < number_of_keys; idx++) { in mbedtls_psa_platform_get_builtin_key() local 120 if (desc_table[idx].key_id == MBEDTLS_SVC_KEY_ID_GET_KEY_ID(key_id)) { in mbedtls_psa_platform_get_builtin_key() 121 *lifetime = desc_table[idx].lifetime; in mbedtls_psa_platform_get_builtin_key() 122 *slot_number = desc_table[idx].slot_number; in mbedtls_psa_platform_get_builtin_key()
|