| /optee_os/core/pta/tests/ |
| H A D | lockdep.c | 1 // SPDX-License-Identifier: BSD-2-Clause 20 int count = 1; in self_test_lockdep1() local 30 return count; in self_test_lockdep1() 31 count++; in self_test_lockdep1() 35 return count; in self_test_lockdep1() 36 count++; in self_test_lockdep1() 40 return count; in self_test_lockdep1() 41 count++; in self_test_lockdep1() 45 return count; in self_test_lockdep1() 46 count++; in self_test_lockdep1() [all …]
|
| /optee_os/core/drivers/scmi-msg/ |
| H A D | base.c | 1 // SPDX-License-Identifier: BSD-3-Clause 3 * Copyright (c) 2015-2019, Arm Limited and Contributors. All rights reserved. 8 #include <drivers/scmi-msg.h> 26 if (msg->in_size) { in report_version() 39 /* Null agent count since agent discovery is not supported */ in report_attributes() 43 if (msg->in_size) { in report_attributes() 53 struct scmi_protocol_message_attributes_a2p *in_args = (void *)msg->in; in report_message_attributes() 60 if (msg->in_size != sizeof(*in_args)) { in report_message_attributes() 65 if (!message_id_is_supported(in_args->message_id)) { in report_message_attributes() 80 if (msg->in_size) { in discover_vendor() [all …]
|
| /optee_os/core/drivers/imx/mu/ |
| H A D | imx_mu.c | 1 // SPDX-License-Identifier: BSD-2-Clause 3 * Copyright 2022-2023, 2025 NXP 7 #include <imx-regs.h> 52 unsigned int count = 0; in imx_mu_receive_msg() local 68 memcpy(&msg->header, &response, sizeof(response)); in imx_mu_receive_msg() 71 if (msg->header.size > IMX_MU_MSG_SIZE) { in imx_mu_receive_msg() 78 for (count = 1; count < msg->header.size; count++) { in imx_mu_receive_msg() 79 res = imx_mu_plat_receive(base, count % nb_channel, in imx_mu_receive_msg() 80 &msg->data.u32[count - 1]); in imx_mu_receive_msg() 97 unsigned int count = 0; in imx_mu_send_msg() local [all …]
|
| /optee_os/core/drivers/ |
| H A D | rockchip_otp.c | 1 // SPDX-License-Identifier: BSD-3-Clause 44 uint32_t count) in rockchip_otp_read_secure() argument 58 if (!value || !count || count > BURST_SIZE || in rockchip_otp_read_secure() 59 (index + count > MAX_INDEX)) in rockchip_otp_read_secure() 62 /* Setup read: index, count, command = READ */ in rockchip_otp_read_secure() 64 SHIFT_U32(count, BURST_SHIFT) | in rockchip_otp_read_secure() 97 for (i = 0; i < count; i++) { in rockchip_otp_read_secure() 107 uint32_t count) in rockchip_otp_write_secure() argument 118 if (!value || !count || count > BURST_SIZE || in rockchip_otp_write_secure() 119 (index + count > MAX_INDEX)) in rockchip_otp_write_secure() [all …]
|
| /optee_os/lib/libutils/isoc/arch/arm/softfloat/source/include/ |
| H A D | primitives.h | 1 /* SPDX-License-Identifier: BSD-3-Clause */ 5 This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic 46 /*---------------------------------------------------------------------------- 47 | Shifts `a' right by the number of bits given in `count', which must be in 49 | into the least-significant bit of the shifted value by setting the least- 50 | significant bit to 1. This shifted-and-jammed value is returned. 51 *----------------------------------------------------------------------------*/ 54 uint64_t softfloat_shortShiftRightJam64( uint64_t a, uint_fast8_t count ) in softfloat_shortShiftRightJam64() argument 55 { return a>>count | ((a & (((uint_fast64_t) 1<<count) - 1)) != 0); } in softfloat_shortShiftRightJam64() 57 uint64_t softfloat_shortShiftRightJam64( uint64_t a, uint_fast8_t count ); [all …]
|
| /optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ |
| H A D | s_shiftRightJam128Extra.c | 1 // SPDX-License-Identifier: BSD-3-Clause 5 This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 46 uint64_t a64, uint64_t a0, uint64_t extra, uint_fast32_t count ) in softfloat_shiftRightJam128Extra() argument 51 negCount = -count; in softfloat_shiftRightJam128Extra() 52 if ( count < 64 ) { in softfloat_shiftRightJam128Extra() 53 z.v.v64 = a64>>count; in softfloat_shiftRightJam128Extra() 54 z.v.v0 = a64<<(negCount & 63) | a0>>count; in softfloat_shiftRightJam128Extra() 58 if ( count == 64 ) { in softfloat_shiftRightJam128Extra() 63 if ( count < 128 ) { in softfloat_shiftRightJam128Extra() 64 z.v.v0 = a64>>(count & 63); in softfloat_shiftRightJam128Extra() [all …]
|
| H A D | s_countLeadingZeros64.c | 1 // SPDX-License-Identifier: BSD-3-Clause 5 This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 48 uint_fast8_t count; in softfloat_countLeadingZeros64() local 51 count = 0; in softfloat_countLeadingZeros64() 54 count = 32; in softfloat_countLeadingZeros64() 57 /*------------------------------------------------------------------------ in softfloat_countLeadingZeros64() 58 | From here, result is current count + count leading zeros of `a32'. in softfloat_countLeadingZeros64() 59 *------------------------------------------------------------------------*/ in softfloat_countLeadingZeros64() 61 count += 16; in softfloat_countLeadingZeros64() 65 count += 8; in softfloat_countLeadingZeros64() [all …]
|
| H A D | s_shiftRightJam128.c | 1 // SPDX-License-Identifier: BSD-3-Clause 5 This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 45 softfloat_shiftRightJam128( uint64_t a64, uint64_t a0, uint_fast32_t count ) in softfloat_shiftRightJam128() argument 50 if ( count < 64 ) { in softfloat_shiftRightJam128() 51 negCount = -count; in softfloat_shiftRightJam128() 52 z.v64 = a64>>count; in softfloat_shiftRightJam128() 54 a64<<(negCount & 63) | a0>>count in softfloat_shiftRightJam128() 59 (count < 127) in softfloat_shiftRightJam128() 60 ? a64>>(count & 63) in softfloat_shiftRightJam128() 61 | (((a64 & (((uint_fast64_t) 1<<(count & 63)) - 1)) | a0) in softfloat_shiftRightJam128()
|
| H A D | s_shiftRightJam256M.c | 1 // SPDX-License-Identifier: BSD-3-Clause 5 This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 49 uint_fast8_t count, in softfloat_shortShiftRightJamM() argument 57 negCount = -count; in softfloat_shortShiftRightJamM() 61 partWordZ = wordA>>count; in softfloat_shortShiftRightJamM() 62 if ( partWordZ<<count != wordA ) partWordZ |= 1; in softfloat_shortShiftRightJamM() 67 partWordZ = wordA>>count; in softfloat_shortShiftRightJamM() 75 const uint64_t *aPtr, uint_fast32_t count, uint64_t *zPtr ) in softfloat_shiftRightJam256M() argument 83 wordCount = count>>6; in softfloat_shiftRightJam256M() 91 --i; in softfloat_shiftRightJam256M() [all …]
|
| H A D | s_countLeadingZeros32.c | 1 // SPDX-License-Identifier: BSD-3-Clause 5 This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 48 uint_fast8_t count; in softfloat_countLeadingZeros32() local 50 count = 0; in softfloat_countLeadingZeros32() 52 count = 16; in softfloat_countLeadingZeros32() 56 count += 8; in softfloat_countLeadingZeros32() 59 count += softfloat_countLeadingZeros8[a>>24]; in softfloat_countLeadingZeros32() 60 return count; in softfloat_countLeadingZeros32()
|
| H A D | s_shiftRightJam64Extra.c | 1 // SPDX-License-Identifier: BSD-3-Clause 5 This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 46 uint64_t a, uint64_t extra, uint_fast32_t count ) in softfloat_shiftRightJam64Extra() argument 50 if ( count < 64 ) { in softfloat_shiftRightJam64Extra() 51 z.v = a>>count; in softfloat_shiftRightJam64Extra() 52 z.extra = a<<(-count & 63); in softfloat_shiftRightJam64Extra() 55 z.extra = (count == 64) ? a : (a != 0); in softfloat_shiftRightJam64Extra()
|
| H A D | s_shortShiftRightJamM.c | 1 // SPDX-License-Identifier: BSD-3-Clause 5 This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 48 uint_fast8_t count, in softfloat_shortShiftRightJamM() argument 56 negCount = -count; in softfloat_shortShiftRightJamM() 60 partWordZ = wordA>>count; in softfloat_shortShiftRightJamM() 61 if ( partWordZ<<count != wordA ) partWordZ |= 1; in softfloat_shortShiftRightJamM() 66 partWordZ = wordA>>count; in softfloat_shortShiftRightJamM()
|
| /optee_os/ta/pkcs11/src/ |
| H A D | processing_rsa.c | 1 // SPDX-License-Identifier: BSD-2-Clause 3 * Copyright (c) 2018-2021, Linaro Limited 28 serialargs_init(&args, proc_params->data, proc_params->size); in pkcs2tee_proc_params_rsa_pss() 45 proc->extra_ctx = TEE_Malloc(sizeof(struct rsa_pss_processing_ctx), in pkcs2tee_proc_params_rsa_pss() 47 if (!proc->extra_ctx) in pkcs2tee_proc_params_rsa_pss() 50 ctx = proc->extra_ctx; in pkcs2tee_proc_params_rsa_pss() 52 ctx->hash_alg = hash; in pkcs2tee_proc_params_rsa_pss() 53 ctx->mgf_type = mgf; in pkcs2tee_proc_params_rsa_pss() 54 ctx->salt_len = salt_len; in pkcs2tee_proc_params_rsa_pss() 67 rsa_pss_ctx = proc->extra_ctx; in pkcs2tee_validate_rsa_pss() [all …]
|
| H A D | persistent_token.c | 1 // SPDX-License-Identifier: BSD-2-Clause 3 * Copyright (c) 2018-2020, Linaro Limited 64 res = TEE_WriteObjectData(db_hdl, token->db_main, in update_persistent_db() 65 sizeof(*token->db_main)); in update_persistent_db() 94 memset(hash + sz, 0, TEE_MAX_HASH_SIZE - sz); in do_hash() 145 TEE_MemMove(&token->db_main->so_identity, &identity, sizeof(identity)); in setup_so_identity_auth_from_client() 146 token->db_main->flags |= PKCS11_CKFT_PROTECTED_AUTHENTICATION_PATH; in setup_so_identity_auth_from_client() 148 token->db_main->so_pin_salt = 0; in setup_so_identity_auth_from_client() 165 assert(token->db_main->flags & in setup_identity_auth_from_pin() 197 EMSG("Invalid PIN ACL string - login"); in setup_identity_auth_from_pin() [all …]
|
| H A D | attributes.c | 1 // SPDX-License-Identifier: BSD-2-Clause 3 * Copyright (c) 2017-2020, Linaro Limited 33 size_t buf_len = sizeof(struct obj_attrs) + (*head)->attrs_size; in add_attribute() 54 (*head)->attrs_size += 2 * sizeof(uint32_t) + size; in add_attribute() 55 (*head)->attrs_count++; in add_attribute() 70 end = cur + h->attrs_size; in _remove_attribute() 83 TEE_MemMove(cur, cur + next_off, end - (cur + next_off)); in _remove_attribute() 85 h->attrs_count--; in _remove_attribute() 86 h->attrs_size -= next_off; in _remove_attribute() 87 end -= next_off; in _remove_attribute() [all …]
|
| H A D | processing_ec.c | 1 // SPDX-License-Identifier: BSD-2-Clause 3 * Copyright (c) 2017-2020, Linaro Limited 250 * - as a PrintableString 'edwards25519' or 'edwards448' 251 * - as an OID, DER encoded ASN.1 Object 284 .label_size = sizeof(#_label) - 1, \ 304 if (size == curve->oid_size && in get_curve() 305 !TEE_MemCompare(attr, curve->oid_der, curve->oid_size)) in get_curve() 308 if (size == curve->name_size && in get_curve() 309 !TEE_MemCompare(attr, curve->name_der, curve->name_size)) in get_curve() 323 return curve->key_size; in ec_params2tee_keysize() [all …]
|
| /optee_os/lib/libutils/isoc/newlib/ |
| H A D | strncpy.c | 1 // SPDX-License-Identifier: BSD-3-Clause 3 * Copyright (c) 1994-2009 Red Hat, Inc. 35 <<strncpy>>---counted copy string 82 (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) 85 #define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) 89 #define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) 105 size_t count) 113 while (count > 0) 115 --count; 119 while (count-- > 0) [all …]
|
| /optee_os/ta/avb/ |
| H A D | entry.c | 1 // SPDX-License-Identifier: BSD-2-Clause 80 size_t count; in read_rb_idx() local 99 res = TEE_ReadObjectData(h, &idx, sizeof(idx), &count); in read_rb_idx() 102 if (count != sizeof(idx)) { in read_rb_idx() 105 if (count) { in read_rb_idx() 136 size_t count; in write_rb_idx() local 156 res = TEE_ReadObjectData(h, &idx, sizeof(idx), &count); in write_rb_idx() 159 if (count != sizeof(idx)) in write_rb_idx() 184 size_t count; in read_lock_state() local 195 res = TEE_ReadObjectData(h, &lock_state, sizeof(lock_state), &count); in read_lock_state() [all …]
|
| /optee_os/ldelf/ |
| H A D | ftrace.c | 1 // SPDX-License-Identifier: BSD-2-Clause 28 int count = 0; in ftrace_init() local 40 assert(elf && elf->is_main); in ftrace_init() 42 if (SUB_OVERFLOW(finfo->buf_end.ptr64, finfo->buf_start.ptr64, in ftrace_init() 51 fbuf = (struct ftrace_buf *)(vaddr_t)finfo->buf_start.ptr64; in ftrace_init() 52 fbuf->head_off = sizeof(struct ftrace_buf); in ftrace_init() 53 p = (char *)fbuf + fbuf->head_off; in ftrace_init() 54 count = snprintk(p, MAX_HEADER_STRLEN, in ftrace_init() 56 (void *)&elf->uuid, elf->load_addr); in ftrace_init() 57 assert(count < MAX_HEADER_STRLEN); in ftrace_init() [all …]
|
| /optee_os/core/include/drivers/ |
| H A D | rockchip_otp.h | 1 /* SPDX-License-Identifier: BSD-2-Clause */ 16 * @count number of 32 bit words to read 19 uint32_t count); 26 * @count number of 32 bit words to write 29 uint32_t count);
|
| H A D | stm32_gpio.h | 1 /* SPDX-License-Identifier: BSD-3-Clause */ 3 * Copyright (c) 2017-2023, STMicroelectronics 25 * @count: [in] Number of cells of @bank and @pin, [out] pin count in @pinctrl 29 unsigned int *count); 32 * stm32_gpio_chip_bank_id() - Get the GPIO bank ID associated to a chip 40 unsigned int *count __unused) in stm32_gpio_pinctrl_bank_pin()
|
| /optee_os/ta/pkcs11/scripts/ |
| H A D | verify-helpers.sh | 2 # SPDX-License-Identifier: BSD-2-Clause 6 basepath="$(dirname $(dirname $(readlink -f "$0")))" 8 details () [[ ${SHOW_DETAILS} -ne 0 ]] 12 SYMBOL_LIST="$(grep PKCS11\_$PREFIX\_ ${basepath}/include/pkcs11_ta.h | cut -f2 | cut '-d ' -f1)" 13 details && echo -e "\e[4m${PREFIX}\e[0m" 15 details && echo -e "symbol\tuses\tstatus" 17 details && echo -n "$symbol" 18 COUNT="$(grep ${symbol} ${basepath}/src/* | wc -l)" 19 details && echo -n -e "\t${COUNT}\t" 20 PRESENT="$(grep PKCS11_ID.*\($symbol.*\) ${basepath}/src/pkcs11_helpers.c | wc -l)" [all …]
|
| /optee_os/core/kernel/ |
| H A D | pm.c | 1 // SPDX-License-Identifier: BSD-2-Clause 21 static const char no_name[] = "no-name"; 27 (!is_unpaged((void *)(vaddr_t)pm_hdl->callback) || in verify_cb_args() 28 (pm_hdl->handle && !is_unpaged(pm_hdl->handle)))) { in verify_cb_args() 30 (void *)(vaddr_t)pm_hdl->callback, pm_hdl->handle); in verify_cb_args() 38 const char *name = pm_hdl->name; in register_pm_cb() 39 size_t count = pm_cb_count; in register_pm_cb() local 55 ref = realloc(pm_cb_ref, sizeof(*ref) * (count + 1)); in register_pm_cb() 59 ref[count] = *pm_hdl; in register_pm_cb() 60 ref[count].flags = 0; in register_pm_cb() [all …]
|
| /optee_os/core/tests/ |
| H A D | notif_test_wd.c | 1 // SPDX-License-Identifier: BSD-2-Clause 41 if (wd->pending) in test_wd_callback() 42 wd->timeout_count++; in test_wd_callback() 43 wd->call_count++; in test_wd_callback() 44 if (wd->call_count < 10 || !(wd->call_count % 60) || wd->pending) { in test_wd_callback() 47 wd->guest_id, wd->call_count, wd->timeout_count); in test_wd_callback() 50 wd->call_count, wd->timeout_count); in test_wd_callback() 52 wd->pending = true; in test_wd_callback() 53 notif_send_async(NOTIF_VALUE_DO_BOTTOM_HALF, wd->guest_id); in test_wd_callback() 65 if (!wd->enabled) { in wd_ndrv_atomic_cb() [all …]
|
| /optee_os/core/lib/zlib/ |
| H A D | inftrees.c | 1 // SPDX-License-Identifier: Zlib 2 /* inftrees.c -- generate Huffman trees for efficient decoding 3 * Copyright (C) 1995-2022 Mark Adler 13 " inflate 1.2.12 Copyright 1995-2022 Mark Adler "; 23 The code lengths are lens[0..codes-1]. The result starts at *table, 24 whose indices are 0..2^bits-1. work is a writable array of at least 27 -1 is an invalid code, and +1 means that ENOUGH isn't enough. table 46 unsigned drop; /* code bits to drop for sub-table */ 59 unsigned short count[MAXBITS+1]; /* number of codes of each length */ local 78 code lengths are lens[0..codes-1]. Each length corresponds to the [all …]
|