T398: Source cleanup for tool chain integration
This is a code cleanup to improve portability.
Specific issues addressed:
- Added type casts to (void *) here and there
- Changed non-standard \e escapes to \033
- Added cmake function to handle preinclude
- Changed a few Image$$ references to make use of the REGION_DECLARE
macro
- Reordered code slightly to avoid the need for a "void *rangeptr"
variable
- Changed compile time check typedef "err_msg" to avoid declaring
zero sized array, which is not standards compliant. It will now
either be -1 (error) or 1 (ok), not -1 and 0
- Reordered the *nfsptr_t typedef to make the cmse_nonsecure_call
standards compliant
- Added null tests to both secure and non_secure suites to avoid
defining zero length array. Also use this to find end of list
- Only define __stdout for ARMCLANG builds and conditionalize ns printf
output for ARMCLANG/GCC/IAR
- Cleaned up some enum type mismatches
- Changed non standard EINVAL error return to -1. The value was only
checked against 0 anyway
- Added type cast for conversion from float to int
Have tested with IAR, which starts and runs the idle thread. Changes
related to this is not included in this commit.
Author: Thomas Tornblom <thomas.tornblom@iar.com>
Signed-off-by: Thomas Tornblom <thomas.tornblom@iar.com>
Note: Sign off authority needs to adhere to the [DCO](./dco.txt)
rules.
Change-Id: I3e5229c0777623b128474af0311020ccacc1b797
diff --git a/interface/src/tfm_audit_api.c b/interface/src/tfm_audit_api.c
index 0770bd0..9ce86ef 100644
--- a/interface/src/tfm_audit_api.c
+++ b/interface/src/tfm_audit_api.c
@@ -26,7 +26,7 @@
struct audit_core_retrieve_output output_s = {.buffer = buffer,
.record_size = record_size};
- return tfm_ns_lock_dispatch((veneer_fn)tfm_audit_veneer_retrieve_record,
+ return (enum psa_audit_err) tfm_ns_lock_dispatch((veneer_fn)tfm_audit_veneer_retrieve_record,
(uint32_t)&input_s,
(uint32_t)&output_s,
0,
@@ -36,7 +36,7 @@
enum psa_audit_err psa_audit_get_info(uint32_t *num_records,
uint32_t *size)
{
- return tfm_ns_lock_dispatch((veneer_fn)tfm_audit_veneer_get_info,
+ return (enum psa_audit_err) tfm_ns_lock_dispatch((veneer_fn)tfm_audit_veneer_get_info,
(uint32_t)num_records,
(uint32_t)size,
0,
@@ -46,7 +46,7 @@
enum psa_audit_err psa_audit_get_record_info(const uint32_t record_index,
uint32_t *size)
{
- return tfm_ns_lock_dispatch((veneer_fn)tfm_audit_veneer_get_record_info,
+ return (enum psa_audit_err) tfm_ns_lock_dispatch((veneer_fn)tfm_audit_veneer_get_record_info,
(uint32_t)record_index,
(uint32_t)size,
0,
@@ -57,7 +57,7 @@
const uint8_t *token,
const uint32_t token_size)
{
- return tfm_ns_lock_dispatch((veneer_fn)tfm_audit_veneer_delete_record,
+ return (enum psa_audit_err) tfm_ns_lock_dispatch((veneer_fn)tfm_audit_veneer_delete_record,
(uint32_t)record_index,
(uint32_t)token,
(uint32_t)token_size,