Build: Major warnings cleanup
This is a major type-mismatch cleanup and warnings elimination.
The IAR toolchain runs with more warnings enabled than ARMCLANG or
GNUARM, which has resulted in this effort.
This should make it easier to enable "pedantic" mode also for GNUARM.
There are still a few warnings about jumping past variable
initialization and falling off the end of non-void functions, but there
are comments in some of these parts that implies that this is done to
catch programming errors, like having case labels for all possible enum
values.
Reordered initializer in tfm_attestation_req_mngr.c to eliminate CI
warning.
Disabled "Pe940" warnings in CommonConfig.cmake to suppress warnings
about inline assembly functions declared to return value that doesn't
declare a return value in the __ASM() statement.
Disabled "Pe546" warnings to supress warnings about jumping over
unused initializers.
Fixed what appears to be a copy/paste bug in tfm_ss_core_test.c.
Removed unused variable "ret" in Driver_PPC.c for AN519 and AN521, to
make it similar to AN524.
Signed-off-by: TTornblom <thomas.tornblom@iar.com>
Change-Id: I2b729c73e4b004cff6b0530cc1350fcf900e4272
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index 0763abc..86a7bf9 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -137,7 +137,7 @@
include("Common/FindIARARM")
include("Common/${IARARM_MODULE}")
- set (COMMON_COMPILE_FLAGS -e --dlib_config=full --vla --silent -DNO_TYPEOF ${CMSE_FLAGS})
+ set (COMMON_COMPILE_FLAGS -e --dlib_config=full --vla --silent -DNO_TYPEOF ${CMSE_FLAGS} --diag_suppress Pe546,Pe940)
##Shared compiler and linker settings.
function(config_setting_shared_compiler_flags tgt)
embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS ${COMMON_COMPILE_FLAGS} "-DImage$$= " "-DLoad$$LR$$= " "-D$$ZI$$Base=$$Base" "-D$$ZI$$Limit=$$Limit" "-D$$RO$$Base=$$Base" "-D$$RO$$Limit=$$Limit" "-D$$RW$$Base=$$Base" "-D$$RW$$Limit=$$Limit" "-D_DATA$$RW$$Base=_DATA$$Base" "-D_DATA$$RW$$Limit=_DATA$$Limit" "-D_DATA$$ZI$$Base=_DATA$$Base" "-D_DATA$$ZI$$Limit=_DATA$$Limit" "-D_STACK$$ZI$$Base=_STACK$$Base" "-D_STACK$$ZI$$Limit=_STACK$$Limit" )
diff --git a/app/main_ns.c b/app/main_ns.c
index 9cc31c9..3739db4 100644
--- a/app/main_ns.c
+++ b/app/main_ns.c
@@ -74,9 +74,9 @@
* \brief Static globals to hold RTOS related quantities,
* main thread
*/
-static osStatus_t status;
-static osThreadId_t thread_id;
+#if defined(TEST_FRAMEWORK_NS) || defined(PSA_API_TEST_NS)
static osThreadFunc_t thread_func;
+#endif
#ifdef TFM_MULTI_CORE_TOPOLOGY
static struct ns_mailbox_queue_t ns_mailbox_queue;
@@ -184,7 +184,7 @@
tfm_ns_multi_core_boot();
#endif
- status = osKernelInitialize();
+ (void) osKernelInitialize();
/* Initialize the TFM NS interface */
tfm_ns_interface_init();
@@ -196,14 +196,11 @@
#endif
#if defined(TEST_FRAMEWORK_NS) || defined(PSA_API_TEST_NS)
- thread_id = osThreadNew(thread_func, NULL, &thread_attr);
-#else
- UNUSED_VARIABLE(thread_id);
- UNUSED_VARIABLE(thread_func);
+ (void) osThreadNew(thread_func, NULL, &thread_attr);
#endif
LOG_MSG("Non-Secure system starting...\r\n");
- status = osKernelStart();
+ (void) osKernelStart();
/* Reached only in case of error */
for (;;) {
diff --git a/bl2/ext/mcuboot/bootutil/src/loader.c b/bl2/ext/mcuboot/bootutil/src/loader.c
index 2807d0b..6aecfce 100644
--- a/bl2/ext/mcuboot/bootutil/src/loader.c
+++ b/bl2/ext/mcuboot/bootutil/src/loader.c
@@ -55,7 +55,8 @@
#define IMAGES_ITER(x)
#endif
-#if !defined(MCUBOOT_NO_SWAP) && !defined(MCUBOOT_RAM_LOADING)
+#if !defined(MCUBOOT_NO_SWAP) && !defined(MCUBOOT_RAM_LOADING) && !defined(MCUBOOT_OVERWRITE_ONLY)
+
#if defined(MCUBOOT_VALIDATE_PRIMARY_SLOT) && !defined(MCUBOOT_OVERWRITE_ONLY)
static int boot_status_fails = 0;
@@ -159,7 +160,7 @@
(state)->swap_type, \
(state)->copy_done, \
(state)->image_ok)
-#endif /* !MCUBOOT_NO_SWAP && !MCUBOOT_RAM_LOADING */
+#endif /* !MCUBOOT_NO_SWAP && !MCUBOOT_RAM_LOADING && !defined(MCUBOOT_OVERWRITE_ONLY) */
/*
* \brief Verifies the image header: magic value, flags, integer overflow.
@@ -599,7 +600,8 @@
}
#endif /* !MCUBOOT_NO_SWAP && !MCUBOOT_OVERWRITE_ONLY */
-#if !defined(MCUBOOT_NO_SWAP) && !defined(MCUBOOT_RAM_LOADING)
+#if !defined(MCUBOOT_NO_SWAP) && !defined(MCUBOOT_RAM_LOADING) && !defined(MCUBOOT_OVERWRITE_ONLY)
+
/**
* Determines where in flash the most recent boot status is stored. The boot
* status is necessary for completing a swap that was interrupted by a boot
@@ -860,13 +862,6 @@
static int
boot_read_status(struct boot_loader_state *state, struct boot_status *bs)
{
- const struct flash_area *fap;
- uint32_t off;
- uint8_t swap_info;
- int status_loc;
- int area_id;
- int rc;
-
memset(bs, 0, sizeof *bs);
bs->idx = BOOT_STATUS_IDX_0;
bs->state = BOOT_STATUS_STATE_0;
@@ -875,7 +870,13 @@
#ifdef MCUBOOT_OVERWRITE_ONLY
/* Overwrite-only doesn't make use of the swap status area. */
return 0;
-#endif
+#else
+ const struct flash_area *fap;
+ uint32_t off;
+ uint8_t swap_info;
+ int status_loc;
+ int area_id;
+ int rc;
status_loc = boot_status_source(state);
switch (status_loc) {
@@ -916,6 +917,7 @@
flash_area_close(fap);
return rc;
+#endif
}
/**
diff --git a/lib/ext/qcbor/test/float_tests.c b/lib/ext/qcbor/test/float_tests.c
index 5fd320b..aaf7f49 100644
--- a/lib/ext/qcbor/test/float_tests.c
+++ b/lib/ext/qcbor/test/float_tests.c
@@ -82,7 +82,7 @@
UsefulBufC HalfPrecision = UsefulBuf_FROM_BYTE_ARRAY_LITERAL(spExpectedHalf);
QCBORDecodeContext DC;
- QCBORDecode_Init(&DC, HalfPrecision, 0);
+ QCBORDecode_Init(&DC, HalfPrecision, QCBOR_DECODE_MODE_NORMAL);
QCBORItem Item;
@@ -210,7 +210,7 @@
// Now parse the hand-constructed CBOR. This will invoke the
// conversion to a float
QCBORDecodeContext DC;
- QCBORDecode_Init(&DC, UsefulOutBuf_OutUBuf(&UOB), 0);
+ QCBORDecode_Init(&DC, UsefulOutBuf_OutUBuf(&UOB), QCBOR_DECODE_MODE_NORMAL);
QCBORItem Item;
diff --git a/lib/ext/qcbor/test/qcbor_decode_tests.c b/lib/ext/qcbor/test/qcbor_decode_tests.c
index a9e1fb2..e185617 100644
--- a/lib/ext/qcbor/test/qcbor_decode_tests.c
+++ b/lib/ext/qcbor/test/qcbor_decode_tests.c
@@ -2080,7 +2080,6 @@
{
QCBORDecodeContext DCtx;
QCBORItem Item;
- int nCBORError;
QCBORDecode_Init(&DCtx,
UsefulBuf_FROM_BYTE_ARRAY_LITERAL(spDateTestInput),
@@ -2092,7 +2091,7 @@
QCBORDecode_SetCallerConfiguredTagList(&DCtx, &TagList);
// String date
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -1;
if(Item.uDataType != QCBOR_TYPE_DATE_STRING ||
UsefulBuf_Compare(Item.val.dateString, UsefulBuf_FromSZ("1985-04-12"))){
@@ -2100,7 +2099,7 @@
}
// Epoch date
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -3;
if(Item.uDataType != QCBOR_TYPE_DATE_EPOCH ||
Item.val.epochDate.nSeconds != 1400000000 ||
@@ -2110,7 +2109,7 @@
// Epoch date with extra CBOR_TAG_B64 tag that doesn't really mean anything
// but want to be sure extra tag doesn't cause a problem
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -5;
if(Item.uDataType != QCBOR_TYPE_DATE_EPOCH ||
Item.val.epochDate.nSeconds != 1400000001 ||
@@ -2125,7 +2124,7 @@
}
// Epoch date in float format with fractional seconds
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -8;
if(Item.uDataType != QCBOR_TYPE_DATE_EPOCH ||
Item.val.epochDate.nSeconds != 1 ||
@@ -2550,7 +2549,6 @@
{
QCBORDecodeContext DCtx;
QCBORItem Item;
- int nCBORError;
QCBORDecode_Init(&DCtx,
UsefulBuf_FROM_BYTE_ARRAY_LITERAL(spBigNumInput),
@@ -2558,14 +2556,14 @@
//
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -1;
if(Item.uDataType != QCBOR_TYPE_ARRAY) {
return -1;
}
//
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -1;
if(Item.uDataType != QCBOR_TYPE_POSBIGNUM ||
UsefulBuf_Compare(Item.val.bigNum, UsefulBuf_FROM_BYTE_ARRAY_LITERAL(spBigNum))){
@@ -2573,7 +2571,7 @@
}
//
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -1;
if(Item.uDataType != QCBOR_TYPE_NEGBIGNUM ||
UsefulBuf_Compare(Item.val.bigNum, UsefulBuf_FROM_BYTE_ARRAY_LITERAL(spBigNum))){
@@ -2581,13 +2579,13 @@
}
//
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -1;
if(Item.uDataType != QCBOR_TYPE_MAP) {
return -1;
}
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -1;
if(Item.uDataType != QCBOR_TYPE_POSBIGNUM ||
Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
@@ -2595,7 +2593,7 @@
return -1;
}
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -1;
if(Item.uDataType != QCBOR_TYPE_POSBIGNUM ||
Item.uLabelType != QCBOR_TYPE_INT64 ||
@@ -2604,7 +2602,7 @@
return -1;
}
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -1;
if(Item.uDataType != QCBOR_TYPE_NEGBIGNUM ||
Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
@@ -2612,7 +2610,7 @@
return -1;
}
- if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
+ if(QCBORDecode_GetNext(&DCtx, &Item))
return -1;
if(Item.uDataType != QCBOR_TYPE_NEGBIGNUM ||
Item.uLabelType != QCBOR_TYPE_INT64 ||
@@ -2634,9 +2632,8 @@
QCBORItem *pItem)
{
QCBORItem Item;
- int nCBORError;
- if((nCBORError = QCBORDecode_GetNext(pCtx, &Item))) return -1;
+ if(QCBORDecode_GetNext(pCtx, &Item)) return -1;
if(Item.uDataType != uDataType) return -1;
if(uNestingLevel > 0) {
if(Item.uLabelType != QCBOR_TYPE_INT64 &&
@@ -2811,7 +2808,7 @@
static int32_t parse_indeflen_nested(UsefulBufC Nested, int nNestLevel)
{
QCBORDecodeContext DC;
- QCBORDecode_Init(&DC, Nested, 0);
+ QCBORDecode_Init(&DC, Nested, QCBOR_DECODE_MODE_NORMAL);
int j;
for(j = 0; j < nNestLevel; j++) {
@@ -3421,7 +3418,8 @@
// nothing can be done with it unless that is set up.
QCBORDecodeContext DC;
const uint8_t pMinimalCBOR[] = {0xa0}; // One empty map
- QCBORDecode_Init(&DC, UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pMinimalCBOR),0);
+ QCBORDecode_Init(&DC, UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pMinimalCBOR),
+ QCBOR_DECODE_MODE_NORMAL);
// Set up an memory pool of 100 bytes
// Then fish into the internals of the decode context
@@ -3519,7 +3517,8 @@
// nothing can be done with it unless that is set up.
QCBORDecodeContext DC;
const uint8_t pMinimalCBOR[] = {0x62, 0x48, 0x69}; // "Hi"
- QCBORDecode_Init(&DC, UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pMinimalCBOR),0);
+ QCBORDecode_Init(&DC, UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pMinimalCBOR),
+ QCBOR_DECODE_MODE_NORMAL);
uint8_t pAllocatorBuffer[50];
diff --git a/lib/ext/t_cose/src/t_cose_parameters.c b/lib/ext/t_cose/src/t_cose_parameters.c
index a2a5cf4..528e22c 100644
--- a/lib/ext/t_cose/src/t_cose_parameters.c
+++ b/lib/ext/t_cose/src/t_cose_parameters.c
@@ -1,7 +1,7 @@
/*
* t_cose_parameters.c
*
- * Copyright 2019, Laurence Lundblade
+ * Copyright 2019-2020, Laurence Lundblade
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -583,7 +583,7 @@
QCBORDecodeContext decode_context;
enum t_cose_err_t return_value;
- QCBORDecode_Init(&decode_context, encoded_protected_parameters, 0);
+ QCBORDecode_Init(&decode_context, encoded_protected_parameters, QCBOR_DECODE_MODE_NORMAL);
return_value = parse_cose_header_parameters(&decode_context,
returned_params,
diff --git a/lib/ext/t_cose/test/t_cose_test.c b/lib/ext/t_cose/test/t_cose_test.c
index eae4760..3b973ee 100644
--- a/lib/ext/t_cose/test/t_cose_test.c
+++ b/lib/ext/t_cose/test/t_cose_test.c
@@ -539,7 +539,7 @@
signed_cose_buffer,
&signed_cose);
if(return_value) {
- return 2000 + return_value;
+ return ((enum t_cose_err_t) (2000 + return_value));
}
/* --- Done making COSE Sign1 object --- */
@@ -706,7 +706,7 @@
{T_COSE_TEST_BAD_PROTECTED, T_COSE_ERR_PARAMETER_CBOR},
- {0, 0}
+ {0, T_COSE_SUCCESS}
};
@@ -760,7 +760,7 @@
{T_COSE_TEST_TOO_MANY_TSTR_CRIT_LABLELS, T_COSE_ERR_CRIT_PARAMETER},
- {0, 0}
+ {0, T_COSE_SUCCESS}
};
@@ -906,7 +906,7 @@
/* Just one not-well-formed byte -- a reserved value */
{ {(uint8_t[]){0x3c}, 1}, T_COSE_ERR_SIGN1_FORMAT },
/* terminate the list */
- { {NULL, 0}, 0 },
+ { {NULL, 0}, T_COSE_SUCCESS },
};
diff --git a/platform/ext/target/cypress/psoc64/CMSIS_Driver/Driver_USART.c b/platform/ext/target/cypress/psoc64/CMSIS_Driver/Driver_USART.c
index 4890afb..6ddb7c5 100644
--- a/platform/ext/target/cypress/psoc64/CMSIS_Driver/Driver_USART.c
+++ b/platform/ext/target/cypress/psoc64/CMSIS_Driver/Driver_USART.c
@@ -207,7 +207,7 @@
return uart_dev->rx_nbr_bytes;
}
-static uint32_t USARTx_SetDataBits(uint32_t control,
+static int32_t USARTx_SetDataBits(uint32_t control,
cy_stc_scb_uart_config_t *config)
{
switch (control & ARM_USART_DATA_BITS_Msk) {
@@ -238,7 +238,7 @@
return ARM_DRIVER_OK;
}
-static uint32_t USARTx_SetParity(uint32_t control,
+static int32_t USARTx_SetParity(uint32_t control,
cy_stc_scb_uart_config_t *config)
{
switch (control & ARM_USART_PARITY_Msk) {
@@ -261,7 +261,7 @@
return ARM_DRIVER_OK;
}
-static uint32_t USARTx_SetStopBits(uint32_t control,
+static int32_t USARTx_SetStopBits(uint32_t control,
cy_stc_scb_uart_config_t *config)
{
switch (control & ARM_USART_STOP_BITS_Msk) {
diff --git a/platform/ext/target/cypress/psoc64/smpu_config.h b/platform/ext/target/cypress/psoc64/smpu_config.h
index 236fc67..c6df71a 100644
--- a/platform/ext/target/cypress/psoc64/smpu_config.h
+++ b/platform/ext/target/cypress/psoc64/smpu_config.h
@@ -47,7 +47,7 @@
CY_PROT_SUBREGION_DIS7)
#define SMPU0_SLAVE_CONFIG {\
.address = (void *)SMPU0_BASE, \
- .regionSize = SMPU0_REGIONSIZE, \
+ .regionSize = (cy_en_prot_size_t) SMPU0_REGIONSIZE, \
.subregions = SMPU0_SUBREGION_DIS, \
.userPermission = CY_PROT_PERM_RWX, \
.privPermission = CY_PROT_PERM_RWX, \
@@ -74,7 +74,7 @@
#define SMPU1_REGIONSIZE PROT_SIZE_16KB_BIT_SHIFT
#define SMPU1_SLAVE_CONFIG {\
.address = (void *)SMPU1_BASE, \
- .regionSize = SMPU1_REGIONSIZE, \
+ .regionSize = (cy_en_prot_size_t) SMPU1_REGIONSIZE, \
.subregions = ALL_ENABLED, \
.userPermission = CY_PROT_PERM_RW, \
.privPermission = CY_PROT_PERM_RW, \
@@ -99,7 +99,7 @@
#define SMPU2_REGIONSIZE PROT_SIZE_512B_BIT_SHIFT
#define SMPU2_SLAVE_CONFIG {\
.address = (void *)SMPU2_BASE, \
- .regionSize = SMPU2_REGIONSIZE, \
+ .regionSize = (cy_en_prot_size_t) SMPU2_REGIONSIZE, \
.subregions = ALL_ENABLED, \
.userPermission = CY_PROT_PERM_RW, \
.privPermission = CY_PROT_PERM_RW, \
@@ -127,7 +127,7 @@
CY_PROT_SUBREGION_DIS2)
#define SMPU3_SLAVE_CONFIG {\
.address = (void *)SMPU3_BASE, \
- .regionSize = SMPU3_REGIONSIZE, \
+ .regionSize = (cy_en_prot_size_t) SMPU3_REGIONSIZE, \
.subregions = SMPU3_SUBREGION_DIS, \
.userPermission = CY_PROT_PERM_RW, \
.privPermission = CY_PROT_PERM_RW, \
@@ -161,7 +161,7 @@
#define SMPU6_REGIONSIZE PROT_SIZE_32KB_BIT_SHIFT
#define SMPU6_SLAVE_CONFIG {\
.address = (void *)SMPU6_BASE, \
- .regionSize = SMPU6_REGIONSIZE, \
+ .regionSize = (cy_en_prot_size_t) SMPU6_REGIONSIZE, \
.subregions = ALL_ENABLED, \
.userPermission = CY_PROT_PERM_RW, \
.privPermission = CY_PROT_PERM_RW, \
@@ -188,7 +188,7 @@
CY_PROT_SUBREGION_DIS1)
#define SMPU7_SLAVE_CONFIG {\
.address = (void *)SMPU7_BASE, \
- .regionSize = SMPU7_REGIONSIZE, \
+ .regionSize = (cy_en_prot_size_t) SMPU7_REGIONSIZE, \
.subregions = SMPU7_SUBREGION_DIS, \
.userPermission = CY_PROT_PERM_DISABLED, \
.privPermission = CY_PROT_PERM_RW, \
diff --git a/platform/ext/target/cypress/psoc64/spm_hal.c b/platform/ext/target/cypress/psoc64/spm_hal.c
index 62dc8a7..f181c1f 100644
--- a/platform/ext/target/cypress/psoc64/spm_hal.c
+++ b/platform/ext/target/cypress/psoc64/spm_hal.c
@@ -244,7 +244,7 @@
IPC_TX_NOTIFY_MASK, IPC_SYNC_MAGIC);
while (1)
{
- status = Cy_IPC_Drv_GetInterruptStatusMasked(
+ status = (cy_en_ipcdrv_status_t) Cy_IPC_Drv_GetInterruptStatusMasked(
Cy_IPC_Drv_GetIntrBaseAddr(IPC_RX_INTR_STRUCT));
status >>= CY_IPC_NOTIFY_SHIFT;
if (status & IPC_RX_INT_MASK) {
@@ -267,7 +267,7 @@
}
}
-enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(int32_t irq_line,
+enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(IRQn_Type irq_line,
uint32_t priority)
{
uint32_t quantized_priority = priority >> (8U - __NVIC_PRIO_BITS);
@@ -345,23 +345,23 @@
return nvic_interrupt_enable();
}
-void tfm_spm_hal_clear_pending_irq(int32_t irq_line)
+void tfm_spm_hal_clear_pending_irq(IRQn_Type irq_line)
{
NVIC_ClearPendingIRQ(irq_line);
}
-void tfm_spm_hal_enable_irq(int32_t irq_line)
+void tfm_spm_hal_enable_irq(IRQn_Type irq_line)
{
NVIC_EnableIRQ(irq_line);
}
-void tfm_spm_hal_disable_irq(int32_t irq_line)
+void tfm_spm_hal_disable_irq(IRQn_Type irq_line)
{
NVIC_DisableIRQ(irq_line);
}
enum irq_target_state_t tfm_spm_hal_set_irq_target_state(
- int32_t irq_line,
+ IRQn_Type irq_line,
enum irq_target_state_t target_state)
{
(void)irq_line;
diff --git a/platform/ext/target/cypress/psoc64/target_cfg.c b/platform/ext/target/cypress/psoc64/target_cfg.c
index 99c341e..9014a35 100644
--- a/platform/ext/target/cypress/psoc64/target_cfg.c
+++ b/platform/ext/target/cypress/psoc64/target_cfg.c
@@ -1184,14 +1184,11 @@
void ppu_init_cfg(void)
{
- cy_en_prot_status_t ret;
- (void)ret;
-
size_t n = sizeof(ppu_init_table)/sizeof(ppu_init_table[0]);
for (int i = 0; i < n; i++)
{
- ret = PPU_Configure(ppu_init_table[i]);
+ cy_en_prot_status_t ret = PPU_Configure(ppu_init_table[i]);
assert(ret == CY_PROT_SUCCESS);
}
diff --git a/platform/ext/target/mps2/an519/cmsis_drivers/Driver_PPC.c b/platform/ext/target/mps2/an519/cmsis_drivers/Driver_PPC.c
index 9787d05..fc198a2 100644
--- a/platform/ext/target/mps2/an519/cmsis_drivers/Driver_PPC.c
+++ b/platform/ext/target/mps2/an519/cmsis_drivers/Driver_PPC.c
@@ -734,11 +734,9 @@
ARM_PPC_SecAttr sec_attr,
ARM_PPC_PrivAttr priv_attr)
{
- enum ppc_sse200_error_t ret;
-
- ret = ppc_sse200_config_peripheral(&APB_PPCEXP2_DEV_S, periph,
- (enum ppc_sse200_sec_attr_t)sec_attr,
- (enum ppc_sse200_priv_attr_t)priv_attr);
+ ppc_sse200_config_peripheral(&APB_PPCEXP2_DEV_S, periph,
+ (enum ppc_sse200_sec_attr_t)sec_attr,
+ (enum ppc_sse200_priv_attr_t)priv_attr);
return ARM_DRIVER_OK;
}
diff --git a/platform/ext/target/mps2/an519/spm_hal.c b/platform/ext/target/mps2/an519/spm_hal.c
index 22f8758..8d0514d 100644
--- a/platform/ext/target/mps2/an519/spm_hal.c
+++ b/platform/ext/target/mps2/an519/spm_hal.c
@@ -228,7 +228,7 @@
return *((uint32_t *)(memory_regions.non_secure_code_start+ 4));
}
-enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(int32_t irq_line,
+enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(IRQn_Type irq_line,
uint32_t priority)
{
uint32_t quantized_priority = priority >> (8U - __NVIC_PRIO_BITS);
@@ -236,23 +236,23 @@
return TFM_PLAT_ERR_SUCCESS;
}
-void tfm_spm_hal_clear_pending_irq(int32_t irq_line)
+void tfm_spm_hal_clear_pending_irq(IRQn_Type irq_line)
{
NVIC_ClearPendingIRQ(irq_line);
}
-void tfm_spm_hal_enable_irq(int32_t irq_line)
+void tfm_spm_hal_enable_irq(IRQn_Type irq_line)
{
NVIC_EnableIRQ(irq_line);
}
-void tfm_spm_hal_disable_irq(int32_t irq_line)
+void tfm_spm_hal_disable_irq(IRQn_Type irq_line)
{
NVIC_DisableIRQ(irq_line);
}
enum irq_target_state_t tfm_spm_hal_set_irq_target_state(
- int32_t irq_line,
+ IRQn_Type irq_line,
enum irq_target_state_t target_state)
{
uint32_t result;
diff --git a/platform/ext/target/mps2/an519/target_cfg.h b/platform/ext/target/mps2/an519/target_cfg.h
index e31971e..fb985bf 100644
--- a/platform/ext/target/mps2/an519/target_cfg.h
+++ b/platform/ext/target/mps2/an519/target_cfg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 Arm Limited
+ * Copyright (c) 2017-2020 Arm Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -72,7 +72,7 @@
{
uint32_t periph_start;
uint32_t periph_limit;
- int16_t periph_ppc_bank;
+ enum ppc_bank_e periph_ppc_bank;
int16_t periph_ppc_loc;
};
diff --git a/platform/ext/target/mps2/an521/cmsis_drivers/Driver_PPC.c b/platform/ext/target/mps2/an521/cmsis_drivers/Driver_PPC.c
index 9787d05..fc198a2 100644
--- a/platform/ext/target/mps2/an521/cmsis_drivers/Driver_PPC.c
+++ b/platform/ext/target/mps2/an521/cmsis_drivers/Driver_PPC.c
@@ -734,11 +734,9 @@
ARM_PPC_SecAttr sec_attr,
ARM_PPC_PrivAttr priv_attr)
{
- enum ppc_sse200_error_t ret;
-
- ret = ppc_sse200_config_peripheral(&APB_PPCEXP2_DEV_S, periph,
- (enum ppc_sse200_sec_attr_t)sec_attr,
- (enum ppc_sse200_priv_attr_t)priv_attr);
+ ppc_sse200_config_peripheral(&APB_PPCEXP2_DEV_S, periph,
+ (enum ppc_sse200_sec_attr_t)sec_attr,
+ (enum ppc_sse200_priv_attr_t)priv_attr);
return ARM_DRIVER_OK;
}
diff --git a/platform/ext/target/mps2/an521/spm_hal.c b/platform/ext/target/mps2/an521/spm_hal.c
index 6526e31..51d488b 100644
--- a/platform/ext/target/mps2/an521/spm_hal.c
+++ b/platform/ext/target/mps2/an521/spm_hal.c
@@ -261,7 +261,7 @@
return *((uint32_t *)(memory_regions.non_secure_code_start+ 4));
}
-enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(int32_t irq_line,
+enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(IRQn_Type irq_line,
uint32_t priority)
{
uint32_t quantized_priority = priority >> (8U - __NVIC_PRIO_BITS);
@@ -269,23 +269,23 @@
return TFM_PLAT_ERR_SUCCESS;
}
-void tfm_spm_hal_clear_pending_irq(int32_t irq_line)
+void tfm_spm_hal_clear_pending_irq(IRQn_Type irq_line)
{
NVIC_ClearPendingIRQ(irq_line);
}
-void tfm_spm_hal_enable_irq(int32_t irq_line)
+void tfm_spm_hal_enable_irq(IRQn_Type irq_line)
{
NVIC_EnableIRQ(irq_line);
}
-void tfm_spm_hal_disable_irq(int32_t irq_line)
+void tfm_spm_hal_disable_irq(IRQn_Type irq_line)
{
NVIC_DisableIRQ(irq_line);
}
enum irq_target_state_t tfm_spm_hal_set_irq_target_state(
- int32_t irq_line,
+ IRQn_Type irq_line,
enum irq_target_state_t target_state)
{
uint32_t result;
diff --git a/platform/ext/target/mps2/an521/target_cfg.h b/platform/ext/target/mps2/an521/target_cfg.h
index e31971e..fb985bf 100644
--- a/platform/ext/target/mps2/an521/target_cfg.h
+++ b/platform/ext/target/mps2/an521/target_cfg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 Arm Limited
+ * Copyright (c) 2017-2020 Arm Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -72,7 +72,7 @@
{
uint32_t periph_start;
uint32_t periph_limit;
- int16_t periph_ppc_bank;
+ enum ppc_bank_e periph_ppc_bank;
int16_t periph_ppc_loc;
};
diff --git a/platform/ext/target/mps2/an539/spm_hal.c b/platform/ext/target/mps2/an539/spm_hal.c
index ce345c5..93f0a93 100644
--- a/platform/ext/target/mps2/an539/spm_hal.c
+++ b/platform/ext/target/mps2/an539/spm_hal.c
@@ -242,7 +242,7 @@
return *((uint32_t *)(memory_regions.non_secure_code_start + 4));
}
-enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(int32_t irq_line, uint32_t priority)
+enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(IRQn_Type irq_line, uint32_t priority)
{
uint32_t quantized_priority = priority >> (8U - __NVIC_PRIO_BITS);
NVIC_SetPriority(irq_line, quantized_priority);
@@ -291,7 +291,7 @@
}
enum irq_target_state_t tfm_spm_hal_set_irq_target_state(
- int32_t irq_line,
+ IRQn_Type irq_line,
enum irq_target_state_t target_state)
{
uint32_t result;
@@ -329,17 +329,17 @@
return nvic_interrupt_enable();
}
-void tfm_spm_hal_clear_pending_irq(int32_t irq_line)
+void tfm_spm_hal_clear_pending_irq(IRQn_Type irq_line)
{
NVIC_ClearPendingIRQ(irq_line);
}
-void tfm_spm_hal_enable_irq(int32_t irq_line)
+void tfm_spm_hal_enable_irq(IRQn_Type irq_line)
{
NVIC_EnableIRQ(irq_line);
}
-void tfm_spm_hal_disable_irq(int32_t irq_line)
+void tfm_spm_hal_disable_irq(IRQn_Type irq_line)
{
NVIC_DisableIRQ(irq_line);
}
diff --git a/platform/ext/target/mps2/an539/target_cfg.h b/platform/ext/target/mps2/an539/target_cfg.h
index 7667485..c92c488 100644
--- a/platform/ext/target/mps2/an539/target_cfg.h
+++ b/platform/ext/target/mps2/an539/target_cfg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019 Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020 Arm Limited. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -59,7 +59,7 @@
struct tfm_spm_partition_platform_data_t {
uint32_t periph_start;
uint32_t periph_limit;
- int16_t periph_ppc_bank;
+ enum ppc_bank_e periph_ppc_bank;
int16_t periph_ppc_loc;
};
diff --git a/platform/ext/target/mps3/an524/cmsis_drivers/Driver_PPC.c b/platform/ext/target/mps3/an524/cmsis_drivers/Driver_PPC.c
index a17e157..9ffc35f 100644
--- a/platform/ext/target/mps3/an524/cmsis_drivers/Driver_PPC.c
+++ b/platform/ext/target/mps3/an524/cmsis_drivers/Driver_PPC.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2019 Arm Limited. All rights reserved.
+ * Copyright (c) 2016-2020 Arm Limited. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -817,11 +817,9 @@
ARM_PPC_SecAttr sec_attr,
ARM_PPC_PrivAttr priv_attr)
{
- enum ppc_sse200_error_t ret;
-
- ret = ppc_sse200_config_peripheral(&APB_PPCEXP2_DEV, periph,
- (enum ppc_sse200_sec_attr_t)sec_attr,
- (enum ppc_sse200_priv_attr_t)priv_attr);
+ ppc_sse200_config_peripheral(&APB_PPCEXP2_DEV, periph,
+ (enum ppc_sse200_sec_attr_t)sec_attr,
+ (enum ppc_sse200_priv_attr_t)priv_attr);
return ARM_DRIVER_OK;
}
diff --git a/platform/ext/target/mps3/an524/spm_hal.c b/platform/ext/target/mps3/an524/spm_hal.c
index c39c2ca..f5dd600 100644
--- a/platform/ext/target/mps3/an524/spm_hal.c
+++ b/platform/ext/target/mps3/an524/spm_hal.c
@@ -275,7 +275,7 @@
return TFM_PLAT_ERR_SUCCESS;
}
-enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(int32_t irq_line,
+enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(IRQn_Type irq_line,
uint32_t priority)
{
uint32_t quantized_priority = priority >> (8U - __NVIC_PRIO_BITS);
@@ -283,23 +283,23 @@
return TFM_PLAT_ERR_SUCCESS;
}
-void tfm_spm_hal_clear_pending_irq(int32_t irq_line)
+void tfm_spm_hal_clear_pending_irq(IRQn_Type irq_line)
{
NVIC_ClearPendingIRQ(irq_line);
}
-void tfm_spm_hal_enable_irq(int32_t irq_line)
+void tfm_spm_hal_enable_irq(IRQn_Type irq_line)
{
NVIC_EnableIRQ(irq_line);
}
-void tfm_spm_hal_disable_irq(int32_t irq_line)
+void tfm_spm_hal_disable_irq(IRQn_Type irq_line)
{
NVIC_DisableIRQ(irq_line);
}
enum irq_target_state_t tfm_spm_hal_set_irq_target_state(
- int32_t irq_line,
+ IRQn_Type irq_line,
enum irq_target_state_t target_state)
{
uint32_t result;
diff --git a/platform/ext/target/mps3/an524/target_cfg.c b/platform/ext/target/mps3/an524/target_cfg.c
index 11b6884..cdc3fee 100644
--- a/platform/ext/target/mps3/an524/target_cfg.c
+++ b/platform/ext/target/mps3/an524/target_cfg.c
@@ -257,7 +257,7 @@
NVIC_EnableIRQ(PPC_IRQn);
- return ARM_DRIVER_OK;
+ return (enum tfm_plat_err_t) ARM_DRIVER_OK;
}
/*------------------- SAU/IDAU configuration functions -----------------------*/
diff --git a/platform/ext/target/mps3/an524/target_cfg.h b/platform/ext/target/mps3/an524/target_cfg.h
index 715e79a..6cc3ed1 100644
--- a/platform/ext/target/mps3/an524/target_cfg.h
+++ b/platform/ext/target/mps3/an524/target_cfg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019 Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020 Arm Limited. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@
struct tfm_spm_partition_platform_data_t {
uint32_t periph_start;
uint32_t periph_limit;
- int16_t periph_ppc_bank;
+ enum ppc_bank_e periph_ppc_bank;
int16_t periph_ppc_loc;
};
diff --git a/platform/ext/target/musca_a/CMSIS_Driver/Driver_QSPI_Flash.c b/platform/ext/target/musca_a/CMSIS_Driver/Driver_QSPI_Flash.c
index b29f03f..d8c23b3 100644
--- a/platform/ext/target/musca_a/CMSIS_Driver/Driver_QSPI_Flash.c
+++ b/platform/ext/target/musca_a/CMSIS_Driver/Driver_QSPI_Flash.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2019 Arm Limited. All rights reserved.
+ * Copyright (c) 2013-2020 Arm Limited. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -249,8 +249,8 @@
/* The erase function checks whether the address is aligned with
* the sector or subsector and checks the Flash memory boundaries.
*/
- err = mt25ql_erase(ARM_FLASH0_DEV.dev,
- addr, ARM_FLASH0_DEV.data->sector_size);
+ err = mt25ql_erase(ARM_FLASH0_DEV.dev, addr,
+ (enum mt25ql_erase_t) ARM_FLASH0_DEV.data->sector_size);
ARM_FLASH0_STATUS.busy = DRIVER_STATUS_IDLE;
diff --git a/platform/ext/target/musca_a/Device/Source/device_definition.c b/platform/ext/target/musca_a/Device/Source/device_definition.c
index 43913d4..1773e08 100644
--- a/platform/ext/target/musca_a/Device/Source/device_definition.c
+++ b/platform/ext/target/musca_a/Device/Source/device_definition.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2020 Arm Limited. All rights reserved.
*
* Licensed under the Apache License Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -615,7 +615,7 @@
* more.
*/
.size = 0x00800000U, /* 8 MiB */
- .config_state = { 0 },
+ .config_state = { MT25QL_FUNC_STATE_NOT_INITED },
};
#endif
@@ -632,6 +632,6 @@
* more.
*/
.size = 0x00800000U, /* 8 MiB */
- .config_state = { 0 },
+ .config_state = { MT25QL_FUNC_STATE_NOT_INITED },
};
#endif
diff --git a/platform/ext/target/musca_a/Libraries/mt25ql_flash_lib.c b/platform/ext/target/musca_a/Libraries/mt25ql_flash_lib.c
index 578cc5b..f748ecf 100644
--- a/platform/ext/target/musca_a/Libraries/mt25ql_flash_lib.c
+++ b/platform/ext/target/musca_a/Libraries/mt25ql_flash_lib.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 Arm Limited
+ * Copyright (c) 2018-2020 Arm Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -514,7 +514,7 @@
qspi_ip6514e_enable(dev->controller);
- dev->config_state = (struct mt25ql_config_state_t){ 0 };
+ dev->config_state = (struct mt25ql_config_state_t){ MT25QL_FUNC_STATE_NOT_INITED };
dev->config_state.func_state = MT25QL_FUNC_STATE_NOT_INITED;
return MT25QL_ERR_NONE;
diff --git a/platform/ext/target/musca_a/services/src/tfm_ioctl_s_api.c b/platform/ext/target/musca_a/services/src/tfm_ioctl_s_api.c
index e734f12..e744f39 100644
--- a/platform/ext/target/musca_a/services/src/tfm_ioctl_s_api.c
+++ b/platform/ext/target/musca_a/services/src/tfm_ioctl_s_api.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -31,7 +31,7 @@
&out_vec);
*result = out.u.result;
- return ret;
+ return (enum tfm_platform_err_t) ret;
}
__attribute__((section("SFN")))
@@ -60,7 +60,7 @@
&out_vec);
*result = out.u.result;
- return ret;
+ return (enum tfm_platform_err_t) ret;
}
__attribute__((section("SFN")))
@@ -88,7 +88,7 @@
&out_vec);
*result = out.u.result;
- return ret;
+ return (enum tfm_platform_err_t) ret;
}
__attribute__((section("SFN")))
@@ -116,7 +116,7 @@
*result = out.u.gpio_read_result.result;
*data = out.u.gpio_read_result.data;
- return ret;
+ return (enum tfm_platform_err_t) ret;
}
__attribute__((section("SFN")))
@@ -145,7 +145,7 @@
&out_vec);
*result = out.u.result;
- return ret;
+ return (enum tfm_platform_err_t) ret;
}
__attribute__((section("SFN")))
@@ -174,7 +174,7 @@
&out_vec);
*result = out.u.result;
- return ret;
+ return (enum tfm_platform_err_t) ret;
}
__attribute__((section("SFN")))
@@ -202,6 +202,6 @@
*result = out.u.gpio_read_result.result;
*data = out.u.gpio_read_result.data;
- return ret;
+ return (enum tfm_platform_err_t) ret;
}
diff --git a/platform/ext/target/musca_a/spm_hal.c b/platform/ext/target/musca_a/spm_hal.c
index 36f1e15..b361d73 100644
--- a/platform/ext/target/musca_a/spm_hal.c
+++ b/platform/ext/target/musca_a/spm_hal.c
@@ -268,7 +268,7 @@
return *((uint32_t *)(memory_regions.non_secure_code_start+ 4));
}
-enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(int32_t irq_line,
+enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(IRQn_Type irq_line,
uint32_t priority)
{
uint32_t quantized_priority = priority >> (8U - __NVIC_PRIO_BITS);
@@ -276,23 +276,23 @@
return TFM_PLAT_ERR_SUCCESS;
}
-void tfm_spm_hal_clear_pending_irq(int32_t irq_line)
+void tfm_spm_hal_clear_pending_irq(IRQn_Type irq_line)
{
NVIC_ClearPendingIRQ(irq_line);
}
-void tfm_spm_hal_enable_irq(int32_t irq_line)
+void tfm_spm_hal_enable_irq(IRQn_Type irq_line)
{
NVIC_EnableIRQ(irq_line);
}
-void tfm_spm_hal_disable_irq(int32_t irq_line)
+void tfm_spm_hal_disable_irq(IRQn_Type irq_line)
{
NVIC_DisableIRQ(irq_line);
}
enum irq_target_state_t tfm_spm_hal_set_irq_target_state(
- int32_t irq_line,
+ IRQn_Type irq_line,
enum irq_target_state_t target_state)
{
uint32_t result;
diff --git a/platform/ext/target/musca_a/target_cfg.h b/platform/ext/target/musca_a/target_cfg.h
index 742fab6..dfbed39 100644
--- a/platform/ext/target/musca_a/target_cfg.h
+++ b/platform/ext/target/musca_a/target_cfg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 Arm Limited
+ * Copyright (c) 2018-2020 Arm Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,7 +67,7 @@
{
uint32_t periph_start;
uint32_t periph_limit;
- int16_t periph_ppc_bank;
+ enum ppc_bank_e periph_ppc_bank;
int16_t periph_ppc_loc;
};
diff --git a/platform/ext/target/musca_b1/spm_hal.c b/platform/ext/target/musca_b1/spm_hal.c
index d9ae389..11c4af9 100644
--- a/platform/ext/target/musca_b1/spm_hal.c
+++ b/platform/ext/target/musca_b1/spm_hal.c
@@ -287,7 +287,7 @@
return *((uint32_t *)(memory_regions.non_secure_code_start+ 4));
}
-enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(int32_t irq_line,
+enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(IRQn_Type irq_line,
uint32_t priority)
{
uint32_t quantized_priority = priority >> (8U - __NVIC_PRIO_BITS);
@@ -295,23 +295,23 @@
return TFM_PLAT_ERR_SUCCESS;
}
-void tfm_spm_hal_clear_pending_irq(int32_t irq_line)
+void tfm_spm_hal_clear_pending_irq(IRQn_Type irq_line)
{
NVIC_ClearPendingIRQ(irq_line);
}
-void tfm_spm_hal_enable_irq(int32_t irq_line)
+void tfm_spm_hal_enable_irq(IRQn_Type irq_line)
{
NVIC_EnableIRQ(irq_line);
}
-void tfm_spm_hal_disable_irq(int32_t irq_line)
+void tfm_spm_hal_disable_irq(IRQn_Type irq_line)
{
NVIC_DisableIRQ(irq_line);
}
enum irq_target_state_t tfm_spm_hal_set_irq_target_state(
- int32_t irq_line,
+ IRQn_Type irq_line,
enum irq_target_state_t target_state)
{
uint32_t result;
diff --git a/platform/ext/target/musca_b1/target_cfg.h b/platform/ext/target/musca_b1/target_cfg.h
index 26f2968..c6bb82d 100644
--- a/platform/ext/target/musca_b1/target_cfg.h
+++ b/platform/ext/target/musca_b1/target_cfg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 Arm Limited
+ * Copyright (c) 2018-2020 Arm Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -75,7 +75,7 @@
{
uint32_t periph_start;
uint32_t periph_limit;
- int16_t periph_ppc_bank;
+ enum ppc_bank_e periph_ppc_bank;
int16_t periph_ppc_loc;
};
diff --git a/platform/ext/target/musca_s1/spm_hal.c b/platform/ext/target/musca_s1/spm_hal.c
index 45622c4..741dc58 100644
--- a/platform/ext/target/musca_s1/spm_hal.c
+++ b/platform/ext/target/musca_s1/spm_hal.c
@@ -237,7 +237,7 @@
return *((uint32_t *)(memory_regions.non_secure_code_start+ 4));
}
-enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(int32_t irq_line,
+enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(IRQn_Type irq_line,
uint32_t priority)
{
uint32_t quantized_priority = priority >> (8U - __NVIC_PRIO_BITS);
@@ -245,23 +245,23 @@
return TFM_PLAT_ERR_SUCCESS;
}
-void tfm_spm_hal_clear_pending_irq(int32_t irq_line)
+void tfm_spm_hal_clear_pending_irq(IRQn_Type irq_line)
{
NVIC_ClearPendingIRQ(irq_line);
}
-void tfm_spm_hal_enable_irq(int32_t irq_line)
+void tfm_spm_hal_enable_irq(IRQn_Type irq_line)
{
NVIC_EnableIRQ(irq_line);
}
-void tfm_spm_hal_disable_irq(int32_t irq_line)
+void tfm_spm_hal_disable_irq(IRQn_Type irq_line)
{
NVIC_DisableIRQ(irq_line);
}
enum irq_target_state_t tfm_spm_hal_set_irq_target_state(
- int32_t irq_line,
+ IRQn_Type irq_line,
enum irq_target_state_t target_state)
{
uint32_t result;
diff --git a/platform/ext/target/musca_s1/target_cfg.h b/platform/ext/target/musca_s1/target_cfg.h
index f995216..d42f305 100644
--- a/platform/ext/target/musca_s1/target_cfg.h
+++ b/platform/ext/target/musca_s1/target_cfg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020 Arm Limited. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,7 +71,7 @@
{
uint32_t periph_start;
uint32_t periph_limit;
- int16_t periph_ppc_bank;
+ enum ppc_bank_e periph_ppc_bank;
int16_t periph_ppc_loc;
};
diff --git a/platform/ext/target/sse-200_aws/spm_hal.c b/platform/ext/target/sse-200_aws/spm_hal.c
index 34b2c1c..659f835 100644
--- a/platform/ext/target/sse-200_aws/spm_hal.c
+++ b/platform/ext/target/sse-200_aws/spm_hal.c
@@ -228,7 +228,7 @@
return *((uint32_t *)(memory_regions.non_secure_code_start+ 4));
}
-enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(int32_t irq_line,
+enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(IRQn_Type irq_line,
uint32_t priority)
{
uint32_t quantized_priority = priority >> (8U - __NVIC_PRIO_BITS);
@@ -236,23 +236,23 @@
return TFM_PLAT_ERR_SUCCESS;
}
-void tfm_spm_hal_clear_pending_irq(int32_t irq_line)
+void tfm_spm_hal_clear_pending_irq(IRQn_Type irq_line)
{
NVIC_ClearPendingIRQ(irq_line);
}
-void tfm_spm_hal_enable_irq(int32_t irq_line)
+void tfm_spm_hal_enable_irq(IRQn_Type irq_line)
{
NVIC_EnableIRQ(irq_line);
}
-void tfm_spm_hal_disable_irq(int32_t irq_line)
+void tfm_spm_hal_disable_irq(IRQn_Type irq_line)
{
NVIC_DisableIRQ(irq_line);
}
enum irq_target_state_t tfm_spm_hal_set_irq_target_state(
- int32_t irq_line,
+ IRQn_Type irq_line,
enum irq_target_state_t target_state)
{
uint32_t result;
diff --git a/platform/ext/target/sse-200_aws/target_cfg.h b/platform/ext/target/sse-200_aws/target_cfg.h
index 3abd27d..d3f6ed7 100644
--- a/platform/ext/target/sse-200_aws/target_cfg.h
+++ b/platform/ext/target/sse-200_aws/target_cfg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 Arm Limited
+ * Copyright (c) 2017-2020 Arm Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -72,7 +72,7 @@
{
uint32_t periph_start;
uint32_t periph_limit;
- int16_t periph_ppc_bank;
+ enum ppc_bank_e periph_ppc_bank;
int16_t periph_ppc_loc;
};
diff --git a/platform/include/tfm_spm_hal.h b/platform/include/tfm_spm_hal.h
index 3607753..caed249 100644
--- a/platform/include/tfm_spm_hal.h
+++ b/platform/include/tfm_spm_hal.h
@@ -221,7 +221,7 @@
*
* \return Returns values as specified by the \ref tfm_plat_err_t
*/
-enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(int32_t irq_line,
+enum tfm_plat_err_t tfm_spm_hal_set_secure_irq_priority(IRQn_Type irq_line,
uint32_t priority);
/**
@@ -229,21 +229,21 @@
*
* \param[in] irq_line The IRQ to clear pending for.
*/
-void tfm_spm_hal_clear_pending_irq(int32_t irq_line);
+void tfm_spm_hal_clear_pending_irq(IRQn_Type irq_line);
/**
* \brief Enables an IRQ
*
* \param[in] irq_line The IRQ to be enabled.
*/
-void tfm_spm_hal_enable_irq(int32_t irq_line);
+void tfm_spm_hal_enable_irq(IRQn_Type irq_line);
/**
* \brief Disables an IRQ
*
* \param[in] irq_line The IRQ to be disabled
*/
-void tfm_spm_hal_disable_irq(int32_t irq_line);
+void tfm_spm_hal_disable_irq(IRQn_Type irq_line);
/**
* \brief Set the target state of an IRQ
@@ -257,7 +257,7 @@
* assigned to Non-Secure
*/
enum irq_target_state_t tfm_spm_hal_set_irq_target_state(
- int32_t irq_line,
+ IRQn_Type irq_line,
enum irq_target_state_t target_state);
#ifdef TFM_MULTI_CORE_TOPOLOGY
diff --git a/secure_fw/core/include/tfm_irq_list.h b/secure_fw/core/include/tfm_irq_list.h
index ab22ca7..fbad8f4 100644
--- a/secure_fw/core/include/tfm_irq_list.h
+++ b/secure_fw/core/include/tfm_irq_list.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -15,7 +15,7 @@
struct tfm_core_irq_signal_data_t {
int32_t partition_id;
psa_signal_t signal_value;
- int32_t irq_line;
+ IRQn_Type irq_line;
uint32_t irq_priority;
};
diff --git a/secure_fw/core/ipc/tfm_multi_core.c b/secure_fw/core/ipc/tfm_multi_core.c
index 75db3be..0678509 100644
--- a/secure_fw/core/ipc/tfm_multi_core.c
+++ b/secure_fw/core/ipc/tfm_multi_core.c
@@ -42,7 +42,8 @@
while (1) {
}
- /* Should not run here */
+
+ /* NOTREACHED */
TFM_ASSERT(false);
}
diff --git a/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc b/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc
index d44f7c6..0c86e72 100644
--- a/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc
+++ b/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc
@@ -29,7 +29,7 @@
#ifdef TFM_ENABLE_IRQ_TEST
{ TFM_IRQ_TEST_1, SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ, TFM_TIMER0_IRQ, 64 },
#endif /* TFM_ENABLE_IRQ_TEST */
- {0, 0, 0, 0} /* add dummy element to avoid non-standard empty array */
+ {0, 0, (IRQn_Type) 0, 0} /* add dummy element to avoid non-standard empty array */
};
const size_t tfm_core_irq_signals_count = (sizeof(tfm_core_irq_signals) /
diff --git a/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc.template b/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc.template
index 5e9d44c..e5a7d6b 100644
--- a/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc.template
+++ b/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc.template
@@ -41,7 +41,7 @@
{% endif %}
{% endif %}
{% endfor %}
- {0, 0, 0, 0} /* add dummy element to avoid non-standard empty array */
+ {0, 0, (IRQn_Type) 0, 0} /* add dummy element to avoid non-standard empty array */
};
const size_t tfm_core_irq_signals_count = (sizeof(tfm_core_irq_signals) /
diff --git a/secure_fw/core/ipc/tfm_spe_mailbox.c b/secure_fw/core/ipc/tfm_spe_mailbox.c
index edc5eeb..baa02c7 100644
--- a/secure_fw/core/ipc/tfm_spe_mailbox.c
+++ b/secure_fw/core/ipc/tfm_spe_mailbox.c
@@ -19,7 +19,7 @@
static int32_t tfm_mailbox_dispatch(uint32_t call_type,
const struct psa_client_params_t *params,
- int32_t client_id, uint32_t *psa_ret)
+ int32_t client_id, int32_t *psa_ret)
{
struct client_call_params_t spm_params = {0};
@@ -183,7 +183,7 @@
{
uint8_t idx;
int32_t result;
- uint32_t psa_ret = PSA_ERROR_GENERIC_ERROR;
+ int32_t psa_ret = PSA_ERROR_GENERIC_ERROR;
mailbox_queue_status_t mask_bits, pend_slots, reply_slots = 0;
struct ns_mailbox_queue_t *ns_queue = spe_mailbox_queue.ns_queue;
struct mailbox_msg_t *msg_ptr;
diff --git a/secure_fw/core/tfm_boot_data.c b/secure_fw/core/tfm_boot_data.c
index 02bcc1f..84a7825 100644
--- a/secure_fw/core/tfm_boot_data.c
+++ b/secure_fw/core/tfm_boot_data.c
@@ -138,9 +138,9 @@
uint8_t tlv_major = (uint8_t)args[0];
uint8_t *buf_start = (uint8_t *)args[1];
uint16_t buf_size = (uint16_t)args[2];
- uint8_t *ptr;
struct tfm_boot_data *boot_data;
#ifdef BOOT_DATA_AVAILABLE
+ uint8_t *ptr;
struct shared_data_tlv_entry tlv_entry;
uintptr_t tlv_end, offset;
#endif /* BOOT_DATA_AVAILABLE */
@@ -210,10 +210,10 @@
boot_data = (struct tfm_boot_data *)buf_start;
boot_data->header.tlv_magic = SHARED_DATA_TLV_INFO_MAGIC;
boot_data->header.tlv_tot_len = SHARED_DATA_HEADER_SIZE;
- ptr = boot_data->data;
}
#ifdef BOOT_DATA_AVAILABLE
+ ptr = boot_data->data;
/* Iterates over the TLV section and copy TLVs with requested major
* type to the provided buffer.
*/
diff --git a/secure_fw/core/tfm_core_svcalls_ipc.c b/secure_fw/core/tfm_core_svcalls_ipc.c
index 202b5173..7cbf907 100644
--- a/secure_fw/core/tfm_core_svcalls_ipc.c
+++ b/secure_fw/core/tfm_core_svcalls_ipc.c
@@ -120,7 +120,7 @@
uint32_t tfm_core_svc_handler(uint32_t *svc_args, uint32_t exc_return)
{
- uint8_t svc_number = 0;
+ tfm_svc_number_t svc_number = TFM_SVC_SFN_REQUEST;
/*
* Stack contains:
* r0, r1, r2, r3, r12, r14 (lr), the return address and xPSR
@@ -130,7 +130,7 @@
/* SV called directly from secure context. Check instruction for
* svc_number
*/
- svc_number = ((uint8_t *)svc_args[6])[-2];
+ svc_number = ((tfm_svc_number_t *)svc_args[6])[-2];
} else {
/* Secure SV executing with NS return.
* NS cannot directly trigger S SVC so this should not happen. This is
diff --git a/secure_fw/services/crypto/crypto_init.c b/secure_fw/services/crypto/crypto_init.c
index b3acd55..743ce1d 100644
--- a/secure_fw/services/crypto/crypto_init.c
+++ b/secure_fw/services/crypto/crypto_init.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -113,7 +113,7 @@
const uint32_t sfn_id)
{
psa_status_t status = PSA_SUCCESS;
- size_t in_len = PSA_MAX_IOVEC, out_len = PSA_MAX_IOVEC, i, read_size;
+ size_t in_len = PSA_MAX_IOVEC, out_len = PSA_MAX_IOVEC, i;
psa_invec in_vec[PSA_MAX_IOVEC] = { {0} };
psa_outvec out_vec[PSA_MAX_IOVEC] = { {0} };
void *alloc_buf_ptr = NULL;
@@ -140,7 +140,7 @@
return status;
}
/* Read from the IPC framework inputs into the scratch */
- read_size = psa_read(msg->handle, i, alloc_buf_ptr, msg->in_size[i]);
+ (void) psa_read(msg->handle, i, alloc_buf_ptr, msg->in_size[i]);
/* Populate the fields of the input to the secure function */
in_vec[i].base = alloc_buf_ptr;
in_vec[i].len = msg->in_size[i];
@@ -258,7 +258,7 @@
}
}
- /* This is unreachable */
+ /* NOTREACHED */
return;
}
#endif /* TFM_PSA_API */
diff --git a/secure_fw/services/crypto/crypto_key.c b/secure_fw/services/crypto/crypto_key.c
index e88040d..ef3b309 100644
--- a/secure_fw/services/crypto/crypto_key.c
+++ b/secure_fw/services/crypto/crypto_key.c
@@ -577,7 +577,6 @@
return status;
#endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
- return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t tfm_crypto_generate_key(psa_invec in_vec[],
diff --git a/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c b/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
index 07d9a80..8366bfb 100644
--- a/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
+++ b/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
@@ -171,13 +171,10 @@
psa_status_t attest_partition_init(void)
{
- psa_status_t err = PSA_SUCCESS;
+ psa_status_t err = attest_init();
#ifdef TFM_PSA_API
psa_signal_t signals;
-#endif
- err = attest_init();
-#ifdef TFM_PSA_API
if (err != PSA_SUCCESS) {
tfm_abort();
}
@@ -197,6 +194,7 @@
tfm_abort();
}
}
-#endif
+#else
return err;
+#endif
}
diff --git a/secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.c b/secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.c
index 518f877..eb634b8 100644
--- a/secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.c
+++ b/secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.c
@@ -349,8 +349,8 @@
return PSA_ERROR_GENERIC_ERROR;
}
its_is_init = true;
-#endif
return PSA_SUCCESS;
+#endif
}
size_t its_req_mngr_read(uint8_t *buf, size_t num_bytes)
diff --git a/secure_fw/services/platform/platform_sp.c b/secure_fw/services/platform/platform_sp.c
index f5d0973..b17e62e 100644
--- a/secure_fw/services/platform/platform_sp.c
+++ b/secure_fw/services/platform/platform_sp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -102,16 +102,16 @@
num = psa_read(msg->handle, 0, &request, sizeof(request));
if (num != sizeof(request)) {
- return PSA_ERROR_PROGRAMMER_ERROR;
+ return (enum tfm_platform_err_t) PSA_ERROR_PROGRAMMER_ERROR;
}
if (in_len > 1) {
if (msg->in_size[1] > INPUT_BUFFER_SIZE) {
- return PSA_ERROR_PROGRAMMER_ERROR;
+ return (enum tfm_platform_err_t) PSA_ERROR_PROGRAMMER_ERROR;
}
num = psa_read(msg->handle, 1, &input_buffer, msg->in_size[1]);
if (num != msg->in_size[1]) {
- return PSA_ERROR_PROGRAMMER_ERROR;
+ return (enum tfm_platform_err_t) PSA_ERROR_PROGRAMMER_ERROR;
}
invec.base = input_buffer;
invec.len = msg->in_size[1];
@@ -120,7 +120,7 @@
if (out_len > 0) {
if (msg->out_size[0] > OUTPUT_BUFFER_SIZE) {
- return PSA_ERROR_PROGRAMMER_ERROR;
+ return (enum tfm_platform_err_t) PSA_ERROR_PROGRAMMER_ERROR;
}
outvec.base = output_buffer;
outvec.len = msg->out_size[0];
@@ -188,7 +188,7 @@
}
}
-#endif /* TFM_PSA_API */
-
+#else
return TFM_PLATFORM_ERR_SUCCESS;
+#endif /* TFM_PSA_API */
}
diff --git a/secure_fw/services/secure_storage/tfm_sst_req_mngr.c b/secure_fw/services/secure_storage/tfm_sst_req_mngr.c
index ec9635d..94a0e78 100644
--- a/secure_fw/services/secure_storage/tfm_sst_req_mngr.c
+++ b/secure_fw/services/secure_storage/tfm_sst_req_mngr.c
@@ -418,12 +418,13 @@
tfm_abort();
}
}
-#endif
+#else
/* In library mode, initialisation is delayed until the first secure
* function call, as calls to the Crypto service are required for
* initialisation.
*/
return PSA_SUCCESS;
+#endif
}
psa_status_t sst_req_mngr_read_asset_data(uint8_t *out_data, uint32_t size)
diff --git a/secure_fw/spm/spm_func.c b/secure_fw/spm/spm_func.c
index 6b9c46b..afb0479 100644
--- a/secure_fw/spm/spm_func.c
+++ b/secure_fw/spm/spm_func.c
@@ -411,7 +411,7 @@
uint32_t handler_partition_id = svc_ctx->r0;
sfn_t unpriv_handler = (sfn_t)svc_ctx->r1;
uint32_t irq_signal = svc_ctx->r2;
- uint32_t irq_line = svc_ctx->r3;
+ IRQn_Type irq_line = (IRQn_Type) svc_ctx->r3;
enum tfm_status_e res;
uint32_t psp = __get_PSP();
uint32_t handler_partition_psp;
@@ -922,7 +922,7 @@
* \retval >=0 The IRQ line number associated with a signal in the partition
* \retval <0 error
*/
-static int32_t get_irq_line_for_signal(int32_t partition_id,
+static IRQn_Type get_irq_line_for_signal(int32_t partition_id,
psa_signal_t signal)
{
size_t i;
@@ -933,7 +933,7 @@
return tfm_core_irq_signals[i].irq_line;
}
}
- return -1;
+ return (IRQn_Type) -1;
}
void tfm_spm_enable_irq_handler(uint32_t *svc_args)
@@ -945,7 +945,7 @@
tfm_spm_partition_get_running_partition_idx();
uint32_t running_partition_id =
tfm_spm_partition_get_partition_id(running_partition_idx);
- int32_t irq_line;
+ IRQn_Type irq_line;
/* Only a single signal is allowed */
if (!tfm_is_one_bit_set(irq_signal)) {
@@ -972,7 +972,7 @@
tfm_spm_partition_get_running_partition_idx();
uint32_t running_partition_id =
tfm_spm_partition_get_partition_id(running_partition_idx);
- int32_t irq_line;
+ IRQn_Type irq_line;
/* Only a single signal is allowed */
if (!tfm_is_one_bit_set(irq_signal)) {
@@ -1030,7 +1030,7 @@
uint32_t running_partition_idx;
uint32_t running_partition_id;
const struct spm_partition_runtime_data_t *curr_part_data;
- int32_t irq_line;
+ IRQn_Type irq_line;
running_partition_idx = tfm_spm_partition_get_running_partition_idx();
running_partition_id =
diff --git a/secure_fw/spm/spm_ipc.c b/secure_fw/spm/spm_ipc.c
index 90e688f..d6e707d 100644
--- a/secure_fw/spm/spm_ipc.c
+++ b/secure_fw/spm/spm_ipc.c
@@ -47,7 +47,7 @@
TFM_CONN_HANDLE_MAX_NUM);
void tfm_irq_handler(uint32_t partition_id, psa_signal_t signal,
- int32_t irq_line);
+ IRQn_Type irq_line);
#include "tfm_secure_irq_handlers_ipc.inc"
@@ -1392,7 +1392,7 @@
* \retval "Does not return" Partition ID is invalid
*/
void tfm_irq_handler(uint32_t partition_id, psa_signal_t signal,
- int32_t irq_line)
+ IRQn_Type irq_line)
{
tfm_spm_hal_disable_irq(irq_line);
notify_with_signal(partition_id, signal);
@@ -1441,7 +1441,7 @@
*/
static int32_t get_irq_line_for_signal(int32_t partition_id,
psa_signal_t signal,
- int32_t *irq_line)
+ IRQn_Type *irq_line)
{
size_t i;
@@ -1458,7 +1458,7 @@
void tfm_spm_psa_eoi(uint32_t *args)
{
psa_signal_t irq_signal;
- int32_t irq_line = 0;
+ IRQn_Type irq_line = (IRQn_Type) 0;
int32_t ret;
struct spm_partition_desc_t *partition = NULL;
@@ -1497,7 +1497,7 @@
{
struct tfm_state_context_t *svc_ctx = (struct tfm_state_context_t *)args;
psa_signal_t irq_signal = svc_ctx->r0;
- int32_t irq_line = 0;
+ IRQn_Type irq_line = (IRQn_Type) 0;
int32_t ret;
struct spm_partition_desc_t *partition = NULL;
@@ -1525,7 +1525,7 @@
{
struct tfm_state_context_t *svc_ctx = (struct tfm_state_context_t *)args;
psa_signal_t irq_signal = svc_ctx->r0;
- int32_t irq_line = 0;
+ IRQn_Type irq_line = (IRQn_Type) 0;
int32_t ret;
struct spm_partition_desc_t *partition = NULL;
diff --git a/test/suites/attestation/non_secure/attestation_ns_interface_testsuite.c b/test/suites/attestation/non_secure/attestation_ns_interface_testsuite.c
index e19bc32..b739b9a 100644
--- a/test/suites/attestation/non_secure/attestation_ns_interface_testsuite.c
+++ b/test/suites/attestation/non_secure/attestation_ns_interface_testsuite.c
@@ -29,16 +29,16 @@
static struct test_t attestation_interface_tests[] = {
#ifdef INCLUDE_TEST_CODE /* Remove them from release build */
{&tfm_attest_test_2001, "TFM_ATTEST_TEST_2001",
- "Minimal token test of attest token", {0} },
+ "Minimal token test of attest token", {TEST_PASSED} },
{&tfm_attest_test_2002, "TFM_ATTEST_TEST_2002",
- "Minimal token size test of attest token", {0} },
+ "Minimal token size test of attest token", {TEST_PASSED} },
{&tfm_attest_test_2003, "TFM_ATTEST_TEST_2003",
- "Short circuit signature test of attest token", {0} },
+ "Short circuit signature test of attest token", {TEST_PASSED} },
#endif
{&tfm_attest_test_2004, "TFM_ATTEST_TEST_2004",
- "ECDSA signature test of attest token", {0} },
+ "ECDSA signature test of attest token", {TEST_PASSED} },
{&tfm_attest_test_2005, "TFM_ATTEST_TEST_2005",
- "Negative test cases for initial attestation service", {0} },
+ "Negative test cases for initial attestation service", {TEST_PASSED} },
};
void
diff --git a/test/suites/attestation/secure/attestation_s_interface_testsuite.c b/test/suites/attestation/secure/attestation_s_interface_testsuite.c
index 66362da..a01303b 100644
--- a/test/suites/attestation/secure/attestation_s_interface_testsuite.c
+++ b/test/suites/attestation/secure/attestation_s_interface_testsuite.c
@@ -29,16 +29,16 @@
static struct test_t attestation_interface_tests[] = {
#ifdef INCLUDE_TEST_CODE /* Remove them from release build */
{&tfm_attest_test_1001, "TFM_ATTEST_TEST_1001",
- "Minimal token test of attest token", {0} },
+ "Minimal token test of attest token", {TEST_PASSED} },
{&tfm_attest_test_1002, "TFM_ATTEST_TEST_1002",
- "Minimal token size test of attest token", {0} },
+ "Minimal token size test of attest token", {TEST_PASSED} },
{&tfm_attest_test_1003, "TFM_ATTEST_TEST_1003",
- "Short circuit signature test of attest token", {0} },
+ "Short circuit signature test of attest token", {TEST_PASSED} },
#endif
{&tfm_attest_test_1004, "TFM_ATTEST_TEST_1004",
- "ECDSA signature test of attest token", {0} },
+ "ECDSA signature test of attest token", {TEST_PASSED} },
{&tfm_attest_test_1005, "TFM_ATTEST_TEST_1005",
- "Negative test cases for initial attestation service", {0} },
+ "Negative test cases for initial attestation service", {TEST_PASSED} },
};
void
diff --git a/test/suites/audit/non_secure/audit_ns_interface_testsuite.c b/test/suites/audit/non_secure/audit_ns_interface_testsuite.c
index 5c27ba9..1dfe049 100644
--- a/test/suites/audit/non_secure/audit_ns_interface_testsuite.c
+++ b/test/suites/audit/non_secure/audit_ns_interface_testsuite.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -54,7 +54,7 @@
static struct test_t audit_veneers_tests[] = {
{&tfm_audit_test_1001, "TFM_AUDIT_TEST_1001",
- "Non Secure functional", {0} },
+ "Non Secure functional", {TEST_PASSED} },
};
void register_testsuite_ns_audit_interface(struct test_suite_t *p_test_suite)
diff --git a/test/suites/audit/secure/audit_s_interface_testsuite.c b/test/suites/audit/secure/audit_s_interface_testsuite.c
index cf74fea..7bda71e 100644
--- a/test/suites/audit/secure/audit_s_interface_testsuite.c
+++ b/test/suites/audit/secure/audit_s_interface_testsuite.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -33,7 +33,7 @@
static struct test_t audit_veneers_tests[] = {
{&tfm_audit_test_1001, "TFM_AUDIT_TEST_1001",
- "Secure functional", {0} },
+ "Secure functional", {TEST_PASSED} },
};
void register_testsuite_s_audit_interface(struct test_suite_t *p_test_suite)
diff --git a/test/suites/core/non_secure/core_ns_interactive_testsuite.c b/test/suites/core/non_secure/core_ns_interactive_testsuite.c
index 85603a2..93c1994 100644
--- a/test/suites/core/non_secure/core_ns_interactive_testsuite.c
+++ b/test/suites/core/non_secure/core_ns_interactive_testsuite.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -20,7 +20,7 @@
static struct test_t core_tests[] = {
{&tfm_core_test_2001, "TFM_CORE_TEST_2001",
- "Interactive tests", {0} },
+ "Interactive tests", {TEST_PASSED} },
};
void register_testsuite_ns_core_interactive(struct test_suite_t *p_test_suite)
diff --git a/test/suites/core/non_secure/core_ns_positive_testsuite.c b/test/suites/core/non_secure/core_ns_positive_testsuite.c
index 42a14e3..7d86dca 100644
--- a/test/suites/core/non_secure/core_ns_positive_testsuite.c
+++ b/test/suites/core/non_secure/core_ns_positive_testsuite.c
@@ -30,7 +30,7 @@
#define TOSTRING(x) #x
#define CORE_TEST_DESCRIPTION(number, fn, description) \
{fn, "TFM_CORE_TEST_"TOSTRING(number),\
- description, {0} }
+ description, {TEST_PASSED} }
#ifndef TFM_PSA_API
static void tfm_core_test_get_caller_client_id(struct test_result_t *ret);
diff --git a/test/suites/crypto/non_secure/crypto_ns_interface_testsuite.c b/test/suites/crypto/non_secure/crypto_ns_interface_testsuite.c
index 8e7d210..fa15df1 100644
--- a/test/suites/crypto/non_secure/crypto_ns_interface_testsuite.c
+++ b/test/suites/crypto/non_secure/crypto_ns_interface_testsuite.c
@@ -35,49 +35,49 @@
static struct test_t crypto_tests[] = {
{&tfm_crypto_test_6001, "TFM_CRYPTO_TEST_6001",
- "Non Secure Key management interface", {0} },
+ "Non Secure Key management interface", {TEST_PASSED} },
{&tfm_crypto_test_6002, "TFM_CRYPTO_TEST_6002",
- "Non Secure Symmetric encryption (AES-128-CBC) interface", {0} },
+ "Non Secure Symmetric encryption (AES-128-CBC) interface", {TEST_PASSED} },
{&tfm_crypto_test_6003, "TFM_CRYPTO_TEST_6003",
- "Non Secure Symmetric encryption (AES-128-CFB) interface", {0} },
+ "Non Secure Symmetric encryption (AES-128-CFB) interface", {TEST_PASSED} },
{&tfm_crypto_test_6005, "TFM_CRYPTO_TEST_6005",
- "Non Secure Symmetric encryption (AES-128-CTR) interface", {0} },
+ "Non Secure Symmetric encryption (AES-128-CTR) interface", {TEST_PASSED} },
{&tfm_crypto_test_6007, "TFM_CRYPTO_TEST_6007",
- "Non Secure Symmetric encryption invalid cipher (AES-128-GCM)", {0} },
+ "Non Secure Symmetric encryption invalid cipher (AES-128-GCM)", {TEST_PASSED} },
{&tfm_crypto_test_6008, "TFM_CRYPTO_TEST_6008",
- "Non Secure Symmetric encryption invalid cipher (AES-152-CBC)", {0} },
+ "Non Secure Symmetric encryption invalid cipher (AES-152-CBC)", {TEST_PASSED} },
{&tfm_crypto_test_6009, "TFM_CRYPTO_TEST_6009",
- "Non Secure Symmetric encryption invalid cipher (HMAC-128-CFB)", {0} },
+ "Non Secure Symmetric encryption invalid cipher (HMAC-128-CFB)", {TEST_PASSED} },
{&tfm_crypto_test_6010, "TFM_CRYPTO_TEST_6010",
- "Non Secure Unsupported Hash (SHA-1) interface", {0} },
+ "Non Secure Unsupported Hash (SHA-1) interface", {TEST_PASSED} },
{&tfm_crypto_test_6011, "TFM_CRYPTO_TEST_6011",
- "Non Secure Hash (SHA-224) interface", {0} },
+ "Non Secure Hash (SHA-224) interface", {TEST_PASSED} },
{&tfm_crypto_test_6012, "TFM_CRYPTO_TEST_6012",
- "Non Secure Hash (SHA-256) interface", {0} },
+ "Non Secure Hash (SHA-256) interface", {TEST_PASSED} },
{&tfm_crypto_test_6013, "TFM_CRYPTO_TEST_6013",
- "Non Secure Hash (SHA-384) interface", {0} },
+ "Non Secure Hash (SHA-384) interface", {TEST_PASSED} },
{&tfm_crypto_test_6014, "TFM_CRYPTO_TEST_6014",
- "Non Secure Hash (SHA-512) interface", {0} },
+ "Non Secure Hash (SHA-512) interface", {TEST_PASSED} },
{&tfm_crypto_test_6019, "TFM_CRYPTO_TEST_6019",
- "Non Secure Unsupported HMAC (SHA-1) interface", {0} },
+ "Non Secure Unsupported HMAC (SHA-1) interface", {TEST_PASSED} },
{&tfm_crypto_test_6020, "TFM_CRYPTO_TEST_6020",
- "Non Secure HMAC (SHA-256) interface", {0} },
+ "Non Secure HMAC (SHA-256) interface", {TEST_PASSED} },
{&tfm_crypto_test_6021, "TFM_CRYPTO_TEST_6021",
- "Non Secure HMAC (SHA-384) interface", {0} },
+ "Non Secure HMAC (SHA-384) interface", {TEST_PASSED} },
{&tfm_crypto_test_6022, "TFM_CRYPTO_TEST_6022",
- "Non Secure HMAC (SHA-512) interface", {0} },
+ "Non Secure HMAC (SHA-512) interface", {TEST_PASSED} },
{&tfm_crypto_test_6024, "TFM_CRYPTO_TEST_6024",
- "Non Secure HMAC with long key (SHA-224) interface", {0} },
+ "Non Secure HMAC with long key (SHA-224) interface", {TEST_PASSED} },
{&tfm_crypto_test_6030, "TFM_CRYPTO_TEST_6030",
- "Non Secure AEAD (AES-128-CCM) interface", {0} },
+ "Non Secure AEAD (AES-128-CCM) interface", {TEST_PASSED} },
{&tfm_crypto_test_6031, "TFM_CRYPTO_TEST_6031",
- "Non Secure AEAD (AES-128-GCM) interface", {0} },
+ "Non Secure AEAD (AES-128-GCM) interface", {TEST_PASSED} },
{&tfm_crypto_test_6032, "TFM_CRYPTO_TEST_6032",
- "Non Secure key policy interface", {0} },
+ "Non Secure key policy interface", {TEST_PASSED} },
{&tfm_crypto_test_6033, "TFM_CRYPTO_TEST_6033",
- "Non Secure key policy check permissions", {0} },
+ "Non Secure key policy check permissions", {TEST_PASSED} },
{&tfm_crypto_test_6034, "TFM_CRYPTO_TEST_6034",
- "Non Secure persistent key interface", {0} },
+ "Non Secure persistent key interface", {TEST_PASSED} },
};
void register_testsuite_ns_crypto_interface(struct test_suite_t *p_test_suite)
diff --git a/test/suites/crypto/secure/crypto_sec_interface_testsuite.c b/test/suites/crypto/secure/crypto_sec_interface_testsuite.c
index c3a19bd..0b1279f 100644
--- a/test/suites/crypto/secure/crypto_sec_interface_testsuite.c
+++ b/test/suites/crypto/secure/crypto_sec_interface_testsuite.c
@@ -37,51 +37,51 @@
static struct test_t crypto_tests[] = {
{&tfm_crypto_test_5001, "TFM_CRYPTO_TEST_5001",
- "Secure Key management interface", {0} },
+ "Secure Key management interface", {TEST_PASSED} },
{&tfm_crypto_test_5002, "TFM_CRYPTO_TEST_5002",
- "Secure Symmetric encryption (AES-128-CBC) interface", {0} },
+ "Secure Symmetric encryption (AES-128-CBC) interface", {TEST_PASSED} },
{&tfm_crypto_test_5003, "TFM_CRYPTO_TEST_5003",
- "Secure Symmetric encryption (AES-128-CFB) interface", {0} },
+ "Secure Symmetric encryption (AES-128-CFB) interface", {TEST_PASSED} },
{&tfm_crypto_test_5005, "TFM_CRYPTO_TEST_5005",
- "Secure Symmetric encryption (AES-128-CTR) interface", {0} },
+ "Secure Symmetric encryption (AES-128-CTR) interface", {TEST_PASSED} },
{&tfm_crypto_test_5007, "TFM_CRYPTO_TEST_5007",
- "Secure Symmetric encryption invalid cipher (AES-128-GCM)", {0} },
+ "Secure Symmetric encryption invalid cipher (AES-128-GCM)", {TEST_PASSED} },
{&tfm_crypto_test_5008, "TFM_CRYPTO_TEST_5008",
- "Secure Symmetric encryption invalid cipher (AES-152-CBC)", {0} },
+ "Secure Symmetric encryption invalid cipher (AES-152-CBC)", {TEST_PASSED} },
{&tfm_crypto_test_5009, "TFM_CRYPTO_TEST_5009",
- "Secure Symmetric encryption invalid cipher (HMAC-128-CFB)", {0} },
+ "Secure Symmetric encryption invalid cipher (HMAC-128-CFB)", {TEST_PASSED} },
{&tfm_crypto_test_5010, "TFM_CRYPTO_TEST_5010",
- "Secure Unsupported Hash (SHA-1) interface", {0} },
+ "Secure Unsupported Hash (SHA-1) interface", {TEST_PASSED} },
{&tfm_crypto_test_5011, "TFM_CRYPTO_TEST_5011",
- "Secure Hash (SHA-224) interface", {0} },
+ "Secure Hash (SHA-224) interface", {TEST_PASSED} },
{&tfm_crypto_test_5012, "TFM_CRYPTO_TEST_5012",
- "Secure Hash (SHA-256) interface", {0} },
+ "Secure Hash (SHA-256) interface", {TEST_PASSED} },
{&tfm_crypto_test_5013, "TFM_CRYPTO_TEST_5013",
- "Secure Hash (SHA-384) interface", {0} },
+ "Secure Hash (SHA-384) interface", {TEST_PASSED} },
{&tfm_crypto_test_5014, "TFM_CRYPTO_TEST_5014",
- "Secure Hash (SHA-512) interface", {0} },
+ "Secure Hash (SHA-512) interface", {TEST_PASSED} },
{&tfm_crypto_test_5019, "TFM_CRYPTO_TEST_5019",
- "Secure Unsupported HMAC (SHA-1) interface", {0} },
+ "Secure Unsupported HMAC (SHA-1) interface", {TEST_PASSED} },
{&tfm_crypto_test_5020, "TFM_CRYPTO_TEST_5020",
- "Secure HMAC (SHA-256) interface", {0} },
+ "Secure HMAC (SHA-256) interface", {TEST_PASSED} },
{&tfm_crypto_test_5021, "TFM_CRYPTO_TEST_5021",
- "Secure HMAC (SHA-384) interface", {0} },
+ "Secure HMAC (SHA-384) interface", {TEST_PASSED} },
{&tfm_crypto_test_5022, "TFM_CRYPTO_TEST_5022",
- "Secure HMAC (SHA-512) interface", {0} },
+ "Secure HMAC (SHA-512) interface", {TEST_PASSED} },
{&tfm_crypto_test_5024, "TFM_CRYPTO_TEST_5024",
- "Secure HMAC with long key (SHA-224) interface", {0} },
+ "Secure HMAC with long key (SHA-224) interface", {TEST_PASSED} },
{&tfm_crypto_test_5030, "TFM_CRYPTO_TEST_5030",
- "Secure AEAD (AES-128-CCM) interface", {0} },
+ "Secure AEAD (AES-128-CCM) interface", {TEST_PASSED} },
{&tfm_crypto_test_5031, "TFM_CRYPTO_TEST_5031",
- "Secure AEAD (AES-128-GCM) interface", {0} },
+ "Secure AEAD (AES-128-GCM) interface", {TEST_PASSED} },
{&tfm_crypto_test_5032, "TFM_CRYPTO_TEST_5032",
- "Secure key policy interface", {0} },
+ "Secure key policy interface", {TEST_PASSED} },
{&tfm_crypto_test_5033, "TFM_CRYPTO_TEST_5033",
- "Secure key policy check permissions", {0} },
+ "Secure key policy check permissions", {TEST_PASSED} },
{&tfm_crypto_test_5034, "TFM_CRYPTO_TEST_5034",
- "Secure persistent key interface", {0} },
+ "Secure persistent key interface", {TEST_PASSED} },
{&tfm_crypto_test_5035, "TFM_CRYPTO_TEST_5035",
- "Key access control", {0} },
+ "Key access control", {TEST_PASSED} },
};
void register_testsuite_s_crypto_interface(struct test_suite_t *p_test_suite)
diff --git a/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c b/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c
index aee23b2..ef054ea 100644
--- a/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c
+++ b/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -37,31 +37,31 @@
static struct test_t ipc_veneers_tests[] = {
{&tfm_ipc_test_1001, "TFM_IPC_TEST_1001",
- "Get PSA framework version", {0}},
+ "Get PSA framework version", {TEST_PASSED}},
{&tfm_ipc_test_1002, "TFM_IPC_TEST_1002",
- "Get version of an RoT Service", {0}},
+ "Get version of an RoT Service", {TEST_PASSED}},
{&tfm_ipc_test_1003, "TFM_IPC_TEST_1003",
- "Connect to an RoT Service", {0}},
+ "Connect to an RoT Service", {TEST_PASSED}},
{&tfm_ipc_test_1004, "TFM_IPC_TEST_1004",
- "Call an RoT Service", {0}},
+ "Call an RoT Service", {TEST_PASSED}},
{&tfm_ipc_test_1005, "TFM_IPC_TEST_1005",
- "Call IPC_INIT_BASIC_TEST service", {0}},
+ "Call IPC_INIT_BASIC_TEST service", {TEST_PASSED}},
{&tfm_ipc_test_1006, "TFM_IPC_TEST_1006",
- "Call PSA RoT access APP RoT memory test service", {0}},
+ "Call PSA RoT access APP RoT memory test service", {TEST_PASSED}},
#ifdef TFM_IPC_ISOLATION_2_TEST_READ_ONLY_MEM
{&tfm_ipc_test_1007, "TFM_IPC_TEST_1007",
- "Call PSA RoT access APP RoT readonly memory test service", {0}},
+ "Call PSA RoT access APP RoT readonly memory test service", {TEST_PASSED}},
#endif
#ifdef TFM_IPC_ISOLATION_2_APP_ACCESS_PSA_MEM
{&tfm_ipc_test_1008, "TFM_IPC_TEST_1008",
- "Call APP RoT access PSA RoT memory test service", {0}},
+ "Call APP RoT access PSA RoT memory test service", {TEST_PASSED}},
#endif
#ifdef TFM_IPC_ISOLATION_2_MEM_CHECK
{&tfm_ipc_test_1009, "TFM_IPC_TEST_1009",
- "Call APP RoT memory check test service", {0}},
+ "Call APP RoT memory check test service", {TEST_PASSED}},
#endif
{&tfm_ipc_test_1010, "TFM_IPC_TEST_1010",
- "Test psa_call with the status of PSA_ERROR_PROGRAMMER_ERROR", {0}},
+ "Test psa_call with the status of PSA_ERROR_PROGRAMMER_ERROR", {TEST_PASSED}},
};
void register_testsuite_ns_ipc_interface(struct test_suite_t *p_test_suite)
diff --git a/test/suites/ipc/secure/ipc_s_interface_testsuite.c b/test/suites/ipc/secure/ipc_s_interface_testsuite.c
index 0937f8d..213dfff 100644
--- a/test/suites/ipc/secure/ipc_s_interface_testsuite.c
+++ b/test/suites/ipc/secure/ipc_s_interface_testsuite.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -13,7 +13,7 @@
static void tfm_ipc_test_1001(struct test_result_t *ret);
static struct test_t ipc_veneers_tests[] = {
- {&tfm_ipc_test_1001, "TFM_IPC_TEST_1001", "Secure functional", {0} },
+ {&tfm_ipc_test_1001, "TFM_IPC_TEST_1001", "Secure functional", {TEST_PASSED} },
};
void register_testsuite_s_ipc_interface(struct test_suite_t *p_test_suite)
diff --git a/test/suites/its/secure/psa_its_s_reliability_testsuite.c b/test/suites/its/secure/psa_its_s_reliability_testsuite.c
index c562c6d..4528424 100644
--- a/test/suites/its/secure/psa_its_s_reliability_testsuite.c
+++ b/test/suites/its/secure/psa_its_s_reliability_testsuite.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -35,9 +35,9 @@
static struct test_t reliability_tests[] = {
{&tfm_its_test_3001, "TFM_ITS_TEST_3001",
- "repetitive sets and gets in/from an asset", {0} },
+ "repetitive sets and gets in/from an asset", {TEST_PASSED} },
{&tfm_its_test_3002, "TFM_ITS_TEST_3002",
- "repetitive sets, gets and removes", {0} },
+ "repetitive sets, gets and removes", {TEST_PASSED} },
};
void register_testsuite_s_psa_its_reliability(struct test_suite_t *p_test_suite)
diff --git a/test/suites/multi_core/non_secure/multi_core_ns_interface_testsuite.c b/test/suites/multi_core/non_secure/multi_core_ns_interface_testsuite.c
index c0c8a7f..70563b2 100644
--- a/test/suites/multi_core/non_secure/multi_core_ns_interface_testsuite.c
+++ b/test/suites/multi_core/non_secure/multi_core_ns_interface_testsuite.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -70,10 +70,10 @@
static struct test_t multi_core_tests[] = {
{&multi_client_call_light_test,
"MULTI_CLIENT_CALL_LIGHT_TEST",
- "Multiple outstanding NS PSA client calls lightweight test", {0}},
+ "Multiple outstanding NS PSA client calls lightweight test", {TEST_PASSED}},
{&multi_client_call_heavy_test,
"MULTI_CLIENT_CALL_HEAVY_TEST",
- "Multiple outstanding NS PSA client calls heavyweight test", {0}},
+ "Multiple outstanding NS PSA client calls heavyweight test", {TEST_PASSED}},
};
void register_testsuite_multi_core_ns_interface(
diff --git a/test/suites/platform/non_secure/platform_ns_interface_testsuite.c b/test/suites/platform/non_secure/platform_ns_interface_testsuite.c
index 815da74..3d664bb 100644
--- a/test/suites/platform/non_secure/platform_ns_interface_testsuite.c
+++ b/test/suites/platform/non_secure/platform_ns_interface_testsuite.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -11,7 +11,7 @@
static struct test_t platform_interface_tests[] = {
{&tfm_platform_test_common_001, "TFM_PLATFORM_TEST_2001",
- "Minimal platform service test", {0} },
+ "Minimal platform service test", {TEST_PASSED} },
};
void
diff --git a/test/suites/platform/secure/platform_s_interface_testsuite.c b/test/suites/platform/secure/platform_s_interface_testsuite.c
index 27136c5..3bd1872 100644
--- a/test/suites/platform/secure/platform_s_interface_testsuite.c
+++ b/test/suites/platform/secure/platform_s_interface_testsuite.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -11,7 +11,7 @@
static struct test_t platform_interface_tests[] = {
{&tfm_platform_test_common_001, "TFM_PLATFORM_TEST_1001",
- "Minimal platform service test", {0} },
+ "Minimal platform service test", {TEST_PASSED} },
};
void
diff --git a/test/suites/qcbor/non_secure/qcbor_ns_testsuite.c b/test/suites/qcbor/non_secure/qcbor_ns_testsuite.c
index 109b181..f44994b 100644
--- a/test/suites/qcbor/non_secure/qcbor_ns_testsuite.c
+++ b/test/suites/qcbor/non_secure/qcbor_ns_testsuite.c
@@ -28,7 +28,7 @@
static struct test_t qcbor_regression_test[] = {
{&tfm_qcbor_test_7001, "TFM_QCBOR_TEST_7001",
- "Regression test of QCBOR library", {0} },
+ "Regression test of QCBOR library", {TEST_PASSED} },
};
/* To execute only selected test cases, then remove unwanted ones from the array
diff --git a/test/suites/sst/secure/psa_ps_s_reliability_testsuite.c b/test/suites/sst/secure/psa_ps_s_reliability_testsuite.c
index 4fbcabd..426edba 100644
--- a/test/suites/sst/secure/psa_ps_s_reliability_testsuite.c
+++ b/test/suites/sst/secure/psa_ps_s_reliability_testsuite.c
@@ -36,9 +36,9 @@
static struct test_t reliability_tests[] = {
{&tfm_sst_test_3001, "TFM_SST_TEST_3001",
- "repetitive sets and gets in/from an asset", {0} },
+ "repetitive sets and gets in/from an asset", {TEST_PASSED} },
{&tfm_sst_test_3002, "TFM_SST_TEST_3002",
- "repetitive sets, gets and removes", {0} },
+ "repetitive sets, gets and removes", {TEST_PASSED} },
};
void register_testsuite_s_psa_ps_reliability(struct test_suite_t *p_test_suite)
diff --git a/test/suites/sst/secure/sst_rollback_protection_testsuite.c b/test/suites/sst/secure/sst_rollback_protection_testsuite.c
index c26cda2..fbcdc04 100644
--- a/test/suites/sst/secure/sst_rollback_protection_testsuite.c
+++ b/test/suites/sst/secure/sst_rollback_protection_testsuite.c
@@ -65,29 +65,29 @@
static struct test_t interface_tests[] = {
{&tfm_sst_test_4001, "TFM_SST_TEST_4001",
- "Check SST area version when NV counters 1/2/3 have the same value", {0}},
+ "Check SST area version when NV counters 1/2/3 have the same value", {TEST_PASSED}},
{&tfm_sst_test_4002, "TFM_SST_TEST_4002",
- "Check SST area version when it is different from NV counters 1/2/3", {0}},
+ "Check SST area version when it is different from NV counters 1/2/3", {TEST_PASSED}},
{&tfm_sst_test_4003, "TFM_SST_TEST_4003",
"Check SST area version when NV counters 1 and 2 are equals, 3 is "
- "different, and SST area version match NV counters 1 and 2", {0}},
+ "different, and SST area version match NV counters 1 and 2", {TEST_PASSED}},
{&tfm_sst_test_4004, "TFM_SST_TEST_4004",
"Check SST area version when NV counters 2 and 3 are equals, 1 is "
- "different and SST area version match NV counter 2 and 3", {0}},
+ "different and SST area version match NV counter 2 and 3", {TEST_PASSED}},
{&tfm_sst_test_4005, "TFM_SST_TEST_4005",
"Check SST area version when NV counters 2 and 3 are equals, 1 is "
- "different and SST area version match NV counter 1", {0}},
+ "different and SST area version match NV counter 1", {TEST_PASSED}},
{&tfm_sst_test_4006, "TFM_SST_TEST_4006",
"Check SST area version when NV counters 1, 2 and 3 have different values "
- "and SST area version match NV counter 1 value", {0}},
+ "and SST area version match NV counter 1 value", {TEST_PASSED}},
{&tfm_sst_test_4007, "TFM_SST_TEST_4007",
"Check SST area version when NV counters 1, 2 and 3 have different values "
- "and SST area version match NV counter 2 value", {0}},
+ "and SST area version match NV counter 2 value", {TEST_PASSED}},
{&tfm_sst_test_4008, "TFM_SST_TEST_4008",
"Check SST area version when NV counters 1, 2 and 3 have different values "
- "and SST area version match NV counter 3 value", {0}},
+ "and SST area version match NV counter 3 value", {TEST_PASSED}},
{&tfm_sst_test_4009, "TFM_SST_TEST_4009",
- "Check SST area version when NV counter 1 cannot be incremented", {0}},
+ "Check SST area version when NV counter 1 cannot be incremented", {TEST_PASSED}},
};
void register_testsuite_s_rollback_protection(struct test_suite_t *p_test_suite)
diff --git a/test/suites/t_cose/non_secure/t_cose_ns_testsuite.c b/test/suites/t_cose/non_secure/t_cose_ns_testsuite.c
index 91ad7fc..3428a08 100644
--- a/test/suites/t_cose/non_secure/t_cose_ns_testsuite.c
+++ b/test/suites/t_cose/non_secure/t_cose_ns_testsuite.c
@@ -25,7 +25,7 @@
static struct test_t t_cose_regression_test[] = {
{&tfm_t_cose_test_8001, "TFM_T_COSE_TEST_8001",
- "Regression test of t_cose library", {0} },
+ "Regression test of t_cose library", {TEST_PASSED} },
};
/* To execute all test cases, then pass this array to RunTestsTCose()
diff --git a/test/test_services/tfm_core_test/tfm_ss_core_test.c b/test/test_services/tfm_core_test/tfm_ss_core_test.c
index 87d22ed..31dffa7 100644
--- a/test/test_services/tfm_core_test/tfm_ss_core_test.c
+++ b/test/test_services/tfm_core_test/tfm_ss_core_test.c
@@ -232,8 +232,8 @@
out_buf_1 = data_buf_ptr;
data_buf_ptr += in_vec[1].len;
- out_vec[1].base = out_buf_0;
- out_vec[1].len = data_buf_ptr - out_buf_0;
+ out_vec[1].base = out_buf_1;
+ out_vec[1].len = data_buf_ptr - out_buf_1;
#ifdef TFM_PSA_API
err = psa_test_common(SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_SID,
@@ -583,7 +583,7 @@
; /* do nothing */
}
}
-#endif /* defined(TFM_PSA_API) */
-
+#else
return CORE_TEST_ERRNO_SUCCESS;
+#endif /* defined(TFM_PSA_API) */
}
diff --git a/test/test_services/tfm_core_test_2/tfm_ss_core_test_2.c b/test/test_services/tfm_core_test_2/tfm_ss_core_test_2.c
index d118756..a242f71 100644
--- a/test/test_services/tfm_core_test_2/tfm_ss_core_test_2.c
+++ b/test/test_services/tfm_core_test_2/tfm_ss_core_test_2.c
@@ -32,7 +32,6 @@
#endif /* !defined(TFM_PSA_API) */
/* structures for secure IRQ testing */
-static enum irq_test_scenario_t current_scenario = IRQ_TEST_SCENARIO_NONE;
static struct irq_test_execution_data_t *current_execution_data;
psa_status_t spm_core_test_2_slave_service(struct psa_invec *in_vec,
@@ -193,7 +192,6 @@
enum irq_test_scenario_t irq_test_scenario,
struct irq_test_execution_data_t *execution_data)
{
- current_scenario = irq_test_scenario;
current_execution_data = execution_data;
switch (irq_test_scenario) {
@@ -401,7 +399,7 @@
return CORE_TEST_ERRNO_INVALID_PARAMETER;
}
- num = psa_read(msg->handle, 0, &irq_test_scenario, sizeof(uint32_t));
+ num = psa_read(msg->handle, 0, &irq_test_scenario, sizeof(irq_test_scenario));
if (num != msg->in_size[0]) {
return CORE_TEST_ERRNO_INVALID_PARAMETER;
}
@@ -412,7 +410,8 @@
return CORE_TEST_ERRNO_INVALID_PARAMETER;
}
- return spm_core_test_2_prepare_test_scenario_internal(irq_test_scenario,
+ return spm_core_test_2_prepare_test_scenario_internal((enum irq_test_scenario_t)
+ irq_test_scenario,
execution_data);
}
@@ -425,12 +424,13 @@
return CORE_TEST_ERRNO_INVALID_PARAMETER;
}
- num = psa_read(msg->handle, 0, &irq_test_scenario, sizeof(uint32_t));
+ num = psa_read(msg->handle, 0, &irq_test_scenario, sizeof(irq_test_scenario));
if (num != msg->in_size[0]) {
return CORE_TEST_ERRNO_INVALID_PARAMETER;
}
- return spm_core_test_2_execute_test_scenario_internal(irq_test_scenario);
+ return spm_core_test_2_execute_test_scenario_internal((enum irq_test_scenario_t)
+ irq_test_scenario);
}
#endif /* defined(TFM_PSA_API) */
@@ -472,6 +472,7 @@
; /* do nothing */
}
}
-#endif /* defined(TFM_PSA_API) */
+#else
return CORE_TEST_ERRNO_SUCCESS;
+#endif /* defined(TFM_PSA_API) */
}
diff --git a/test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1.c b/test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1.c
index 28c11a7..168d2a9 100644
--- a/test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1.c
+++ b/test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -45,7 +45,7 @@
tfm_plat_test_secure_timer_stop();
}
-uint32_t spm_irq_test_1_prepare_test_scenario_internal(
+int32_t spm_irq_test_1_prepare_test_scenario_internal(
enum irq_test_scenario_t irq_test_scenario,
struct irq_test_execution_data_t *execution_data)
{
@@ -73,7 +73,7 @@
return CORE_TEST_ERRNO_SUCCESS;
}
-uint32_t spm_irq_test_1_execute_test_scenario(
+int32_t spm_irq_test_1_execute_test_scenario(
struct psa_invec *in_vec, size_t in_len,
struct psa_outvec *out_vec, size_t out_len)
{
@@ -283,7 +283,8 @@
return CORE_TEST_ERRNO_INVALID_PARAMETER;
}
- return spm_irq_test_1_prepare_test_scenario_internal(irq_test_scenario,
+ return spm_irq_test_1_prepare_test_scenario_internal((enum irq_test_scenario_t)
+ irq_test_scenario,
execution_data);
}
@@ -400,7 +401,7 @@
; /* do nothing */
}
}
-#endif /* TFM_PSA_API */
-
+#else
return TFM_SUCCESS;
+#endif /* TFM_PSA_API */
}
diff --git a/test/test_services/tfm_secure_client_service/tfm_secure_client_service.c b/test/test_services/tfm_secure_client_service/tfm_secure_client_service.c
index fc69c60..62a8b5d 100644
--- a/test/test_services/tfm_secure_client_service/tfm_secure_client_service.c
+++ b/test/test_services/tfm_secure_client_service/tfm_secure_client_service.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -42,8 +42,9 @@
break;
}
}
-#endif
+#else
return 0;
+#endif
}
int32_t tfm_secure_client_service_sfn_run_tests(void)
diff --git a/test/test_services/tfm_sst_test_service/tfm_sst_test_service.c b/test/test_services/tfm_sst_test_service/tfm_sst_test_service.c
index bd29085..94ec3a9 100644
--- a/test/test_services/tfm_sst_test_service/tfm_sst_test_service.c
+++ b/test/test_services/tfm_sst_test_service/tfm_sst_test_service.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -43,6 +43,7 @@
break;
}
}
-#endif
+#else
return PSA_SUCCESS;
+#endif
}