feat(ffa-svc): add `ffa_func_name` and `ffa_error_name`
Adds helper functions for getting string representations of function
identifiers and error codes. This makes debug logs more readable than
printing the integer value.
Change-Id: I9e74c197686dc08e0c71886f641c60829587bad6
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/spm/common/sp_tests/sp_test_ffa.c b/spm/common/sp_tests/sp_test_ffa.c
index 219b149..63bf131 100644
--- a/spm/common/sp_tests/sp_test_ffa.c
+++ b/spm/common/sp_tests/sp_test_ffa.c
@@ -99,18 +99,20 @@
test_target.expected_ret : FFA_ERROR;
if (ffa_func_id(ffa_ret) != expected_ret) {
- ERROR("Unexpected return: %x (expected %x)."
+ ERROR("Unexpected return: %s (expected %s)."
" FFA_FEATURES test: %s.\n",
- ffa_func_id(ffa_ret), expected_ret,
+ ffa_func_name(ffa_func_id(ffa_ret)),
+ ffa_func_name(expected_ret),
test_target.test_name);
}
if (expected_ret == FFA_ERROR) {
if (ffa_error_code(ffa_ret) !=
FFA_ERROR_NOT_SUPPORTED) {
- ERROR("Unexpected error code: %x (expected %x)."
+ ERROR("Unexpected error code: %s (expected %s)."
" FFA_FEATURES test: %s.\n",
- ffa_error_code(ffa_ret), expected_ret,
+ ffa_error_name(ffa_error_code(ffa_ret)),
+ ffa_error_name(expected_ret),
test_target.test_name);
}
}