mbed-os5 only for TYBLE16
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
Diff: components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/tfm_utils.c
- Revision:
- 0:5b88d5760320
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/tfm_utils.c Tue Dec 17 23:23:45 2019 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018-2019, Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + */ +#include <inttypes.h> +#include <stdio.h> +#include "tfm_utils.h" + +void tfm_panic(void) +{ + while (1) + ; +} + +int32_t tfm_bitcount(uint32_t n) +{ + int32_t count = 0; + uint8_t tmp; + + while (n) { + tmp = n & 0xFF; + while (tmp) { + count += tmp & 0x1; + tmp >>= 1; + } + n >>= 8; + } + + return count; +}