/trusted-firmware-a/lib/xlat_tables_v2/ |
A D | xlat_tables_core.c | 97 assert(ctx->next_table < ctx->tables_num); in xlat_table_get_empty() 99 return ctx->tables[ctx->next_table++]; in xlat_table_get_empty() 710 if (ctx->mmap[ctx->mmap_num - 1].size != 0U) in mmap_add_region_check() 777 const mmap_region_t *mm_end = ctx->mmap + ctx->mmap_num; in mmap_add_region_ctx() 1005 0U, ctx->base_table, ctx->base_table_entries, in mmap_add_dynamic_region_ctx() 1034 ctx->base_table, ctx->base_table_entries, in mmap_add_dynamic_region_ctx() 1119 xlat_tables_unmap_region(ctx, mm, 0U, ctx->base_table, in mmap_remove_dynamic_region_ctx() 1135 mm = ctx->mmap; in mmap_remove_dynamic_region_ctx() 1221 ctx->base_table, ctx->base_table_entries, in init_xlat_tables_ctx() 1238 assert(ctx->max_va <= ctx->va_max_address); in init_xlat_tables_ctx() [all …]
|
A D | xlat_tables_utils.c | 243 ctx->base_table_entries); in xlat_tables_print() 258 xlat_tables_print_internal(ctx, 0U, ctx->base_table, in xlat_tables_print() 259 ctx->base_table_entries, ctx->base_level); in xlat_tables_print() 356 assert(ctx != NULL); in xlat_get_mem_attributes_internal() 357 assert(ctx->initialized); in xlat_get_mem_attributes_internal() 366 ctx->base_table, in xlat_get_mem_attributes_internal() 367 ctx->base_table_entries, in xlat_get_mem_attributes_internal() 391 xlat_desc_print(ctx, desc); in xlat_get_mem_attributes_internal() 451 assert(ctx != NULL); in xlat_change_mem_attributes_ctx() 452 assert(ctx->initialized); in xlat_change_mem_attributes_ctx() [all …]
|
/trusted-firmware-a/lib/el3_runtime/aarch64/ |
A D | context_mgmt.c | 78 assert(ctx != NULL); in cm_setup_context() 83 zeromem(ctx, sizeof(*ctx)); in cm_setup_context() 382 sme_enable(ctx); in manage_extensions_nonsecure() 385 sve_enable(ctx); in manage_extensions_nonsecure() 418 sme_enable(ctx); in manage_extensions_secure() 424 sme_disable(ctx); in manage_extensions_secure() 432 sve_enable(ctx); in manage_extensions_secure() 438 sve_disable(ctx); in manage_extensions_secure() 452 cpu_context_t *ctx; in cm_init_context_by_index() local 464 cpu_context_t *ctx; in cm_init_my_context() local [all …]
|
/trusted-firmware-a/drivers/nxp/crypto/caam/src/auth/ |
A D | hash.c | 48 *ctx = &glbl_ctx; in hash_init() 71 ctx->active = false; in hash_update() 78 ctx->active = false; in hash_update() 88 sec_out32(&ctx->sg_tbl[ctx->sg_num].addr_hi, in hash_update() 91 sec_out32(&ctx->sg_tbl[ctx->sg_num].addr_hi, 0x0); in hash_update() 93 sec_out32(&ctx->sg_tbl[ctx->sg_num].addr_lo, (uintptr_t) data_ptr); in hash_update() 95 sec_out32(&ctx->sg_tbl[ctx->sg_num].len_flag, in hash_update() 98 ctx->sg_num++; in hash_update() 129 final = sec_in32(&ctx->sg_tbl[ctx->sg_num - 1].len_flag) | in hash_final() 131 sec_out32(&ctx->sg_tbl[ctx->sg_num - 1].len_flag, final); in hash_final() [all …]
|
A D | rsa.c | 41 struct rsa_context ctx __aligned(CACHE_WRITEBACK_GRANULE); in rsa_public_verif_sec() 47 memset(&ctx, 0, sizeof(struct rsa_context)); in rsa_public_verif_sec() 49 ctx.pkin.a = sign; in rsa_public_verif_sec() 50 ctx.pkin.a_siz = klen; in rsa_public_verif_sec() 51 ctx.pkin.n = rsa_pub_key; in rsa_public_verif_sec() 52 ctx.pkin.n_siz = klen; in rsa_public_verif_sec() 53 ctx.pkin.e = rsa_pub_key + klen; in rsa_public_verif_sec() 54 ctx.pkin.e_siz = klen; in rsa_public_verif_sec() 56 cnstr_jobdesc_pkha_rsaexp(jobdesc.desc, &ctx.pkin, to, klen); in rsa_public_verif_sec() 61 flush_dcache_range((uintptr_t)&ctx.pkin, sizeof(ctx.pkin)); in rsa_public_verif_sec()
|
/trusted-firmware-a/plat/qti/qtiseclib/src/ |
A D | qtiseclib_cb_interface.c | 132 void *ctx; in qtiseclib_cb_get_ns_ctx() local 134 ctx = cm_get_context(NON_SECURE); in qtiseclib_cb_get_ns_ctx() 135 if (ctx) { in qtiseclib_cb_get_ns_ctx() 141 read_ctx_reg(get_el3state_ctx(ctx), CTX_SPSR_EL3); in qtiseclib_cb_get_ns_ctx() 145 read_ctx_reg(get_el1_sysregs_ctx(ctx), CTX_SPSR_EL1); in qtiseclib_cb_get_ns_ctx() 147 read_ctx_reg(get_el1_sysregs_ctx(ctx), CTX_ELR_EL1); in qtiseclib_cb_get_ns_ctx() 150 qti_ns_ctx->x0 = read_ctx_reg(get_gpregs_ctx(ctx), CTX_GPREG_X0); in qtiseclib_cb_get_ns_ctx() 151 qti_ns_ctx->x1 = read_ctx_reg(get_gpregs_ctx(ctx), CTX_GPREG_X1); in qtiseclib_cb_get_ns_ctx() 152 qti_ns_ctx->x2 = read_ctx_reg(get_gpregs_ctx(ctx), CTX_GPREG_X2); in qtiseclib_cb_get_ns_ctx() 153 qti_ns_ctx->x3 = read_ctx_reg(get_gpregs_ctx(ctx), CTX_GPREG_X3); in qtiseclib_cb_get_ns_ctx() [all …]
|
/trusted-firmware-a/lib/xlat_mpu/ |
A D | xlat_mpu_core.c | 181 if (ctx->mmap[ctx->mmap_num - 1].size != 0U) { in mmap_add_region_check() 250 const mmap_region_t *mm_end = ctx->mmap + ctx->mmap_num; in mmap_add_region_ctx() 262 assert(!ctx->initialized); in mmap_add_region_ctx() 274 mm_last = ctx->mmap; in mmap_add_region_ctx() 300 if (end_pa > ctx->max_pa) { in mmap_add_region_ctx() 301 ctx->max_pa = end_pa; in mmap_add_region_ctx() 304 ctx->max_va = end_va; in mmap_add_region_ctx() 322 assert(ctx != NULL); in init_xlat_tables_ctx() 323 assert(!ctx->initialized); in init_xlat_tables_ctx() 364 ctx->initialized = true; in init_xlat_tables_ctx() [all …]
|
A D | xlat_mpu_utils.c | 32 void xlat_tables_print(__unused xlat_ctx_t *ctx) in xlat_tables_print() argument 39 static void xlat_tables_print_internal(__unused xlat_ctx_t *ctx) in xlat_tables_print_internal() argument 78 void xlat_tables_print(__unused xlat_ctx_t *ctx) in xlat_tables_print() argument 80 xlat_tables_print_internal(ctx); in xlat_tables_print()
|
/trusted-firmware-a/drivers/amlogic/crypto/ |
A D | sha_dma.c | 129 if (ctx->started == 0) { in asd_compute_sha() 131 ctx->started = 1; in asd_compute_sha() 135 ctx->started = 0; in asd_compute_sha() 156 if (ctx->blocksz) { in asd_sha_update() 158 memcpy(ctx->block + ctx->blocksz, data, nr); in asd_sha_update() 159 ctx->blocksz += nr; in asd_sha_update() 165 asd_compute_sha(ctx, ctx->block, SHA256_BLOCKSZ, 0); in asd_sha_update() 166 ctx->blocksz = 0; in asd_sha_update() 174 memcpy(ctx->block + ctx->blocksz, data, nr); in asd_sha_update() 175 ctx->blocksz += nr; in asd_sha_update() [all …]
|
/trusted-firmware-a/services/std_svc/spmd/ |
A D | spmd_pm.c | 87 assert(ctx != NULL); in spmd_cpu_on_finish_handler() 88 assert(ctx->state != SPMC_STATE_ON); in spmd_cpu_on_finish_handler() 105 el3_state = get_el3state_ctx(&ctx->cpu_ctx); in spmd_cpu_on_finish_handler() 112 ctx->state = SPMC_STATE_ON_PENDING; in spmd_cpu_on_finish_handler() 114 rc = spmd_spm_core_sync_entry(ctx); in spmd_cpu_on_finish_handler() 118 ctx->state = SPMC_STATE_OFF; in spmd_cpu_on_finish_handler() 122 ctx->state = SPMC_STATE_ON; in spmd_cpu_on_finish_handler() 136 assert(ctx != NULL); in spmd_cpu_off_handler() 137 assert(ctx->state != SPMC_STATE_OFF); in spmd_cpu_off_handler() 142 rc = spmd_spm_core_sync_entry(ctx); in spmd_cpu_off_handler() [all …]
|
A D | spmd_main.c | 132 spmd_spm_core_context_t *ctx = spmd_get_context(); in spmd_spm_core_sync_exit() local 135 assert(cm_get_context(SECURE) == &(ctx->cpu_ctx)); in spmd_spm_core_sync_exit() 142 spmd_spm_core_exit(ctx->c_rt_ctx, rc); in spmd_spm_core_sync_exit() 158 ctx->state = SPMC_STATE_ON_PENDING; in spmd_init() 160 rc = spmd_spm_core_sync_entry(ctx); in spmd_init() 166 ctx->state = SPMC_STATE_ON; in spmd_init() 211 ctx->secure_interrupt_ongoing = true; in spmd_secure_interrupt_handler() 213 rc = spmd_spm_core_sync_entry(ctx); in spmd_secure_interrupt_handler() 218 ctx->secure_interrupt_ongoing = false; in spmd_secure_interrupt_handler() 226 SMC_RET0(&ctx->cpu_ctx); in spmd_secure_interrupt_handler() [all …]
|
/trusted-firmware-a/services/spd/trusty/ |
A D | trusty.c | 159 ctx->fiq_handler_active = 1; in trusty_fiq_handler() 160 (void)memcpy(&ctx->fiq_gpregs, get_gpregs_ctx(handle), sizeof(ctx->fiq_gpregs)); in trusty_fiq_handler() 166 cm_set_elr_spsr_el3(NON_SECURE, ctx->fiq_handler_pc, (uint32_t)ctx->fiq_handler_cpsr); in trusty_fiq_handler() 174 struct trusty_cpu_ctx *ctx; in trusty_set_fiq_handler() local 181 ctx = &trusty_cpu_ctx[cpu]; in trusty_set_fiq_handler() 184 ctx->fiq_handler_sp = stack; in trusty_set_fiq_handler() 194 SMC_RET4(handle, ctx->fiq_pc, ctx->fiq_cpsr, sp_el0, ctx->fiq_sp_el1); in trusty_get_fiq_regs() 222 (void)memcpy(get_gpregs_ctx(handle), &ctx->fiq_gpregs, sizeof(ctx->fiq_gpregs)); in trusty_fiq_exit() 223 ctx->fiq_handler_active = 0; in trusty_fiq_exit() 225 cm_set_elr_spsr_el3(NON_SECURE, ctx->fiq_pc, (uint32_t)ctx->fiq_cpsr); in trusty_fiq_exit() [all …]
|
/trusted-firmware-a/lib/el3_runtime/aarch32/ |
A D | context_mgmt.c | 62 assert(ctx != NULL); in cm_setup_context() 67 zeromem(ctx, sizeof(*ctx)); in cm_setup_context() 69 reg_ctx = get_regs_ctx(ctx); in cm_setup_context() 160 cpu_context_t *ctx; in cm_init_context_by_index() local 162 cm_setup_context(ctx, ep); in cm_init_context_by_index() 172 cpu_context_t *ctx; in cm_init_my_context() local 174 cm_setup_context(ctx, ep); in cm_init_my_context() 188 cpu_context_t *ctx = cm_get_context(security_state); in cm_prepare_el3_exit() local 191 assert(ctx != NULL); in cm_prepare_el3_exit() 194 scr = read_ctx_reg(get_regs_ctx(ctx), CTX_SCR); in cm_prepare_el3_exit() [all …]
|
/trusted-firmware-a/lib/cpus/aarch64/ |
A D | cpuamu.c | 32 struct cpuamu_ctx *ctx = &cpuamu_ctxs[plat_my_core_pos()]; in cpuamu_context_save() local 38 ctx->mask = cpuamu_read_cpuamcntenset_el0(); in cpuamu_context_save() 41 cpuamu_write_cpuamcntenclr_el0(ctx->mask); in cpuamu_context_save() 46 ctx->cnts[i] = cpuamu_cnt_read(i); in cpuamu_context_save() 51 struct cpuamu_ctx *ctx = &cpuamu_ctxs[plat_my_core_pos()]; in cpuamu_context_restore() local 60 cpuamu_write_cpuamcntenclr_el0(ctx->mask); in cpuamu_context_restore() 65 cpuamu_cnt_write(i, ctx->cnts[i]); in cpuamu_context_restore() 69 cpuamu_write_cpuamcntenset_el0(ctx->mask); in cpuamu_context_restore()
|
/trusted-firmware-a/services/std_svc/spm_mm/ |
A D | spm_mm_main.c | 92 assert(ctx != NULL); in spm_sp_synchronous_entry() 95 cm_set_context(&(ctx->cpu_ctx), SECURE); in spm_sp_synchronous_entry() 120 sp_context_t *ctx = &sp_ctx; in spm_sp_synchronous_exit() local 138 sp_context_t *ctx; in spm_init() local 142 ctx = &sp_ctx; in spm_init() 144 ctx->state = SP_STATE_RESET; in spm_init() 146 rc = spm_sp_synchronous_entry(ctx); in spm_init() 149 ctx->state = SP_STATE_IDLE; in spm_init() 161 sp_context_t *ctx; in spm_mm_setup() local 169 ctx = &sp_ctx; in spm_mm_setup() [all …]
|
A D | spm_mm_setup.c | 28 cpu_context_t *ctx = &(sp_ctx->cpu_ctx); in spm_sp_setup() local 66 cm_setup_context(ctx, &ep_info); in spm_sp_setup() 73 write_ctx_reg(get_gpregs_ctx(ctx), CTX_GPREG_SP_EL0, in spm_sp_setup() 124 write_ctx_reg(get_el1_sysregs_ctx(ctx), CTX_MAIR_EL1, in spm_sp_setup() 127 write_ctx_reg(get_el1_sysregs_ctx(ctx), CTX_TCR_EL1, in spm_sp_setup() 130 write_ctx_reg(get_el1_sysregs_ctx(ctx), CTX_TTBR0_EL1, in spm_sp_setup() 134 u_register_t sctlr_el1 = read_ctx_reg(get_el1_sysregs_ctx(ctx), CTX_SCTLR_EL1); in spm_sp_setup() 170 write_ctx_reg(get_el1_sysregs_ctx(ctx), CTX_SCTLR_EL1, sctlr_el1); in spm_sp_setup() 178 write_ctx_reg(get_el1_sysregs_ctx(ctx), CTX_VBAR_EL1, in spm_sp_setup() 181 write_ctx_reg(get_el1_sysregs_ctx(ctx), CTX_CNTKCTL_EL1, in spm_sp_setup() [all …]
|
/trusted-firmware-a/include/drivers/amlogic/crypto/ |
A D | sha_dma.h | 26 static inline void asd_sha_init(struct asd_ctx *ctx, enum ASD_MODE mode) in asd_sha_init() argument 28 ctx->started = 0; in asd_sha_init() 29 ctx->mode = mode; in asd_sha_init() 30 ctx->blocksz = 0; in asd_sha_init() 33 void asd_sha_update(struct asd_ctx *ctx, void *data, size_t len); 34 void asd_sha_finalize(struct asd_ctx *ctx);
|
/trusted-firmware-a/include/lib/el3_runtime/aarch64/ |
A D | context.h | 403 #define read_ctx_reg(ctx, offset) ((ctx)->ctx_regs[(offset) >> DWORD_SHIFT]) argument 404 #define write_ctx_reg(ctx, offset, val) (((ctx)->ctx_regs[(offset) >> DWORD_SHIFT]) \ argument 476 #define set_aapcs_args0(ctx, x0) do { \ argument 479 #define set_aapcs_args1(ctx, x0, x1) do { \ argument 481 set_aapcs_args0(ctx, x0); \ 483 #define set_aapcs_args2(ctx, x0, x1, x2) do { \ argument 485 set_aapcs_args1(ctx, x0, x1); \ 489 set_aapcs_args2(ctx, x0, x1, x2); \ 493 set_aapcs_args3(ctx, x0, x1, x2, x3); \ 497 set_aapcs_args4(ctx, x0, x1, x2, x3, x4); \ [all …]
|
/trusted-firmware-a/lib/extensions/amu/aarch64/ |
A D | amu.c | 229 write_cptr_el3_tam(ctx, 0U); in amu_enable() 444 struct amu_ctx *ctx; in amu_context_save() local 462 ctx = &amu_ctxs_[core_pos]; in amu_context_save() 479 write_amcntenclr0_el0_px(ctx->group0_enable); in amu_context_save() 484 write_amcntenclr1_el0_px(ctx->group1_enable); in amu_context_save() 495 ctx->group0_cnts[i] = amu_group0_cnt_read(i); in amu_context_save() 500 ctx->group1_cnts[i] = amu_group1_cnt_read(i); in amu_context_save() 536 struct amu_ctx *ctx; in amu_context_restore() local 556 ctx = &amu_ctxs_[core_pos]; in amu_context_restore() 585 amu_group0_cnt_write(i, ctx->group0_cnts[i]); in amu_context_restore() [all …]
|
/trusted-firmware-a/services/std_svc/rmmd/ |
A D | rmmd_main.c | 100 assert(cm_get_context(REALM) == &(ctx->cpu_ctx)); in rmmd_rmm_sync_exit() 107 rmmd_rmm_exit(ctx->c_rt_ctx, rc); in rmmd_rmm_sync_exit() 129 ctx->state = RMM_STATE_RESET; in rmm_init() 134 rc = rmmd_rmm_sync_entry(ctx); in rmm_init() 140 ctx->state = RMM_STATE_IDLE; in rmm_init() 248 if (ctx->state == RMM_STATE_RESET) { in rmmd_rmi_handler() 271 rmmd_rmm_context_t *ctx = &rmm_context[linear_id]; in rmmd_cpu_on_finish_handler() local 273 ctx->state = RMM_STATE_RESET; in rmmd_cpu_on_finish_handler() 276 cm_setup_context(&ctx->cpu_ctx, rmm_ep_info); in rmmd_cpu_on_finish_handler() 281 rc = rmmd_rmm_sync_entry(ctx); in rmmd_cpu_on_finish_handler() [all …]
|
/trusted-firmware-a/lib/extensions/amu/aarch32/ |
A D | amu.c | 291 struct amu_ctx *ctx; in amu_context_save() local 307 ctx = &amu_ctxs_[core_pos]; in amu_context_save() 320 ctx->group0_enable = read_amcntenset0_px(); in amu_context_save() 321 write_amcntenclr0_px(ctx->group0_enable); in amu_context_save() 325 ctx->group1_enable = read_amcntenset1_px(); in amu_context_save() 326 write_amcntenclr1_px(ctx->group1_enable); in amu_context_save() 337 ctx->group0_cnts[i] = amu_group0_cnt_read(i); in amu_context_save() 354 struct amu_ctx *ctx; in amu_context_restore() local 371 ctx = &amu_ctxs_[core_pos]; in amu_context_restore() 409 write_amcntenset0_px(ctx->group0_enable); in amu_context_restore() [all …]
|
/trusted-firmware-a/tools/encrypt_fw/src/ |
A D | encrypt.c | 28 EVP_CIPHER_CTX *ctx; in gcm_encrypt() local 79 ctx = EVP_CIPHER_CTX_new(); in gcm_encrypt() 80 if (ctx == NULL) { in gcm_encrypt() 86 ret = EVP_EncryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, NULL, NULL); in gcm_encrypt() 93 ret = EVP_EncryptInit_ex(ctx, NULL, NULL, key, iv); in gcm_encrypt() 100 ret = EVP_EncryptUpdate(ctx, enc_data, &enc_len, data, bytes); in gcm_encrypt() 110 ret = EVP_EncryptFinal_ex(ctx, enc_data, &enc_len); in gcm_encrypt() 117 ret = EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, TAG_SIZE, tag); in gcm_encrypt() 141 EVP_CIPHER_CTX_free(ctx); in gcm_encrypt()
|
/trusted-firmware-a/drivers/nxp/auth/csf_hdr_parser/ |
A D | csf_hdr_parser.c | 52 void *ctx; in deploy_rotpk_hash_table() local 68 ret = hash_init(algo, &ctx); in deploy_rotpk_hash_table() 74 ret = hash_update(algo, ctx, (uint8_t *)((uint8_t *)srk_buffer), in deploy_rotpk_hash_table() 81 ret = hash_final(algo, ctx, hash, digest_size); in deploy_rotpk_hash_table() 109 ret = hash_init(algo, &ctx); in deploy_rotpk_hash_table() 121 ret = hash_final(algo, ctx, rotpk_hash_table[i], digest_size); in deploy_rotpk_hash_table() 144 void *ctx; in calc_img_hash() local 149 ret = hash_init(algo, &ctx); in calc_img_hash() 162 ret = hash_update(algo, ctx, in calc_img_hash() 170 ret = hash_update(algo, ctx, (uint8_t *)(img_addr), img_size); in calc_img_hash() [all …]
|
/trusted-firmware-a/plat/imx/common/ |
A D | plat_imx8_gic.c | 100 void plat_gic_save(unsigned int proc_num, struct plat_gic_ctx *ctx) in plat_gic_save() argument 104 gicv3_rdistif_save(i, &ctx->rdist_ctx[i]); in plat_gic_save() 105 gicv3_distif_save(&ctx->dist_ctx); in plat_gic_save() 108 void plat_gic_restore(unsigned int proc_num, struct plat_gic_ctx *ctx) in plat_gic_restore() argument 111 gicv3_distif_init_restore(&ctx->dist_ctx); in plat_gic_restore() 113 gicv3_rdistif_init_restore(i, &ctx->rdist_ctx[i]); in plat_gic_restore()
|
/trusted-firmware-a/include/lib/xlat_tables/ |
A D | xlat_tables_v2.h | 248 void init_xlat_tables_ctx(xlat_ctx_t *ctx); 255 void xlat_setup_dynamic_ctx(xlat_ctx_t *ctx, unsigned long long pa_max, 268 void mmap_add_region_ctx(xlat_ctx_t *ctx, const mmap_region_t *mm); 276 void mmap_add_ctx(xlat_ctx_t *ctx, const mmap_region_t *mm); 285 void mmap_add_region_alloc_va_ctx(xlat_ctx_t *ctx, mmap_region_t *mm); 308 int mmap_add_dynamic_region_ctx(xlat_ctx_t *ctx, mmap_region_t *mm); 323 int mmap_add_dynamic_region_alloc_va_ctx(xlat_ctx_t *ctx, mmap_region_t *mm); 336 int mmap_remove_dynamic_region_ctx(xlat_ctx_t *ctx, 382 int xlat_change_mem_attributes_ctx(const xlat_ctx_t *ctx, uintptr_t base_va, 411 int xlat_get_mem_attributes_ctx(const xlat_ctx_t *ctx, uintptr_t base_va,
|