SST: Use macros generated by tools
- Use the SID and service version defined in sid.h.
- Use signal defined in tfm_secure_storage.h.
- Remove manual definitions in tfm_sst_defs.h.
- Remove tfm_sst_signal.h.
Change-Id: Iccedbb1a8947847e5c7c33b341b8302e334fec27
Signed-off-by: Edison Ai <edison.ai@arm.com>
diff --git a/interface/include/tfm_sst_defs.h b/interface/include/tfm_sst_defs.h
index 3a5e819..9132cce 100644
--- a/interface/include/tfm_sst_defs.h
+++ b/interface/include/tfm_sst_defs.h
@@ -15,23 +15,6 @@
/* Invalid UID */
#define TFM_SST_INVALID_UID 0
-#ifdef TFM_PSA_API
-/*
- * Defines for SID and minor version number. These SIDs should align with the
- * value in service manifest file.
- */
-#define TFM_SST_SET_SID (0x00000060)
-#define TFM_SST_SET_MIN_VER (0x0001)
-#define TFM_SST_GET_SID (0x00000061)
-#define TFM_SST_GET_MIN_VER (0x0001)
-#define TFM_SST_GET_INFO_SID (0x00000062)
-#define TFM_SST_GET_INFO_MIN_VER (0x0001)
-#define TFM_SST_REMOVE_SID (0x00000063)
-#define TFM_SST_REMOVE_MIN_VER (0x0001)
-#define TFM_SST_GET_SUPPORT_SID (0x00000064)
-#define TFM_SST_GET_SUPPORT_MIN_VER (0x0001)
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/interface/src/tfm_sst_api.c b/interface/src/tfm_sst_api.c
index 34d19fe..af06424 100644
--- a/interface/src/tfm_sst_api.c
+++ b/interface/src/tfm_sst_api.c
@@ -9,7 +9,9 @@
#include "tfm_ns_lock.h"
#include "tfm_veneers.h"
-#include "tfm_sst_defs.h"
+#ifdef TFM_PSA_API
+#include "psa_manifest/sid.h"
+#endif
#define IOVEC_LEN(x) (uint32_t)(sizeof(x)/sizeof(x[0]))
/* FixMe: Check if PSA framework header would provide similar macro. */
@@ -37,7 +39,7 @@
};
#ifdef TFM_PSA_API
- handle = psa_connect(TFM_SST_SET_SID, TFM_SST_SET_MIN_VER);
+ handle = psa_connect(TFM_SST_SET_SID, TFM_SST_SET_VERSION);
if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
return PSA_PS_ERROR_OPERATION_FAILED;
}
@@ -84,7 +86,7 @@
};
#ifdef TFM_PSA_API
- handle = psa_connect(TFM_SST_GET_SID, TFM_SST_GET_MIN_VER);
+ handle = psa_connect(TFM_SST_GET_SID, TFM_SST_GET_VERSION);
if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
return PSA_PS_ERROR_OPERATION_FAILED;
}
@@ -128,7 +130,7 @@
};
#ifdef TFM_PSA_API
- handle = psa_connect(TFM_SST_GET_INFO_SID, TFM_SST_GET_INFO_MIN_VER);
+ handle = psa_connect(TFM_SST_GET_INFO_SID, TFM_SST_GET_INFO_VERSION);
if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
return PSA_PS_ERROR_OPERATION_FAILED;
}
@@ -171,7 +173,7 @@
};
#ifdef TFM_PSA_API
- handle = psa_connect(TFM_SST_REMOVE_SID, TFM_SST_REMOVE_MIN_VER);
+ handle = psa_connect(TFM_SST_REMOVE_SID, TFM_SST_REMOVE_VERSION);
if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
return PSA_PS_ERROR_OPERATION_FAILED;
}
@@ -236,7 +238,7 @@
* ignored.
*/
#ifdef TFM_PSA_API
- handle = psa_connect(TFM_SST_GET_SUPPORT_SID, TFM_SST_GET_SUPPORT_MIN_VER);
+ handle = psa_connect(TFM_SST_GET_SUPPORT_SID, TFM_SST_GET_SUPPORT_VERSION);
if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
return support_flags;
}