Dualcpu: Support multiple outstanding NS PSA client calls in SPE side

Add the handling of multiple outstanding PSA client call in SPE
side in multi-core topology.
- Add a field caller_data in TF-M message body to contain the
  private data of message owner.
- Declare tfm_rpc_set_caller_data(). TF-M SPM sets the private data
  of NS client in field caller_data by calling
  tfm_rpc_set_caller_data() in multi-core topology.
- Implement dummy tfm_rpc_set_caller_data() for single Armv8-M
  platform and multi-core topology respectively.

The entire implementation in SPE mailbox to support multiple
outstanding NS PSA client call will be completed in further
patches.

Change-Id: I19a8ff0c1567dd4f384600e8a1a7691d6b7e4004
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/secure_fw/spm/spm_api_ipc.c b/secure_fw/spm/spm_api_ipc.c
index 340c778..19f1d9a 100644
--- a/secure_fw/spm/spm_api_ipc.c
+++ b/secure_fw/spm/spm_api_ipc.c
@@ -17,6 +17,7 @@
 #include "tfm_spm_hal.h"
 #include "spm_api.h"
 #include "spm_db.h"
+#include "tfm_api.h"
 #include "tfm_core_mem_check.h"
 #include "tfm_internal_defines.h"
 #include "tfm_wait.h"
@@ -399,6 +400,11 @@
     if (handle != PSA_NULL_HANDLE) {
         msg->msg.rhandle = tfm_spm_get_rhandle(service, handle);
     }
+
+    /* Set the private data of NSPE client caller in multi-core topology */
+    if (TFM_CLIENT_ID_IS_NS(client_id)) {
+        tfm_rpc_set_caller_data(msg, client_id);
+    }
 }
 
 int32_t tfm_spm_send_event(struct tfm_spm_service_t *service,